~ubuntu-branches/ubuntu/utopic/nwchem/utopic

« back to all changes in this revision

Viewing changes to src/tools/ga-5-1/armci/src/devices/openib/armci-vapi.h

  • Committer: Package Import Robot
  • Author(s): Michael Banck, Daniel Leidert, Andreas Tille, Michael Banck
  • Date: 2013-07-04 12:14:55 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130704121455-5tvsx2qabor3nrui
Tags: 6.3-1
* New upstream release.
* Fixes anisotropic properties (Closes: #696361).
* New features include:
  + Multi-reference coupled cluster (MRCC) approaches
  + Hybrid DFT calculations with short-range HF 
  + New density-functionals including Minnesota (M08, M11) and HSE hybrid
    functionals
  + X-ray absorption spectroscopy (XAS) with TDDFT
  + Analytical gradients for the COSMO solvation model
  + Transition densities from TDDFT 
  + DFT+U and Electron-Transfer (ET) methods for plane wave calculations
  + Exploitation of space group symmetry in plane wave geometry optimizations
  + Local density of states (LDOS) collective variable added to Metadynamics
  + Various new XC functionals added for plane wave calculations, including
    hybrid and range-corrected ones
  + Electric field gradients with relativistic corrections 
  + Nudged Elastic Band optimization method
  + Updated basis sets and ECPs 

[ Daniel Leidert ]
* debian/watch: Fixed.

[ Andreas Tille ]
* debian/upstream: References

[ Michael Banck ]
* debian/upstream (Name): New field.
* debian/patches/02_makefile_flags.patch: Refreshed.
* debian/patches/06_statfs_kfreebsd.patch: Likewise.
* debian/patches/07_ga_target_force_linux.patch: Likewise.
* debian/patches/05_avoid_inline_assembler.patch: Removed, no longer needed.
* debian/patches/09_backported_6.1.1_fixes.patch: Likewise.
* debian/control (Build-Depends): Added gfortran-4.7 and gcc-4.7.
* debian/patches/10_force_gcc-4.7.patch: New patch, explicitly sets
  gfortran-4.7 and gcc-4.7, fixes test suite hang with gcc-4.8 (Closes:
  #701328, #713262).
* debian/testsuite: Added tests for COSMO analytical gradients and MRCC.
* debian/rules (MRCC_METHODS): New variable, required to enable MRCC methods.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*$Id: armci-vapi.h,v 1.21.2.1 2007-03-06 19:50:24 vinod Exp $ */
2
 
#ifndef _VAPI_H
3
 
#define _VAPI_H
4
 
 
5
 
/*vapi includes*/
6
 
#ifdef MELLANOX
7
 
#include <vapi.h>
8
 
#include <evapi.h>
9
 
#include <mtl_common.h>
10
 
#include <ib_defs.h>
11
 
#include <vapi_common.h>
12
 
#endif
13
 
 
14
 
#ifdef OPENIB
15
 
#include <infiniband/verbs.h>
16
 
#endif
17
 
 
18
 
 
19
 
#define DSCRID_NBDSCR 10000
20
 
 
21
 
#define MAX_RDMA_SIZE           (8388608)
22
 
#define DEFAULT_ADDR_LEN        (8) /* format length of hcalid/qp_num.*/
23
 
 
24
 
#define DEFAULT_PORT            (1) /*for vapi*/
25
 
#define DEFAULT_MTU             (MTU1024)
26
 
#define DEFAULT_PSN             (0)
27
 
#define DEFAULT_PKEY_IX         (0)
28
 
#define DEFAULT_P_KEY           (0x0)
29
 
#define DEFAULT_MIN_RNR_TIMER   (5)
30
 
#define DEFAULT_SERVICE_LEVEL   (0)
31
 
#define DEFAULT_TIME_OUT        (5)
32
 
#define DEFAULT_STATIC_RATE     (2)
33
 
#define DEFAULT_SRC_PATH_BITS   (0)
34
 
#define DEFAULT_RETRY_COUNT     (1)
35
 
#define DEFAULT_RNR_RETRY       (1)
36
 
 
37
 
 
38
 
#define DEFAULT_R_KEY           (0x0)
39
 
#define DEFAULT_L_KEY           (0x0)
40
 
 
41
 
#define  DEFAULT_MAX_WQE        2048/*(1023)*/
42
 
 
43
 
typedef struct {
44
 
    void *data_ptr;         /* pointer where the data should go */
45
 
    long ack;               /* header ack */
46
 
    void *ack_ptr;          /* pointer where the data should go */
47
 
#if defined(PEND_BUFS)
48
 
  unsigned int imm_msg:1;
49
 
  unsigned int data_len:31;
50
 
#endif
51
 
} msg_tag_t;
52
 
 
53
 
typedef struct {
54
 
#ifdef MELLANOX
55
 
        VAPI_sr_desc_t sdscr;
56
 
        VAPI_sg_lst_entry_t    ssg_entry;
57
 
        VAPI_rr_desc_t rdscr;
58
 
        VAPI_sg_lst_entry_t    rsg_entry;
59
 
#endif
60
 
#ifdef OPENIB
61
 
        struct ibv_send_wr sdscr;
62
 
        struct ibv_sge ssg_entry;
63
 
        struct ibv_recv_wr rdscr;
64
 
        struct ibv_sge rsg_entry;
65
 
#endif
66
 
} armci_vapi_field_t;
67
 
 
68
 
typedef struct {
69
 
#ifdef MELLANOX
70
 
        VAPI_lkey_t lkey;
71
 
        VAPI_rkey_t rkey;
72
 
        VAPI_mr_hndl_t memhndl;
73
 
#endif
74
 
#ifdef OPENIB
75
 
        uint32_t rkey;
76
 
        uint32_t lkey;
77
 
        struct ibv_mr *memhndl;
78
 
#endif
79
 
}armci_vapi_memhndl_t;
80
 
 
81
 
extern char * armci_vapi_client_mem_alloc(int);
82
 
 
83
 
typedef struct {
84
 
        int tag;
85
 
        int issg;
86
 
#ifdef MELLANOX
87
 
        VAPI_sr_desc_t sdescr;
88
 
        VAPI_rr_desc_t rdescr;
89
 
        VAPI_sg_lst_entry_t sg_entry[56]; /*ff:this has to be malloced*/
90
 
#endif
91
 
#ifdef OPENIB
92
 
        struct ibv_send_wr sdescr;
93
 
        struct ibv_recv_wr rdescr;
94
 
        struct ibv_sge sg_entry[56]; /*ff:this has to be malloced*/
95
 
#endif
96
 
        int numofsends;
97
 
        int numofrecvs;
98
 
        int myindex;
99
 
} sr_descr_t;
100
 
 
101
 
typedef struct {
102
 
        int tag;
103
 
        int issg;
104
 
#ifdef MELLANOX
105
 
        VAPI_rr_desc_t descr;
106
 
        VAPI_sg_lst_entry_t sg_entry[56]; /*ff:this has to be malloced*/
107
 
#endif
108
 
#ifdef OPENIB
109
 
        struct ibv_recv_wr descr;
110
 
        struct ibv_send_wr sg_entry[56]; /*ff:this has to be malloced*/
111
 
#endif
112
 
        int numofrecvs;
113
 
            int myindex;
114
 
} rdescr_t;
115
 
 
116
 
#if defined(PEND_BUFS)
117
 
#ifdef OPENIB
118
 
/* typedef struct { */
119
 
/*   struct ibv_recv_wr  dscr; */
120
 
/*   struct ibv_sge      sg_entry; */
121
 
/* } IMMBUF_NW_T; */
122
 
/* typedef struct { */
123
 
/*   struct ibv_sge sg_entry; */
124
 
/*   struct ibv_recv_wr rdscr; */
125
 
/*   struct ibv_send_wr sdscr; */
126
 
/* } PENDBUF_NW_T; */
127
 
#define IMMBUF_NW_T         \
128
 
  struct ibv_recv_wr  dscr; \
129
 
  struct ibv_sge sg_entry;  \
130
 
  int send_pending; 
131
 
#define PENDBUF_NW_T        \
132
 
  struct ibv_sge sg_entry;  \
133
 
  struct ibv_recv_wr rdscr; \
134
 
  struct ibv_send_wr sdscr; 
135
 
 
136
 
#define IS_IMM_MSG(msginfo) ((msginfo).tag.imm_msg)
137
 
 
138
 
void armci_complete_immbuf(void *vbuf);
139
 
void armci_complete_pendbuf(void *buf);
140
 
/*Note that start_put and start_get cannot report completion from
141
 
  within. They have to just return and report completion later.  
142
 
 */
143
 
void armci_pbuf_start_put(void *src, void *dst, int bytes, int proc,
144
 
                          int bufid);
145
 
void armci_pbuf_start_get(void *msg_info,
146
 
                          void *src, void *dst, int bytes, int proc, 
147
 
                          int bufid);
148
 
#else
149
 
#error "PEND_BUFS only implemented for OPENIB"
150
 
#endif
151
 
#endif
152
 
 
153
 
void armci_client_nbcall_complete(sr_descr_t *,int,int);
154
 
void armci_vapi_set_mark_buf_send_complete(int);
155
 
 
156
 
#define ARMCI_MEMHDL_T armci_vapi_memhndl_t
157
 
 
158
 
#define REGIONS_REQUIRE_MEMHDL
159
 
 
160
 
#define PIPE_BUFSIZE__  (4096)
161
 
#define PIPE_MIN_BUFSIZE 1024 
162
 
#define PIPE_MEDIUM_BUFSIZE (2*1024)
163
 
 
164
 
 
165
 
#define VBUF_DLEN 4*64*1023
166
 
#define MSG_BUFLEN_DBL ((VBUF_DLEN)>>3)
167
 
 
168
 
#if defined(PEND_BUFS)
169
 
#define IMM_BUF_NUM_DEFAULT 4
170
 
#define IMM_BUF_LEN_DEFAULT 2048
171
 
#define PENDING_BUF_NUM_DEFAULT 20
172
 
#define PENDING_BUF_LEN_DEFAULT (VBUF_DLEN)
173
 
#endif
174
 
 
175
 
#ifdef PIPE_BUFSIZE
176
 
#  define STRIDED_GET_BUFLEN_DBL 31*1024
177
 
#  define STRIDED_GET_BUFLEN (STRIDED_GET_BUFLEN_DBL<<3)
178
 
#  define MAX_BUFLEN (STRIDED_GET_BUFLEN+EXTRA_MSG_BUFLEN)
179
 
#else
180
 
#  define MAX_BUFLEN (MSG_BUFLEN+EXTRA_MSG_BUFLEN)
181
 
#endif
182
 
#define BALANCE_BUFFERS
183
 
#ifdef BALANCE_BUFFERS
184
 
#  define BALANCE_FACTOR 1.6
185
 
/* #  define BALANCE_FACTOR 2.0 */
186
 
#  define BALANCE_BUFSIZE 25000
187
 
#endif
188
 
 
189
 
#define BUF_EXTRA_FIELD_T armci_vapi_field_t 
190
 
#define GET_SEND_BUFFER _armci_buf_get
191
 
#define FREE_SEND_BUFFER _armci_buf_release
192
 
#ifdef MELLANOX
193
 
#define INIT_SEND_BUF(_field,_snd,_rcv) _snd=1;_rcv=1;memset(&((_field).sdscr),0,sizeof(VAPI_sr_desc_t));(_field).sdscr.id=avail+1;armci_vapi_set_mark_buf_send_complete(avail+1)
194
 
#endif
195
 
#ifdef OPENIB
196
 
#define INIT_SEND_BUF(_field,_snd,_rcv) _snd=1;_rcv=1;memset(&((_field).sdscr),0,sizeof(struct ibv_send_wr));(_field).sdscr.wr_id=avail+1;armci_vapi_set_mark_buf_send_complete(avail+1)
197
 
#endif
198
 
#define BUF_ALLOCATE armci_vapi_client_mem_alloc
199
 
 
200
 
#define CLEAR_SEND_BUF_FIELD(_field,_snd,_rcv,_to,_op) armci_vapi_complete_buf((armci_vapi_field_t *)(&(_field)),(_snd),(_rcv),(_to),(_op));_snd=0;_rcv=0;_to=0
201
 
 
202
 
#define TEST_SEND_BUF_FIELD(_field,_snd,_rcv,_to,_op,_pret) armci_vapi_test_buf((armci_vapi_field_t *)(&(_field)),(_snd),(_rcv),(_to),(_op),(_pret))
203
 
 
204
 
#define CLIENT_BUF_BYPASS 1
205
 
 
206
 
#define _armci_bypass 1
207
 
 
208
 
#define COMPLETE_HANDLE _armci_buf_complete_nb_request
209
 
 
210
 
#if defined(ALLOW_PIN)
211
 
#  define NB_CMPL_T sr_descr_t*
212
 
#  define ARMCI_NB_WAIT(_cntr) if(_cntr)if(nb_handle->tag==(_cntr)->tag)\
213
 
          armci_client_nbcall_complete(_cntr,nb_handle->tag,nb_handle->op);
214
 
#  define CLEAR_HNDL_FIELD(_x) _x=NULL
215
 
#endif
216
 
 
217
 
/* #define DIRECT_PUT_MIN_SIZE 8192 */
218
 
#define DIRECT_PUT_MIN_SIZE 0
219
 
 
220
 
#define LONG_GET_THRESHOLD 2147483648
221
 
#define LONG_GET_THRESHOLD_STRIDED 2147483648
222
 
#ifndef ARMCI_STAMP
223
 
#error "ARMCI_STAMP used to define ARMCI_VAPI_COMPLETE not found!"
224
 
#define ARMCI_VAPI_COMPLETE 1088451863
225
 
#else
226
 
#define ARMCI_VAPI_COMPLETE ARMCI_STAMP
227
 
#endif
228
 
#define ARMCI_POST_SCATTER 1000000001
229
 
#define ARMCI_VAPI_CLEAR 0
230
 
#ifdef MELLANOX
231
 
#define VAPI_SGGET_MIN_COLUMN 720
232
 
#define VAPI_SGPUT_MIN_COLUMN 720
233
 
#endif
234
 
#ifdef OPENIB
235
 
/* #define VAPI_SGGET_MIN_COLUMN 2147483648 */
236
 
#define VAPI_SGPUT_MIN_COLUMN 2147483648
237
 
#define VAPI_SGGET_MIN_COLUMN 10
238
 
/* #define VAPI_SGPUT_MIN_COLUMN 720 */
239
 
#endif
240
 
#define DSCRID_SCATTERCLIENT 70000
241
 
#define DSCRID_SCATTERCLIENT_END 70000+9999
242
 
 
243
 
#define MAX_PENDING 32
244
 
 
245
 
#define HAS_RDMA_GET
246
 
 
247
 
#if defined(OPENIB)
248
 
#if 1
249
 
#define PUT_NO_SRV_COPY /*server rdma-s from to client buffers (in
250
 
                          buffers.c) to
251
 
                          remote memory (bypassing
252
 
                          servers intermediate buffers) when possible*/
253
 
#define GET_NO_SRV_COPY /*server rdma-s from remote memory to client
254
 
                          buffers (in buffers.c) (bypassing server
255
 
                          intermediate buffers) when possible*/ 
256
 
int no_srv_copy_nsegs_ulimit();/*max #contig segs for which we avoid server copy. Too many segments might overflow a queue*/
257
 
#endif
258
 
#define GET_STRIDED_COPY_PIPELINED /*client copies data from buffers
259
 
                                     to user memory in segments rather
260
 
                                     than waiting for all the data*/
261
 
#define GET_STRIDED_COPY_PIPELINED_SIZE (1*1024) /*size of each segment*/
262
 
#endif
263
 
 
264
 
#endif /* _VAPI_CONST_H */
265
 
 
266
 
extern void armci_wait_ack(char *buffer);
267
 
extern void armci_complete_multi_sglist_sends(int proc);
268
 
extern void armci_client_direct_send(int p,void *src_buf, void *dst_buf, int len,void** contextptr,int nbtag,ARMCI_MEMHDL_T *lochdl,ARMCI_MEMHDL_T *remhdl);