Building Custom Solver on DMP on HPC

Dear All,

I am trying to build the custom solver locally on my university HPC. I need some help to understand this process.

Before building the custom solver, I installed Mfix-20.3.1 in my HPC storage folder by using the following process.

  1. Loaded the following modules
  • module load cmake/cmake-3.7.2-ic-2017
  • module load openmpi/openmpi-3.1.0-ic-2017.1.043
  • module load python/python-3.6.3-ic-2017.1.043
  1. Unzip mfix-20.3.1 tar ball in the directory /home/user/mfix-20.3.1
  2. mkdir release-build #made a build directory
  3. cd release-build #changed the directory
  4. cmake /home/user/mfix-20.3.1/release-build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_MPI=1 -DCMAKE_Fortran_COMPILER=ifort
  5. did ‘make’

The Mfix executable is successfully created in the folder as follows:

To build the custom solver for the tutorial silane_pyrolysis:

  1. I copied the silane_pyrolysis tutorial folder from the source tar folder in the following path:
    ~/NASA_Pyrolant/TestRun_Mfix/silane_pyrolysis_2d
  2. Here, my idea is to build the custom solver executable in the same silane_pyrolysis_2d folder. Thus, I used the following build process. The input command and output are as follows:

[rkancherla@ec274 silane_pyrolysis_2d]$ cmake -DCMAKE_Fortran_COMPILER=ifort -DCMAKE_IN STALL_PREFIX=~/NASA_Pyrolant/TestRun_Mfix/silane_pyrolysis_2d -DUDF_DIR=~/NASA_Pyrolant /TestRun_Mfix/silane_pyrolysis_2d -DVERSION=20.3.1 /lustre/fs0/home/rkancherla/apps/MFi x/mfix-20.3.1/release-build-2031
– MFIX build settings summary:
– Build type = RelWithDebInfo
– CMake version = 3.7.2
– Fortran compiler = ifort
– Fortran flags = -O2 -g -DNDEBUG
– ENABLE_MPI = 1
– ENABLE_OpenMP = OFF
– ENABLE_CTEST = OFF
– ENABLE_COVERAGE = OFF
– Found MPI_Fortran: /apps/openmpi/openmpi-3.1.0-ic-2017.1.043/lib/libmpi_usempif08.so ;/apps/openmpi/openmpi-3.1.0-ic-2017.1.043/lib/libmpi_usempi_ignore_tkr.so;/apps/openmp i/openmpi-3.1.0-ic-2017.1.043/lib/libmpi_mpifh.so;/apps/openmpi/openmpi-3.1.0-ic-2017.1 .043/lib/libmpi.so (found version “20.3.1”)
– Found PythonInterp: /apps/python/python-3.6.3-ic-2017.1.043/bin/python (found versio n “3.6.3”)

Found UDFs:
/home/rkancherla/NASA_Pyrolant/TestRun_Mfix/silane_pyrolysis_2d/usr0.f;/home/rkancherla /NASA_Pyrolant/TestRun_Mfix/silane_pyrolysis_2d/usr1.f;/home/rkancherla/NASA_Pyrolant/T estRun_Mfix/silane_pyrolysis_2d/usr_init_namelist.f;/home/rkancherla/NASA_Pyrolant/Test Run_Mfix/silane_pyrolysis_2d/usr_mod.f;/home/rkancherla/NASA_Pyrolant/TestRun_Mfix/sila ne_pyrolysis_2d/usr_rates.f;/home/rkancherla/apps/MFix/mfix-20.3.1/model/usr_read_namel ist.f;/home/rkancherla/NASA_Pyrolant/TestRun_Mfix/silane_pyrolysis_2d/species.inc
– Configuring done
– Generating done
– Build files have been written to: /lustre/fs0/home/rkancherla/apps/MFix/mfix-20.3.1/ release-build-2031

I need help with the following:

  1. Is my custom build process is correct?
  2. How to build the custom solver in the tutorial folder (silane_pyrolysis_2d)?
  3. I do not understand exact meaning of “-DCMAKE_IN STALL_PREFIX”, “-DUDF_DIR” and the path defined after “-DVERSION” in my custom build command (command is shown earlier).

The help of the community will be appreciated.

Regards,
Raghu

Building the custom solver for each MFiX project involves a full build of the MFiX source (plus any UDFs for that project. So, building the (default) solver in /home/user/mfix-20.3.1 didn’t hurt anything, but was not necessary and is not used to build or run the silane custom solver.

  1. “Build files have been written to…” means your cmake command was successful. However, running CMake just generates the Makefiles for building. Next, run make to actually build the MFiX solver.

https://mfix.netl.doe.gov/doc/mfix/20.3.1/solver/build-source.html#id1

  1. To build the custom solver, next run make.

  2. When building from source with CMake, you do not need to use -DCMAKE_INSTALL_PREFIX or -DVERSION. You do not need -DUDF_DIR either, because UDF_DIR defaults to your current directory, and you are building the silane_pyrolysis_2d directory which contains all the UDFs for that tutorials (usr0.f, usr1.f, all the *.f files.).

So to build the Silane tutorial, you could have done:

cd ~/NASA_Pyrolant/TestRun_Mfix/ 
cp -r /home/user/mfix-20.3.1/tutorials/tfm/silane_pyrolysis_2d .  # like you did
cd silane_pyrolysis_2d
export FC=ifort                              #  same as -DCMAKE_Fortran_COMPILER=ifort but less to type
cmake /home/user/mfix-20.3.1 -DENABLE_MPI=1  #  RelWithDebInfo is the default
make -j    # builds the custom solver with the UDFs for the silane tutorial
1 Like