This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
gfortran and mpich2 interaction
- From: jdelia at intec dot unl dot edu dot ar
- To: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>
- Date: Thu, 08 May 2008 15:15:16 -0300
- Subject: gfortran and mpich2 interaction
Dear gfortran developers,
From the first distributions of the GFORTRAN compiler (experimental
or not), I had noticed a little execution problem (of low impact) when
the attached test program runs in parallel using MPICH2. I ignore if
it is a problem of GFORTRAN or MPICH2 but it does not happen neither
with g95 nor with ifort.
In the simple test, in parallel, the processor 0 must read a variable
"n" that is entered by
console. During the execution (including the case with a single
process), it does not
print any message until a value is entered for the required variable.
In the present test I used the current 1.0.7 stable version of MPICH2
(http://www.mcs.anl.gov/research/projects/mpich2/downloads/index.php?s=downloads)
$ which mpif90
/usr/local/mpich2-exp/1.0.7/bin/mpif90
$ mpif90 --version
GNU Fortran (GCC) 4.4.0 20080302 (experimental) [trunk revision 132813]
Copyright (C) 2007 Free Software Foundation, Inc.
GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING
$ mpif90 -Wall -std=f2003 -fPIC -o testinputmpi.exe testinputmpi.f90
$ mpiexec -machinefile ~/machi.dat -np 1 testinputmpi.exe
100
100
100
matrix rank ; n : ?
matrix rank ; n = 100
matrix rank ; n : ?
matrix rank ; n = 100
matrix rank ; n : ?
matrix rank ; n = 100
The nodes of our Beowulf cluster are 32-bit processors (i386, Intel
Pentium 4).
Perhaps, in case that the problem is in gfortran, is there some compilation
flag for fix this little trouble ?
Thanks in advance,
Regards,
Jorge.
! -----------------------------------------------------------------
! MPICH2
! which mpif90
! mpif90 --version
! mpif90 -Wall -std=f2003 -fPIC -o testinputmpi.exe testinputmpi.f90
! mpdboot -n 5 -f ~/mpd.hosts
! mpdtrace
! mpdringtest
! mpiexec -machinefile ~/machi.dat -np 2 testinputmpi.exe
! mpdallexit
!
! -----------------------------------------------------------------
program testinputmpi
use mpi
implicit none
integer :: myid, siza, ierr, master=0, n
!
call MPI_Init (ierr)
call MPI_Comm_size (MPI_COMM_WORLD, siza, ierr) ! number of processes
call MPI_Comm_rank (MPI_COMM_WORLD, myid, ierr) ! my rank
!
if (myid == master) then
! alternative 1
write (*,*)
write (*,*) " matrix rank ; n : ? "
read (*,*) n
write (*,*) " matrix rank ; n = ", n
! alternative 2
write (6,*)
write (6,*) " matrix rank ; n : ? "
read (5,*) n
write (6,*) " matrix rank ; n = ", n
! alternative 3
print *
print *, " matrix rank ; n : ? "
read (*,*) n
print *, " matrix rank ; n = ", n
else
write (*,*) "hellow from ", myid, " of ", siza, "processes"
end if
!
call MPI_Finalize (ierr)
!
end program
! -------------------------------------------------------------------
CIMEC, http://www.cimec.org.ar/
INTEC, Guemes 3450, 3000-Santa Fe, ARGENTINA
tel: +54-342-451.15.94, extension 1018;
+54-342-455.91.75, fax: +54-342-455.09.44
Universidad Nacional del Litoral (UNL)
Consejo Nacional de Investigaciones Cientificas y Tecnicas (CONICET)
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.