/[MITgcm]/MITgcm/eesupp/src/eedie.F
ViewVC logotype

Diff of /MITgcm/eesupp/src/eedie.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1 by cnh, Wed Apr 22 19:15:30 1998 UTC revision 1.8 by ce107, Thu Dec 22 00:56:49 2005 UTC
# Line 1  Line 1 
1  C $Id$  C $Header$
2    C $Name$
3    
4  #include "CPP_EEOPTIONS.h"  #include "CPP_EEOPTIONS.h"
5    #ifdef USE_LIBHPM
6    # include "f_hpm.h"
7    #endif
8    
9  CStartOfInterface  CStartOfInterface
10        SUBROUTINE EEDIE        SUBROUTINE EEDIE
# Line 13  C     | Note: This routine can also be c Line 17  C     | Note: This routine can also be c
17  C     | directives set so that no multi-processing is initialised|  C     | directives set so that no multi-processing is initialised|
18  C     | This is OK and should work fine.                         |  C     | This is OK and should work fine.                         |
19  C     \==========================================================/  C     \==========================================================/
20          IMPLICIT NONE
21    
22  C     == Global variables ==  C     == Global variables ==
23  #include "SIZE.h"  #include "SIZE.h"
# Line 37  C--   Check that all the threads have en Line 42  C--   Check that all the threads have en
42  C     No thread should reach this loop before all threads have set  C     No thread should reach this loop before all threads have set
43  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
44  C     in the code or the behaviour of the parallel compiler directives  C     in the code or the behaviour of the parallel compiler directives
45  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
46  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
47  C     need a different parallel compiler for main.F  C     bug or you may need a different parallel compiler for main.F
48        nThreadsDone = 0        nThreadsDone = 0
49        DO I = 1, nThreads        DO I = 1, nThreads
50         IF ( threadIsComplete(I) ) nThreadsDone = nThreadsDone+1         IF ( threadIsComplete(I) ) nThreadsDone = nThreadsDone+1
51        ENDDO        ENDDO
52        IF ( nThreadsDone .LT. nThreads ) THEN        IF ( nThreadsDone .LT. nThreads ) THEN
53         WRITE(msgBuf,'(A,I,A,I,A)')         WRITE(msgBuf,'(A,I5,A,I5,A)')
54       & 'S/R EEDIE: Only ',nThreadsDone,       & 'S/R EEDIE: Only ',nThreadsDone,
55       & ' threads have completed, ',nThreads,' are expected for this configuration!'       & ' threads have completed, ',nThreads,
56         WRITE(0,*) msgBuf       & ' are expected for this configuration!'
57         WRITE(0,*) 'Possibly you have different values of setenv PARALLEL and nThreads?'         WRITE(*,*) msgBuf
58           WRITE(*,*)
59         & 'Possibly you have different setenv PARALLEL and nThreads?'
60         eeEndError = .TRUE.         eeEndError = .TRUE.
61         fatalError = .TRUE.         fatalError = .TRUE.
62        ENDIF        ENDIF
63    
64    #ifdef USE_LIBHPM
65          CALL F_HPMTERMINATE(myProcId)
66    #endif
67  #ifdef ALLOW_USE_MPI  #ifdef ALLOW_USE_MPI
68  C--  C--
69  C--   MPI style multiple-process termination  C--   MPI style multiple-process termination
# Line 61  C--   ================================== Line 71  C--   ==================================
71  #ifndef ALWAYS_USE_MPI  #ifndef ALWAYS_USE_MPI
72        IF ( usingMPI ) THEN        IF ( usingMPI ) THEN
73  #endif  #endif
74    #ifdef COMPONENT_MODULE
75           IF ( useCoupler) CALL MPI_BARRIER( MPI_COMM_WORLD, mpiRC )
76    #endif
77         CALL MPI_FINALIZE  ( mpiRC )         CALL MPI_FINALIZE  ( mpiRC )
78         IF ( mpiRC .NE. MPI_SUCCESS ) THEN         IF ( mpiRC .NE. MPI_SUCCESS ) THEN
79          eeEndError = .TRUE.          eeEndError = .TRUE.
80          fatalError = .TRUE.          fatalError = .TRUE.
81          WRITE(msgBuf,'(A,I)')          WRITE(msgBuf,'(A,I5)')
82       &       'S/R FIN_PROCS: MPI_FINALIZE return code',       &       'S/R FIN_PROCS: MPI_FINALIZE return code',
83       &       mpiRC       &       mpiRC
84          CALL PRINT_ERROR( msgBuf, 1 )          CALL PRINT_ERROR( msgBuf, 1 )

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.22