Page tree

MESH - A Community Hydrology - Land Surface Model

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Current »

Compiling Standalone MESH on Plato is the same as compiling other Fortran, C/C++, and/or MPI equivalents of these codes. While the GNU GCC/GFortran compiler exists on Plato, users are advised to instead use the Intel compiler, as it is kept more up-to-date.

Step-by-step guide

Two steps are involved with compiling code on Plato. First, the user must load the appropriate module(s). Second, the user must compile the code.

Loading a module for the compiler

  1. Check the version of the Intel compiler available:
    module avail openmpi/intel

    [nsid@plato* ~]$ module avail openmpi/intel
    --------------------------------------- /cm/shared/modulefiles ---------------------------------------
  2. Load the module:
    module load openmpi/intel/64/2.0.0

    You can confirm that the module has loaded using the 'which' command:

    [nsid@plato* ~]$ which mpirun

    If the module was not loaded, 'which' will return with no path to the program:

    [nsid@plato* ~]$ which mpirun
    /usr/bin/which: no mpirun in (...)

    Add the above command to ~/.bashrc after 'module load null' to load this module automatically:

    # Rocks module info
    module load null
    module load openmpi/intel/64/2.0.0

Compiling Standalone MESH

Since Plato has been migrated to SLURM, MPI-compatible programs can no longer be run in serial. They have to be called with 'mpirun -np 1' explicitly, or else recompiled to run in serial (e.g., using 'ifort' compiler). It is advised to compile both serial and parallel versions of Standalone MESH for Plato. The process of loading the Intel module remains unchanged.
  1. Navigate to the folder containing 'makefile' for Standalone MESH:
    cd /path/to/MESH_Code

    Replace '/path/to/MESH_Code' with the path to the folder containing the 'makefile' and code for Standalone MESH.

  2. Compile the code:

    1. Run 'make -f makefile.mpi_intel' or 'make -f makefile.ifort' to  compiler the program. Use makefile.mpi_intel to compile code that is MPI-compatible. Use makefile.ifort to compile code to run in serial, which is not MPI-compatible.

    2. Run 'make -f makefile.mpi_intel clean' or 'make -f makefile.ifort clean' to remove intermediate objects (or else run 'rm *.mod *.o').

      It is essential to run the 'clean' command between switching from makefile.mpi_intel and makefile.ifort, and vice versa.



  • No labels