MFiX build solver failed

I have two been trying to simulate a two-fluid model for fluidized bed gasification. But when I run the MFiX simulation it does not have the default solver option. Therefore I tried to build a solver with the build tool and I found this error.

“Fatal Error: Cannot open module file ‘mpi.mod’ for reading at (1): No such file or directory”

  • OS: Linux/Ubuntu 20.04

But the with the locate mpi.mod command I found list of locations

  • /boot/grub/i386-pc/mpi.mod
  • /usr/lib/grub/i386-pc/mpi.mod
  • /usr/lib/x86_64-linux-gnu/fortran/gfortran-mod-15/openmpi/mpi.mod
  • /usr/lib/x86_64-linux-gnu/openmpi/lib/mpi.mod

And in my bashrc file I have the configuration as:

export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"

export PATH="/path/to/mfix:$PATH"
export MODULEPATH="/usr/lib/x86_x64-linux-gnu/openmpi/modules:$MODULEPATH"

I don’t know what goes wrong. I am looking for any tip to solve this issue.

Hi Henok

I have a few questions for you, and one suggestion:

  1. Why is there no default solver? How did you install MFiX? Did you install MFiX via Conda or some other way? What version?

  2. What is the purpose of the pyenv commands in your .bashrc?

  3. Why are you setting MODULEPATH?

Suggestion: Since you are having trouble running an MPI program the first thing to do is to verify the MPI installation without MFiX in the mix. There is a little program mfix/src/tools/mpi/hello_world.f90 that tests the MPI installation. Or you can use this https://mpitutorial.com/tutorials/mpi-hello-world/

See if you can get that to compile and run successfully and then we’ll tackle MFiX

Hi @cgw, thanks a lot for the prompt reply.

  1. I installed mfix using the Source/Pip option from the mfix download page

    • Downloaded 22.4.2 Source Tarball
    • Run on a terminal: python3 -m pip install mfix-22.4.2.tar.gz
    • Set environment variables on bashrc
        export PYENV_ROOT="$HOME/.pyenv"
        command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
        eval "$(pyenv init -)"
    
        export PATH="/path/to/mfix:$PATH"
        export MODULEPATH="/usr/lib/x86_x64-linux-gnu/openmpi/modules:$MODULEPATH"
        ```
    
  2. The pyenv commands in .bashrc enable to define the python version in a shell before mfix can be run. mfix version I installed does not support python 3.8 which is my default python and I had to install 3.9.10.

    • Open a terminal from the mfix working directory / root
    • Run pyenv shell 3.9.10
    • Run mfix
  3. I set MODULEPATH following an online solution to fix the build solver problem but it didn’t work.

Concerning mpi:
I successfully built and run the mpi_hello_world.c with the run.py file following MPI Hello World · MPI Tutorial

  • run git clone https://github.com/mpitutorial/mpitutorial

  • run export MPICC=/usr/bin/mpicc

  • run cd mpitutorial/tutorials/mpi-hello-world/code

  • cd to the root directory and run export MPIRUN=/usr/bin/mpirun

  • Copy the run.py file to mpitutorial/tutorials/mpi-hello-world/code and Change #!/usr/bin/python to #!/home/henok/.pyenv/shims/python in the run.py

  • run mpirun -n 2 mpi_hello_world and the result is

Hello world from processor henok-ThinkPad-L540, rank 0 out of 2 processors
Hello world from processor henok-ThinkPad-L540, rank 1 out of 2 processors

Is it not possible to install using Conda?

Dear @cgw, it is possible to install using Conda but I did not try that option. Since I have already python installed on my Linux machine I thought I can save disk space by avoiding installing Conda. I will try that option.
Thank you very much for the kind followup.

If you want to save time and disk space, start with miniforge/mamba instead of the full Anaconda download, which is huge and has lots of components you don’t need
https://mfix.netl.doe.gov/doc/mfix/22.4/html/getting_started/install-linux.html#alternative-install-miniforge-mamba

Hi @cgw, that is a very good suggestion. I will give it a try. Thank you very much!

1 Like

Dear @cgw ,

I installed Anaconda and tried to install the mfix as per the instruction on the mfix download page. Unfortunately, I got the following error. I tried to get some online solution but with no luck and I cannot figure out how to solve it.

conda create -n mfix-22.4.2 mfix==22.4.2 mfix-doc==22.4.2 mfix-gui==22.4.2 mfix-solver==22.4.2 mfix-src==22.4.2 -c conda-forge -c https://mfix.netl.doe.gov/s3/7c67abc5/b2cc8d19ca74faa65ed0a02e42d16dde//conda/dist
Collecting package metadata (current_repodata.json): failed

UnavailableInvalidChannel: HTTP 404 NOT FOUND for channel s3/7c67abc5/6934a8ff3dc2e207e0af2e5c53d27129//conda <https://mfix.netl.doe.gov/s3/7c67abc5/6934a8ff3dc2e207e0af2e5c53d27129//conda>

The channel is not accessible or is invalid.

You will need to adjust your conda configuration to proceed.
Use `conda config --show channels` to view your configuration's current state,
and use `conda config --show-sources` to view config file locations.

I then checked the conda configuration with:

conda config --show channels 

and get

channels:
  - conda-forge
  - https://mfix.netl.doe.gov/s3/7c67abc5/6934a8ff3dc2e207e0af2e5c53d27129//conda/

Also with

conda config --show-sources

I get

==> /home/henok/.condarc <==
channels:
  - conda-forge
  - https://mfix.netl.doe.gov/s3/7c67abc5/6934a8ff3dc2e207e0af2e5c53d27129//conda/

This looks like it might be a transient network failure - can you try again?

Also note that the “secret” code that is part of the download token is only valid for a short period of time, you may have to go back to the mfix.netl.doe.gov website to get a fresh download code

You should not have the mfix.netl.doe.gov channel in your .condarc - just conda-forge

Dear @cgw ,

Thank you very much I have successfully run my first mfix two-fluid model simulation. I have edited the condarc configuration file as per your advice, successfully installed mfix on conda environment, and successfully ran the simulation with the default solver.

:clap: :clap: :clap:

1 Like