Discussion:
mpif90 on Kubuntu 7.10
(too old to reply)
Bart Vandewoestyne
2007-10-31 11:58:24 UTC
Permalink
I am trying to compile a simple MPI testprogram on a Kubuntu 7.10
(Gutsy Gibbon) Linux machine. We are using the OpenMPI and gfortran
packages from our Kubuntu installation for both OpenMPI and gfortran:

***@kortrijk:~$ 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
***@kortrijk:~$ dpkg --list | grep gfortran
ii gfortran 4.1.2-1ubuntu1 The GNU Fortran 95 compiler
ii gfortran-4.1 4.1.2-0ubuntu4 The GNU Fortran 95 compiler
ii libgfortran1 4.1.2-0ubuntu4 Runtime library for GNU Fortran applications
ii libgfortran1-dev 4.1.2-0ubuntu4 GNU Fortran library development

The testprogram I'm using is the following:


program test_mpi

use mpi

implicit none
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


I get undefined reference errors when I simply compile with mpif90 without
any additional flags:

***@kortrijk:~/mpi_test$ mpif90 test_mpi.f90
/tmp/ccNMqzGg.o: In function `MAIN__':
test_mpi.f90:(.text+0x9c): undefined reference to `mpi_init_'
test_mpi.f90:(.text+0x11e): undefined reference to `mpi_comm_rank_'
test_mpi.f90:(.text+0x210): undefined reference to `mpi_finalize_'
collect2: ld returned 1 exit status

So I therefore add the -fsecond-underscore flag and things seem to compile
fine:

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

Now, as I try to run this, the program silently exits somewhere in the
mpi_init subroutine and it doesn't seem to proceed beyond that routine:

***@kortrijk:~/mpi_test$ mpirun -np 4 a.out
right before mpi_init
right before mpi_init
right before mpi_init
right before mpi_init
***@kortrijk:~/mpi_test$


And this is where we are stuck :-( Why doesn't the program continue until
the end?

Does anybody see what I'm possibly doing wrong?

Regards,
Bart
--
"Share what you know. Learn what you don't."
l***@sohu.com
2007-10-31 18:41:40 UTC
Permalink
I compiled your program ,everything went right.

the compiler is gfortran 4.3.0 20071026 (experimental).
MPI is openmpi 1.2.4

[01:26:03][~]$mpif90 1.f90
[01:26:13][~]$mpirun -np 4 a.out
right before mpi_init
right before mpi_init
right before mpi_init
right before mpi_init
right before mpi_comm_rank
Hello, I'm processor 3
right before mpi_finalize
right before mpi_comm_rank
Hello, I'm processor 0
right before mpi_finalize
right before mpi_comm_rank
Hello, I'm processor 1
right before mpi_finalize
right before mpi_comm_rank
Hello, I'm processor 2
right before mpi_finalize
Bart Vandewoestyne
2007-10-31 18:57:49 UTC
Permalink
Post by Bart Vandewoestyne
I am trying to compile a simple MPI testprogram on a Kubuntu 7.10
(Gutsy Gibbon) Linux machine. We are using the OpenMPI and gfortran
Let me correct myself: it's not Kubuntu 7.10 Gutsy Gibbon that
we're running, it's Kubuntu 7.04 feisty.

Bart
--
"Share what you know. Learn what you don't."
Maciej Marek
2007-11-02 12:30:39 UTC
Permalink
Post by Bart Vandewoestyne
Let me correct myself: it's not Kubuntu 7.10 Gutsy Gibbon that
we're running, it's Kubuntu 7.04 feisty.
Hm, not so long ago I reported here, on this group,
some problems with Lahey Fortran and LAM/MPI on
Kubuntu 7.04 Feisty. All problems disappeared when
I downgraded to Kubuntu Dapper.

I still don't know what went wrong.


Regards,
Maciej Marek

Loading...