Start MAP from a job script
When debugging it is common to submit runs from inside a debugger. When profiling the usual approach is to run the program offline, producing a profile file that can be inspected later.
To do this, replace your usual program invocation such as:
mpirun -n 4 PROGRAM [ARGUMENTS]...
With a Linaro MAP command such as:
map --profile mpirun -n 4 PROGRAM [ARGUMENTS]...
map --profile --np=4 PROGRAM [ARGUMENTS]...
Linaro MAP runs without a user interface, gathering data to a .map
profile file. Its
filename is based on a combination of program name, process count, and
timestamp, such as program_2p_2012-12-19_10-51.map
.
If you are using OpenMP, the value of OMP_NUM_THREADS
is also included
in the name after the process count, such as program_2p_8t_2014-10-21_12-45.map
.
This default name can be changed with the --output
argument. To examine
this file, either run MAP and select Load Profile Data File, or access it directly with the command:
map program_2p_2012-12-19_10-51.map
Note
When you start MAP to examine an existing profile file, a valid license is not needed.
When running without a user interface, MAP prints a short header and footer to
stderr with your program’s output in between. The --silent
argument
suppresses this additional output so that your program’s output is intact.
As an alternative to --profile
, you can use Reverse Connect (see
Reverse Connect) to connect back to the
user interface if you wish to use interactive profiling from inside the queue. So the
above example becomes either:
map --connect mpirun -n 4 PROGRAM [ARGUMENTS]...
or:
map --connect --np=4 PROGRAM [ARGUMENTS]...