Tags:
create new tag
, view all tags

Using the PGI 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 hydra, at ~hpc/tests/omp/pgi, for a simple example.

The Makefile, for a trivial 'hello world!" example, is

#
FFLAGS = -mp
FC = gfortran $(FFLAGS)
#
all: hello
#
%.o : %.f90
        $(FC) -c $<
#
hello: hello.o
        $(FC) -o $@ $?
#
hello.o: hello.f90

-- SylvainKorzennikHPCAnalyst - 28 Jun 2012

Topic revision: r1 - 2012-06-28 - SylvainKorzennikHPCAnalyst
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2015 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback