Skip to content
Snippets Groups Projects
arm.md 1.29 KiB
Newer Older
Jan Siwiec's avatar
Jan Siwiec committed
# Using ARM Partition
Jan Siwiec's avatar
Jan Siwiec committed

For testing your application on the ARM partition,
you need to prepare a job script for that partition or use the interactive job:

```
salloc -A PROJECT-ID -p p01-arm
```

On the partition, you should reload the list of modules:

```
ml architecture/aarch64
```

For compilation, `gcc` and `OpenMPI` compilers are available.
Hence, the compilation process should be the same as on the `x64` architecture.

Let's have the following `hello world` example:

```
#include "mpi.h"
#include "omp.h"

int main(int argc, char **argv)
{
        int rank;
        MPI_Init(&argc, &argv);
        MPI_Comm_rank(MPI_COMM_WORLD, &rank);
        #pragma omp parallel
        {
                printf("Hello on rank %d, thread %d\n", rank, omp_get_thread_num());
        }
        MPI_Finalize();
}
```

You can compile and run the example:

```
ml OpenMPI/4.1.4-GCC-11.3.0
mpic++ -fopenmp hello.cpp -o hello
mpirun -n 4 ./hello
```

Please see [gcc options](https://gcc.gnu.org/onlinedocs/gcc/AArch64-Options.html) for more advanced compilation settings.
No complications are expected as long as the application does not use any intrinsic for `x64` architecture.
If you want to use intrinsic,
[SVE](https://developer.arm.com/documentation/102699/0100/Optimizing-with-intrinsics) instruction set is available.