Back to home page

MITgcm

 
 

    


File indexing completed on 2023-05-28 05:10:54 UTC

view on githubraw file Latest commit b4daa243 on 2023-05-28 03:53:22 UTC
b4daa24319 Shre*0001 /*
                0002 ##########################################################
                0003 # This file is part of the AdjoinableMPI library         #
                0004 # released under the MIT License.                        #
                0005 # The full COPYRIGHT notice can be found in the top      #
                0006 # level directory of the AdjoinableMPI distribution.     #
                0007 ########################################################## 
                0008 */
                0009 #ifndef _AMPI_REQUEST_H_
                0010 #define _AMPI_REQUEST_H_
                0011 
                0012 /**
                0013  * \file 
                0014  * \ingroup UserInterfaceHeaders
                0015  * \brief definitions for an AMPI_Request which is an MPI_Request augmented with additional information
                0016  *
                0017  * the request in the AMPI context need to be used to track extra information;
                0018  * the extra information cannot be exposed in Fortran77 but there can be a 
                0019  * Fortran90 equivalent and it can be exposed in C to allow source transformation 
                0020  * tools to use TBR analysis on the tracked information.
                0021  */ 
                0022 
                0023 #include "ampi/userIF/pairedWith.h"
                0024 
                0025 /** \ingroup UserInterfaceDeclarations
                0026  * @{
                0027  */
                0028 /**
                0029  * does the request originate with a  send or a receive 
                0030  */
                0031 enum AMPI_Request_origin_E { 
                0032   AMPI_SEND_ORIGIN,
                0033   AMPI_RECV_ORIGIN
                0034 };
                0035 
                0036 #ifdef AMPI_FORTRANCOMPATIBLE
                0037 typedef int AMPI_Request_origin;
                0038 #else 
                0039 typedef enum AMPI_Request_origin_E AMPI_Request_origin;
                0040 #endif 
                0041 
                0042 /**
                0043  * MPI_Request augmented with extra information 
                0044  */ 
                0045 struct AMPI_Request_S {
                0046 
                0047   /**
                0048    * \ref AMPI_Isend / \ref AMPI_Irecv  buf  parameter 
                0049    */
                0050   void *buf;
                0051 
                0052   /**
                0053    * The corresponding adjoint buffer
                0054    */
                0055   void *adjointBuf ;
                0056 
                0057   /**
                0058    * \ref AMPI_Isend / \ref AMPI_Irecv  count  parameter 
                0059    */
                0060   int count;
                0061 
                0062   /**
                0063    * \ref AMPI_Isend / \ref AMPI_Irecv  datatype  parameter 
                0064    */
                0065   MPI_Datatype datatype;
                0066 
                0067   /**
                0068    * \ref AMPI_Isend / \ref AMPI_Irecv  dst or src  parameter 
                0069    */
                0070   int endPoint;
                0071 
                0072   /**
                0073    * \ref AMPI_Isend / \ref AMPI_Irecv  tag parameter 
                0074    */
                0075   int tag;
                0076 
                0077   /**
                0078    * \ref AMPI_Isend / \ref AMPI_Irecv sets this
                0079    */ 
                0080   enum AMPI_PairedWith_E pairedWith;
                0081 
                0082   /**
                0083    * \ref AMPI_Isend / \ref AMPI_Irecv  comm  parameter 
                0084    */
                0085   MPI_Comm comm;
                0086 
                0087   /**
                0088    * temporary adjoint buffer; not to be traced
                0089    */
                0090   void *adjointTempBuf;
                0091   
                0092   /**
                0093    * the count of the adjoint buffer size in terms of the original data type; not to be traced;
                0094    */
                0095   int adjointCount;
                0096   
                0097   /**
                0098    * the "plain" request returned by MPI_Isend or MPI_Irecv resp; not to be traced
                0099    */  
                0100   MPI_Request plainRequest;
                0101 
                0102   /**
                0103    * the "plain" request returned in the bw sweep by the MPI_Send/Recv in the BW_AMPI_Wait
                0104    */
                0105   MPI_Request bwRequest;
                0106 
                0107   /**
                0108    * the "plain" request returned by MPI_Isend or MPI_Irecv resp; 
                0109    */  
                0110   MPI_Request tracedRequest;
                0111 
                0112   /**
                0113    * the "plain" request returned by the shadow MPI_Isend or MPI_Irecv resp (TLS mode); 
                0114    */  
                0115   MPI_Request shadowRequest;
                0116 
                0117   /**
                0118    * \ref AMPI_Isend / \ref AMPI_Irecv sets this
                0119    */ 
                0120   enum AMPI_Request_origin_E origin;
                0121 
                0122   void *idx;
                0123 
                0124 };
                0125 
                0126 #ifdef AMPI_FORTRANCOMPATIBLE
                0127 typedef MPI_Request AMPI_Request;
                0128 #else 
                0129 typedef struct AMPI_Request_S AMPI_Request;
                0130 #endif 
                0131 
                0132 /** @} */
                0133 
                0134 #endif