Blame src/include/mpii_bsend.h

Packit Service c5cf8c
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
Packit Service c5cf8c
/*
Packit Service c5cf8c
 *
Packit Service c5cf8c
 *  (C) 2001 by Argonne National Laboratory.
Packit Service c5cf8c
 *      See COPYRIGHT in top-level directory.
Packit Service c5cf8c
 */
Packit Service c5cf8c
Packit Service c5cf8c
#ifndef MPII_BSEND_H_INCLUDED
Packit Service c5cf8c
#define MPII_BSEND_H_INCLUDED
Packit Service c5cf8c
Packit Service c5cf8c
/* This file is separated out as it is used by the configure script to
Packit Service c5cf8c
 * find the Bsend overhead value. */
Packit Service c5cf8c
Packit Service c5cf8c
/*
Packit Service c5cf8c
 * Description of the Bsend data structures.
Packit Service c5cf8c
 *
Packit Service c5cf8c
 * Bsend is buffered send; a buffer, provided by the user, is used to store
Packit Service c5cf8c
 * both the user's message and information that my be needed to send that
Packit Service c5cf8c
 * message.  In addition, space within that buffer must be allocated, so
Packit Service c5cf8c
 * additional information is required to manage that space allocation.
Packit Service c5cf8c
 * In the following, the term "segment" denotes a fragment of the user buffer
Packit Service c5cf8c
 * that has been allocated either to free (unused) space or to a particular
Packit Service c5cf8c
 * user message.
Packit Service c5cf8c
 *
Packit Service c5cf8c
 * The following datastructures are used:
Packit Service c5cf8c
 *
Packit Service c5cf8c
 *  BsendMsg_t  - Describes a user message, including the values of tag
Packit Service c5cf8c
 *                and datatype (*could* be used incase the data is already
Packit Service c5cf8c
 *                contiguous; see below)
Packit Service c5cf8c
 *  BsendData_t - Describes a segment of the user buffer.  This data structure
Packit Service c5cf8c
 *                contains a BsendMsg_t for segments that contain a user
Packit Service c5cf8c
 *                message.  Each BsendData_t segment belongs to one of
Packit Service c5cf8c
 *                three lists: avail (unused and free), active (currently
Packit Service c5cf8c
 *                sending) and pending (contains a user message that has
Packit Service c5cf8c
 *                not begun sending because of some resource limit, such
Packit Service c5cf8c
 *                as no more MPID requests available).
Packit Service c5cf8c
 *  BsendBuffer - This global structure contains pointers to the user buffer
Packit Service c5cf8c
 *                and the three lists, along with the size of the user buffer.
Packit Service c5cf8c
 *
Packit Service c5cf8c
 */
Packit Service c5cf8c
Packit Service c5cf8c
/* Used to communication the type of bsend */
Packit Service c5cf8c
typedef enum {
Packit Service c5cf8c
    BSEND = 0,
Packit Service c5cf8c
    IBSEND = 1,
Packit Service c5cf8c
    BSEND_INIT = 2
Packit Service c5cf8c
} MPII_Bsend_kind_t;
Packit Service c5cf8c
Packit Service c5cf8c
struct MPIR_Request;
Packit Service c5cf8c
struct MPIR_Comm;
Packit Service c5cf8c
Packit Service c5cf8c
/* BsendMsg is used to hold all of the message particulars in case a
Packit Service c5cf8c
   request is not currently available */
Packit Service c5cf8c
typedef struct MPII_Bsend_msg {
Packit Service c5cf8c
    void *msgbuf;
Packit Service c5cf8c
    MPI_Aint count;
Packit Service c5cf8c
    MPI_Datatype dtype;
Packit Service c5cf8c
    int tag;
Packit Service c5cf8c
    struct MPIR_Comm *comm_ptr;
Packit Service c5cf8c
    int dest;
Packit Service c5cf8c
} MPII_Bsend_msg_t;
Packit Service c5cf8c
Packit Service c5cf8c
/* BsendData describes a bsend request */
Packit Service c5cf8c
typedef struct MPII_Bsend_data {
Packit Service c5cf8c
    size_t size;                /* size that is available for data */
Packit Service c5cf8c
    size_t total_size;          /* total size of this segment,
Packit Service c5cf8c
                                 * including all headers */
Packit Service c5cf8c
    struct MPII_Bsend_data *next, *prev;
Packit Service c5cf8c
    MPII_Bsend_kind_t kind;
Packit Service c5cf8c
    struct MPIR_Request *request;
Packit Service c5cf8c
    MPII_Bsend_msg_t msg;
Packit Service c5cf8c
    double alignpad;            /* make sure that the struct
Packit Service c5cf8c
                                 * shares double alignment */
Packit Service c5cf8c
} MPII_Bsend_data_t;
Packit Service c5cf8c
Packit Service c5cf8c
#endif /* MPII_BSEND_H_INCLUDED */