MARE2DEM calling sequence and command line arguments

How you run MARE2DEM will depend on your particular computer or cluster system. On a cluster server you will need to submit each MARE2DEM job to the queue system, so find the queue submission instructions on a website or contact your system administrator for help with that.   The instructions below pertain to launching MARE2DEM directly from a terminal on a laptop or desktop; on a cluster, you would include the launching commands below in your queue submission script.

The basic calling sequence for MARE2DEM looks like this:

/opt/openmpi/bin/mpirun -np 9 ∼/Source/MARE2DEM Test.0.resistivity

Here's a breakdown of the sequence.  The first command mpirun  tells the computer to run MARE2DEM in parallel on a given number of processors, in this case 9 processors (-np 9).  Then the MARE2DEM executable is listed. The last argument is the name of the input resistivity file to model, in this case the starting iteration (0) for model Test. Note that you need to run this command from the folder containing the model files.

MARE2DEM uses a manager-worker model for parallel finite element modeling, where there is one manager and np-1 worker processors. The manager doesn't do much except send and receives tasks to each worker and mostly sits around idle; therefore, when running MARE2DEM on laptops or desktops it can be advantageous to call mpirun with one extra core.  For example, on an 8 core laptop or desktop, you should use "-np 9". If your system instead has 16 cores, you could change the argument to "-np 17".

Note the path to the mpirun executable. You will also want to substitute the correct path to your MARE2DEM executable.  If you are Unix knowledgable, you can add both executables to your search path (e.g., using a .bash_profile or .profile file) and then use the shorter calling sequence:

mpirun -np 9 MARE2DEM Test.0.resistivity

In the examples below I will only refer to the shorter calling sequence.

Inversion Mode

By default, MARE2DEM will launch into inversion mode, meaning it will search for a conductivity model compatible with the input data. If MARE2DEM detects that the input model has no free parameters (i.e., there are no free resistivity values), it will automatically switch to forward mode and just compute the forward response of the input model and then stop.

During an inversion run, MARE2DEM will save a new .resistivity file at the end of each Occam iteration. You can easily restart an inversion from an intermediate iteration. For example to start from iteration 8, the calling command is

mpirun -np 9 MARE2DEM Test.8.resistivity
Forward Mode

You can force MARE2DEM to only compute the forward response of an inversion model using the -F flag:

mpirun -np 9 MARE2DEM -F Test.0.resistivity
Forward Fields Mode

MARE2DEM also supports a special mode called forward fields that is useful for synthetic forward model simulations. Forward fields mode is launched using the -FF flag:

mpirun -np 9 MARE2DEM -FF Test.0.resistivity

If you run MARE2DEM using this special mode, it will compute all 3 components of the electric and magnetic fields for all combinations of receivers, frequencies and sources listed in the data file, regardless of what (if any) specific data are listed in the data array (more on that in a future post). The full field vectors are output to special files with the extensions .fieldsMT and .fieldsCSEM.  This can be useful for creating plots of the EM fields diffusing throughout the model and for looking at quantities like the EM Poynting vectors. This new feature is not yet supported by the distributed MATLAB plotting routines, so you will have to roll your own plotting codes for now.

Leave a Reply