MIKE

From Alliance Doc
Jump to navigation Jump to search
Other languages:

MIKE powered by DHI is a a hydraulic and hydrological modeling software package.

License requirements[edit]

MIKE is a commercial product and each user needs to supply their own license.

In order for you to use it on our HPC clusters, you will need to contact MIKE Customer Care at: mike@dhigroup.com and confirm that you have

  • an internet license, and
  • a download link for the Linux version of MIKE.

Installation[edit]

You need to download the installation archives for Linux.

The following instructions assume that the installation archives are these three files, depending on the version of MIKE:

  • MIKE_Zero_2023_rhel7_22.11.05.tgz
  • MIKE_Zero_2023_Tools_rhel7_22.11.05.tgz
  • MIKE_Zero_2023_Examples.tgz
  • MIKE_Zero_2022_rhel7_Update_1.tgz
  • MIKE_Zero_2022_Tools_rhel7_Update_1.tgz
  • MIKE_Zero_2022_Examples_Update_1.tgz


1. Create a directory ~/scratch/MIKE_TGZ and upload the three archives to that location.

2. MIKE was compiled with the Intel MPI library, therefore you must load a matching intelmpi module.

module load StdEnv/2020  intel/2021.2.0  intelmpi/2021.2.0
module load StdEnv/2020  intel/2020.1.217  intelmpi/2019.7.217

3. Run the following commands depending on the version of MIKE. They will extract the archives, run the `install.sh` installation scripts for each component and then Patch the binaries so that they can find the dynamic libraries of Intel MPI.

export MIKE_TGZ="$HOME/scratch/MIKE_TGZ"
export MIKE_HOME="$HOME/MIKE/2023"

cd $MIKE_TGZ
tar -xzf MIKE_Zero_2023_rhel7_22.11.05.tgz
tar -xzf MIKE_Zero_2023_Tools_rhel7_22.11.05.tgz
tar -xzf MIKE_Zero_2023_Examples.tgz

cd $MIKE_TGZ/MIKE_Zero_2023_rhel7_22.11.05
sh install.sh --eula --install-path "$MIKE_HOME" --license-server 127.0.0.1
cd $MIKE_TGZ/MIKE_Zero_2023_Tools_rhel7_22.11.05
sh install.sh --eula --install-path "$MIKE_HOME"
cd $MIKE_TGZ/MIKE_Zero_2023_Examples
sh install.sh --eula --install-path "$MIKE_HOME"

module load StdEnv/2020  intel/2021.2.0  intelmpi/2021.2.0
setrpaths.sh --path "$MIKE_HOME/bin"  --add_origin  \
    --add_path="$EBROOTIMPI/mpi/latest/lib/release:$EBROOTIMPI/mpi/latest/lib"
MIKE_TGZ_DIR="$HOME/MIKE_TGZ"
MIKE_INST_DIR="$HOME/MIKE/2022"

cd $MIKE_TGZ_DIR
tar -xzf MIKE_Zero_2022_rhel7_Update_1.tgz 
tar -xzf MIKE_Zero_2022_Tools_rhel7_Update_1.tgz
tar -xzf MIKE_Zero_2022_Examples_Update_1.tgz

cd $MIKE_TGZ_DIR/MIKE_Zero_2022_rhel7_Update_1
sh install.sh --eula --install-path "$MIKE_INST_DIR" --license-server 127.0.0.1
cd $MIKE_TGZ_DIR/MIKE_Zero_2022_Tools_rhel7_Update_1
sh install.sh --eula --install-path "$MIKE_INST_DIR"
cd $MIKE_TGZ_DIR/MIKE_Zero_2022_Examples_Update_1
sh install.sh --eula --install-path "$MIKE_INST_DIR"

module load StdEnv/2020 intel/2020.1.217 intelmpi/2019.7.217
setrpaths.sh --path "$MIKE_INST_DIR/bin"  --add_origin  \
    --add_path="$EBROOTIMPI/intel64/lib/release:$EBROOTIMPI/intel64/lib"

Other versions[edit]

The instructions above assume specific filenames for the installation archives. When installing minor updates released in the same year, the filenames for the archives (e.g. in tar -xzf MIKE_Zero_2023_rhel7_22.11.05.tgz), as well as the directory names (e.g. in cd $MIKE_TGZ/MIKE_Zero_2023_rhel7_22.11.05) need to be adjusted accordingly. Future major releases of MIKE may use a newer version of Intel MPI, so the above instructions may need to be adapted accordingly. Try a module of the Intel MPI library with a matching Major version (i.e. year). If you run into problems adapting the recipe for newer versions of MIKE, contact our Technical support.

Create a module[edit]

Paste these commands into your terminal to create an environment module for MIKE. Make sure to adjust the version ("2022") to match the version you have installed. Also adjust the version of the intelmpi and intel modules to match what you had loaded during the installation.


export MIKE_VERSION=2023
mkdir -p $HOME/modulefiles/mike
cat > $HOME/modulefiles/mike/${MIKE_VERSION}.lua <<EOF
help([[
Module for MIKE ${MIKE_VERSION} (by DHI group)
]])
local version = "${MIKE_VERSION}"
whatis("Version:".. version)
whatis("Keywords: FEM, Finite Elements, Simulation")
whatis("URL: https://www.mikepoweredbydhi.com/mike-" .. version)
whatis("Description: MIKE is a hydraulic and hydrological modeling software package.")

local home = os.getenv("HOME") or "~"
local root = pathJoin( home, "MIKE", version)

depends_on("StdEnv/2020", "intel/2021.2.0", "intelmpi/2021.2.0")

setenv("I_MPI_PMI_LIBRARY", "/opt/software/slurm/lib/libpmi2.so")
setenv("SLURM_MPI_TYPE", "pmi2")
setenv("MIKE_HOME", root)
setenv("MIKE_PROGRESS", "STDOUT")
prepend_path( "PATH", pathJoin(root, "bin"))
EOF
export MIKE_VERSION=2022
mkdir -p $HOME/modulefiles/mike
cat > $HOME/modulefiles/mike/${MIKE_VERSION}.lua <<EOF
help([[
  Module for MIKE ${MIKE_VERSION} (by DHI group)
]])
local version = "${MIKE_VERSION}"
whatis("Version:".. version)
whatis("Keywords: FEM, Finite Elements, Simulation")
whatis("URL: https://www.mikepoweredbydhi.com/mike-" .. version)
whatis("Description: MIKE is a hydraulic and hydrological modeling software package.")

local home = os.getenv("HOME") or "~"
local root = pathJoin( home, "MIKE", version)

depends_on("StdEnv/2020", "intel/2020.1.217", "intelmpi/2019.7.217") 

setenv("I_MPI_PMI_LIBRARY", "/opt/software/slurm/lib/libpmi2.so")
setenv("SLURM_MPI_TYPE", "pmi2")
setenv("MIKE_HOME", root)
setenv("MIKE_PROGRESS", "STDOUT")
prepend_path( "PATH", pathJoin(root, "bin"))
EOF

Activate this module in each job or login session with:

Question.png
[name@server ~]$ module load mike/2023
Question.png
[name@server ~]$ module load mike/2022

Configure the license[edit]

From MIKE Customer Care you will have instructions like this for configuring your license:

Question.png
[name@server ~]$ licconfig set --type=internet --iuser=user@example.com --ipassword=my-password

This normally needs to be done only once whenever you get a new license or license code. The license information will be stored in a file ~/.config/DHI/license/NetLmLcwConfig.xml.

Example job script[edit]

File : job_mike_2023_CPU.sh

#!/bin/bash
#SBATCH --nodes=1
#SBATCH --ntasks=8
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=4000M
#SBATCH --time=00:20:00

module load StdEnv/2020  intel/2021.2.0  intelmpi/2021.2.0  mike/2023
export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK:-1}

engine="FemEngineHD"
model="my_model.m3fm"

srun $engine $model


File : job_mike_2022_CPU.sh

#!/bin/bash
#SBATCH --nodes=1
#SBATCH --ntasks=8
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=4000M
#SBATCH --time=00:20:00

module load StdEnv/2020  intel/2020.1.217  intelmpi/2019.7.217  mike/2022
export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK:-1}
slurm_hl2hl.py --format MPIHOSTLIST > machinefile.$SLURM_JOBID

engine="FemEngineHD"
model="my_model.m3fm"

mpirun -machinefile machinefile.$SLURM_JOBID $engine $model