Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated for recent system upgrades to Plato.

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.

Sections on this page:

Table of Contents

Step-by-step guide

Two steps are involved with compiling code on Plato. First, the user must load the appropriate module(s) containing the compiler must be loaded, if not already loaded by default. Second, the user must compile the codecode must be compiled.

Loading a module for the compiler

Note

Since recent system upgrades to Plato to align with ComputeCanada systems, the necessary modules may be loaded automatically. To check, you can run which mpifort. If it returns a path, then the module containing the compiler is loaded and there is no need to complete the following steps in this section.

Code Block
languagetext
[nsid@plato ~]$ which mpifort
/cvmfs/soft.computecanada.ca/easybuild/software/2017/avx/Compiler/intel2016.4/openmpi/2.1.1/bin/mpicc
  1. Check the version of the Intel compiler available:
    module avail openmpi/intel

    Code Block
    languagepowershelltext
    [nsid@plato* ~]$ module avail openmpi/intel
    
    ------- Global Aliases -------
       allinea-cpu -> ddt-cpu    allinea-gpu -> ddt-gpu    arm-forge-cpu -> ddt-cpu    arm-forge-gpu -> ddt-gpu
    
    ------- Compiler---- /cm/shared/modulefiles dependent avx modules ---------------------------------------
    openmpi/intel/64/
       openmpi/1.8.5
    8 (m)    openmpi/intel/64/2.0.02 (m)    openmpi/2.1.1 (m,D)
    
      Where:
       m:  MPI implementations / Implémentations MPI
       L:  Module is loaded
       D:  Default Module
    Info
    The module marked D is loaded if no specific version is provided when loading the module.
  2. Load the module:

    1. To load the default version (advised):
      module load openmpi

    /intel/64/2.0.0
    1. To load a specific version:
      module load openmpi/1.8.8

      Note
      In this case, you should adjust your profile to load the desired version, or else jobs may run using the default version.
Info

You can confirm that the module

...

is loaded using the

...

which

...

command:

Code Block
language

...

text
[nsid@plato* ~]$ which 

...

mpifort
/

...

cvmfs/soft.computecanada.ca/easybuild/software/2017/avx/Compiler/intel2016.4/openmpi/2.1.1/bin/mpifort

If the module was not loaded,

...

which

...

will return with

...

a message that it cannot find the program:

Code Block
language

...

text
[nsid@plato* ~]$ which 

...

mpifort
/usr/bin/which: no 

...

mpifort in (...)
Tip

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

Note

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

    Info

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

  2. Compile the code:

    1. Use makefile.mpi_intel to compile code that is MPI-compatible:

      1. Run 'make -f makefile.mpi_intel'

      or
      1. to compile the code.

      2. Run 'make -f makefile.

      ifort' to  compiler the program. Use makefile.mpi_intel to compile code that is MPI-compatible.
      1. mpi_intel clean' to remove intermediate objects (or else run 'rm *.mod *.o').

        Info
        This process creates a program named mpi_sa_mesh.
    2. Use makefile.ifort to compile code to run in serial, which is not MPI-compatible.:
      1. Run 'make -f makefile.

      mpi_intel clean' or
      1. ifort' to compile the code.

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

        Info
        This process creates a program named sa_mesh.


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

Content by Label
showLabelsfalse
max5
spacesMESH
showSpacefalse
sortmodified
showSpacefalse
reversetrue
typepage
cqllabel in ("compiling","plato") and type = "page" and space = "MESH"
labelscompiling Plato

Page properties
hiddentrue
Related issues