1
#ifndef ARMCI_PORTALS_H
2
#define ARMCI_PORTALS_H
4
/* portals header file */
6
#include <portals/portals3.h>
7
#include <portals/nal.h>
10
#define NUM_COMP_DSCR 4
12
#define ARMCI_PORTALS_PTL_NUMBER 37
15
#define NUM_SERV_BUFS 1
17
/*corresponds to num of different armci mem regions*/
18
#define MAX_MEM_REGIONS 10
20
#define VBUF_DLEN_ORG 4*64*1024
21
#define VBUF_DLEN 16*1024
22
#define MSG_BUFLEN_DBL_VT ((VBUF_DLEN)>>3)
24
/* VBUF_DLEN are only used in Vinod's code */
26
#ifdef PORTALS_USE_RENDEZ_VOUS
27
# define MSG_BUFLEN_DBL 262144 /* for rendez-vous, this can go bigger i think */
29
# define MSG_BUFLEN_DBL 1280 /* this is smaller when rendez-vous is off */
34
#define ARMCI_NET_ERRTOSTR(__ARMCI_ERC_) ptl_err_str[__ARMCI_ERC_]
44
ARMCI_PORTALS_NBGETPUT
45
} armci_portals_optype;
48
void *data_ptr; /* pointer where the data should go */
49
long ack; /* header ack */
50
void *ack_ptr; /* pointer where the data should go */
52
#if defined(SERV_QUEUE)
58
typedef struct armci_portals_desc{
62
armci_portals_optype type;
64
ptl_handle_md_t mem_dsc_hndl;
69
extern char *armci_portals_client_buf_allocate(int);
70
#define BUF_ALLOCATE armci_portals_client_buf_allocate
71
#define BUF_EXTRA_FIELD_T comp_desc*
73
#define INIT_SEND_BUF(_field,_snd,_rcv) _snd=1;_rcv=1;_field=NULL
75
#define GET_SEND_BUFFER _armci_buf_get
76
#define FREE_SEND_BUFFER _armci_buf_release
78
#define CLEAR_SEND_BUF_FIELD(_field,_snd,_rcv,_to,_op) if((_op==UNLOCK || _op==PUT || ARMCI_ACC(_op)) && _field!=NULL)x_buf_wait_ack((request_header_t *)((void **)&(_field)+1),((char *)&(_field)-sizeof(BUF_INFO_T)));_field=NULL;
79
#define TEST_SEND_BUF_FIELD(_field,_snd,_rcv,_to,_op,_ret)
80
#define COMPLETE_HANDLE _armci_buf_complete_nb_request
82
#define NB_CMPL_T comp_desc*
83
#define ARMCI_NB_WAIT(_cntr) if(_cntr){\
86
if(nb_handle->tag==_cntr->tag)\
87
rc = armci_client_complete(0,nb_handle->proc,nb_handle->tag,_cntr);\
89
printf("\n%d:wait null ctr\n",armci_me);}
95
/* structure of computing process */
98
ptl_process_id_t rank;
100
ptl_handle_eq_t eq_h;
101
ptl_process_id_t Srank;
102
ptl_handle_ni_t Sni_h;
103
ptl_handle_eq_t Seq_h;
104
int outstanding_puts;
105
int outstanding_gets;
106
ptl_process_id_t *procid_map;
107
ptl_process_id_t *servid_map;
108
int free_comp_desc_index;
109
caddr_t dsbase[MAX_DS];
110
size_t dssizes[MAX_DS];
111
ptl_match_bits_t heap_mb[MAX_DS];
112
ptl_md_t heap_md[MAX_DS];
113
ptl_handle_me_t heap_me_h[MAX_DS];
114
ptl_handle_md_t heap_md_h[MAX_DS];
116
long serv_offs[MAX_DS];
118
}armci_portals_proc_t;
123
ptl_handle_me_t me_h;
124
ptl_handle_md_t md_h;
125
}armci_portals_serv_mem_t;
129
int outstanding_puts;
130
int outstanding_gets;
131
armci_portals_serv_mem_t meminfo[MAX_MEM_REGIONS];
132
}armci_portals_serv_t;
135
extern void print_mem_desc_table(void);
136
extern int armci_init_portals(caddr_t);
137
extern void armci_fini_portals(void);
138
extern int armci_post_descriptor(ptl_md_t *md);
139
extern int armci_prepost_descriptor(void* start, long bytes);
140
extern ptl_size_t armci_get_offset(ptl_md_t md, void *ptr,int proc);
141
extern int armci_get_md(void * start, int bytes , ptl_md_t * md, ptl_match_bits_t * mb);
142
extern void armci_portals_put(int,void *,void *,int,void **,int );
143
extern void armci_portals_get(int,void *,void *,int,void **,int );
144
extern void comp_desc_init();
145
extern int armci_client_complete(ptl_event_kind_t evt,int proc_id, int nb_tag ,comp_desc * cdesc);
146
extern void armci_portals_memsetup(long);
148
extern MPI_Comm portals_smp_comm;
150
#endif /* ARMCI_PORTALS_H */