Setting Memory by Environment Variables


Clicked A Few Times
I would like to set the available memory of a job through the submission script, rather than inside the input file; I noted that it seems to be possible from the code input/memory._def.F


However, when I set the variable MEM_TOTAL, MEM_HEAP etc, they are all ignored. Does anyone has some idea?

e.g.
export MEM_TOTAL=137438953472 #(1TB)

In the output

          Memory information
------------------

heap = 13107200 doubles = 100.0 Mbytes
stack = 13107197 doubles = 100.0 Mbytes
global = 26214400 doubles = 200.0 Mbytes (distinct from heap & stack)
total = 52428797 doubles = 400.0 Mbytes
verify = yes
hardfail = no

Thanks!
~Dominic

Forum Vet
Dominic
Thanks for reporting this.
This code path is likely to have been disabled at some point in the past. I was not aware of its existence and we do not even mention it in the documentation.
A combined use of cp, cat and/or echo should allow you to reach the same result in a script ... do you agree?

echo "start myjob " > input.nw
echo " memory 1200 mb " >> input.nw
cp body_of_input.nw >> input.nw 

Cheers, Edo

Clicked A Few Times
Thanks Edo,

your suggested method will work for sure, but we try to avoid to modify users' input files; it will be a nice feature to set memory outside the input file....

~Dominic


Forum >> NWChem's corner >> Running NWChem