Control memory consumption

The chemistry part of ProDiMo can require quite a significant amount of memory (RAM), in particular if it is run in parallel mode (which it usually is). To control the amount of memory used in the chemistry one can set

8     ! memLimitGB   : limit memory in the chemistry

in the Parameter.in file, where 8 is the default value. The value has to be an integer.

Most of ProDiMo's memory is required for the LDAT array, which stores all line optical depths and other line quantities as function of z, to compute the line flux estimates once a vertical column is finished. Each time there is a free openMP process that is idle and wants to start a new column, it can either (i) re-use the LDAT of a previously finished column, (ii) allocate LDAT for a new column or (iii) wait for a column to finish.

If you limit the total memory consumption via memLimitGB, and an openMP process wants to do (ii), ProDiMo checks the memory size of all current LDAT and may deny (ii), so that the process needs to wait -> (iii).

This way, we can make sure that ProDiMo's memory consumption does not explode, which can otherwise happen if you are using a huge number of processes, and huge NXX. When (ii) is denied in a model run, the following log statement is written to the prodimo.log

INFO: Running into memory limit (memLimitGB) of    1 GB ,NoPElim=   7, NoPE=   8

The numbers are just examples. If you have the feeling ProDiMo is slow you might check your log file for this statement, and adapt memLimitGB accordingly (i.e. increase it if possible).

Another option of controlling this limit is via an environment variable:

export ProDiMo_memLimitGB=100

Which can be set in a terminal before running ProDiMo or put into a login script (e.g. .bashrc, .profile etc.). This is especially useful for big cluster machines (which often have > 100 GB RAM available) and avoids setting the memLimitGB for every model individually.