1 /*
2  * Copyright (C) by Argonne National Laboratory
3  *     See COPYRIGHT in top-level directory
4  */
5 
6 #ifndef UCX_PRE_H_INCLUDED
7 #define UCX_PRE_H_INCLUDED
8 
9 #include <ucp/api/ucp.h>
10 
11 #define MPIDI_UCX_KVSAPPSTRLEN 4096
12 
13 typedef struct {
14     int dummy;
15 } MPIDI_UCX_Global_t;
16 
17 typedef union {
18     MPIR_Request *req;
19     MPI_Status *status;
20     void *buf;
21 } MPIDI_UCX_ucp_request_t;
22 
23 typedef struct {
24     ucp_datatype_t ucp_datatype;
25 } MPIDI_UCX_dt_t;
26 
27 typedef union {
28     ucp_tag_message_h message_handler;
29     MPIDI_UCX_ucp_request_t *ucp_request;
30 } MPIDI_UCX_request_t;
31 
32 typedef struct {
33     int handler_id;
34     char *pack_buffer;
35     ucp_dt_iov_t iov[2];
36 } MPIDI_UCX_am_request_t;
37 
38 typedef struct MPIDI_UCX_am_header_t {
39     uint64_t handler_id;
40     uint64_t data_sz;
41     uint64_t payload[];
42 } MPIDI_UCX_am_header_t;
43 
44 typedef struct MPIDI_UCX_win_info {
45     ucp_rkey_h rkey;
46     uint64_t addr;
47     uint32_t disp;
48 } MPIDI_UCX_win_info_t;
49 
50 typedef enum {
51     MPIDI_UCX_WIN_SYNC_UNSET = 0,
52     MPIDI_UCX_WIN_SYNC_FLUSH_LOCAL = 1, /* need both local and remote flush */
53     MPIDI_UCX_WIN_SYNC_FLUSH = 2        /* need only remote flush */
54 } MPIDI_UCX_win_sync_flag_t;
55 
56 typedef struct MPIDI_UCX_win_target_sync {
57     MPIDI_UCX_win_sync_flag_t need_sync;        /* flag for op completion */
58 } MPIDI_UCX_win_target_sync_t;
59 
60 typedef struct {
61     MPIDI_UCX_win_info_t *info_table;   /* NULL indicates AM fallback for entire win */
62     ucp_mem_h mem_h;
63     bool mem_mapped;            /* Indicate whether mem_h has been mapped (e.g., supported mem type).
64                                  * Set at win init and checked at win free for mem_unmap */
65 
66     MPIDI_UCX_win_target_sync_t *target_sync;
67 } MPIDI_UCX_win_t;
68 
69 typedef struct {
70     ucp_ep_h dest[MPIDI_CH4_MAX_VCIS][MPIDI_CH4_MAX_VCIS];
71 } MPIDI_UCX_addr_t;
72 
73 typedef struct {
74     int dummy;
75 } MPIDI_UCX_comm_t;
76 
77 typedef struct {
78     int dummy;
79 } MPIDI_UCX_op_t;
80 
81 #endif /* UCX_PRE_H_INCLUDED */
82