How to execute MFiX-exa?

I think I have done installation of MFiX-exa.
But I don’t know how to execute MFiX-exa…
Please check whether I have done installation of MFiX-exa.
And please tell me how to start MFiX-exa.
I attached the code that I got.

~/Downloads/mfix-23-12-tar/mfix/build$ make -j
Consolidate compiler generated dependencies of target buildInfomfixcore
[ 0%] Building CXX object src/CMakeFiles/buildInfomfixcore.dir/__/mfixcore/AMReX_buildInfo.cpp.o
[ 0%] Linking CXX static library libbuildInfomfixcore.a
Consolidate compiler generated dependencies of target amrex_3d
[ 0%] Built target buildInfomfixcore
[ 50%] Built target amrex_3d
Consolidate compiler generated dependencies of target fsnapshot
Consolidate compiler generated dependencies of target fboxinfo
Consolidate compiler generated dependencies of target fnan
Consolidate compiler generated dependencies of target fextract
Consolidate compiler generated dependencies of target fcompare
Consolidate compiler generated dependencies of target fextrema
Consolidate compiler generated dependencies of target fvarnames
Consolidate compiler generated dependencies of target ftime
Consolidate compiler generated dependencies of target fgradient
Consolidate compiler generated dependencies of target fvolumesum
Consolidate compiler generated dependencies of target amrex_hydro
[ 51%] Built target fextrema
[ 53%] Built target fcompare
[ 53%] Built target fboxinfo
[ 53%] Built target fsnapshot
[ 53%] Built target fextract
[ 53%] Built target fvarnames
[ 53%] Built target fgradient
[ 55%] Built target ftime
[ 58%] Built target fvolumesum
[ 58%] Built target fnan
[ 65%] Built target amrex_hydro
[ 66%] Built target amrex_hydro_api
Consolidate compiler generated dependencies of target mfixcore
[ 98%] Built target mfixcore
Consolidate compiler generated dependencies of target mfix
[100%] Linking CXX executable mfix
lto-wrapper: warning: using serial compilation of 128 LTRANS jobs
[100%] Built target mfix

Please ask MFiX-EXA questions in the MFiX-EXA category (I moved this for you).

1 Like

See if you can run one of the simple test problems, e.g.,
./mfix ../tests/FLD01-x/inputs_single

You should see screen output for ~2000 iterations or so and something like this at the end
AMReX (23.12-21-gef38229189e3) finalized

I got this error massage. I think I have to add the commands directory. Where can I download the directory?

0000@000:~$ ~/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 4: amrex.fpe_trap_invalid: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 9: mfix.steady_state: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 10: mfix.steady_state_tol: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 12: mfix.gravity: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 14: amr.blocking_factor: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 20: amr.max_level: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 22: geometry.coord_sys: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 23: geometry.is_periodic: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 24: geometry.prob_lo: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 25: geometry.prob_hi: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 28: amr.n_cell: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 36: amr.max_grid_size_x: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 37: amr.max_grid_size_y: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 38: amr.max_grid_size_z: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 44: fabarray.mfiter_tile_size: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 49: mfix.par_ascii_int: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 50: mfix.par_ascii_file: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 52: mfix.plot_int=1: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 53: mfix.plot_file=FLD01: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 55: mfix.check_int: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 56: mfix.check_file: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 62: mfix.plt_vel_g: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 63: mfix.plt_p_g: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 69: fluid.solve: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 71: fluid.viscosity: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 72: fluid.viscosity.constant: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 77: dem.solve: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 84: mfix.regions: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 86: regions.full-domain.lo: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 87: regions.full-domain.hi: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 89: regions.wall1.lo: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 90: regions.wall1.hi: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 92: regions.wall2.lo: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 93: regions.wall2.hi: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 100: ic.regions: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 105: ic.full-domain.fluid.volfrac: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 106: ic.full-domain.fluid.density: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 107: ic.full-domain.fluid.pressure: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 108: ic.full-domain.fluid.velocity: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 115: bc.delp_dir: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 116: bc.delp: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 118: bc.regions: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 120: bc.wall1: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 121: bc.wall1.normal: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 123: bc.wall2: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 124: bc.wall2.normal: command not found
/home/gpuadmin/Downloads/mfix-23-12-tar/mfix/tests/FLD01-x/inputs_single: line 126: mfix.stop_for_unused_inputs: command not found

That’s not surprising. I have no idea how it would have built the code in that few lines of output. It looks like you never fully unzipped the tarball. Hard to say what is really going on without access to your system. So, I’m going reformat a :poop:y old laptop with a fresh ubuntu install and start from scratch to show you the steps to build and run from nothing.

Before I get started I want to say that MFIX-Exa is not a friendly code. It does not have a GUI. It is a very high-level HPC code and basically can not be modified by a general user base. If you do not have experience with CFD and multiphase flow, this is not the code to learn on. I would recommend our classic MFiX code or a black-box commercial code for that. Further, if you don’t have a GPU to use or at least a few dozen CPUs, you’re are probably better off with MFiX classic. But, with that being said…

I start off by logging into the mfix website, navigating to the MFIX-Exa download page and clicking the Download button to download the tarball.

edit: I guess I can’t post more than 3 times in a row so this is going to be a long one…


Now, I open a terminal and unpack the tarball following the command on the Download page:

cd ~/Downloads
tar -xzvf mfix-23-12-tar.gz

I go into the mfix directory and copy the build directory. Incredibly unnecessary, but that’s just what I do.

cd mfix/ 
cp -r exec exec.serial
cd exec.serial

Next I use the vi editor (which I always forget how terrible default vi is that’s shipped with ubuntu so when I say vi I’m actually using vim.tiny) to edit the GNUmakefile. I’m just going to do the most basic build without MPI. So I set

USE_MPI = FALSE
DEBUG     = FALSE

Then I try to make, knowing full well it’s not going to make. It doesn’t, saying

Command 'make' not found, but can be installed with:
sudo apt install make

because I don’t have GNU make. But it gives me to command to install it. So I do,

sudo apt install make

But this gives me an error I don’t know:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package make is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'make' has no installation candidate

So I googled “ubuntu install make” to find a stackexchange with the answer:

sudo apt-get update
sudo apt-get -y install make

Oh. Right. update first. I always forget that…


Ok. So I update and install GNU make and try to make clean && make again but now it errors out with the message:

./subprojects/amrex/Tools/GNUMake/Make.defs:29: *** USE_DPCPP has been deprecated. Use USE_SYCL instead.
/bin/sh: 1: git: not found
Loading ../subprojects/amrex/Tools/GNUMake/comps/gnu.mak...
/bin/sh: 1: g++: not found
expr: syntax error: unexpected argument ‘8’
../subprojects/amrex/Tools/GNUMake/comps/gnu.mak:49: *** GCC < 8 not supported.  Stop.

Looks like I have a few problems, but first the gcc version is too old. Let’s check it.

gcc --version
Command 'gcc' not found, but can be installed with:
sudo apt install gcc

Oh. Right. Ubuntu isn’t shipped with gcc by default. But look, it says what to do to install it right there. So I

sudo apt install gcc

and install gcc.


Now I try to make clean && make again but I still get similar errors:

./subprojects/amrex/Tools/GNUMake/Make.defs:29: *** USE_DPCPP has been deprecated. Use USE_SYCL instead.
/bin/sh: 1: git: not found
Loading ../subprojects/amrex/Tools/GNUMake/comps/gnu.mak...
/bin/sh: 1: g++: not found
expr: syntax error: unexpected argument ‘8’
../subprojects/amrex/Tools/GNUMake/comps/gnu.mak:49: *** GCC < 8 not supported.  Stop.

It looks like it’s going to need some help finding the compiler. But it also looks like it needs git,
which is a bit surprising because I thought we packaged the necessary subprojects… anyway, so I google “ubuntu install git” and

sudo apt install git-all

and install git.


Now I try to build again, make clean && make and it’s still complaining that

../subprojects/amrex/Tools/GNUMake/comps/gnu.mak:49: *** GCC < 8 not supported.  Stop.

even though a gcc --version shows

gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Oh. Right. I didn’t install a c++ compiler too. Duh. Check g++ --version:

command 'g++' not found, but can be installed with:
sudo apt install g++

Again, I just follow the prompt,

sudo apt install g++

and install the GNU c++ compiler.


Ok! Now let’s try make clean && make again. It starts to build. :tada: Slowly. :turtle:. So I’m going to go do the dishes and be back in a little bit…


Failed again. This time an error building AMReX,

make: gfortran: No such file or directory
make: *** [../subprojects/amrex/Tools/GNUMake/Make.rules:329: tmp_build_dir/o/3d.gnu.EXE/AMReX_fort_mod.o] Error 127

Again, I’m missing a compiler. This time the GNU fortran compiler. I could install it, but MFIX-Exa has no fortran in it, so we don’t even need to build AMReX with fortran. I’ve never suppressed fortran with gmake so I pull up the amrex documentation and find the needed command, BL_NO_FORT=TRUE, and add it to the GNUmakefile and try to make clean && make again. For some reason, make doesn’t like that command at all. I also tried DBL_NO_FORT=TRUE and NO_FORT=TRUE without success. I have no idea. Note to self, don’t be lazy and install cmake next time. (With cmake -DAMReX_FORTRAN=NO disables fortran.) So I

sudo apt install gfortran

and try to make clean && make again.

I’m going to crack a beer while this decrepit old machine struggles to build.


At the end of my beer and the end if my build, the bottom of the screen finally says,

SUCCESS

Let’s test it.

mkdir test && cd test
cp ../../benchmarks/05-cyl-fluidbed/Size0001/inputs ./test/
ln -s ../mfix3d.gnu.ex mfix
./mfix inputs

You should get a lot of screen output. If you want to see it, better to pipe it to a screen file. But it should start with (something like):

Initializing AMReX (152fdac6aa4c)...
AMReX (152fdac6aa4c) initialized
   MFIX git describe: 23.12
AMReX-Hydro git hash: f24f4a6f00b93d79e9772100e620d219be7787cb
Number of levels: 1

and end with (something like):

Time spent in main (after init) 7.505165299
Time spent in main      8.187476383
 
AMReX (152fdac6aa4c) finalized

Voilà. You’ve run your first MFIX-Exa simulation.

Thank you so much!
I finally succeeded after trying many times as you taught me.

FYI @jmusser fixed the BL_NO_FORT = TRUE bug and pushed a fix into develop. He mentioned that it may also not require git anymore, but I haven’t tested that. It will be available in the next release.