New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
#880 (ctl_stop doesn't stop execution when code not built with key_mpp_mpi defined.) – NEMO

Opened 12 years ago

Closed 11 years ago

#880 closed Defect (fixed)

ctl_stop doesn't stop execution when code not built with key_mpp_mpi defined.

Reported by: trackstand Owned by: nemo
Priority: low Milestone:
Component: OCE Version: v3.3
Severity: Keywords:
Cc:

Description

Calling ctl_stop should stop the code but when running in serial mode it doesn't - instead it calls mppstop() which, as key_mpp_mpi is not defined, just prints an error message saying it shouldn't have been called. Hence, the code returns from ctl_stop() and proceeds to execute. The problematic bit of ctl_stop() is shown below:

IF( cd1 == 'STOP' ) THEN

IF(lwp) WRITE(numout,*) 'huge E-R-R-O-R : immediate stop'
CALL mppstop()

ENDIF
!

END SUBROUTINE ctl_stop

I think there should be a check on lk_mpp here.

Commit History (2)

ChangesetAuthorTimeChangeLog
3800gm2013-02-12T05:56:41+01:00

dev_v3_4_STABLE_2012: #880 : proper stop when calling ctl_stop in serial mode

3799gm2013-02-12T05:55:06+01:00

dev_MERGE_2012: #880 : proper stop when calling ctl_stop in serial mode

Change History (2)

comment:1 Changed 11 years ago by clevy

Proposed change in lib_mpp.F90:

Change in ctl_stop from :

IF( cd1 == 'STOP' ) THEN

IF(lwp) WRITE(numout,*) 'huge E-R-R-O-R : immediate stop'
CALL mppstop()

ENDIF

To:

IF( cd1 == 'STOP' ) THEN

IF(lwp) WRITE(numout,*) 'huge E-R-R-O-R : immediate stop'

#if defined key_mpp_mpi

CALL mppstop()

#else

STOP

#endif

ENDIF

comment:2 Changed 11 years ago by gm

  • Resolution set to fixed
  • Status changed from new to closed
  • Type changed from Bug to Defect

In the case described here (a call to ctl_stop with 'STOP' as 1st argument, and in serial mode) mppstop routine is indeed call. This routine prints an error message saying it shouldn't have been called AND it also stop the run as required (see the mppstop routine in serial mode just below).

SUBROUTINE mppstop
   WRITE(*,*) 'mppstop: You should not have seen this print if running in mpp mode! error?...'
   WRITE(*,*) 'mppstop: ..otherwise this is a stop condition raised by ctl_stop in single processor mode'
   STOP
END SUBROUTINE mppstop

So the real issue is the misleading error message. There is no error!

The error message has to be removed :

   SUBROUTINE mppstop
      STOP      ! non MPP case, just stop the run
   END SUBROUTINE mppstop

This has been changed in both dev_v3_4_STABLE_2012 (future v3.4.1) and dev_MERGE_2012 (future v3.5 alpha)

see Changeset 3799 for branches/2012/dev_MERGE_2012

and see Changeset 3800 for branches/2012/dev_v3_4_STABLE_2012

Gurvan

Note: See TracTickets for help on using tickets.