9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-12-21 11:03:29 +01: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) call usleep(10)
value = 0.d0 value = 0.d0
IRP_IF MACOS
IRP_ELSE
iunit = getUnitAndOpen('/proc/self/status','r') iunit = getUnitAndOpen('/proc/self/status','r')
do do
read(iunit,*,err=10,end=20) key, value read(iunit,*,err=10,end=20) key, value
@ -39,6 +41,7 @@ subroutine resident_memory(value)
end do end do
20 continue 20 continue
close(iunit) close(iunit)
IRP_ENDIF
value = value / (1024.d0*1024.d0) value = value / (1024.d0*1024.d0)
call omp_unset_lock(file_lock) call omp_unset_lock(file_lock)
end function end function
@ -53,6 +56,9 @@ subroutine total_memory(value)
character*(32) :: key character*(32) :: key
double precision, intent(out) :: value double precision, intent(out) :: value
value = 0.d0
IRP_IF MACOS
IRP_ELSE
iunit = getUnitAndOpen('/proc/self/status','r') iunit = getUnitAndOpen('/proc/self/status','r')
do do
read(iunit,*,err=10,end=20) key, value read(iunit,*,err=10,end=20) key, value
@ -63,6 +69,7 @@ subroutine total_memory(value)
end do end do
20 continue 20 continue
close(iunit) close(iunit)
IRP_ENDIF
value = value / (1024.d0*1024.d0) value = value / (1024.d0*1024.d0)
end function end function