Skip to content

Setup and Configuration: KVS

PMoldtmann edited this page Nov 28, 2022 · 25 revisions

Running kvstest locally

  1. Move to your MaMiCo build folder
  2. From ~/.../MaMiCo/examples copy kvs.xml.template to your build folder as kvs.xml
  3. From ~/.../MaMiCo/examples copy kvstest.ini.template to your build folder as kvstest.ini
  4. From ~/.../MaMiCo/coupling/tests/kvs-lbmpy copy kvstest.py to your build folder
  5. Install coloredlogs library via $ python3 -m pip install --user coloredlogs
  6. Via $ ccmake . enable pybind11 and MPI, MPI should automatically be enabled upon configuring with pybind11, exit via c > g
  7. In kvstest.py ensure that the line import pythonfilters as pf is not included in the script
  8. Execute via $ python3 kvstest.py

Running kvstest on HSUper (tested on 28th Nov 2022)

  • Install Python Pandas via $ python3 -m pip install --user pandas
  • Install Python MatPlotLib via $ python3 -m pip install --user matplotlib
  • Install Python LBMPy via $ python3 -m pip install --user lbmpy
  • Install IPython via $ python3 -m pip install --user IPython
  • Install iPyWidgets via $ python3 -m pip install --user ipywidgets
  1. Clone the MaMiCo-github GitHub Setup

  2. Create a build folder $ mkdir build

  3. Move to build folder $ cd build

  4. From ~/.../MaMiCo/examples copy kvs.xml.template to your build folder as kvs.xml e.g. $ cp ~/git_workspace/MaMiCo/examples/kvs.xml.template kvs.xml

  5. From ~/.../MaMiCo/examples copy kvstest.ini.template to your build folder as kvstest.ini e.g. $ cp ~/git_workspace/MaMiCo/examples/kvstest.ini.template kvstest.ini

  6. From ~/.../MaMiCo/coupling/tests/kvs-lbmpy copy kvstest.py to your build folder e.g. $ cp ~/git_workspace/MaMiCo/coupling/tests/kvs-lbmpy/kvstest.py kvstest.py

  7. Load spack via $ ml USER-SPACK

  8. Load pybind11 via $ spack load py-pybind11@2.9.1; this important because this will change the Python version to 3.9.12; in order to avoid the "ModuleNotFoundError" the Python version used when executing the script must be equal to the version used for compilation of MaMiCo

  9. Load Numpy $ spack load py-numpy@1.22.4

  10. Load cmake $ ml cmake

  11. Load gcc via $ ml gcc and via $ gcc --version make sure gcc 12.1.0 is loaded

  12. Load MPI as pybind11 requires it $ ml openmpi

  13. $ cmake ..

  14. via $ ccmake . enable pybind11 and MPI, MPI should automatically be enabled upon configuring with pybind11, exit via "c" > "c" > "g"

  15. Compile MaMiCo via $ make -j16

  16. In kvstest.py ensure that the line import pythonfilters as pf is not included in the script

  17. At last, a job will need to be submitted, for which a template is available on the HSU homepage; for an example see below...

Example Job-File

A working example for a job file can be seen here:

  • Create a file with the .job-extension, e.g. kvstest.job
  • The content of this file may look like the following:
#!/bin/bash 

#SBATCH --job-name=kvs_test       # specifies a user-defined job name 
#SBATCH --nodes=1                 # number of compute nodes to be used 
#SBATCH --ntasks=8                # number of MPI processes 
#SBATCH --partition=dev           # partition (small_shared, small, medium, small_fat, sm$
                                # special partitions: large (for selected users only!) 
                                # job configuration testing partition: dev 
#SBATCH --cpus-per-task=1         # number of cores per process 
#SBATCH --time=00:30:00           # maximum wall clock limit for job execution 
#SBATCH --output=kvs_test_%j.log  # log file which will contain all output 

# commands to be executed 

cd $HOME/git_workspace/MaMiCo/build   #cd 

python3 kvstest.py

  • Now submit the job via $ sbatch kvstest.job

If trying to run tvstest.py on HSUper prints the error message ModuleNotFoundError: No module named 'mamico' rebuild MaMiCo as you may have compiled MaMiCo using the wrong python version. Ensure that Python 3.9.12 is used and rebuild MaMiCo.

Clone this wiki locally