memocc Subroutine

public subroutine memocc(istat, isize, array, routine)

Uses

Memory profiling routine, based in the profiling routine included in the UppASD software package . control the memory occupation by calculating the overall size in bytes of the allocated arrays Usage: when allocating allocating an array stuff of dimension n in the routine dosome

allocate(stuff(n),stat=i_stat)

call memocc(i_stat,product(shape(stuff))*kind(stuff),'stuff','dosome')

when deallocating

i_all=-product(shape(stuff))*kind(stuff)

deallocate(stuff,stat=i_stat)

call memocc(i_stat,i_all,'stuff','dosome')

the counters are initialized with call memocc(0,iproc,'count','start') (iproc = mpi rank, nproc=mpi size) and stopped with call memocc(0,0,'count','stop') at the end of the calculation a short report is printed on the screen some information can be also written on disk following the needs This file is distributed under the terms of the GNU General Public License, see http://www.gnu.org/copyleft/gpl.txt . Copyright (C) Luigi Genovese, CEA Grenoble, France, 2007

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: istat
integer, intent(in) :: isize
character(len=*), intent(in) :: array
character(len=*), intent(in) :: routine