mpidpkt.h 20.4 KB
Newer Older
1
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
2 3 4 5 6 7 8
/*
 *  (C) 2001 by Argonne National Laboratory.
 *      See COPYRIGHT in top-level directory.
 */

#ifndef HAVE_MPIDPKT_H
#define HAVE_MPIDPKT_H
9

10 11
#include "oputil.h"

12 13 14 15 16 17 18
#ifdef HAVE_STDINT_H
#  include <stdint.h>
#endif
#ifdef HAVE_INTTYPES_H
#  include <inttypes.h>
#endif

19 20 21
/* Enable the use of data within the message packet for small messages */
#define USE_EAGER_SHORT
#define MPIDI_EAGER_SHORT_INTS 4
22
/* FIXME: This appears to assume that sizeof(int) == 4 (or at least >= 4) */
23 24
#define MPIDI_EAGER_SHORT_SIZE 16

25 26 27
/* This is the number of ints that can be carried within an RMA packet */
#define MPIDI_RMA_IMMED_INTS 1

28 29 30
/* Union over all types (integer, logical, and multi-language types) that are
   allowed in a CAS operation.  This is used to allocate enough space in the
   packet header for immediate data.  */
31
typedef union {
32
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_, type_name_) c_type_ cas_##type_name_;
33 34 35 36 37 38 39 40
    MPIR_OP_TYPE_GROUP(C_INTEGER)
    MPIR_OP_TYPE_GROUP(FORTRAN_INTEGER)
    MPIR_OP_TYPE_GROUP(LOGICAL)
    MPIR_OP_TYPE_GROUP(BYTE)
    MPIR_OP_TYPE_GROUP(C_INTEGER_EXTRA)
    MPIR_OP_TYPE_GROUP(FORTRAN_INTEGER_EXTRA)
    MPIR_OP_TYPE_GROUP(LOGICAL_EXTRA)
    MPIR_OP_TYPE_GROUP(BYTE_EXTRA)
41
#undef MPIR_OP_TYPE_MACRO
42 43
} MPIDI_CH3_CAS_Immed_u;

44 45 46 47 48 49 50
/* Union over all types (all predefined types) that are allowed in a
   Fetch-and-op operation.  This can be too large for the packet header, so we
   limit the immediate space in the header to FOP_IMMED_INTS. */

#define MPIDI_RMA_FOP_IMMED_INTS 2
#define MPIDI_RMA_FOP_RESP_IMMED_INTS 8

51 52 53
/* *INDENT-OFF* */
/* Indentation turned off because "indent" is getting confused with
 * the lack of a semi-colon in the fields below */
54
typedef union {
55
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_, type_name_) c_type_ fop##type_name_;
56 57
    MPIR_OP_TYPE_GROUP_ALL_BASIC
    MPIR_OP_TYPE_GROUP_ALL_EXTRA
58
#undef MPIR_OP_TYPE_MACRO
59
} MPIDI_CH3_FOP_Immed_u;
60
/* *INDENT-ON* */
61

62
/*
63
 * Predefined packet types.  This simplifies some of the code.
64
 */
65 66
/* FIXME: Having predefined names makes it harder to add new message types,
   such as different RMA types. */
Pavan Balaji's avatar
Pavan Balaji committed
67 68 69
/* We start with an arbitrarily chosen number (42), to help with
 * debugging when a packet type is not initialized or wrongly
 * initialized. */
70
typedef enum {
Pavan Balaji's avatar
Pavan Balaji committed
71
    MPIDI_CH3_PKT_EAGER_SEND = 42,
72
#if defined(USE_EAGER_SHORT)
73
    MPIDI_CH3_PKT_EAGERSHORT_SEND,
74
#endif /* defined(USE_EAGER_SHORT) */
75
    MPIDI_CH3_PKT_EAGER_SYNC_SEND,      /* FIXME: no sync eager */
76 77 78 79
    MPIDI_CH3_PKT_EAGER_SYNC_ACK,
    MPIDI_CH3_PKT_READY_SEND,
    MPIDI_CH3_PKT_RNDV_REQ_TO_SEND,
    MPIDI_CH3_PKT_RNDV_CLR_TO_SEND,
80
    MPIDI_CH3_PKT_RNDV_SEND,    /* FIXME: should be stream put */
81 82
    MPIDI_CH3_PKT_CANCEL_SEND_REQ,
    MPIDI_CH3_PKT_CANCEL_SEND_RESP,
83
    MPIDI_CH3_PKT_PUT,  /* RMA Packets begin here */
84 85 86 87 88
    MPIDI_CH3_PKT_GET,
    MPIDI_CH3_PKT_GET_RESP,
    MPIDI_CH3_PKT_ACCUMULATE,
    MPIDI_CH3_PKT_LOCK,
    MPIDI_CH3_PKT_LOCK_GRANTED,
89
    MPIDI_CH3_PKT_UNLOCK,
90
    MPIDI_CH3_PKT_FLUSH,
Xin Zhao's avatar
Xin Zhao committed
91
    MPIDI_CH3_PKT_FLUSH_ACK,
92
    MPIDI_CH3_PKT_DECR_AT_COUNTER,
93 94 95 96 97
    MPIDI_CH3_PKT_LOCK_PUT_UNLOCK,      /* optimization for single puts */
    MPIDI_CH3_PKT_LOCK_GET_UNLOCK,      /* optimization for single gets */
    MPIDI_CH3_PKT_LOCK_ACCUM_UNLOCK,    /* optimization for single accumulates */
    /* RMA Packets end here */
    MPIDI_CH3_PKT_ACCUM_IMMED,  /* optimization for short accumulate */
98
    /* FIXME: Add PUT, GET_IMMED packet types */
99 100
    MPIDI_CH3_PKT_CAS,
    MPIDI_CH3_PKT_CAS_RESP,
101 102
    MPIDI_CH3_PKT_FOP,
    MPIDI_CH3_PKT_FOP_RESP,
103 104
    MPIDI_CH3_PKT_GET_ACCUM,
    MPIDI_CH3_PKT_GET_ACCUM_RESP,
105
    MPIDI_CH3_PKT_FLOW_CNTL_UPDATE,     /* FIXME: Unused */
106
    MPIDI_CH3_PKT_CLOSE,
Wesley Bland's avatar
Wesley Bland committed
107
    MPIDI_CH3_PKT_REVOKE,
Pavan Balaji's avatar
Pavan Balaji committed
108
    MPIDI_CH3_PKT_END_CH3,
109
    /* The channel can define additional types by defining the value
110
     * MPIDI_CH3_PKT_ENUM */
111
# if defined(MPIDI_CH3_PKT_ENUM)
Pavan Balaji's avatar
Pavan Balaji committed
112
    MPIDI_CH3_PKT_ENUM,
113
# endif
Pavan Balaji's avatar
Pavan Balaji committed
114
    MPIDI_CH3_PKT_END_ALL,
115
    MPIDI_CH3_PKT_INVALID = -1  /* forces a signed enum to quash warnings */
Pavan Balaji's avatar
Pavan Balaji committed
116
} MPIDI_CH3_Pkt_type_t;
117

118
/* These flags can be "OR'ed" together */
119 120 121 122 123 124
typedef enum {
    MPIDI_CH3_PKT_FLAG_NONE = 0,
    MPIDI_CH3_PKT_FLAG_RMA_LOCK = 1,
    MPIDI_CH3_PKT_FLAG_RMA_UNLOCK = 2,
    MPIDI_CH3_PKT_FLAG_RMA_FLUSH = 4,
    MPIDI_CH3_PKT_FLAG_RMA_REQ_ACK = 8,
125
    MPIDI_CH3_PKT_FLAG_RMA_DECR_AT_COUNTER = 16,
126 127
    MPIDI_CH3_PKT_FLAG_RMA_NOCHECK = 32,
    MPIDI_CH3_PKT_FLAG_RMA_SHARED = 64,
128 129
    MPIDI_CH3_PKT_FLAG_RMA_EXCLUSIVE = 128,
    MPIDI_CH3_PKT_FLAG_RMA_FLUSH_ACK = 256
130
} MPIDI_CH3_Pkt_flags_t;
131

132
typedef struct MPIDI_CH3_Pkt_send {
133 134
    MPIDI_CH3_Pkt_type_t type;  /* XXX - uint8_t to conserve space ??? */
    MPIDI_Message_match match;
135
    MPI_Request sender_req_id;  /* needed for ssend and send cancel */
136 137 138
    MPIDI_msg_sz_t data_sz;
#if defined(MPID_USE_SEQUENCE_NUMBERS)
    MPID_Seqnum_t seqnum;
139 140
#endif
} MPIDI_CH3_Pkt_send_t;
141

142
/* NOTE: Normal and synchronous eager sends, as well as all ready-mode sends,
143 144 145 146
   use the same structure but have a different type value. */
typedef MPIDI_CH3_Pkt_send_t MPIDI_CH3_Pkt_eager_send_t;
typedef MPIDI_CH3_Pkt_send_t MPIDI_CH3_Pkt_eager_sync_send_t;
typedef MPIDI_CH3_Pkt_send_t MPIDI_CH3_Pkt_ready_send_t;
147 148

#if defined(USE_EAGER_SHORT)
149
typedef struct MPIDI_CH3_Pkt_eagershort_send {
150 151 152 153 154 155
    MPIDI_CH3_Pkt_type_t type;  /* XXX - uint8_t to conserve space ??? */
    MPIDI_Message_match match;
    MPIDI_msg_sz_t data_sz;
#if defined(MPID_USE_SEQUENCE_NUMBERS)
    MPID_Seqnum_t seqnum;
#endif
156 157
    int data[MPIDI_EAGER_SHORT_INTS];   /* FIXME: Experimental for now */
} MPIDI_CH3_Pkt_eagershort_send_t;
158
#endif /* defined(USE_EAGER_SHORT) */
159

160
typedef struct MPIDI_CH3_Pkt_eager_sync_ack {
161 162
    MPIDI_CH3_Pkt_type_t type;
    MPI_Request sender_req_id;
163
} MPIDI_CH3_Pkt_eager_sync_ack_t;
164 165 166

typedef MPIDI_CH3_Pkt_send_t MPIDI_CH3_Pkt_rndv_req_to_send_t;

167
typedef struct MPIDI_CH3_Pkt_rndv_clr_to_send {
168 169 170
    MPIDI_CH3_Pkt_type_t type;
    MPI_Request sender_req_id;
    MPI_Request receiver_req_id;
171
} MPIDI_CH3_Pkt_rndv_clr_to_send_t;
172

173
typedef struct MPIDI_CH3_Pkt_rndv_send {
174 175
    MPIDI_CH3_Pkt_type_t type;
    MPI_Request receiver_req_id;
176
} MPIDI_CH3_Pkt_rndv_send_t;
177

178
typedef struct MPIDI_CH3_Pkt_cancel_send_req {
179 180 181
    MPIDI_CH3_Pkt_type_t type;
    MPIDI_Message_match match;
    MPI_Request sender_req_id;
182
} MPIDI_CH3_Pkt_cancel_send_req_t;
183

184
typedef struct MPIDI_CH3_Pkt_cancel_send_resp {
185 186 187
    MPIDI_CH3_Pkt_type_t type;
    MPI_Request sender_req_id;
    int ack;
188
} MPIDI_CH3_Pkt_cancel_send_resp_t;
189

190 191 192
/* *INDENT-OFF* */
/* Indentation turned off because "indent" is getting confused with
 * the lack of a semi-colon in the field below */
193 194 195
#if defined(MPIDI_CH3_PKT_DEFS)
MPIDI_CH3_PKT_DEFS
#endif
196
/* *INDENT-ON* */
197

198 199 200 201 202 203 204 205 206 207 208 209 210
#define MPIDI_CH3_PKT_RMA_GET_TARGET_DATATYPE(pkt_, datatype_, err_)    \
    {                                                                   \
        err_ = MPI_SUCCESS;                                             \
        switch(pkt_.type) {                                             \
        case (MPIDI_CH3_PKT_PUT):                                       \
            datatype_ = pkt_.put.datatype;                              \
            break;                                                      \
        case (MPIDI_CH3_PKT_GET):                                       \
            datatype_ = pkt_.get.datatype;                              \
            break;                                                      \
        case (MPIDI_CH3_PKT_ACCUMULATE):                                \
            datatype_ = pkt_.accum.datatype;                            \
            break;                                                      \
Xin Zhao's avatar
Xin Zhao committed
211 212 213
        case (MPIDI_CH3_PKT_GET_ACCUM):                                 \
            datatype_ = pkt_.get_accum.datatype;                        \
            break;                                                      \
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236
        case (MPIDI_CH3_PKT_CAS):                                       \
            datatype_ = pkt_.cas.datatype;                              \
            break;                                                      \
        case (MPIDI_CH3_PKT_FOP):                                       \
            datatype_ = pkt_.fop.datatype;                              \
            break;                                                      \
        case (MPIDI_CH3_PKT_LOCK_PUT_UNLOCK):                           \
            datatype_ = pkt_.lock_put_unlock.datatype;                  \
            break;                                                      \
        case (MPIDI_CH3_PKT_LOCK_GET_UNLOCK):                           \
            datatype_ = pkt_.lock_get_unlock.datatype;                  \
            break;                                                      \
        case (MPIDI_CH3_PKT_LOCK_ACCUM_UNLOCK):                         \
            datatype_ = pkt_.lock_accum_unlock.datatype;                \
            break;                                                      \
        case (MPIDI_CH3_PKT_ACCUM_IMMED):                               \
            datatype_ = pkt_.accum_immed.datatype;                      \
            break;                                                      \
        default:                                                        \
            MPIU_ERR_SETANDJUMP1(err_, MPI_ERR_OTHER, "**invalidpkt", "**invalidpkt %d", pkt_.type); \
        }                                                               \
    }

237
typedef struct MPIDI_CH3_Pkt_put {
238
    MPIDI_CH3_Pkt_type_t type;
239
    MPIDI_CH3_Pkt_flags_t flags;
240 241 242
    void *addr;
    int count;
    MPI_Datatype datatype;
243 244 245 246 247 248 249 250 251 252 253
    int dataloop_size;          /* for derived datatypes */
    MPI_Win target_win_handle;  /* Used in the last RMA operation in each
                                 * epoch for decrementing rma op counter in
                                 * active target rma and for unlocking window
                                 * in passive target rma. Otherwise set to NULL*/
    MPI_Win source_win_handle;  /* Used in the last RMA operation in an
                                 * epoch in the case of passive target rma
                                 * with shared locks. Otherwise set to NULL*/
} MPIDI_CH3_Pkt_put_t;

typedef struct MPIDI_CH3_Pkt_get {
254
    MPIDI_CH3_Pkt_type_t type;
255
    MPIDI_CH3_Pkt_flags_t flags;
256 257 258
    void *addr;
    int count;
    MPI_Datatype datatype;
259
    int dataloop_size;          /* for derived datatypes */
260
    MPI_Request request_handle;
261 262 263 264 265 266 267 268 269 270
    MPI_Win target_win_handle;  /* Used in the last RMA operation in each
                                 * epoch for decrementing rma op counter in
                                 * active target rma and for unlocking window
                                 * in passive target rma. Otherwise set to NULL*/
    MPI_Win source_win_handle;  /* Used in the last RMA operation in an
                                 * epoch in the case of passive target rma
                                 * with shared locks. Otherwise set to NULL*/
} MPIDI_CH3_Pkt_get_t;

typedef struct MPIDI_CH3_Pkt_get_resp {
271 272
    MPIDI_CH3_Pkt_type_t type;
    MPI_Request request_handle;
273 274 275 276
    /* followings are used to decrement ack_counter at origin */
    int target_rank;
    MPI_Win source_win_handle;
    MPIDI_CH3_Pkt_flags_t flags;
277
} MPIDI_CH3_Pkt_get_resp_t;
278

279
typedef struct MPIDI_CH3_Pkt_accum {
280
    MPIDI_CH3_Pkt_type_t type;
281
    MPIDI_CH3_Pkt_flags_t flags;
282 283 284
    void *addr;
    int count;
    MPI_Datatype datatype;
285
    int dataloop_size;          /* for derived datatypes */
286
    MPI_Op op;
287 288 289 290 291 292 293 294 295
    MPI_Win target_win_handle;  /* Used in the last RMA operation in each
                                 * epoch for decrementing rma op counter in
                                 * active target rma and for unlocking window
                                 * in passive target rma. Otherwise set to NULL*/
    MPI_Win source_win_handle;  /* Used in the last RMA operation in an
                                 * epoch in the case of passive target rma
                                 * with shared locks. Otherwise set to NULL*/
} MPIDI_CH3_Pkt_accum_t;

Xin Zhao's avatar
Xin Zhao committed
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313
typedef struct MPIDI_CH3_Pkt_get_accum {
    MPIDI_CH3_Pkt_type_t type;
    MPIDI_CH3_Pkt_flags_t flags;
    MPI_Request request_handle; /* For get_accumulate response */
    void *addr;
    int count;
    MPI_Datatype datatype;
    int dataloop_size;          /* for derived datatypes */
    MPI_Op op;
    MPI_Win target_win_handle;  /* Used in the last RMA operation in each
                                 * epoch for decrementing rma op counter in
                                 * active target rma and for unlocking window
                                 * in passive target rma. Otherwise set to NULL*/
    MPI_Win source_win_handle;  /* Used in the last RMA operation in an
                                 * epoch in the case of passive target rma
                                 * with shared locks. Otherwise set to NULL*/
} MPIDI_CH3_Pkt_get_accum_t;

314
typedef struct MPIDI_CH3_Pkt_get_accum_resp {
315 316
    MPIDI_CH3_Pkt_type_t type;
    MPI_Request request_handle;
317 318 319 320
    /* followings are used to decrement ack_counter at origin */
    int target_rank;
    MPI_Win source_win_handle;
    MPIDI_CH3_Pkt_flags_t flags;
321
} MPIDI_CH3_Pkt_get_accum_resp_t;
322

323
typedef struct MPIDI_CH3_Pkt_accum_immed {
324
    MPIDI_CH3_Pkt_type_t type;
325
    MPIDI_CH3_Pkt_flags_t flags;
326 327 328 329 330 331
    void *addr;
    int count;
    /* FIXME: Compress datatype/op into a single word (immedate mode) */
    MPI_Datatype datatype;
    MPI_Op op;
    /* FIXME: do we need these (use a regular accum packet if we do?) */
332 333 334 335 336 337 338
    MPI_Win target_win_handle;  /* Used in the last RMA operation in each
                                 * epoch for decrementing rma op counter in
                                 * active target rma and for unlocking window
                                 * in passive target rma. Otherwise set to NULL*/
    MPI_Win source_win_handle;  /* Used in the last RMA operation in an
                                 * epoch in the case of passive target rma
                                 * with shared locks. Otherwise set to NULL*/
339
    int data[MPIDI_RMA_IMMED_INTS];
340
} MPIDI_CH3_Pkt_accum_immed_t;
341

342
typedef struct MPIDI_CH3_Pkt_cas {
343
    MPIDI_CH3_Pkt_type_t type;
344
    MPIDI_CH3_Pkt_flags_t flags;
345
    MPI_Datatype datatype;
346
    void *addr;
347
    MPI_Request request_handle;
348
    MPI_Win source_win_handle;
349 350 351 352
    MPI_Win target_win_handle;  /* Used in the last RMA operation in each
                                 * epoch for decrementing rma op counter in
                                 * active target rma and for unlocking window
                                 * in passive target rma. Otherwise set to NULL*/
353 354
    MPIDI_CH3_CAS_Immed_u origin_data;
    MPIDI_CH3_CAS_Immed_u compare_data;
355
} MPIDI_CH3_Pkt_cas_t;
356

357
typedef struct MPIDI_CH3_Pkt_cas_resp {
358 359 360
    MPIDI_CH3_Pkt_type_t type;
    MPI_Request request_handle;
    MPIDI_CH3_CAS_Immed_u data;
361 362 363 364
    /* followings are used to decrement ack_counter at orign */
    int target_rank;
    MPI_Win source_win_handle;
    MPIDI_CH3_Pkt_flags_t flags;
365
} MPIDI_CH3_Pkt_cas_resp_t;
366

367
typedef struct MPIDI_CH3_Pkt_fop {
368
    MPIDI_CH3_Pkt_type_t type;
369
    MPIDI_CH3_Pkt_flags_t flags;
370 371 372 373
    MPI_Datatype datatype;
    void *addr;
    MPI_Op op;
    MPI_Request request_handle;
374
    MPI_Win source_win_handle;
375 376 377 378
    MPI_Win target_win_handle;  /* Used in the last RMA operation in each
                                 * epoch for decrementing rma op counter in
                                 * active target rma and for unlocking window
                                 * in passive target rma. Otherwise set to NULL*/
379
    int origin_data[MPIDI_RMA_FOP_IMMED_INTS];
380
} MPIDI_CH3_Pkt_fop_t;
381

382
typedef struct MPIDI_CH3_Pkt_fop_resp {
383 384
    MPIDI_CH3_Pkt_type_t type;
    MPI_Request request_handle;
385
    int data[MPIDI_RMA_FOP_RESP_IMMED_INTS];
386 387 388 389
    /* followings are used to decrement ack_counter at orign */
    int target_rank;
    MPI_Win source_win_handle;
    MPIDI_CH3_Pkt_flags_t flags;
390
} MPIDI_CH3_Pkt_fop_resp_t;
391

392
typedef struct MPIDI_CH3_Pkt_lock {
393 394 395 396
    MPIDI_CH3_Pkt_type_t type;
    int lock_type;
    MPI_Win target_win_handle;
    MPI_Win source_win_handle;
397
    int target_rank;            /* Used in unluck/flush response to look up the
398
                                 * target state at the origin. */
399
    int origin_rank;
400
} MPIDI_CH3_Pkt_lock_t;
401

Xin Zhao's avatar
Xin Zhao committed
402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421
typedef struct MPIDI_CH3_Pkt_unlock {
    MPIDI_CH3_Pkt_type_t type;
    int lock_type;
    MPI_Win target_win_handle;
    MPI_Win source_win_handle;
    int target_rank;            /* Used in unluck/flush response to look up the
                                 * target state at the origin. */
    int origin_rank;
} MPIDI_CH3_Pkt_unlock_t;

typedef struct MPIDI_CH3_Pkt_flush {
    MPIDI_CH3_Pkt_type_t type;
    int lock_type;
    MPI_Win target_win_handle;
    MPI_Win source_win_handle;
    int target_rank;            /* Used in unluck/flush response to look up the
                                 * target state at the origin. */
    int origin_rank;
} MPIDI_CH3_Pkt_flush_t;

422
typedef struct MPIDI_CH3_Pkt_lock_granted {
423 424
    MPIDI_CH3_Pkt_type_t type;
    MPI_Win source_win_handle;
Xin Zhao's avatar
Xin Zhao committed
425
    int target_rank;            /* Used in flush_ack response to look up the
426 427
                                 * target state at the origin. */
} MPIDI_CH3_Pkt_lock_granted_t;
428

Xin Zhao's avatar
Xin Zhao committed
429 430 431 432 433 434
typedef struct MPIDI_CH3_Pkt_flush_ack {
    MPIDI_CH3_Pkt_type_t type;
    MPI_Win source_win_handle;
    int target_rank;            /* Used in flush_ack response to look up the
                                 * target state at the origin. */
} MPIDI_CH3_Pkt_flush_ack_t;
435

436 437 438 439 440
typedef struct MPIDI_CH3_Pkt_decr_at_counter {
    MPIDI_CH3_Pkt_type_t type;
    MPI_Win target_win_handle;
} MPIDI_CH3_Pkt_decr_at_counter_t;

441
typedef struct MPIDI_CH3_Pkt_lock_put_unlock {
442
    MPIDI_CH3_Pkt_type_t type;
443
    MPIDI_CH3_Pkt_flags_t flags;
444 445
    MPI_Win target_win_handle;
    MPI_Win source_win_handle;
446
    int origin_rank;
447 448 449 450
    int lock_type;
    void *addr;
    int count;
    MPI_Datatype datatype;
451
} MPIDI_CH3_Pkt_lock_put_unlock_t;
452

453
typedef struct MPIDI_CH3_Pkt_lock_get_unlock {
454
    MPIDI_CH3_Pkt_type_t type;
455
    MPIDI_CH3_Pkt_flags_t flags;
456 457
    MPI_Win target_win_handle;
    MPI_Win source_win_handle;
458
    int origin_rank;
459 460 461 462 463
    int lock_type;
    void *addr;
    int count;
    MPI_Datatype datatype;
    MPI_Request request_handle;
464
} MPIDI_CH3_Pkt_lock_get_unlock_t;
465

466
typedef struct MPIDI_CH3_Pkt_lock_accum_unlock {
467
    MPIDI_CH3_Pkt_type_t type;
468
    MPIDI_CH3_Pkt_flags_t flags;
469 470
    MPI_Win target_win_handle;
    MPI_Win source_win_handle;
471
    int origin_rank;
472 473 474 475 476
    int lock_type;
    void *addr;
    int count;
    MPI_Datatype datatype;
    MPI_Op op;
477
} MPIDI_CH3_Pkt_lock_accum_unlock_t;
478 479


480
typedef struct MPIDI_CH3_Pkt_close {
481 482
    MPIDI_CH3_Pkt_type_t type;
    int ack;
483
} MPIDI_CH3_Pkt_close_t;
484

485
typedef struct MPIDI_CH3_Pkt_revoke {
Wesley Bland's avatar
Wesley Bland committed
486 487
    MPIDI_CH3_Pkt_type_t type;
    MPIR_Context_id_t revoked_comm;
488
} MPIDI_CH3_Pkt_revoke_t;
Wesley Bland's avatar
Wesley Bland committed
489

490
typedef union MPIDI_CH3_Pkt {
491 492
    MPIDI_CH3_Pkt_type_t type;
    MPIDI_CH3_Pkt_eager_send_t eager_send;
493
#if defined(USE_EAGER_SHORT)
494
    MPIDI_CH3_Pkt_eagershort_send_t eagershort_send;
495
#endif                          /* defined(USE_EAGER_SHORT) */
496 497 498 499 500 501 502 503 504 505 506 507
    MPIDI_CH3_Pkt_eager_sync_send_t eager_sync_send;
    MPIDI_CH3_Pkt_eager_sync_ack_t eager_sync_ack;
    MPIDI_CH3_Pkt_eager_send_t ready_send;
    MPIDI_CH3_Pkt_rndv_req_to_send_t rndv_req_to_send;
    MPIDI_CH3_Pkt_rndv_clr_to_send_t rndv_clr_to_send;
    MPIDI_CH3_Pkt_rndv_send_t rndv_send;
    MPIDI_CH3_Pkt_cancel_send_req_t cancel_send_req;
    MPIDI_CH3_Pkt_cancel_send_resp_t cancel_send_resp;
    MPIDI_CH3_Pkt_put_t put;
    MPIDI_CH3_Pkt_get_t get;
    MPIDI_CH3_Pkt_get_resp_t get_resp;
    MPIDI_CH3_Pkt_accum_t accum;
508
    MPIDI_CH3_Pkt_accum_immed_t accum_immed;
Xin Zhao's avatar
Xin Zhao committed
509
    MPIDI_CH3_Pkt_get_accum_t get_accum;
510 511
    MPIDI_CH3_Pkt_lock_t lock;
    MPIDI_CH3_Pkt_lock_granted_t lock_granted;
512
    MPIDI_CH3_Pkt_unlock_t unlock;
513
    MPIDI_CH3_Pkt_flush_t flush;
Xin Zhao's avatar
Xin Zhao committed
514
    MPIDI_CH3_Pkt_flush_ack_t flush_ack;
515
    MPIDI_CH3_Pkt_decr_at_counter_t decr_at_cnt;
516 517 518 519
    MPIDI_CH3_Pkt_lock_put_unlock_t lock_put_unlock;
    MPIDI_CH3_Pkt_lock_get_unlock_t lock_get_unlock;
    MPIDI_CH3_Pkt_lock_accum_unlock_t lock_accum_unlock;
    MPIDI_CH3_Pkt_close_t close;
520 521
    MPIDI_CH3_Pkt_cas_t cas;
    MPIDI_CH3_Pkt_cas_resp_t cas_resp;
522 523
    MPIDI_CH3_Pkt_fop_t fop;
    MPIDI_CH3_Pkt_fop_resp_t fop_resp;
524
    MPIDI_CH3_Pkt_get_accum_resp_t get_accum_resp;
Wesley Bland's avatar
Wesley Bland committed
525
    MPIDI_CH3_Pkt_revoke_t revoke;
526
# if defined(MPIDI_CH3_PKT_DECL)
527
     MPIDI_CH3_PKT_DECL
528
# endif
529
} MPIDI_CH3_Pkt_t;
530 531

#if defined(MPID_USE_SEQUENCE_NUMBERS)
532
typedef struct MPIDI_CH3_Pkt_send_container {
533
    MPIDI_CH3_Pkt_send_t pkt;
534 535
    struct MPIDI_CH3_Pkt_send_container_s *next;
} MPIDI_CH3_Pkt_send_container_t;
536 537 538
#endif

#endif