9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-10-07 00:25:57 +02:00

Fix RSS on mac

This commit is contained in:
Anthony Scemama 2023-04-18 12:22:04 +02:00
parent fd1494482f
commit 0db547ab4b

View File

@ -29,6 +29,8 @@ subroutine resident_memory(value)
call usleep(10)
value = 0.d0
IRP_IF MACOS
IRP_ELSE
iunit = getUnitAndOpen('/proc/self/status','r')
do
read(iunit,*,err=10,end=20) key, value
@ -39,6 +41,7 @@ subroutine resident_memory(value)
end do
20 continue
close(iunit)
IRP_ENDIF
value = value / (1024.d0*1024.d0)
call omp_unset_lock(file_lock)
end function
@ -53,6 +56,9 @@ subroutine total_memory(value)
character*(32) :: key
double precision, intent(out) :: value
value = 0.d0
IRP_IF MACOS
IRP_ELSE
iunit = getUnitAndOpen('/proc/self/status','r')
do
read(iunit,*,err=10,end=20) key, value
@ -63,6 +69,7 @@ subroutine total_memory(value)
end do
20 continue
close(iunit)
IRP_ENDIF
value = value / (1024.d0*1024.d0)
end function