OpenCMISS-Iron Internal API Documentation
cmiss_mpi.f90
Go to the documentation of this file.
1 
43 
45 MODULE cmiss_mpi
46 
47  USE base_routines
48  USE constants
49  USE kinds
50 #ifndef NOMPIMOD
51  USE mpi
52 #endif
54  USE strings
55 
56 #include "macros.h"
57 
58  IMPLICIT NONE
59 
60  PRIVATE
61 
62 #ifdef NOMPIMOD
63 #include "mpif.h"
64 #endif
65 
66  !Module parameters
67 
68  !Module types
69 
70  !Module variables
71 
72  !Interfaces
73 
74  PUBLIC mpi_error_check
75 
76 CONTAINS
77 
78  !
79  !================================================================================================================================
80  !
81 
83  SUBROUTINE mpi_error_check(ROUTINE,MPI_ERR_CODE,ERR,ERROR,*)
84 
85  !Argument Variables
86  CHARACTER(LEN=*) :: ROUTINE
87  INTEGER(INTG), INTENT(IN) :: MPI_ERR_CODE
88  INTEGER(INTG), INTENT(OUT) :: ERR
89  TYPE(varying_string), INTENT(OUT) :: ERROR
90  !Local Variables
91  INTEGER(INTG) :: MPI_IERROR, MPI_ERR_STR_LENGTH
92  CHARACTER(LEN=MAXSTRLEN) :: MPI_ERR_STR
93  TYPE(varying_string) :: LOCAL_ERROR
94 
95  enters("MPI_ERROR_CHECK",err,error,*999)
96 
97  IF(mpi_err_code/=mpi_success) THEN
98  CALL mpi_error_string(mpi_err_code,mpi_err_str,mpi_err_str_length,mpi_ierror)
99  local_error="MPI error "//trim(number_to_vstring(mpi_err_code,"*",err,error))//" ("// &
100  & mpi_err_str(1:mpi_err_str_length)//") in "//routine(1:len_trim(routine))
101  CALL flagerror(local_error,err,error,*999)
102  ENDIF
103 
104  exits("MPI_ERROR_CHECK")
105  RETURN
106 999 errorsexits("MPI_ERROR_CHECK",err,error)
107  RETURN 1
108  END SUBROUTINE mpi_error_check
109 
110  !
111  !================================================================================================================================
112  !
113 
114 END MODULE cmiss_mpi
subroutine, public enters(NAME, ERR, ERROR,)
Records the entry into the named procedure and initialises the error code.
Converts a number to its equivalent varying string representation.
Definition: strings.f90:161
This module contains all string manipulation and transformation routines.
Definition: strings.f90:45
This module provides an iso_varying_string module, conformant to the API specified in ISO/IEC 1539-2:...
This module contains all program wide constants.
Definition: constants.f90:45
subroutine, public exits(NAME)
Records the exit out of the named procedure.
This module contains all the low-level base routines e.g., all debug, control, and low-level communic...
This module contains CMISS MPI routines.
Definition: cmiss_mpi.f90:45
Flags an error condition.
This module contains all kind definitions.
Definition: kinds.f90:45
subroutine, public mpi_error_check(ROUTINE, MPI_ERR_CODE, ERR, ERROR,)
Checks to see if an MPI error has occured during an MPI call and flags a CMISS error it if it has...
Definition: cmiss_mpi.f90:84