10
0
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-12-22 04:13:55 +01:00

Fixes #353: allows more than 2 TB machines

This commit is contained in:
Anthony Scemama 2024-10-16 15:05:32 +02:00
parent ecd6471aae
commit 48b4a8d1e2
2 changed files with 6 additions and 5 deletions

View File

@ -54,9 +54,9 @@ You can also look over its [archives](https://groupes.renater.fr/sympa/arc/quant
# Build status
* Master [![master build status](https://github.com/QuantumPackage/qp2/actions/workflows/compilation.yml/badge.svg)](https://github.com/QuantumPackage/qp2/actions/workflows/compilation.yml/badge.svg)
* Development [![dev build status](https://github.com/QuantumPackage/qp2/actions/workflows/compilation.yml/badge.svg?branch=dev-stable)](https://github.com/QuantumPackage/qp2/actions/workflows/compilation.yml/badge.svg?branch=dev-stable)
* Documentation [![Documentation Status](https://readthedocs.org/projects/quantum-package/badge/?version=master)](https://quantum-package.readthedocs.io/en/master/?badge=master)
* Master [![master build status](https://github.com/QuantumPackage/qp2/actions/workflows/compilation.yml/badge.svg)](https://github.com/QuantumPackage/qp2/actions/workflows/compilation.yml)
* Development [![dev build status](https://github.com/QuantumPackage/qp2/actions/workflows/compilation.yml/badge.svg?branch=dev-stable)](https://github.com/QuantumPackage/qp2/actions/workflows/compilation.yml)
* Documentation [![Documentation Status](https://readthedocs.org/projects/quantum-package/badge/?version=master)](https://quantum-package.readthedocs.io/en/master)

View File

@ -162,6 +162,7 @@ integer function get_total_available_memory() result(res)
integer :: iunit
integer*8, parameter :: KB = 1024
integer*8, parameter :: GiB = 1024**3
integer*8 :: kb_read
integer, external :: getUnitAndOpen
iunit = getUnitAndOpen('/proc/meminfo','r')
@ -170,8 +171,8 @@ integer function get_total_available_memory() result(res)
do
read(iunit, '(A)', END=10) line
if (line(1:10) == "MemTotal: ") then
read(line(11:), *, ERR=20) res
res = int((res*KB) / GiB,4)
read(line(11:), *, ERR=20) kb_read
res = int((kb_read*KB) / GiB,4)
exit
20 continue
end if