Portland compiler fails trying to allocate an unexpectedly large amount of memory: issue with large arrays

From Docswiki
Jump to navigation Jump to search

GMIN jobs on large systems (e.g. 5000 LJ atoms) can sometimes fail with memory allocation errors like this one:

 0: ALLOCATE: 18446744071814864320 bytes requested; not enough memory

This seems rather a lot of memory, and more than GMIN actually requires. It's probably caused by one or more arrays that's larger than 2GB (in my case, what triggered the error was the W work array in mymylbfgs.f, a double precision array of dimension 300035000 for the 5000-atom test job). Different pgi compilers behave differently in this case: on volkhan, pgi/64/7* through pgi/64/11* give the allocate error, but pgi/64/12* work "normally" (for a short test job).

Adding the compiler flags "-mcmodel=medium -Mlarge_arrays" is a good fix for this with the earlier pgi compilers.