Using the GNU compilers and OpenMP
- OpenMP is an API to let the compiler parallelize your code, using directives, called pragmas, and a shared-memory model, by contrast to a message passing model.
- Pragmas look like comments, but get parsed by the compiler when invoking it with the appropriate flag,
- The resulting executable uses multi-threading, and must therefore run on a single compute node.
- You must use the appropriate PE (parallel environment) to submit OpenMP jobs
- Look, on
~hpc/tests/omp/gnu, for a simple example.
, for a trivial 'hello world!" example, is
FFLAGS = -fopenmp
FC = gfortran $(FFLAGS)
%.o : %.f90
$(FC) -c $<
$(FC) -o $@ $?
- 28 Jun 2012