Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

Subject: Re: [OMPI devel] devel Digest, Vol 2631, Issue 1
From: Wolfgang Kallies (w.kallies_at_[hidden])
Date: 2014-02-26 03:44:18


I had this kind of problem before, so I already checked that. The wrapper compiler
and mpirun match.

A very simple testprogram that I used gave me this result:

Total sum: 0.0000000000000000 id 1
 Total sum: 1014.1131933453868 id 0
 Total sum: 0.0000000000000000 id 2
 Total sum: 0.0000000000000000 id 3

the makefile is appended:

targ=output
sources=variables.o mpitest.o
cc=mpif90
flag=
all: dummy

dummy: $(targ)

$(targ): $(sources)
        $(cc) $(flag) -o $(target) $@ $^
        rm *.o

%.o: %.f90
        $(cc) -c -o $@ $^ $(flag)

It uses the same mpirun as well as the same wrapper
compiler as the previous example.

(Admittedly I had the problem of mismatching mpirun
and wrapper compiler before, so this testprogram
used to give me a similar result,
but after fiddling around for a forenoon,
I solved this already.)

devel-request_at_[hidden] wrote:

> Send devel mailing list submissions to
> devel_at_[hidden]
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://www.open-mpi.org/mailman/listinfo.cgi/devel
> or, via email, send a message with subject or body 'help' to
> devel-request_at_[hidden]
>
> You can reach the person managing the list at
> devel-owner_at_[hidden]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of devel digest..."
>
>
> Today's Topics:
>
> 1. wrapper compiler (Wolfgang Kallies)
> 2. Re: wrapper compiler (Jeff Squyres (jsquyres))
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 25 Feb 2014 10:17:12 -0000
> From: "Wolfgang Kallies" <w.kallies_at_[hidden]>
> To: devel_at_[hidden]
> Subject: [OMPI devel] wrapper compiler
> Message-ID: <20140225101712.58049.3955_at_[hidden]>
> Content-Type: text/plain; charset="us-ascii"
>
> Hello,
>
> I am currently implementing MPI in a program I use at work.
>
> The program uses Ipopt and for testing purposes I reduced it to this:
>
> program test
> use mpi
> ...
> call MPI_INIT(ierrmpi)
> call MPI_COMM_RANK(MPI_COMM_WORLD, myid, ierrmpi)
> call MPI_COMM_SIZE(MPI_COMM_WORLD, numprocs, ierrmpi)
>
> write(*,*)'old IDs:',myid,'of process',numprocs
> if(myid.eq.0)then
> write(*,*)'new IDs:',myid,'of process',numproc
> ...
> endif
> 555 call MPI_FINALIZE(ierrmpi)
> end
>
> Using the MPI-Wrapper Compiler I got a result like this:
>
> old IDs: 0 of process 1
> new IDs: 0 of process 1
> old IDs: 0 of process 1
> new IDs: 0 of process 1
> old IDs: 0 of process 1
> new IDs: 0 of process 1
> old IDs: 0 of process 1
> new IDs: 0 of process 1
>
> Without the wrapper compiler, setting the flags manually, I get what should be there:
> old IDs: 3 of process 4
> old IDs: 0 of process 4
> new IDs: 0 of process 4
> old IDs: 2 of process 4
> old IDs: 1 of process 4
>
> I am using Openmpi 1.5.4 with gfortran 4.4.7.
>
> My new old makefile, that gave me the odd results looked like this:
>
> EXECUTABLE = octopus
> NEW_FILES = variables.o test.o readxypulse.o writexypulse.o singlespin_te.o \
> rotation.o readoptparam.o OCT2.o dcar2pol.o\
> OCT2frprmninit.o OCT2frprmn.o OCT2te.o conv2uni.o\
> OCT2grad.o OCT2linmin.o f1dim.o OCT2mnbrak.o brent.o\
> crossproduct.o dpol2car.o readparam.o conv3uni.o\
> ranking.o backrotation.o genpulse.o normalize.o\
> convert2bruker.o help.o readtable.o addphase.o\
> integrate.o car2pol.o pol2car.o\
> Ipopt.o
> FC = mpif90
> FFLAGS = -O3 -fomit-frame-pointer -ffixed-line-length-none
> F77LINKFLAGS = -Wl,--rpath -Wl,/kain/aksg3/wkallies/project-coop/Ipopt-3.10.3/build/lib
> IPOPTLIBDIR = ${exec_prefix}/lib/
> exec_prefix = ${prefix}
> prefix = /kain/aksg3/wkallies/project-coop/Ipopt-3.10.3/build
> LIBS = -L$(IPOPTLIBDIR) -lipopt -ldl -lcoinmumps -lpthread -lcoinhsl -lcoinlapack -lcoinmetis -lcoinblas -lstdc++ -lm
>
> all: dummy
>
> dummy:$(EXECUTABLE)
>
> toinc=-I`echo /kain/aksg3/wkallies/project-coop/Ipopt-3.10.3/build/include/coin`
>
> $(EXECUTABLE):$(NEW_FILES)
> $(FC) $(F77LINKFLAGS) $(FFLAGS) $(toinc) -o $@ $^ $(LIBS)
> rm *.o *.mod
>
> %.o:%.f
> $(FC) $(FFLAGS) $(toinc) -c -o $@ $^
>
> clean:
> rm *.o *.mod octopus
>
> The new one is provided here:
>
>
> EXECUTABLE = octopus
> NEW_FILES = variables.o test.o readxypulse.o writexypulse.o singlespin_te.o \
> rotation.o readoptparam.o OCT2.o dcar2pol.o\
> OCT2frprmninit.o OCT2frprmn.o OCT2te.o conv2uni.o\
> OCT2grad.o OCT2linmin.o f1dim.o OCT2mnbrak.o brent.o\
> crossproduct.o dpol2car.o readparam.o conv3uni.o\
> ranking.o backrotation.o genpulse.o normalize.o\
> convert2bruker.o help.o readtable.o addphase.o\
> integrate.o car2pol.o pol2car.o\
> Ipopt.o
> FC = gfortran
> FFLAGS = -O3 -ffixed-line-length-none -I/usr/include/openmpi-x86_64 -pthread -m64 -I/usr/lib64/openmpi/lib -L/usr/lib64/openmpi/lib -lmpi_f90 -lmpi_f77 -lmpi -ldl
> F77LINKFLAGS = -Wl,--rpath -Wl,/kain/aksg3/wkallies/project-coop/Ipopt-3.10.3/build/lib
> IPOPTLIBDIR = ${exec_prefix}/lib/
> exec_prefix = ${prefix}
> prefix = /kain/aksg3/wkallies/project-coop/Ipopt-3.10.3/build
> LIBS = -L$(IPOPTLIBDIR) -lipopt -ldl -lcoinmumps -lpthread -lcoinhsl -lcoinlapack -lcoinmetis -lcoinblas -lstdc++ -lm
>
> all: dummy
>
> dummy:$(EXECUTABLE)
>
> toinc=-I`echo /kain/aksg3/wkallies/project-coop/Ipopt-3.10.3/build/include/coin`
>
> $(EXECUTABLE):$(NEW_FILES)
> $(FC) $(F77LINKFLAGS) $(FFLAGS) $(toinc) -o $@ $^ $(LIBS)
> rm *.o *.mod
>
> %.o:%.f
> $(FC) $(FFLAGS) $(toinc) -c -o $@ $^
>
> clean:
> rm *.o *.mod octopus
>
>
> Is there a reason why I can't use the wrapper compiler?
>
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Tue, 25 Feb 2014 13:25:11 +0000
> From: "Jeff Squyres (jsquyres)" <jsquyres_at_[hidden]>
> To: Open MPI Developers <devel_at_[hidden]>
> Subject: Re: [OMPI devel] wrapper compiler
> Message-ID: <8880DAF3-9FBF-495D-9539-07CC3EBF869B_at_[hidden]>
> Content-Type: text/plain; charset="us-ascii"
>
> This is a classic symptom of getting the wrong wrapper compiler -- e.g., using an MPICH wrapper compiler but an Open MPI mpirun (or vice versa). Make sure that your wrapper compiler matches the mpirun that you're using -- e.g., check your PATH and LD_LIBRARY_PATH values.
>
>
> On Feb 25, 2014, at 5:17 AM, Wolfgang Kallies <w.kallies_at_[hidden]> wrote:
>
>
> > Hello,
> >
> > I am currently implementing MPI in a program I use at work.
> >
> > The program uses Ipopt and for testing purposes I reduced it to this:
> >
> > program test
> > use mpi
> > ...
> > call MPI_INIT(ierrmpi)
> > call MPI_COMM_RANK(MPI_COMM_WORLD, myid, ierrmpi)
> > call MPI_COMM_SIZE(MPI_COMM_WORLD, numprocs, ierrmpi)
> >
> > write(*,*)'old IDs:',myid,'of process',numprocs
> > if(myid.eq.0)then
> > write(*,*)'new IDs:',myid,'of process',numproc
> > ...
> > endif
> > 555 call MPI_FINALIZE(ierrmpi)
> > end
> >
> > Using the MPI-Wrapper Compiler I got a result like this:
> >
> > old IDs: 0 of process 1
> > new IDs: 0 of process 1
> > old IDs: 0 of process 1
> > new IDs: 0 of process 1
> > old IDs: 0 of process 1
> > new IDs: 0 of process 1
> > old IDs: 0 of process 1
> > new IDs: 0 of process 1
> >
> > Without the wrapper compiler, setting the flags manually, I get what should be there:
> > old IDs: 3 of process 4
> > old IDs: 0 of process 4
> > new IDs: 0 of process 4
> > old IDs: 2 of process 4
> > old IDs: 1 of process 4
> >
> > I am using Openmpi 1.5.4 with gfortran 4.4.7.
> >
> > My new old makefile, that gave me the odd results looked like this:
> >
> > EXECUTABLE = octopus
> > NEW_FILES = variables.o test.o readxypulse.o writexypulse.o singlespin_te.o \
> > rotation.o readoptparam.o OCT2.o dcar2pol.o\
> > OCT2frprmninit.o OCT2frprmn.o OCT2te.o conv2uni.o\
> > OCT2grad.o OCT2linmin.o f1dim.o OCT2mnbrak.o brent.o\
> > crossproduct.o dpol2car.o readparam.o conv3uni.o\
> > ranking.o backrotation.o genpulse.o normalize.o\
> > convert2bruker.o help.o readtable.o addphase.o\
> > integrate.o car2pol.o pol2car.o\
> > Ipopt.o
> > FC = mpif90
> > FFLAGS = -O3 -fomit-frame-pointer -ffixed-line-length-none
> > F77LINKFLAGS = -Wl,--rpath -Wl,/kain/aksg3/wkallies/project-coop/Ipopt-3.10.3/build/lib
> > IPOPTLIBDIR = ${exec_prefix}/lib/
> > exec_prefix = ${prefix}
> > prefix = /kain/aksg3/wkallies/project-coop/Ipopt-3.10.3/build
> > LIBS = -L$(IPOPTLIBDIR) -lipopt -ldl -lcoinmumps -lpthread -lcoinhsl -lcoinlapack -lcoinmetis -lcoinblas -lstdc++ -lm
> >
> > all: dummy
> >
> > dummy:$(EXECUTABLE)
> >
> > toinc=-I`echo /kain/aksg3/wkallies/project-coop/Ipopt-3.10.3/build/include/coin`
> >
> > $(EXECUTABLE):$(NEW_FILES)
> > $(FC) $(F77LINKFLAGS) $(FFLAGS) $(toinc) -o $@ $^ $(LIBS)
> > rm *.o *.mod
> >
> > %.o:%.f
> > $(FC) $(FFLAGS) $(toinc) -c -o $@ $^
> >
> > clean:
> > rm *.o *.mod octopus
> >
> > The new one is provided here:
> >
> >
> > EXECUTABLE = octopus
> > NEW_FILES = variables.o test.o readxypulse.o writexypulse.o singlespin_te.o \
> > rotation.o readoptparam.o OCT2.o dcar2pol.o\
> > OCT2frprmninit.o OCT2frprmn.o OCT2te.o conv2uni.o\
> > OCT2grad.o OCT2linmin.o f1dim.o OCT2mnbrak.o brent.o\
> > crossproduct.o dpol2car.o readparam.o conv3uni.o\
> > ranking.o backrotation.o genpulse.o normalize.o\
> > convert2bruker.o help.o readtable.o addphase.o\
> > integrate.o car2pol.o pol2car.o\
> > Ipopt.o
> > FC = gfortran
> > FFLAGS = -O3 -ffixed-line-length-none -I/usr/include/openmpi-x86_64 -pthread -m64 -I/usr/lib64/openmpi/lib -L/usr/lib64/openmpi/lib -lmpi_f90 -lmpi_f77 -lmpi -ldl
> > F77LINKFLAGS = -Wl,--rpath -Wl,/kain/aksg3/wkallies/project-coop/Ipopt-3.10.3/build/lib
> > IPOPTLIBDIR = ${exec_prefix}/lib/
> > exec_prefix = ${prefix}
> > prefix = /kain/aksg3/wkallies/project-coop/Ipopt-3.10.3/build
> > LIBS = -L$(IPOPTLIBDIR) -lipopt -ldl -lcoinmumps -lpthread -lcoinhsl -lcoinlapack -lcoinmetis -lcoinblas -lstdc++ -lm
> >
> > all: dummy
> >
> > dummy:$(EXECUTABLE)
> >
> > toinc=-I`echo /kain/aksg3/wkallies/project-coop/Ipopt-3.10.3/build/include/coin`
> >
> > $(EXECUTABLE):$(NEW_FILES)
> > $(FC) $(F77LINKFLAGS) $(FFLAGS) $(toinc) -o $@ $^ $(LIBS)
> > rm *.o *.mod
> >
> > %.o:%.f
> > $(FC) $(FFLAGS) $(toinc) -c -o $@ $^
> >
> > clean:
> > rm *.o *.mod octopus
> >
> >
> > Is there a reason why I can't use the wrapper compiler?
> >
> >
> >
> > _______________________________________________
> > devel mailing list
> > devel_at_[hidden]
> > http://www.open-mpi.org/mailman/listinfo.cgi/devel
> >
> >
>
>
> --
> Jeff Squyres
> jsquyres_at_[hidden]
> For corporate legal information go to: http://www.cisco.com/web/about/doing_business/legal/cri/
>
>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> devel mailing list
> devel_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/devel
>
> ------------------------------
>
> End of devel Digest, Vol 2631, Issue 1
> **************************************
>
>
>