1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ 2 /* 3 * Copyright (c) 2004-2005 The Trustees of Indiana University. 4 * All rights reserved. 5 * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. 6 * All rights reserved. 7 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, 8 * University of Stuttgart. All rights reserved. 9 * Copyright (c) 2004-2005 The Regents of the University of California. 10 * All rights reserved. 11 * Copyright (c) 2012 Sandia National Laboratories. All rights reserved. 12 * Copyright (c) 2014 Los Alamos National Security, LLC. All rights 13 * reserved. 14 * Copyright (c) 2015 Research Organization for Information Science 15 * and Technology (RIST). All rights reserved. 16 * $COPYRIGHT$ 17 * 18 * Additional copyrights may follow 19 * 20 * $HEADER$ 21 */ 22 23 #ifndef OMPI_MCA_OSC_PT2PT_DATA_MOVE_H 24 #define OMPI_MCA_OSC_PT2PT_DATA_MOVE_H 25 26 #include "osc_pt2pt_header.h" 27 28 int ompi_osc_pt2pt_control_send(ompi_osc_pt2pt_module_t *module, 29 int target, 30 void *data, 31 size_t len); 32 33 /** 34 * ompi_osc_pt2pt_control_send_unbuffered: 35 * 36 * @short Send an unbuffered control message to a peer. 37 * 38 * @param[in] module - OSC PT2PT module 39 * @param[in] target - Target rank 40 * @param[in] data - Data to send 41 * @param[in] len - Length of data 42 * 43 * @long Directly send a control message. This does not allocate a 44 * fragment, so should only be used when sending other messages would 45 * be erroneous (such as complete messages, when there may be queued 46 * transactions from an overlapping post that has already heard back 47 * from its peer). The buffer specified by data will be available 48 * when this call returns. 49 */ 50 int ompi_osc_pt2pt_control_send_unbuffered (ompi_osc_pt2pt_module_t *module, 51 int target, void *data, size_t len); 52 53 /** 54 * ompi_osc_pt2pt_isend_w_cb: 55 * 56 * @short Post a non-blocking send with a specified callback. 57 * 58 * @param[in] ptr - Source buffer. Will be available when the callback fires 59 * @param[in] count - Number of elements to send 60 * @param[in] datatype - Datatype of elements 61 * @param[in] source - Ranks to send data to 62 * @param[in] tag - Tag to use 63 * @param[in] comm - Communicator for communicating with rank 64 * @param[in] cb - Function to call when the request is complete 65 * @param[in] ctx - Context to store in new request for callback 66 * 67 * @long This function posts a new send request. Upon completion the function cb will 68 * be called with the associated request. The context specified in ctx will be stored in 69 * the req_completion_cb_data member of the ompi_request_t for use by the callback. 70 */ 71 int ompi_osc_pt2pt_isend_w_cb (const void *ptr, int count, ompi_datatype_t *datatype, int target, int tag, 72 ompi_communicator_t *comm, ompi_request_complete_fn_t cb, void *ctx); 73 74 /** 75 * ompi_osc_pt2pt_irecv_w_cb: 76 * 77 * @short Post a non-blocking receive with a specified callback. 78 * 79 * @param[inout] ptr - Destination for incoming data 80 * @param[in] count - Number of elements to receive 81 * @param[in] datatype - Datatype of elements 82 * @param[in] source - Ranks to receive data from 83 * @param[in] tag - Tag to use 84 * @param[in] comm - Communicator for communicating with rank 85 * @param[in] request_out - Location to store new receive request (may be NULL) 86 * @param[in] cb - Function to call when the request is complete 87 * @param[in] ctx - Context to store in new request for callback 88 * 89 * @long This function posts a new request and stores the request in request_out if 90 * provided. Upon completion the function cb will be called with the associated 91 * request. The context specified in ctx will be stored in the req_completion_cb_data 92 * member of the ompi_request_t for use by the callback. 93 */ 94 int ompi_osc_pt2pt_irecv_w_cb (void *ptr, int count, ompi_datatype_t *datatype, int source, int tag, 95 ompi_communicator_t *comm, ompi_request_t **request_out, 96 ompi_request_complete_fn_t cb, void *ctx); 97 98 int ompi_osc_pt2pt_process_lock(ompi_osc_pt2pt_module_t* module, 99 int source, 100 struct ompi_osc_pt2pt_header_lock_t* lock_header); 101 102 void ompi_osc_pt2pt_process_lock_ack(ompi_osc_pt2pt_module_t* module, 103 struct ompi_osc_pt2pt_header_lock_ack_t* lock_header); 104 105 int ompi_osc_pt2pt_process_unlock(ompi_osc_pt2pt_module_t* module, 106 int source, 107 struct ompi_osc_pt2pt_header_unlock_t* lock_header); 108 int ompi_osc_pt2pt_process_flush (ompi_osc_pt2pt_module_t *module, int source, 109 ompi_osc_pt2pt_header_flush_t *flush_header); 110 111 /** 112 * ompi_osc_pt2pt_process_unlock_ack: 113 * 114 * @short Process an incoming unlock acknowledgement. 115 * 116 * @param[in] module - OSC PT2PT module 117 * @param[in] source - Source rank 118 * @param[in] unlock_ack_header - Incoming unlock ack header 119 */ 120 void ompi_osc_pt2pt_process_unlock_ack (ompi_osc_pt2pt_module_t *module, int source, 121 ompi_osc_pt2pt_header_unlock_ack_t *unlock_ack_header); 122 123 /** 124 * ompi_osc_pt2pt_process_flush_ack: 125 * 126 * @short Process an incoming flush acknowledgement. 127 * 128 * @param[in] module - OSC PT2PT module 129 * @param[in] source - Source rank 130 * @param[in] flush_ack_header - Incoming flush ack header 131 */ 132 void ompi_osc_pt2pt_process_flush_ack (ompi_osc_pt2pt_module_t *module, int source, 133 ompi_osc_pt2pt_header_flush_ack_t *flush_ack_header); 134 135 /** 136 * ompi_osc_pt2pt_frag_start_receive: 137 * 138 * @short Start receiving fragments on the OSC module. 139 * 140 * @param[in] module - OSC module 141 * 142 * @long This function starts receiving eager fragments on the module. The current 143 * implementation uses the pml to transfer eager fragments. 144 */ 145 int ompi_osc_pt2pt_frag_start_receive (ompi_osc_pt2pt_module_t *module); 146 147 /** 148 * ompi_osc_pt2pt_process_receive: 149 * 150 * @short Report a receive request 151 * 152 * @param[in] recv - Receive structure 153 * 154 * @long This function reposts a receive request. This function should not be called from 155 * a pml request callback as it can lead to deep recursion during heavy load. 156 */ 157 int ompi_osc_pt2pt_process_receive (ompi_osc_pt2pt_receive_t *recv); 158 159 #endif