]> git.uio.no Git - u/mrichter/AliRoot.git/blame - GEANT321/gparal/gpinit.F
Minor changes at comments.
[u/mrichter/AliRoot.git] / GEANT321 / gparal / gpinit.F
CommitLineData
fe4da5cc 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
3C------------------------------------------------------------------------
4C gpinit
5C Function: initialises the parallel environment (MPI) and
6C parallel's Geant's variables that track it.
7C
8C called by: <USER>, uginit, (if CERNLIB_PARA switch is used)
9C------------------------------------------------------------------------
10#if defined(CERNLIB_PARA)
11 subroutine gpinit
12 implicit none
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
19
20 integer ierr1, ierr2, ierr3
21 integer ibase, lunerr
22 integer msgerror, rngerror
23 data ibase / 1 /
24 data msgerror, rngerror / 0, 0 /
25 parameter (lunerr= 0)
26
27c Initialise Event Level Parallel Geant (message passing)
28c
29c Tasks:
30c Initialise Message Passing and my relevant variables (npsize etc)
31
32 nprank= -1
33
34c Initialise Message Passing
35
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) )
40 + msgerror=1
41
42 write(*,*) ' Node ', nprank , ' initialised - one of ', npsize
43
44c Set Error flag ...
45
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
51 else
52 write (lunerr, *) ' MASSIVE ERROR> in an unknown node. '
53 write (lunerr, *)
54 & ' This is non-recoverable, MPI did not initialise at all'
55c
56c This is non-recoverable, MPI did not initialise at all
57 call gpabort()
58c ieorun= 1
59 stop
60 endif
61 endif
62c
63c By default a static decomposition of events is done, with
64c each processor geting 1/number of processors of the share
65c of events.
66c If an input file exists or the time per event has a large standard
67c deviation, the events can be dynamically assigned. You will then
68c need to look at the routines gukine and muxread in gexam3.
69c
70c The following just initialises the default "static" configuration,
71c in which there is no "master" or "leader".
72c
73c -- Id of task expected to be a "master"
74 npleader = -1
75c -- Id of task expected to be 1st worker
76c (representative for printout ...)
77 nfirstworker= 0
78
79 msgerrpas= msgerror
80
81 return
82 end
62be6b28 83#else
84 SUBROUTINE GPINIT_DUMMY
85 END
fe4da5cc 86#endif