1 *CMZ : 11/11/94 14.40.52 by John Apostolakis CERN GP-MIMD 2
2 *-- Author : John Apostolakis CERN GP-MIMD 2 13/07/94
3 C------------------------------------------------------------------------
5 C Function: initialises the parallel environment (MPI) and
6 C parallel's Geant's variables that track it.
8 C called by: <USER>, uginit, (if CERNLIB_PARA switch is used)
9 C------------------------------------------------------------------------
10 #if defined(CERNLIB_PARA)
13 #include "geant321/mpifinc.inc"
14 #include "geant321/multiprox.inc"
15 #include "geant321/multseeds.inc"
16 #include "geant321/gcflag.inc"
17 integer msgerrpas, ierr
18 common /gpinitpas/ msgerrpas, ierr
20 integer ierr1, ierr2, ierr3
22 integer msgerror, rngerror
24 data msgerror, rngerror / 0, 0 /
27 c Initialise Event Level Parallel Geant (message passing)
30 c Initialise Message Passing and my relevant variables (npsize etc)
34 c Initialise Message Passing
36 call MPI_init( ierr1 )
37 call MPI_Comm_rank( MPI_COMM_WORLD, nprank, ierr2 )
38 call MPI_Comm_size( MPI_COMM_WORLD, npsize, ierr3 )
39 if ( (ierr1 .gt. 0) .or. (ierr2 .gt. 0) .or. (ierr3 .gt. 0) )
42 write(*,*) ' Node ', nprank , ' initialised - one of ', npsize
46 if( msgerror .ne. 0) then
47 write (lunerr, *) ' Message Passing Library error ',
48 & ' in initialisation. '
49 if ( (ierr1.ne.0) .or. (nprank .ne. -1)) then
50 write (lunerr, *) ' Occured in node ', nprank
52 write (lunerr, *) ' MASSIVE ERROR> in an unknown node. '
54 & ' This is non-recoverable, MPI did not initialise at all'
56 c This is non-recoverable, MPI did not initialise at all
63 c By default a static decomposition of events is done, with
64 c each processor geting 1/number of processors of the share
66 c If an input file exists or the time per event has a large standard
67 c deviation, the events can be dynamically assigned. You will then
68 c need to look at the routines gukine and muxread in gexam3.
70 c The following just initialises the default "static" configuration,
71 c in which there is no "master" or "leader".
73 c -- Id of task expected to be a "master"
75 c -- Id of task expected to be 1st worker
76 c (representative for printout ...)