Obtain the memory status from all processes (min, max, avg).
Find min, max and average high water mark of the virtual memory usage
across all processes (MPI_COMM_WORLD) on rank 0.
Results are in Megabytes, and the resulting array contains min, max, avg
in this order.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Source Code
function tem_global_vmhwm()result(hwm)real(kind=rk)::hwm(3)! -------------------------------------------------------------------- !integer::myhwm,minhwm,maxhwminteger::nProcsinteger::iErrorreal::myMBreal::sumhwm! -------------------------------------------------------------------- !call MPI_Comm_Size(MPI_COMM_WORLD,nProcs,iError)myhwm=my_status_int('VmHWM:')call MPI_Reduce(myhwm,minhwm,1,MPI_INTEGER,MPI_MIN,0,&&MPI_COMM_WORLD,iError)call MPI_Reduce(myhwm,maxhwm,1,MPI_INTEGER,MPI_MAX,0,&&MPI_COMM_WORLD,iError)myMB=real(myhwm)/1024.0call MPI_Reduce(myMB,sumhwm,1,MPI_REAL,MPI_SUM,0,MPI_COMM_WORLD,&&iError)hwm(1)=real(minhwm,kind=rk)/1024.0_rkhwm(2)=real(maxhwm,kind=rk)/1024.0_rkhwm(3)=sumhwm/real(nProcs,kind=rk)end function tem_global_vmhwm