mpid_rma_types.h 4.54 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
/*
 *  (C) 2001 by Argonne National Laboratory.
 *      See COPYRIGHT in top-level directory.
 */

#if !defined(MPID_RMA_TYPES_H_INCLUDED)
#define MPID_RMA_TYPES_H_INCLUDED

#include "mpidi_ch3_impl.h"

/* Special case RMA operations */

enum MPIDI_RMA_Datatype {
    MPIDI_RMA_DATATYPE_BASIC = 50,
    MPIDI_RMA_DATATYPE_DERIVED = 51
};

19
#define MPID_LOCK_NONE 60
20

21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
 * RMA Declarations.  We should move these into something separate from
 * a Request.
 */

/* to send derived datatype across in RMA ops */
typedef struct MPIDI_RMA_dtype_info {   /* for derived datatypes */
    int is_contig;
    int max_contig_blocks;
    MPI_Aint size;
    MPI_Aint extent;
    int dataloop_size;          /* not needed because this info is sent in
                                 * packet header. remove it after lock/unlock
                                 * is implemented in the device */
    void *dataloop;             /* pointer needed to update pointers
                                 * within dataloop on remote side */
    int dataloop_depth;
    int eltype;
    MPI_Aint ub, lb, true_ub, true_lb;
    int has_sticky_ub, has_sticky_lb;
} MPIDI_RMA_dtype_info;

43
44
45
46
47
typedef enum MPIDI_RMA_Pool_type {
    MPIDI_RMA_POOL_WIN = 6,
    MPIDI_RMA_POOL_GLOBAL = 7
} MPIDI_RMA_Pool_type_t;

48
49
50
/* for keeping track of RMA ops, which will be executed at the next sync call */
typedef struct MPIDI_RMA_Op {
    struct MPIDI_RMA_Op *next;  /* pointer to next element in list */
51

52
53
54
    void *origin_addr;
    int origin_count;
    MPI_Datatype origin_datatype;
55
56
57
58

    void *compare_addr;
    MPI_Datatype compare_datatype;

59
60
61
    void *result_addr;
    int result_count;
    MPI_Datatype result_datatype;
62
63
64
65
66
67
68
69

    struct MPID_Request *request;
    MPIDI_RMA_dtype_info dtype_info;
    void *dataloop;

    int target_rank;

    MPIDI_CH3_Pkt_t pkt;
70
    MPIDI_RMA_Pool_type_t pool_type;
71
    int is_dt;
72
    int piggyback_lock_candidate;
73
74

    MPID_Request *ureq;
75
76
} MPIDI_RMA_Op_t;

77
78
79
80
81
82
83
84
typedef struct MPIDI_RMA_Target {
    struct MPIDI_RMA_Op *read_op_list, *read_op_list_tail;
    struct MPIDI_RMA_Op *write_op_list, *write_op_list_tail;
    struct MPIDI_RMA_Op *dt_op_list, *dt_op_list_tail;
    struct MPIDI_RMA_Op *pending_op_list, *pending_op_list_tail;
    struct MPIDI_RMA_Op *next_op_to_issue;
    struct MPIDI_RMA_Target *next;
    int target_rank;
85
    enum MPIDI_RMA_states access_state;
86
    int lock_type; /* NONE, SHARED, EXCLUSIVE */
87
    int lock_mode;              /* e.g., MODE_NO_CHECK */
88
    int accumulated_ops_cnt;
89
    int disable_flush_local;
90
    int win_complete_flag;
91
92
    int put_acc_issued; /* indicate if PUT/ACC is issued in this epoch
                           after the previous synchronization calls. */
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118

    /* The target structure is free to be cleaned up when all of the
     * following conditions hold true:
     *   - No operations are queued up (op_list == NULL)
     *   - There are no outstanding acks (outstanding_acks == 0)
     *   - There are no incomplete ops (have_remote_incomplete_ops == 0)
     *   - There are no sync messages to be sent (sync_flag == NONE)
     */
    struct {
        /* next synchronization flag to be sent to the target (either
         * piggybacked or as a separate packet */
        enum MPIDI_RMA_sync_types sync_flag;    /* UNLOCK, FLUSH or FLUSH_LOCAL */

        /* packets sent out that we are expecting an ack for */
        int outstanding_acks;

        /* if we sent out any operations, but have not waited for
         * their remote completion, this flag is set.  When the next
         * FLUSH or UNLOCK sync flag is set, we will clear this
         * variable. */
        int have_remote_incomplete_ops; /* have ops that have not completed remotely */
    } sync;

    MPIDI_RMA_Pool_type_t pool_type;
} MPIDI_RMA_Target_t;

Xin Zhao's avatar
Xin Zhao committed
119
120
121
122
123
typedef struct MPIDI_RMA_Slot {
    struct MPIDI_RMA_Target *target_list;
    struct MPIDI_RMA_Target *target_list_tail;
} MPIDI_RMA_Slot_t;

Xin Zhao's avatar
Xin Zhao committed
124
125
126
127
128
129
130
typedef struct MPIDI_RMA_Win_list {
    MPID_Win *win_ptr;
    struct MPIDI_RMA_Win_list *next;
} MPIDI_RMA_Win_list_t;

extern MPIDI_RMA_Win_list_t *MPIDI_RMA_Win_list, *MPIDI_RMA_Win_list_tail;

131
132
typedef struct MPIDI_RMA_Lock_entry {
    struct MPIDI_RMA_Lock_entry *next;
133
    MPIDI_CH3_Pkt_t pkt;    /* all information for this request packet */
134
    MPIDI_VC_t *vc;
135
    void *data;             /* for queued PUTs / ACCs / GACCs, data is copied here */
136
    int data_size;
137
    int all_data_recved;    /* indicate if all data has been received */
138
} MPIDI_RMA_Lock_entry_t;
139
140
141
142

typedef MPIDI_RMA_Op_t *MPIDI_RMA_Ops_list_t;

#endif /* MPID_RMA_TYPES_H_INCLUDED */