Running Bifrost¶
Bifrost is a high-performance MHD code designed to solve magnetohydrodynamic equations using MPI and Fortran. Below are the basic instructions to get started.
Prerequisites¶
To run Bifrost, you will need:
- An MPI implementation (e.g.,
OpenMPI
,MPICH
). - A Fortran compiler (e.g., Intel Fortran
ifort,ifx
, GNU Fortrangfortran
).
Ensure MPI and the Fortran compiler are correctly installed and available in your environment.
Running the Code¶
Bifrost can be executed on one or more MPI ranks. The code supports automatic domain decomposition, so no manual configuration is required to distribute the workload across ranks.
Here is how to run the code:
-
Prepare your environment:
Bifrost allocates a significant amount of memory on the stack. To avoid memory allocation errors, increase the stack size limit using:
* Provide an input parameter file:By default, the code looks for a file named
* Run with MPI:mhd.in
in the current directory. Alternatively, you can specify a custom parameter file with the -i option:Use mpirun (or an equivalent MPI launcher) to execute Bifrost with the desired number of ranks:
For example, to run with 4 MPI ranks:
Input Parameter File (mhd.in)
The parameter file defines the simulation setup (e.g., grid resolution, viscosity parameters, and initial conditions). Ensure your file is correctly formatted and tailored to your specific experiment. For all available options, check this page.