Re: OpenMPI Fortran: 'Error reading module mpi' and unexpected but silent termination



On 2007-10-30, Koen Poppe <MyFirstName.MyLastName@xxxxxxxxxxxxxxxxxxx> wrote:


Hello,

I'm encountering very strange behaviour with the very basic MPI/Fortran
program listed at the end of the message on a system running KUbuntu and
with the following compilers:
- gcc (GCC) 4.1.2 (Ubuntu 4.1.2-0ubuntu4)
- GNU-Fortran compiler, 4.3.0 20071002 (experimental)
- OpenMPI 1.1-2.3

Koen,

As I am guiding you with your master's thesis, let me add some additional
comments to your post.

First of all: apparently something went wrong while you were copy-pasting
your program... I've cleaned up the formatting a bit. Here it is:

---> cut here <---------------------------

program test_mpi

implicit none

!use mpi
include 'mpif.h'

integer :: rank, nb, ierr


print *,"right before mpi_init"
call mpi_init( ierr )

print *, "right before mpi_comm_rank"
call mpi_comm_rank(MPI_COMM_WORLD, rank, ierr)
print *,"Hello, I'm processor ", rank

print *,"right before mpi_finalize"
call mpi_finalize(ierr)

end program test_mpi

-------> end cut <-----------------------


So now what exactly is our problem...

If we try to compile this using

bartv@kortrijk:~/mpi_test$ mpif90 test_mpi.f90

Then we get the errors:

/tmp/cc0CK30o.o: In function `MAIN__':
test_mpi.f90:(.text+0x88): undefined reference to `mpi_init_'
test_mpi.f90:(.text+0x105): undefined reference to `mpi_comm_rank_'
test_mpi.f90:(.text+0x1f6): undefined reference to `mpi_finalize_'
collect2: ld returned 1 exit status

Apparently, as we have found, these undefined references can be solved
by adding the -fsecond-underscore option to the mpif90 wrapper command:

bartv@kortrijk:~/mpi_test$ mpif90 test_mpi.f90 -fsecond-underscore
bartv@kortrijk:~/mpi_test$

Which seems to compile fine. However, you are right. When we try to
run the program using the command

bartv@kortrijk:~/mpi_test$ mpirun -np 4 a.out

we only get the output:

right before mpi_init
right before mpi_init
right before mpi_init
right before mpi_init

so it seems like the program stops at the mpi_init subroutine and never
gets passed that.

We are hoping that somebody in this group can give us some advice on why
the program seems to stop at the mpi_init command. All help welcome.

Thanks,
Bart

PS: for the record: we are trying this on a Kubuntu system using

bartv@kortrijk:~/mpi_test$ mpif90 --version | head -1
GNU Fortran (GCC) 4.3.0 20071002 (experimental) [trunk revision 128946]

and OpenMPI as our MPI-library:

bartv@kortrijk:~/mpi_test$ dpkg --list | grep openmpi
ii openmpi-bin 1.1-2.3 high performance message passing library
ii openmpi-common 1.1-2.3 high performance message passing library
ii openmpi-dev 1.1-2.3 high performance message passing library
ii openmpi-libs0 1.1-2.3 high performance message passing library
.



Relevant Pages

  • Re: Problem in calling c programs and compiling them in tcl/tk
    ... Are you using Tcl's glob command to do this? ... using exec gcc filename.c and later exec ./a.out filename.c. ... the execution of a command that might generate a Tcl error. ... i can call a c program and compile it? ...
    (comp.lang.tcl)
  • RE: Console Application Testing
    ... vbc.exe could be accessed in Visual Studio Command ... If you want to compile the project in command prompt with vbc.exe, ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Macro prompt
    ... I'm sorry, Pcman, I don't think I can help here. ... If you want to test the action of clicking a command button on a form, I suggest you test it by clicking the command button on the form, not by trying to run the Click event code from within the VBE window. ... Steve Schapel, Microsoft Access MVP ... options pop-up menu the the "Compile" section has already checked off Compile ...
    (microsoft.public.access.macros)
  • Re: Using MATLAB functions in C code
    ... interface to MATLAB engine.When I tried to ... option files needed.The command is as follows: ... MATLAB fft amd ifft functions.I just want to compile them like: ... int mlhs, mrhs; ...
    (comp.soft-sys.matlab)
  • Re: [SLE] Compile problem
    ... > This is the first compile time problem I have faced in my relatively short ... So ERRORs stop you getting output, WARNINGs alert you to be ... Make sure that from your command line, ... can you engage any response from the command?] ...
    (SuSE)