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?



Reply via email to