This source file includes following definitions.
- ompi_message_alloc
- ompi_message_return
   1 
   2 
   3 
   4 
   5 
   6 
   7 
   8 
   9 
  10 
  11 
  12 
  13 
  14 #ifndef OMPI_MESSAGE_H
  15 #define OMPI_MESSAGE_H
  16 
  17 #include "mpi.h"
  18 #include "opal/class/opal_free_list.h"
  19 #include "opal/class/opal_pointer_array.h"
  20 
  21 BEGIN_C_DECLS
  22 
  23 struct ompi_communicator_t;
  24 
  25 struct ompi_message_t {
  26     opal_free_list_item_t super;        
  27     int m_f_to_c_index;                 
  28     struct ompi_communicator_t *comm;   
  29     void* req_ptr;                      
  30     int peer;                           
  31     size_t count;                       
  32 };
  33 typedef struct ompi_message_t ompi_message_t;
  34 OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_message_t);
  35 
  36 
  37 
  38 
  39 
  40 
  41 #define PREDEFINED_MESSAGE_PAD 256
  42 
  43 struct ompi_predefined_message_t {
  44     struct ompi_message_t message;
  45     char padding[PREDEFINED_MESSAGE_PAD - sizeof(ompi_message_t)];
  46 };
  47 
  48 typedef struct ompi_predefined_message_t ompi_predefined_message_t;
  49 
  50 int ompi_message_init(void);
  51 
  52 int ompi_message_finalize(void);
  53 
  54 OMPI_DECLSPEC extern opal_free_list_t ompi_message_free_list;
  55 OMPI_DECLSPEC extern opal_pointer_array_t  ompi_message_f_to_c_table;
  56 OMPI_DECLSPEC extern ompi_predefined_message_t  ompi_message_no_proc;
  57 
  58 static inline
  59 ompi_message_t*
  60 ompi_message_alloc(void)
  61 {
  62     return (ompi_message_t *) opal_free_list_get (&ompi_message_free_list);
  63 }
  64 
  65 static inline
  66 void
  67 ompi_message_return(ompi_message_t* msg)
  68 {
  69     if (MPI_UNDEFINED != msg->m_f_to_c_index) {
  70         opal_pointer_array_set_item(&ompi_message_f_to_c_table,
  71                                     msg->m_f_to_c_index, NULL);
  72         msg->m_f_to_c_index = MPI_UNDEFINED;
  73     }
  74 
  75     opal_free_list_return (&ompi_message_free_list,
  76                            &msg->super);
  77 }
  78 
  79 
  80 END_C_DECLS
  81 
  82 #endif