How to use allinea-forge

Software
Version
Cluster
allinea-forge
20.0.3
Beskow

ARM-Forge requires Intel or GNU compilers on Beskow. First swap programming environment and load the allinea-forge module:

$ module swap PrgEnv-cray PrgEnv-gnu # (or PrgEnv-intel)
$ module load allinea-forge/20.0.3

Using the ARM Forge graphical interface

The ARM Forge GUI gives access to both the DDT debugger and MAP profiler. There are two ways to run the ARM Forge graphical user interface (GUI):

  • Running on the login node via X-forwarding

  • Running the Remote Client on local computer and connect via ssh to PDC

Running GUI on a login node

To launch the ARM Forge GUI on a login node and connect it to a running job, you first need to run the GUI in the background and then launch the job on a compute node:

$ ssh <username>@beskow.pdc.kth.se
$ module load allinea-forge           # load default ARM-Forge module
$ forge &                             # or "ddt &" or "map &"
$ salloc ...                          # allocate compute node
$ ddt --connect srun -n 32 ./myprog.x # run myprog.x within DDT, connect to GUI

For this to work, you need to log in with the -X or -Y flags to ssh to enable X forwarding.

Running the Remote Client

To avoid running the GUI over an ssh connection, which can become sluggish, you can download the free ARM Remote Client, which runs on your local computer and connects to a remote process running on Beskow.

After downloading an installer for your operating system, you need to set up the connection to PDC and (possibly) replace which ssh command is used:

  1. Click “Remote Launch”, and select “Configure”

  2. Click “Add”, and for “hostname” write: <username>@beskow.pdc.kth.se. You can also give an optional Connection name.

  3. For “Remote installation directory”, enter /pdc/vol/allinea-forge/20.0.3

  4. Click on “Test Remote Launch” to see if the Remote Client GUI can successfully connect to Beskow.

If connecting fails, you may need to replace the default ssh used by Remote Client. First create the directory ~/.allinea. In this directory create a file called remote-exec. In this file, write

#!/bin/sh /correct/path/to/ssh [correct flags] $*

  • If you are on OSX with an ssh installed via MacPorts, the correct ssh would be /opt/local/bin/ssh

  • If you have not configured your ~/.ssh/config file, you will need to add the flags GSSAPIDelegateCredentials=yes -o GSSAPIKeyExchange=yes -o GSSAPIAuthentication=yes

Running DDT

ARM/Allinea DDT is a parallel debugger.

To debug a parallel program, first start the GUI either on login node or the Remote Client, and connect to Beskow (see above). Then submit either an interactive or batch job with ddt –connect in order to let the running program connect to the DDT GUI:

$ module load allinea-forge
$ salloc ...
$ ddt --connect srun -n 32 ./myexe

A pop-up window should then appear in the running GUI with the message “A new Reverse Connect request is available from beskow-login2.pdc.kth.se for Arm DDT.” Click “Accept” to connect to the running code.

Running MAP

ARM/Allinea MAP is a profiler that shows you which lines of code are slow and gets everything else out of your way.

Here is an example from the official documentation

$ mkdir forge-test
$ cd forge-test
$ cp /pdc/vol/allinea-forge/20.0.3/examples/wave.c .
$ cc  wave.c -o wave.x -lm -g

The binary wave.x is now instrumented for ARM/Allinea MAP (and DDT).

In order to run you must prepend the srun command in your bash script or interactive run with map –profile. Here is a simple script that runs the example compiled above:

#!/bin/bash -l

#SBATCH -J forge-test
#SBATCH -t 0:03:00
#SBATCH --nodes 2
#SBATCH -n 64

module swap PrgEnv-cray PrgEnv-gnu
module load allinea-forge/20.0.3

map --profile srun -n 48 ./wave.x

One can also ignore the mpirun command but not its options (see above example). Allinea MAP is aware of that applications are run with mpirun on Tegner. The run will generate two additional files next to the normal output of the mapped application, namely:

<app>_<cores>p_<date-stamp>_<time-stamp>**.map**

You can open the map file in Allinea Forge GUI. The reuslt will look similar to this one:

../../../../_images/map-summary5.png

PDC takes no responsibility for the correctness of results produced with the binaries. Always evaluate the binaries against known results for the systems and properties you are investigating before using the binaries for production jobs.