prism_abort.F90

Go to the documentation of this file.
00001 !-----------------------------------------------------------------------
00002 ! Copyright 2006-2010, CERFACS, Toulouse, France.
00003 ! Copyright 2006-2010, SGI Germany, Munich, Germany.
00004 ! Copyright 2006-2010, NEC Europe Ltd., London, UK.
00005 ! All rights reserved. Use is subject to OASIS4 license terms.
00006 !-----------------------------------------------------------------------
00007 !BOP
00008 !
00009 ! !ROUTINE: PRISM_Abort
00010 !
00011 ! !INTERFACE:
00012 !
00013       subroutine prism_abort ( comp_id, file, mesg )
00014 !
00015 ! !USES:
00016 !
00017       use PRISM, only : PRISM_UNDEFINED, dummy_interface => prism_abort
00018 !
00019       use PSMILe
00020 
00021       implicit none
00022 !
00023 ! !INPUT PARAMETERS:
00024 !
00025       Character(len=*), Intent(In) :: mesg
00026 
00027 !     Message provided by the application developer
00028 
00029       Character(len=*), Intent(In) :: file
00030 
00031 !     Subroutine or file from which prism_abort has been called.
00032 !
00033 !
00034 ! !INPUT/OUTPUT PARAMETERS:
00035 !
00036       Integer, Intent(InOut)       :: comp_id
00037 
00038 !     Component ID from which prism_abort has been called.
00039 
00040 !
00041 ! !LOCAL VARIABLES
00042 !
00043       integer :: ila_args(PSMILe_trans_Header_length)
00044       integer :: ierror
00045 !
00046 !
00047 ! !DESCRIPTION:
00048 !
00049 !     Best attempt to abort all tasks of the current PRISM application
00050 !
00051 ! !REVISION HISTORY:
00052 
00053 !   Date      Programmer   Description
00054 ! ----------  ----------   -----------
00055 ! 01.12.03      H. Ritzdorf  created
00056 !
00057 !EOP
00058 !----------------------------------------------------------------------
00059 !
00060 ! $Id: prism_abort.F90 2939 2011-02-03 12:13:10Z redler $
00061 ! $Author: redler $
00062 !
00063   Character(len=len_cvs_string), save :: mycvs = 
00064       '$Id: prism_abort.F90 2939 2011-02-03 12:13:10Z redler $'
00065 !
00066 !----------------------------------------------------------------------
00067 !
00068 ! 1st Send the header message to the transformer
00069 !
00070       ila_args(1) = PSMILe_trans_Abort
00071       ila_args(2) = global_rank
00072       ila_args(3) = 1
00073       ila_args(4) = Appl%sequence_number
00074       ila_args(5) = Appl%rank
00075 
00076       call psmile_trs_inform(ila_args, PRISMdrv_root, ierror)
00077 !
00078 ! 2nd Clear write buffer
00079 !
00080       call psmile_flushstd
00081 
00082 ! 3rd Check comp_id and print out information
00083 
00084       if ( comp_id /= PRISM_UNDEFINED ) then
00085 
00086          if (comp_id < 1 .or. &
00087               comp_id > Number_of_Comps_allocated) then
00088              print *, trim(ch_id), 'prism_abort : comp_id (out of range)'
00089              comp_id = PRISM_UNDEFINED
00090          endif
00091 
00092          if (Comps(comp_id)%status == PSMILe_status_free) then
00093             print *, trim(ch_id), 'prism_abort : comp_id (not active)'
00094             comp_id = PRISM_UNDEFINED
00095          endif
00096 
00097       endif
00098 
00099       print *
00100       print *, '********************************************************'
00101       print *, '       Trying to abort the coupled application          '
00102       print *, '********************************************************'
00103       print *
00104       print *, ' prism_abort called from routine ', trim(file)
00105 
00106       if ( comp_id == PRISM_UNDEFINED ) then
00107          print *, ' from unkown component (odd comp_id for prism_abort)'
00108       else
00109          print *, ' in component ', trim(Comps(comp_id)%comp_name)
00110       endif
00111 
00112       print *
00113       print *, trim(mesg)
00114       print *
00115       print *, ' Name of aborting application is ', trim(Appl%name)
00116       print *, ' Rank within global set is  ', global_rank
00117       print *, ' Rank within application is ', Appl%rank
00118       print *, ' Rank within component is   ', Comps(comp_id)%rank
00119       print *, '********************************************************'
00120 
00121 ! 4th flush write buffer
00122 
00123       call psmile_flushstd
00124 
00125 ! 5th shut down MPI processes
00126 !
00127 !     MPI_Abort is now called by the transformer
00128 !     call MPI_Abort ( comm_global, 1, ierror )
00129 
00130       end subroutine prism_abort

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1