[future request] snappyHexMesh: 'std::out_of_range' error
Summary
The following error occurred when testing on the supercomputer Fugaku Pre/Post node (large memory(6TB on board)).
[error messages] terminate called after throwing an instance of 'std::out_of_range' what(): stoi
It appears that the information on the size of the memory could not be expressed integer range.
Example case
Steps to reproduce
[tutorials] tutorials/incompressible/pisoFoam/LES/motorBike/motorBike (When snappyHexMesh is executed)
$ ./Allrun
Environment information
- OpenFOAM version : v2306, v2212, etc
- Operating system : RHEL 8.6 (kernel 4.18.0-372)
- Hardware info : Intel Xeon Platinum 8280L (2.70GHz/28core)
- Compiler : icpc (ICC) 2021.10.0 20230609
Possible fixes
Changing the stoi function in src/OSspecific/POSIX/memInfo/memInfo.C to the stol function will terminate successfully. This correction was found by Fugaku support staff.
diff -r 146727f129a6 -r b255d5d23e65 src/OSspecific/POSIX/memInfo/memInfo.C
--- a/OpenFOAM-v2306/src/OSspecific/POSIX/memInfo/memInfo.C Fri Sep 22 16:37:54 2023 +0900
+++ b/OpenFOAM-v2306/src/OSspecific/POSIX/memInfo/memInfo.C Fri Sep 22 16:46:00 2023 +0900
@@ -100,17 +100,17 @@
if (key == "VmPeak")
{
- peak_ = std::stoi(line.substr(delim+1));
+ peak_ = std::stol(line.substr(delim+1));
--nkeys;
}
else if (key == "VmSize")
{
- size_ = std::stoi(line.substr(delim+1));
+ size_ = std::stol(line.substr(delim+1));
--nkeys;
}
else if (key == "VmRSS")
{
- rss_ = std::stoi(line.substr(delim+1));
+ rss_ = std::stol(line.substr(delim+1));
--nkeys;
}
}
@@ -148,7 +148,7 @@
if (key == "MemFree")
{
- free_ = std::stoi(line.substr(delim+1));
+ free_ = std::stol(line.substr(delim+1));
--nkeys;
}
}
Edited by Akira Azami