[SCore-users] mpirun STDIN usage with Score
Emile CARCAMO
emile.carcamo at nec.fr
Fri Sep 27 23:31:37 JST 2002
Hello list members,
Following is an elementary MPI test which uses stdin as
input data. If an open on unit 5 is not performed, it is
not possible to read this file using an redirection :
dcharpin {1133}-> cat main.f90
program allreduce
implicit none
include 'mpif.h'
integer statut(MPI_STATUS_SIZE)
integer rang,valeur,produit,code,long
character(len=20) noeud
call MPI_INIT_(code)
call MPI_COMM_RANK_(MPI_COMM_WORLD,rang,code)
if (rang == 0) then
!open(unit=5,file='data',form='formatted')
read(5,*) valeur
else
valeur=100*rang
endif
call MPI_ALLREDUCE_ &
(valeur,produit,1,MPI_INTEGER,MPI_PROD,MPI_COMM_WORLD,code)
noeud(1:20) = ' '
call MPI_Get_processor_name_( noeud, long, code)
write(*,'(A,i4,A,A,A,i4)') &
'Processus N°',rang,' sur ',noeud(1:long), &
' reçoit la valeur du produit global ',produit
call system('sleep 1')
call MPI_FINALIZE_(code)
end
dcharpin {1134}-> make clean
rm -f main.exe main.o work.*
dcharpin {1135}-> make
/opt/score5.0.0/mpi/mpich-1.2.0/i386-redhat7-linux2_4/bin/mpif90 -c main.f90
program ALLREDUCE
integer*8 MPI_DISPLACEMENT_CURRENT
^
Warning 2 at (233:mpif.h) : Type size specifiers are an extension to standard
Fortran 95
282 Lines Compiled
/opt/score5.0.0/mpi/mpich-1.2.0/i386-redhat7-linux2_4/bin/mpif90 -static -o
main.exe main.o -L/opt/score5.0.0/mpi/mpich-1.2.0/i386-redhat7-linux2_4/lib
-lfmpich -lmpich -lmpichf -L/opt/score5.0.0/lib/i386-redhat7-linux2_4
-lscoreusr -lscorecommon -lpm -lscwrap -L/usr/lib/gcc-lib/i386-redhat-linux/2.9
6 -L/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../.. -lg2c -lm -lgcc -lc
dcharpin {1136}-> echo "-1" >/tmp/data
dcharpin {1137}-> scout -g essfrance
SCOUT: Error: Already in a scout environment.
dcharpin {1138}-> which mpirun
/opt/score/bin/mpirun
dcharpin {1139}-> mpirun -np 2 ./main.exe </tmp/data
SCore-D 5.0.1 connected.
<0:0> SCORE: 2 nodes (2x1) ready.
Input/Output Error 153: Input file ended
In Procedure: main program
At Line: 14
Statement: List-Directed READ
Unit: 5
Connected To: Stdin
Form: Formatted
Access: Sequential
Records Read : 0
Records Written: 0
End of diagnostics
<1> SCORE: Program signaled (SIGINT).
dcharpin {1140}-> mpirun -np 2 -stdin /tmp/data ./main.exe
SCore-D 5.0.1 connected.
<0:0> SCORE: 2 nodes (2x1) ready.
Input/Output Error 153: Input file ended
In Procedure: main program
At Line: 14
Statement: List-Directed READ
Unit: 5
Connected To: Stdin
Form: Formatted
Access: Sequential
Records Read : 0
Records Written: 0
End of diagnostics
<1> SCORE: Program signaled (SIGINT).
Please note that we are using Score-5.0.1 in conjunction
with Intel compiler versions described below :
Intel(R) C++ Compiler for 32-bit applications, Version 6.0.1 Build 20020822Z
Intel(R) Fortran Compiler for 32-bit applications, Version 6.0.1 Build
20020822Z
Intel(R) Linux Application Debugger Version 6.0 Build 20020521
Many thanks in advance for your help and sorry if this
item was already covered earlier. Best regards,
--
Emile_CARCAMO NEC European http://www.ess.nec.de
System Engineer Supercomputer mailto:emile.carcamo at nec.fr
Systems France GSM mailto:emile.carcamo at orange.fr
(+33)1-3930-6601 FAX
(+33)1-3930-6613 PHONE / Your mouse has moved. Windows NT must be restarted \
(+33)6-8063-7003 GSM \ for the change to take effect. Reboot now? [ OK ] /
More information about the SCore-users
mailing list