Tags:
create new tag
, view all tags

Using the PGI compilers and MPI

Configuration

  • To include MPI support, the basic configuration can be expanded to point to the MPI location (MPICH),
  • i.e., something like
    # #
    # Portland Compiler Group Compilers... # Portland Compiler Group Compilers...
    # #
    PGIVER=12.5 set PGIVER  = 12.5
    PGI=/share/apps/pgi setenv PGI  /share/apps/pgi
    PGIx=$PGI/linux86-64/$PGIVER setenv PGIx $PGI/linux86-64/$PGIVER
    MPICH=$PGIx/mpi/mpich setenv MPICH   $PGIx/mpi/mpich
    LM_LICENSE_FILE=$PGI/license.dat setenv LM_LICENSE_FILE $PGI/license.dat
    MANPATH=${MANPATH}:$PGIx/man:$PGIx/mpi/mpich/man set path = ($PGIx/bin $MPICH/bin $path)
    # if (! $?MANPATH) setenv MANPATH ""
    PATH=$PATH:$PGIx/bin:$MPICH/bin setenv MANPATH ${MANPATH}:$PGIx/man:$PGIx/mpi/mpich/man
    export PATH MPICH LM_LICENSE_FILE MANPATH unset PGIVER
    # #
    alias dbx="pgdbg -text -dbx" alias dbx pgdbg -text -dbx

Examples

  • A simple example, on hydra=, is under ~/hpc/tests/mpi/pgi
  • The Makefile for a trivial 'hello world!" example, is
    #
    # PGI
    PGIVER = 12.5                        
    PGI    = /share/apps/pgi
    PGIx   = $(PGI)/linux86-64/$(PGIVER)
    #
    # mpi location
    MPICH  = $(PGIx)/mpi/mpich
    #
    # (if MPICH is defined in your env, you can ignore the lines above)
    #
    # flags
    CFLAGS = 
    FFLAGS = -fast
    MFLAGS = -I$(MPICH)/include -I$(MPICH)/include/f90choice
    #
    # compiler/linker
    FC     = pgf90 $(FFLAGS) $(MFLAGS) $(IFLAGS)
    CC     = pgcc  $(CFLAGS) $(MFLAGS) $(IFLAGS)
    MPIFC  = $(MPICH)/bin/mpif90 $(FFLAGS)
    MPICC  = $(MPICH)/bin/mpicc $(CFLAGS)
    #
    hello: hello.o
            $(MPICC) -o $@ hello.o
    

-- SylvainKorzennikHPCAnalyst - 28 Jun 2012

Topic revision: r2 - 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