You can either download MFC's latest release from GitHub or clone the repository:
MFC can be built in multiple ways on various operating systems. Please select your desired configuration from the list bellow:
If you wish to build MFC using NVidia's NVHPC SDK, first follow the instructions here.
On Windows, you can either use Intel Compilers with the standard Microsoft toolchain, or the Windows Subsystem for Linux (WSL) for a Linux experience.
Install Windows Subsystem for Linux (WSL) on Windows 11: Either
Useful software to install for using WSL on Windows:
Once you have WSL installed, you can follow the instructions for *nix systems above (for Ubuntu, see Via Aptitude
section).
Install the latest version of:
C:\strawberry\perl\bin\perl.exe
or your installation path to your PATH) Please note that Visual Studio must be installed first, and the oneAPI Toolkits need to be configured with the installed Visual Studio, even if you plan to use a different IDE.Then, to initialize your development environment, run the following command (or your installation path) in the command prompt:
Alternatively, you can run the following command in Powershell:
You could verify the initialization by typing where mpiexec
in the command prompt terminal (does not work in Powershell), which should return the path to the Intel MPI executable. To continue following this guide, please stay in the initialized terminal window. Replace ./mfc.sh
with .\mfc.bat
for all commands.
If .\mfc.bat build
produces errors, please run the command again. Repeating this process three times should resolve all errors (once each for pre_process, simulation, and post_process). If the same error persists after each attempt, please verify that you have installed all required software and properly initialized the development environment. If uncertain, you could try deleting the build directory and starting over.
You will also have access to the .sln
Microsoft Visual Studio solution files for an IDE (Integrated Development Environment).
Using Homebrew you can install the necessary dependencies before configuring your environment:
They will download the dependencies MFC requires to build itself.
MFC can be built with support for various (compile-time) features:
Feature | Enable | Disable | Default | Description |
---|---|---|---|---|
MPI | --mpi | --no-mpi | On | Lets MFC run on multiple processors (and nodes) simultaneously. |
GPU | --gpu | --no-gpu | Off | Enables GPU acceleration via OpenACC. |
Debug | --debug | --no-debug | Off | Requests the compiler build MFC in debug mode. |
GCov | --gcov | --no-gcov | Off | Builds MFC with coverage flags on. |
Unified Memory | --unified | --no-unified | Off | Builds MFC with unified CPU/GPU memory (GH-200 superchip only) |
⚠️ The --gpu
option requires that your compiler supports OpenACC for Fortran for your target GPU architecture.
When these options are given to mfc.sh
, they will be remembered when you issue future commands. You can enable and disable features anytime by passing any of the arguments above. For example, if you previously built MFC with MPI support and no longer wish to run using MPI, you can pass --no-mpi
once, making the change permanent.
MFC comprises three codes, each being a separate target. By default, all targets (pre_process
, simulation
, and post_process
) are selected. To only select a subset, use the -t
(i.e., --targets
) argument. For a detailed list of options, arguments, and features, please refer to ./mfc.sh build --help
.
Most first-time users will want to build MFC using 8 threads (or more!) with MPI support:
Examples:
./mfc.sh build --gpu -j 8
../mfc.sh build --no-mpi
.simulation
code in Debug mode with MPI and GPU support: ./mfc.sh build --debug --gpu -t simulation
.Run MFC's test suite with 8 threads:
Please refer to the Testing document for more information.
MFC has example cases in the examples
folder. You can run such a case interactively using 2 tasks by typing:
Please refer to the Running document for more information on case.py
files and how to run them.