Machine issues & portability

From Geos-chem
Revision as of 20:04, 26 March 2008 by Bmy (Talk | contribs)

Jump to: navigation, search

IFORT Compiler


Harvard users need to make the same fix


The IFORT compiler has an error that can cause the GEOS-Chem to appear that it is running out of memory when it actually isn't. The symptom that we have noticed is that it seems to choke right when the TPCORE is called. This may tend to happen more often IFORT v9 or v10 on Linux Boxes, but it can also happen on Altix/Itanium systems.

The workaround for this bug is as follows:

1. First try adding this to your .cshrc file:

  limit stacksize unlimited

This will tell the operating system to assign the maximum possible memory to the stack.

2. If GEOS-Chem still crashes with the same error, then you may need to set the stacksize variable to a large positive # instead of unlimited. This is a known issue with one of the libraries that the IFORT compiler uses.

Try adding this code to your .cshrc file as well:

 # Due to a limitation in the Intel IFORT v9.x compilers, you must do the
 # following in order to avoid potential memory problems with OpenMP:
 # (1) Explicitly set the "stacksize" limit to 2097152 kbytes
 #      instead of to "unlimited".
 # (2) Explicitly set the KMP_STACKSIZE environment variable
 #      to 209715200 bytes.
 # For more information see the Intel IFORT release notes:
 # This usually has to be done when running GEOS-5 on Altix or Titan.
 # (bmy, 8/16/07)
 limit  stacksize     2097152 kbytes
 setenv KMP_STACKSIZE 209715200

The 2097152 is the maximum allowable stacksize on the Harvard Altix/Itanium system. This may be different on your system. You can find out the maximum stacksize on your machine by typing "limit" at the Unix prompt. On your machine the number may vary. Then just cut-n-paste this number and replace the "2097152 kbytes" in the text above and put that into your .cshrc or .bashrc.

3. If you are using the IFORT 10.x compilers, then you might also need to tell the compiler to put automatic arrays into heap memory instead of on the stack.

From Mike Seymour (

I found this Intel page regarding stack sizes and ifort >=8.0:

It suggests for ifort 10.0 to use the heap for temporary storage with -heap-arrays <size>, where arrays known at compile-time to be larger than <size> are allocated on the heap instead of the stack.

However, setting <size> to be 1000 does not change things. I don't know if smaller values will have an effect, or if there will be performance issues.

PGI Compiler


From Win Trivitayanurak (

In short, TRIM and ADJUSTL or ADJUSTR do not work together properly when compiled with Portland Group Fortran. I propose removing TRIM inside the subroutine StrSqueeze. This is not urgent and relevant to only the few PGI users.

So if you are using the PGI compiler, then you will have to modify the code in routine STRSQUEEZE "charpak_mod.f" such that the statements


are now replaced with


and this will solve the problem. We will incorporate this into a future release of GEOS-Chem.

SGI-MIPS Compiler

Sun Studio Compiler