2 |
C $Name$ |
C $Name$ |
3 |
|
|
4 |
#include "CPP_EEOPTIONS.h" |
#include "CPP_EEOPTIONS.h" |
5 |
|
#include "PACKAGES_CONFIG.h" |
6 |
|
|
7 |
CBOP |
CBOP |
8 |
C !ROUTINE: EEBOOT |
C !ROUTINE: EEBOOT |
9 |
|
|
10 |
C !INTERFACE: |
C !INTERFACE: |
11 |
SUBROUTINE EEBOOT |
SUBROUTINE EEBOOT |
|
IMPLICIT NONE |
|
12 |
|
|
13 |
C !DESCRIPTION: |
C !DESCRIPTION: |
14 |
C *==========================================================* |
C *==========================================================* |
15 |
C | SUBROUTINE EEBOOT |
C | SUBROUTINE EEBOOT |
16 |
C | o Set up execution "environment", particularly perform |
C | o Set up execution "environment", particularly perform |
17 |
C | steps to initialise parallel processing. |
C | steps to initialise parallel processing. |
18 |
C *==========================================================* |
C *==========================================================* |
19 |
C | Note: This routine can also be compiled with CPP |
C | Note: This routine can also be compiled with CPP |
20 |
C | directives set so that no multi-processing is initialised |
C | directives set so that no multi-processing is initialised |
21 |
C | This is OK and works fine. |
C | This is OK and works fine. |
22 |
C *==========================================================* |
C *==========================================================* |
23 |
|
|
24 |
C !CALLING SEQUENCE: |
C !CALLING SEQUENCE: |
25 |
C eeboot() |
C eeboot() |
26 |
C | |
C | |
27 |
C |-- eeboot_minimal() :: Minimal startup. Just enough to |
C |-- eeboot_minimal() :: Minimal startup. Just enough to |
28 |
C | allow basic I/O. |
C | allow basic I/O. |
29 |
C | |
C | |
30 |
C |-- eeintro_msg() :: Write startup greeting. |
C |-- eeintro_msg() :: Write startup greeting. |
37 |
C | |
C | |
38 |
C |-- ini_threading_environment() :: Associate threads with grid regions. |
C |-- ini_threading_environment() :: Associate threads with grid regions. |
39 |
C | |
C | |
40 |
C |-- dfile_init() :: Initialise simple multi-process I/O pacakge. |
C |-- cpl_register() :: Pass attributes to the coupler |
41 |
|
C | |
42 |
|
C |-- w2_eeboot() :: Initialise WRAPPER2 execution environment |
43 |
|
|
44 |
C !USES: |
C !USES: |
45 |
|
IMPLICIT NONE |
46 |
C == Global variables == |
C == Global variables == |
47 |
#include "SIZE.h" |
#include "SIZE.h" |
48 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
52 |
C == Local variables == |
C == Local variables == |
53 |
C I :: Loop counter |
C I :: Loop counter |
54 |
INTEGER I |
INTEGER I |
55 |
|
LOGICAL doReport |
56 |
CEOP |
CEOP |
57 |
|
|
58 |
C-- Set error reporting flags and I/O streams |
C-- Set error reporting flags and I/O streams |
65 |
C eeBootError is a flag used to indicate an error in the |
C eeBootError is a flag used to indicate an error in the |
66 |
C "execution environment" startup pahse as opposed |
C "execution environment" startup pahse as opposed |
67 |
C to the simulation pahse of the execution. |
C to the simulation pahse of the execution. |
68 |
C eeEndError is used to indicate an "execution environment" shutdown |
C eeEndError is used to indicate an "execution environment" shutdown |
69 |
C error. |
C error. |
70 |
C thError flag used to allow a thread to report an error. |
C thError flag used to allow a thread to report an error. |
71 |
C This is only really used during the startup process, |
C This is only really used during the startup process, |
72 |
C although it could be used elsewhere. |
C although it could be used elsewhere. |
73 |
C allMyEdgesAreSharedMemory flag which says for a particular |
C allMyEdgesAreSharedMemory flag which says for a particular |
74 |
C set of blocks the only form of communication |
C set of blocks the only form of communication |
75 |
C it does is using shared memory. |
C it does is using shared memory. |
76 |
C threadIsRunning used during startup to enable check that all |
C threadIsRunning used during startup to enable check that all |
77 |
C the threads are running. |
C the threads are running. |
78 |
fatalError = .FALSE. |
fatalError = .FALSE. |
79 |
eeBootError = .FALSE. |
eeBootError = .FALSE. |
92 |
modelDataUnit = 14 |
modelDataUnit = 14 |
93 |
errorMessageUnit = 15 |
errorMessageUnit = 15 |
94 |
cph errorMessageUnit = 0 is not allowed on some platforms, e.g. SP3 |
cph errorMessageUnit = 0 is not allowed on some platforms, e.g. SP3 |
|
C |
|
|
C Annoyingly there is no universal way to have the usingMPI |
|
|
C parameter work as one might expect. This is because, on some |
|
|
C systems I/O does not work until MPI_Init has been called. The |
|
|
C solution for now is that the parameter below may need to be changed |
|
|
C manually! |
|
|
#ifdef ALLOW_USE_MPI |
|
|
usingMPI = .TRUE. |
|
|
#endif |
|
95 |
|
|
96 |
C-- Start minimal environment so that we can do I/O |
C-- Start minimal environment so that we can do I/O to report errors. |
|
C-- to report errors. |
|
97 |
C Notes |
C Notes |
98 |
C ===== |
C ===== |
99 |
C o Here we start MPI and setup the I/O environment |
C o Here we start MPI and setup the I/O environment |
100 |
C thatis needed for error reporting. |
C that is needed for error reporting. |
101 |
C o Under MPI I/O support is very variable until |
C o Under MPI I/O support is very variable until |
102 |
C MPI is started. This makes is hard to trap the case |
C MPI is started. This makes is hard to trap the case |
103 |
C where mpirun is used to start a non-MPI run or |
C where mpirun is used to start a non-MPI run or |
104 |
C we try to start MPI when mpirun was not used. |
C we try to start MPI when mpirun was not used. |
105 |
C after it is started. |
C after it is started. |
106 |
C jmc: test: |
C jmc: test: |
107 |
C If necessary ( COMPONENT_MODULE defined ) add a 1rst preliminary |
C If necessary ( COMPONENT_MODULE defined ) add a 1rst preliminary |
108 |
C call to eeset_params (in EEBOOT_MINIMAL) to set useCoupler (needed |
C call to eeset_params (in EEBOOT_MINIMAL) to set useCoupler (needed |
109 |
C very early, and the stardard call eeset_params below comes too late) |
C very early, and the stardard call eeset_params below comes too late) |
110 |
C jmc: This needs to be sorted-out in a cleaner way. |
C jmc: This needs to be sorted-out in a cleaner way. |
115 |
CALL EEINTRO_MSG |
CALL EEINTRO_MSG |
116 |
|
|
117 |
C-- Initialise parameters associated with execution environment. |
C-- Initialise parameters associated with execution environment. |
118 |
CALL EESET_PARMS |
doReport = .TRUE. |
119 |
|
CALL EESET_PARMS ( doReport ) |
120 |
IF ( eeBootError ) GOTO 999 |
IF ( eeBootError ) GOTO 999 |
121 |
|
|
122 |
C-- Write summary of execution environment configuration for this run |
C-- Write summary of execution environment configuration for this run |
125 |
C-- Now do the rest of the multi-process startup. |
C-- Now do the rest of the multi-process startup. |
126 |
C o Here we map processes to the model grid. |
C o Here we map processes to the model grid. |
127 |
C o Print tables of process-grid mappings. |
C o Print tables of process-grid mappings. |
128 |
C o Do other miscellaneous multi-processing set up steps. For |
C o Do other miscellaneous multi-processing set up steps. For |
129 |
C example under MPI we create datatypes for communication |
C example under MPI we create datatypes for communication |
130 |
C of array edges. |
C of array edges. |
131 |
CALL INI_PROCS |
CALL INI_PROCS |
|
#ifdef LETS_MAKE_JAM |
|
|
CALL INI_JAM |
|
|
#endif |
|
132 |
IF ( eeBootError ) GOTO 999 |
IF ( eeBootError ) GOTO 999 |
133 |
|
|
134 |
C-- Initialise variables to support "nThreads" of computation. |
C-- Initialise variables to support "nThreads" of computation. |
137 |
CALL INI_THREADING_ENVIRONMENT |
CALL INI_THREADING_ENVIRONMENT |
138 |
IF ( eeBootError ) GOTO 999 |
IF ( eeBootError ) GOTO 999 |
139 |
|
|
140 |
|
#ifdef ALLOW_EXCH2 |
141 |
|
C-- Initialise WRAPPER2 execution environment |
142 |
|
CALL W2_EEBOOT |
143 |
|
#endif /* ALLOW_EXCH2 */ |
144 |
|
|
145 |
C-- Pass attributes to the coupler |
C-- Pass attributes to the coupler |
146 |
#ifdef COMPONENT_MODULE |
#ifdef COMPONENT_MODULE |
147 |
IF ( useCoupler ) CALL CPL_REGISTER |
IF ( useCoupler ) CALL CPL_REGISTER |
148 |
#endif |
#endif |
149 |
|
|
|
#ifdef USE_DFILE |
|
|
C-- Initiialise the multi-process IO package |
|
|
CALL DFILE_INIT |
|
|
#endif |
|
|
|
|
150 |
999 CONTINUE |
999 CONTINUE |
151 |
RETURN |
RETURN |
152 |
END |
END |