Questions about PGI 17.1 Open MPI


I have a question about the Open MPI 1.10.2 provided by PGI with 17.1. Namely, does it require installation in a certain path?

For example, the admins here installed PGI 17.1 in


(and 2017 of course) and the compiler seemed okay. I then whipped up a module to point to the Open MPI included because I was lazy and didn’t want to build it like I usually do (built-in!).

I then went to try and build some libraries. When I got to NCO, it threw:

PGC/x86-64 Linux 17.1-0: compilation completed with warnings
libtool: link: ranlib .libs/libnco.a
/bin/sed: can't read /proj/pgi/linux86-64/2017/mpi/openmpi-1.10.2/lib/ No such file or directory
libtool: link: `/proj/pgi/linux86-64/2017/mpi/openmpi-1.10.2/lib/' is not a valid libtool archive
make[4]: *** [] Error 1
make[4]: *** Waiting for unfinished jobs....

I’ll have to stare a bit more, but I’m wondering if it’s reading, say, lib/pkgconfig/ompi.pc and seeing:


which might tell it that is where Open MPI lives. That is not the prefix we installed under, so I can see some issues.

Is this a new requirement/request from PGI for us to build in /proj to use Open MPI? I looked at the installation guide and says that /opt/pgi is still the default, but should we try /proj/pgi if we want to use the built-in MPI? Or, is this something I should bring up with the NCO devels (and I’ll admit the NCO I’m building isn’t the very latest, I tend to be cautious upgrading it until necessary).[/code]

The key to using the proper mpi library is to use the proper mpi driver.

If you built openmpi with PGI compilers, and you
configure --prefix=/path/to/mpi/software/

and you did
make install

then you should have
mpif90, mpic++, and mpicc
in /path/to/mpi/software/bin


export PATH=/path/to/mpi/software/bin:$PGI/linux86-64/17.1/bin:$PATH

should make

mpif90 mpihello.f

work with the MPI libs you built.

If you wish to use the PGI installed openmpi libs.

export PATH=$PGI/linux86-64/2017/mpi/openmpi/bin:$PGI/linux86-64/17.1/bin:$PATH

and now

mpicc myname.c

should create a proper mpi program.

% more mpihello.f
program hello
include ‘mpif.h’
integer ierr, myproc,hostnm, nprocs
character*64 hostname
call mpi_init(ierr)
call mpi_comm_rank(MPI_COMM_WORLD, myproc, ierr)
write(6,100) myproc,nprocs,hostname
100 format(1x,“hello - I am process”,i3," of", i3, " on host ",A64)
call mpi_finalize(ierr)

% more myname.c
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include “mpi.h”
int main(int argc, char **argv){
int len,ierr,ierr2,irank;
char hname[132];
len = 132;
MPI_Init( &argc, &argv );
ierr=MPI_Comm_rank(MPI_COMM_WORLD, &irank);
if(ierr == -1) {
printf(“MPI_Comm_rank returns err=%d\n”,ierr);
if(ierr2 == -1) {
int errsv=errno;
printf(“gethostname() returns err=%d\n”,errsv);
} else {
printf(“Hostname for process %d is %s\n”,irank,hname);
MPI_Finalize( );

mpif90 -o mpihello mpihello.f
mpicc -o myname myname.c
mpirun -np 4 mpihello
mpirun -np 4 myname


Oh, this does work (and I can confirm it with Open MPI 2.0.2). I was wondering if it’s possible to use the built-in Open MPI that comes with the compiler. It’s there and available and I’m always looking at ways to be lazy if I can.

My only issue with the built-in one is that NCO throws that error because all the Open MPI files in PGI’s distribution seem to have been built with a /proj/pgi prefix and not the /opt/pgi prefix that PGI installs to.