| 1 |
C $Header$ |
C $Header$ |
| 2 |
|
C $Name$ |
| 3 |
|
|
| 4 |
#include "CPP_EEOPTIONS.h" |
#include "CPP_EEOPTIONS.h" |
| 5 |
|
|
| 14 |
C | directives set so that no multi-processing is initialised| |
C | directives set so that no multi-processing is initialised| |
| 15 |
C | This is OK and should work fine. | |
C | This is OK and should work fine. | |
| 16 |
C \==========================================================/ |
C \==========================================================/ |
| 17 |
|
IMPLICIT NONE |
| 18 |
|
|
| 19 |
C == Global variables == |
C == Global variables == |
| 20 |
#include "SIZE.h" |
#include "SIZE.h" |
| 39 |
C No thread should reach this loop before all threads have set |
C No thread should reach this loop before all threads have set |
| 40 |
C threadIsComplete to TRUE. If they do then either there is a bug |
C threadIsComplete to TRUE. If they do then either there is a bug |
| 41 |
C in the code or the behaviour of the parallel compiler directives |
C in the code or the behaviour of the parallel compiler directives |
| 42 |
C are not right for this code. In the latter case different directives |
C are not right for this code. In the latter case different |
| 43 |
C may be available or the compiler itself may have a bug or you may |
C directives may be available or the compiler itself may have a |
| 44 |
C need a different parallel compiler for main.F |
C bug or you may need a different parallel compiler for main.F |
| 45 |
nThreadsDone = 0 |
nThreadsDone = 0 |
| 46 |
DO I = 1, nThreads |
DO I = 1, nThreads |
| 47 |
IF ( threadIsComplete(I) ) nThreadsDone = nThreadsDone+1 |
IF ( threadIsComplete(I) ) nThreadsDone = nThreadsDone+1 |
| 48 |
ENDDO |
ENDDO |
| 49 |
IF ( nThreadsDone .LT. nThreads ) THEN |
IF ( nThreadsDone .LT. nThreads ) THEN |
| 50 |
WRITE(msgBuf,'(A,I,A,I,A)') |
WRITE(msgBuf,'(A,I5,A,I5,A)') |
| 51 |
& 'S/R EEDIE: Only ',nThreadsDone, |
& 'S/R EEDIE: Only ',nThreadsDone, |
| 52 |
& ' threads have completed, ',nThreads,' are expected for this configuration!' |
& ' threads have completed, ',nThreads, |
| 53 |
WRITE(0,*) msgBuf |
& ' are expected for this configuration!' |
| 54 |
WRITE(0,*) 'Possibly you have different values of setenv PARALLEL and nThreads?' |
WRITE(*,*) msgBuf |
| 55 |
|
WRITE(*,*) |
| 56 |
|
& 'Possibly you have different setenv PARALLEL and nThreads?' |
| 57 |
eeEndError = .TRUE. |
eeEndError = .TRUE. |
| 58 |
fatalError = .TRUE. |
fatalError = .TRUE. |
| 59 |
ENDIF |
ENDIF |
| 65 |
#ifndef ALWAYS_USE_MPI |
#ifndef ALWAYS_USE_MPI |
| 66 |
IF ( usingMPI ) THEN |
IF ( usingMPI ) THEN |
| 67 |
#endif |
#endif |
| 68 |
|
#ifdef COMPONENT_MODULE |
| 69 |
|
IF ( useCoupler) CALL MPI_BARRIER( MPI_COMM_WORLD, mpiRC ) |
| 70 |
|
#endif |
| 71 |
CALL MPI_FINALIZE ( mpiRC ) |
CALL MPI_FINALIZE ( mpiRC ) |
| 72 |
IF ( mpiRC .NE. MPI_SUCCESS ) THEN |
IF ( mpiRC .NE. MPI_SUCCESS ) THEN |
| 73 |
eeEndError = .TRUE. |
eeEndError = .TRUE. |
| 74 |
fatalError = .TRUE. |
fatalError = .TRUE. |
| 75 |
WRITE(msgBuf,'(A,I)') |
WRITE(msgBuf,'(A,I5)') |
| 76 |
& 'S/R FIN_PROCS: MPI_FINALIZE return code', |
& 'S/R FIN_PROCS: MPI_FINALIZE return code', |
| 77 |
& mpiRC |
& mpiRC |
| 78 |
CALL PRINT_ERROR( msgBuf, 1 ) |
CALL PRINT_ERROR( msgBuf, 1 ) |