...
Instructions and examples for compiling code for distributed and parallel applications can be found in the system-specific pages.
On cray system cray-mpich is loaded by default. On other systems to compile MPI enable code, for example with openmpi
Code Block |
---|
$ module load openmpi/version
cc -c main.c
cc -o main main.o -L/usr/local/mylib/libs -l<library-name> |
To compile openMP enable code or MPI+openMP enabled code, use -fopenmp flag during compilation
Code Block |
---|
$ cc -fopenmp -c main.c
$ cc -o main main.o -L/usr/local/mylib/libs -l<library-name> |
To compile openACC enabled code or MPI+openACC enabled code, use -fopenmp flag during compilation
Code Block |
---|
cc -fopenmp -c main.c
$ cc -o main main.o -L/usr/local/mylib/libs -l<library-name> |
To compile HIP enabled GPU code or MPI+HIP enabled GPU code
Code Block |
---|
$ module load rocm/version
$ module load cray-accel-amd-gxf90a
$ hipcc main.c |
To compile CUDA enabled GPU code or MPI+CUDA enabled GPU code
Code Block |
---|
$ module load cuda/version
$ nvcc main.c |
Common compiler options
Some relevant families of compiler options are discussed here. A more comprehensive list of options can be found in system-specific pages as well as in the Serial optimisation section.
...