2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-02-12 05:31:06 +08:00
|
|
|
! Copyright (C) 2002-2003 CP group
|
2003-01-20 05:58:50 +08:00
|
|
|
! This file is distributed under the terms of the
|
|
|
|
! GNU General Public License. See the file `License'
|
|
|
|
! in the root directory of the present distribution,
|
|
|
|
! or http://www.gnu.org/copyleft/gpl.txt .
|
|
|
|
!
|
|
|
|
!-----------------------------------------------------------------------
|
|
|
|
subroutine memory
|
|
|
|
!-----------------------------------------------------------------------
|
|
|
|
!
|
|
|
|
! Prints what is hopefully the size of occupied memory
|
|
|
|
! Implemented only for SGI Origin and AIX SP3.
|
|
|
|
! Extremely machine- and operating-system dependent
|
|
|
|
!
|
2004-03-29 05:36:28 +08:00
|
|
|
use io_global, only: stdout, ionode
|
2003-01-20 05:58:50 +08:00
|
|
|
implicit none
|
2004-03-29 05:36:28 +08:00
|
|
|
character(len=80) :: command
|
|
|
|
integer :: pid
|
|
|
|
|
2003-01-20 05:58:50 +08:00
|
|
|
#ifdef __AIX
|
|
|
|
integer getpid_
|
|
|
|
|
|
|
|
pid=getpid_()
|
|
|
|
write(command,10) pid
|
|
|
|
10 format('ps -lp ',i8,' | grep -v SZ | awk ''{print $10}'' ')
|
2003-11-09 18:42:50 +08:00
|
|
|
WRITE( stdout,'(''Estimated size (kB) of each process: '',$)')
|
2004-03-29 05:36:28 +08:00
|
|
|
if( ionode ) call system(command)
|
2003-01-20 05:58:50 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __ORIGIN
|
|
|
|
integer getpid
|
2004-03-29 05:36:28 +08:00
|
|
|
|
2003-01-20 05:58:50 +08:00
|
|
|
pid=getpid()
|
|
|
|
write(command,10) pid
|
|
|
|
10 format('ps -lp ',i8,'|grep -v SZ|awk ''{print $10}''|cut -f1 -d:')
|
2003-11-09 18:42:50 +08:00
|
|
|
WRITE( stdout,'(''Total estimated size (pages) of each process: '',$)')
|
2004-03-29 05:36:28 +08:00
|
|
|
if( ionode ) call system( command )
|
2003-01-20 05:58:50 +08:00
|
|
|
#endif
|
2004-03-29 05:36:28 +08:00
|
|
|
|
2003-01-20 05:58:50 +08:00
|
|
|
return
|
2004-03-29 05:36:28 +08:00
|
|
|
end subroutine
|