~ubuntu-branches/ubuntu/trusty/nwchem/trusty-proposed

« back to all changes in this revision

Viewing changes to src/tools/ga-5-2/comex/src-dmapp/dmapp.h.bak

  • 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
/*
 
2
 * Copyright (c) 2008 Cray Inc. All Rights Reserved.
 
3
 *
 
4
 * The contents of this file is proprietary information of Cray Inc.
 
5
 * and may not be disclosed without prior written consent.
 
6
 *
 
7
 * $HeadURL: http://svn.us.cray.com/svn/baker/packages/dmapp/branches/RB-3.1/include/dmapp.h $
 
8
 * $LastChangedRevision: 2964 $
 
9
 *
 
10
 *
 
11
 * Header file for API for Distributed Memory Applications on Gemini
 
12
 *
 
13
 */
 
14
 
 
15
 
 
16
#ifndef _DMAPP_H
 
17
#define _DMAPP_H
 
18
 
 
19
#include <stddef.h>
 
20
#include <stdint.h>
 
21
#include "gni_pub.h"
 
22
 
 
23
#ifdef __cplusplus
 
24
extern "C"
 
25
{
 
26
#endif
 
27
 
 
28
/* Specifies input _and_ output arguments to DMAPP functions */
 
29
#define INOUT
 
30
 
 
31
/* include version info */
 
32
#include "dmapp_rev.h"
 
33
 
 
34
/*
 
35
 * ******** Defines/Macros ****************************************
 
36
 */
 
37
 
 
38
/* Default threshold, in bytes. Transfers smaller than the threshold
 
39
   are transfered using cpu-based mechanism, transfers of this size
 
40
   or larger are transfered using off-load mechanism. */
 
41
 
 
42
#define DMAPP_OFFLOAD_THRESHOLD              (4096)
 
43
 
 
44
/* Maximum and minimun number of outstanding non-blocking requests 
 
45
   supported; this includes explicit _and_ implicit non-blocking 
 
46
   requests. */
 
47
 
 
48
#define DMAPP_MAX_OUTSTANDING_NB             (2048)
 
49
#define DMAPP_DEF_OUTSTANDING_NB              (512)
 
50
#define DMAPP_MIN_OUTSTANDING_NB                (5) /* coordinated w/ GNI */
 
51
 
 
52
 
 
53
/*
 
54
 * ******** Typedefs, Structs *************************************
 
55
 */
 
56
 
 
57
/*
 
58
 * Function return codes
 
59
 */
 
60
 
 
61
typedef enum dmapp_return {
 
62
        DMAPP_RC_SUCCESS = 0,
 
63
        DMAPP_RC_INVALID_PARAM,
 
64
        DMAPP_RC_ALIGNMENT_ERROR,
 
65
        DMAPP_RC_TRANSACTION_ERROR,
 
66
        DMAPP_RC_RESOURCE_ERROR,
 
67
        DMAPP_RC_PERMISSION_ERROR,
 
68
        DMAPP_RC_NO_SPACE, /* transaction could not be completed due to
 
69
                              insufficient resources; user should synchronize 
 
70
                              more often or increase max_outstanding_nb */
 
71
        DMAPP_RC_NOT_DONE, /* used in _dmapp_nbi_syncid->status */
 
72
        DMAPP_RC_NOT_SUPPORTED,
 
73
        DMAPP_RC_NOT_FOUND,
 
74
        DMAPP_RC_BUSY,
 
75
        DMAPP_RC_NOT_USED
 
76
} dmapp_return_t;
 
77
 
 
78
/*  
 
79
 * These are the valid types which can be supplied via the type input 
 
80
 * parameter to all data motion funtions. 
 
81
 */
 
82
 
 
83
typedef enum dmapp_type {
 
84
        DMAPP_DQW = 0, /* double quad word (16 byte) */
 
85
        DMAPP_QW,      /* quad word (8 byte) */
 
86
        DMAPP_DW,      /* double word (4 byte) */
 
87
        DMAPP_BYTE     /* byte. Don't use this if you want performance ! */
 
88
} dmapp_type_t;
 
89
 
 
90
/* Type of routing to be performed for request packet.
 
91
   These are valid options for the relaxed_ordering field in
 
92
   the dmapp_rma_attrs_t structure below. */
 
93
 
 
94
typedef enum dmapp_routing_type {
 
95
        DMAPP_ROUTING_IN_ORDER = 0,   /* hash off, adapt off; poor performance */
 
96
        DMAPP_ROUTING_DETERMINISTIC,  /* hash on,  adapt off */
 
97
        DMAPP_ROUTING_ADAPTIVE        /* hash off, adapt on  */
 
98
} dmapp_routing_type_t;
 
99
 
 
100
/* Mode of PI access ordering to be used during GNI memory registration
 
101
 * For STRICT ordering both posted and non-posted writes arrive in strict order.
 
102
 * For DEFAULT and RELAXED these ordering constraints are not honoured and hence
 
103
 * extra synchronisation is required when global visibility of data is required
 
104
 * (e.g. during a gsync/fence or after a blocking put)
 
105
 * These modes do not affect Get operations
 
106
 */
 
107
typedef enum dmapp_pi_reg_type {
 
108
        DMAPP_PI_ORDERING_STRICT = 0, /* Strict PI ordering on HT interface (P_PASS_PW=0, NP_PASS_PW=0) */
 
109
        DMAPP_PI_ORDERING_DEFAULT,    /* Default GNI PI ordering (P_PASS_PW=0, NP_PASS_PW=1) */
 
110
        DMAPP_PI_ORDERING_RELAXED     /* Relaxed PI ordering (P_PASS_PW=1, NP_PASS_PW=1) */
 
111
} dmapp_pi_reg_type_t;
 
112
 
 
113
 
 
114
/*  
 
115
 * This is a memory segment descriptor, with an address and length.
 
116
 * The "len" field contains the currently mapped size of the segment.
 
117
 */
 
118
 
 
119
typedef struct dmapp_seg_desc {
 
120
        void             *addr;
 
121
        size_t           len;        /* mapped size of segment in bytes */
 
122
        gni_mem_handle_t memhndl;
 
123
        uint16_t         flags;      /* DMAPP internal use only */
 
124
        void             *reserved;  /* DMAPP internal use only */
 
125
} dmapp_seg_desc_t;
 
126
 
 
127
/*
 
128
 * DMAPP Processing element, aka. PE
 
129
 */
 
130
 
 
131
typedef int dmapp_pe_t; 
 
132
 
 
133
/*  
 
134
 * This is the application and memory layout information for a DMAPP job.
 
135
 */
 
136
 
 
137
typedef struct dmapp_jobinfo {
 
138
        int              version;          /* DMAPP version */
 
139
        int              hw_version;       /* GNI hardware version */
 
140
        int              npes;             /* Number of PEs in entire job */
 
141
        dmapp_pe_t       pe;               /* PE number, in [0, npes-1] */
 
142
        dmapp_seg_desc_t data_seg;         /* Data segment memory */
 
143
        dmapp_seg_desc_t sheap_seg;        /* Symmetric heap memory */
 
144
} dmapp_jobinfo_t;
 
145
 
 
146
/*  
 
147
 * RMA attributes can be used to control the way in which DMAPP handles
 
148
 * various RMA requests.
 
149
 * Some attributes can be set during initialization only, others can be
 
150
 * set multiple times over the course of a job.
 
151
 */
 
152
 
 
153
typedef struct dmapp_rma_attrs {
 
154
        /* max nr of outstanding non-blocking explicit requests supported;
 
155
           can be specified during initialization only; 
 
156
           [DMAPP_MIN_OUTSTANDING_NB, .., DMAPP_MAX_OUTSTANDING_NB] is legal */
 
157
        uint32_t max_outstanding_nb;
 
158
        /* treshhold in bytes for switch from cpu-based mechanisms to 
 
159
           cpu offload mechanisms; can be specified at any time;
 
160
           any value is legal */
 
161
        uint32_t offload_threshold;
 
162
        /* flag to indicate whether relaxed ordering of requests is allowed
 
163
           and if so, which specific routing option to use. Valid options
 
164
           are specified by dmapp_routing_type_t above. The routing mode
 
165
           can be controlled separately for PUTs (including all AMOs) and
 
166
           GETs. The default for PUTs is DMAPP_ROUTING_DETERMINISTIC, the
 
167
           default for GETs is DMAPP_ROUTING_ADAPTIVE. DMAPP_ROUTING_IN_ORDER
 
168
           guarantees the requests arrive in order and is expected to result
 
169
           in poor performance. */
 
170
        uint8_t put_relaxed_ordering;
 
171
        uint8_t get_relaxed_ordering;
 
172
        /* max nr of threads accessing DMAPP; only used with thread-safety 
 
173
           enabled! default is 1; specified during init only; must be >= 1 */
 
174
        uint8_t max_concurrency;
 
175
} dmapp_rma_attrs_t; 
 
176
 
 
177
/*  
 
178
 * EXTENDED
 
179
 * RMA attributes can be used to control the way in which DMAPP handles
 
180
 * various RMA requests.
 
181
 * Some attributes can be set during initialization only, others can be
 
182
 * set multiple times over the course of a job.
 
183
 */
 
184
 
 
185
typedef struct dmapp_rma_attrs_ext {
 
186
        /* max nr of outstanding non-blocking explicit requests supported;
 
187
           can be specified during initialization only; 
 
188
           [DMAPP_MIN_OUTSTANDING_NB, .., DMAPP_MAX_OUTSTANDING_NB] is legal */
 
189
        uint32_t max_outstanding_nb;
 
190
        /* treshhold in bytes for switch from cpu-based mechanisms to 
 
191
           cpu offload mechanisms; can be specified at any time;
 
192
           any value is legal */
 
193
        uint32_t offload_threshold;
 
194
        /* flag to indicate whether relaxed ordering of requests is allowed
 
195
           and if so, which specific routing option to use. Valid options
 
196
           are specified by dmapp_routing_type_t above. The routing mode
 
197
           can be controlled separately for PUTs (including all AMOs) and
 
198
           GETs. The default for PUTs is DMAPP_ROUTING_DETERMINISTIC, the
 
199
           default for GETs is DMAPP_ROUTING_ADAPTIVE. DMAPP_ROUTING_IN_ORDER
 
200
           guarantees the requests arrive in order and is expected to result
 
201
           in poor performance. */
 
202
        uint8_t put_relaxed_ordering;
 
203
        uint8_t get_relaxed_ordering;
 
204
        /* max nr of threads accessing DMAPP; only used with thread-safety 
 
205
           enabled! default is 1; specified during init only; must be >= 1 */
 
206
        uint8_t max_concurrency;
 
207
 
 
208
        /* defines the PI ordering registration flags used by DMAPP when
 
209
         * registering all memory regions with GNI. Hence applies to the DATA,
 
210
         * SYMMETRIC HEAP and any user or dynamically mapped regions.
 
211
         *
 
212
         * Should be set to a value defined in dmapp_pi_reg_type_t the default
 
213
         * is DMAPP_PI_ORDERING_STRICT
 
214
         */
 
215
        uint8_t PI_ordering;
 
216
 
 
217
        uint8_t unused[32];     /* reserved for future expansion */
 
218
 
 
219
} dmapp_rma_attrs_ext_t;
 
220
 
 
221
/*
 
222
 * Synchronization ID
 
223
 */
 
224
 
 
225
typedef struct dmapp_syncid *dmapp_syncid_handle_t;
 
226
 
 
227
/*
 
228
 * DMAPP structures for collective extension support
 
229
 */
 
230
 
 
231
#define DMAPP_C_PSET_MODE_CONCAT                  0x00000001
 
232
/* set for specifying use of collective algorithms which
 
233
   are tolerant to network faults, may be slower than
 
234
   non-fault tolerant algorithms */
 
235
#define DMAPP_C_PSET_MODE_FAULT_TOLERANT          0x00000002
 
236
/* try to use any available hardware offload capabilities
 
237
   for handling collective operations */
 
238
#define DMAPP_C_PSET_MODE_HW_OFFLOAD              0x00000004
 
239
 
 
240
typedef enum dmapp_c_pset_delimiter_type {
 
241
           DMAPP_C_PSET_DELIMITER_VEC = 1,
 
242
           DMAPP_C_PSET_DELIMITER_STRIDED,
 
243
           DMAPP_C_PSET_DELIMITER_LAST
 
244
} dmapp_c_pset_delimiter_type_t;
 
245
 
 
246
typedef struct {
 
247
        uint32_t n_pes;
 
248
        uint32_t *vec_pes;
 
249
} dmapp_c_pset_delimiter_vec_t;
 
250
 
 
251
typedef struct {
 
252
        uint32_t n_pes;
 
253
        uint32_t base_pe;
 
254
        uint32_t stride_pe;
 
255
} dmapp_c_pset_delimiter_strided_t;
 
256
 
 
257
typedef struct {
 
258
        void *concat_buf;
 
259
        uint64_t concat_buf_size;
 
260
        dmapp_c_pset_delimiter_type_t type;
 
261
        union {
 
262
                dmapp_c_pset_delimiter_vec_t vec_type;
 
263
                dmapp_c_pset_delimiter_strided_t stride_type;
 
264
       } u;
 
265
} dmapp_c_pset_desc_t;
 
266
 
 
267
typedef struct dmapp_c_pset *dmapp_c_pset_handle_t;
 
268
 
 
269
typedef enum dmapp_c_pset_attrs_type {
 
270
           DMAPP_C_PSET_ATTRS_VER1 = 1,
 
271
           DMAPP_C_PSET_ATTRS_LAST
 
272
} dmapp_c_pset_attrs_type_t;
 
273
 
 
274
typedef struct {
 
275
        uint32_t radix;
 
276
} dmapp_c_pset_attrs_ver1_t; 
 
277
 
 
278
typedef struct {
 
279
        dmapp_c_pset_attrs_type_t type; 
 
280
        union {
 
281
                dmapp_c_pset_attrs_ver1_t type1;
 
282
       } u;
 
283
} dmapp_c_pset_attrs_t;
 
284
 
 
285
typedef enum dmapp_c_type {
 
286
        DMAPP_C_INT32 = 101,
 
287
        DMAPP_C_UINT32,      
 
288
        DMAPP_C_INT64,
 
289
        DMAPP_C_UINT64,
 
290
        DMAPP_C_FLOAT,
 
291
        DMAPP_C_DOUBLE, 
 
292
        DMAPP_C_COMPLEX8, 
 
293
        DMAPP_C_COMPLEX16, 
 
294
        DMAPP_C_FLOAT_UINT64,
 
295
        DMAPP_C_DOUBLE_UINT64,
 
296
        DMAPP_C_INT32_UINT64,
 
297
        DMAPP_C_INT64_UINT64,     
 
298
        DMAPP_C_TYPE_LAST
 
299
} dmapp_c_type_t;
 
300
 
 
301
typedef enum dmapp_c_op {
 
302
        DMAPP_C_SUM = 201,
 
303
        DMAPP_C_MAX,
 
304
        DMAPP_C_MIN,      
 
305
        DMAPP_C_PROD,
 
306
        DMAPP_C_LAND,
 
307
        DMAPP_C_BAND,
 
308
        DMAPP_C_LOR,      
 
309
        DMAPP_C_BOR,
 
310
        DMAPP_C_LXOR,
 
311
        DMAPP_C_BXOR,
 
312
        DMAPP_C_MINLOC,
 
313
        DMAPP_C_MAXLOC,
 
314
        DMAPP_C_OP_LAST
 
315
} dmapp_c_op_t;
 
316
 
 
317
/*
 
318
 * special data types for minloc/maxloc and complex
 
319
 * global reduction operations
 
320
 */
 
321
 
 
322
typedef struct dmapp_c_float_uint64 {
 
323
        float value;
 
324
        uint64_t loc;
 
325
} dmapp_c_float_uint64_t;
 
326
 
 
327
typedef struct dmapp_c_double_uint64 {
 
328
        double value;
 
329
        uint64_t loc;
 
330
} dmapp_c_double_uint64_t;
 
331
 
 
332
typedef struct dmapp_c_int_uint64 {
 
333
        int value;
 
334
        uint64_t loc;
 
335
} dmapp_c_int_uint64_t;
 
336
 
 
337
typedef struct dmapp_c_int64_uint64 {
 
338
        int64_t value;
 
339
        uint64_t loc;
 
340
} dmapp_c_int64_uint64_t;
 
341
 
 
342
typedef struct dmapp_c_complex8 {
 
343
        float re;
 
344
        float im;
 
345
} dmapp_c_complex8_t;
 
346
 
 
347
typedef struct dmapp_c_complex16 {
 
348
        double re;
 
349
        double im;
 
350
} dmapp_c_complex16_t;
 
351
 
 
352
/*
 
353
 * ******** Function Declarations ********************************
 
354
 */
 
355
 
 
356
/* 
 
357
 * Initialization and Query Functions 
 
358
 */
 
359
 
 
360
/* dmapp_init - Initialize resources for a DMAPP job
 
361
 *              Must be called by all DMAPP applications!
 
362
 *
 
363
 * Parameters:
 
364
 * IN  requested_attrs     Desired job attributes
 
365
 * OUT actual_attrs        Actual job attributes
 
366
 *
 
367
 * Returns: 
 
368
 * DMAPP_RC_SUCCESS        Operation completed successfully
 
369
 * DMAPP_RC_INVALID_PARAM  One or more argument is invalid
 
370
 * DMAPP_RC_RESOURCE_ERROR An error occurred during initialization
 
371
 *
 
372
 */
 
373
 
 
374
extern dmapp_return_t
 
375
dmapp_init(IN  dmapp_rma_attrs_t *requested_attrs,
 
376
           OUT dmapp_rma_attrs_t *actual_attrs);
 
377
 
 
378
 
 
379
/* dmapp_init_ext - Initialize resources for a DMAPP job
 
380
 *                  Must be called by all DMAPP applications!
 
381
 *
 
382
 * Version that takes dmapp_rma_attrs_ext_t
 
383
 * Either dmapp_init() or dmapp_init_ext() should be called
 
384
 *
 
385
 */
 
386
extern dmapp_return_t
 
387
dmapp_init_ext(IN  dmapp_rma_attrs_ext_t *requested_attrs,
 
388
               OUT dmapp_rma_attrs_ext_t *actual_attrs);
 
389
 
 
390
/* dmapp_finalize - Synchronizes and cleans up DMAPP resources
 
391
 *                  Must be called by all DMAPP applications!
 
392
 *
 
393
 * Returns:
 
394
 * DMAPP_RC_SUCCESS
 
395
 */
 
396
 
 
397
extern dmapp_return_t
 
398
dmapp_finalize(void);
 
399
 
 
400
 
 
401
/* dmapp_get_jobinfo - Retrieve general job information
 
402
 *
 
403
 * Parameters:
 
404
 * OUT info   Current information about the job
 
405
 *
 
406
 * Returns: 
 
407
 * DMAPP_RC_SUCCESS    Operation completed successfully
 
408
 * DMAPP_RC_INVALID_PARAM Input parameter is invalid
 
409
 */
 
410
 
 
411
extern dmapp_return_t 
 
412
dmapp_get_jobinfo(OUT dmapp_jobinfo_t *info);
 
413
 
 
414
 
 
415
/* dmapp_get_rma_attrs - Retrieve RMA attributes of a DMAPP job
 
416
 *
 
417
 * Parameters:
 
418
 * OUT attrs   Current RMA attributes of the job
 
419
 *
 
420
 * Returns: 
 
421
 * DMAPP_RC_SUCCESS    Operation completed successfully
 
422
 * DMAPP_RC_INVALID_PARAM Input parameter is invalid
 
423
 */
 
424
 
 
425
extern dmapp_return_t 
 
426
dmapp_get_rma_attrs(OUT dmapp_rma_attrs_t *attrs);
 
427
 
 
428
/* dmapp_get_rma_attrs_ext - Retrieve RMA attributes of a DMAPP job
 
429
 *
 
430
 * Version that returns the dmapp_rma_attrs_ext_t extended structure
 
431
 *
 
432
 */
 
433
extern dmapp_return_t
 
434
dmapp_get_rma_attrs_ext(OUT dmapp_rma_attrs_ext_t *attrs);
 
435
 
 
436
 
 
437
/* dmapp_set_rma_attrs - Set dynamic RMA attributes for a DMAPP job
 
438
 *
 
439
 * Parameters:
 
440
 * IN  requested_attrs Desired job attributes
 
441
 * OUT actual_attrs    Actual job attributes
 
442
 *
 
443
 * Returns: 
 
444
 * DMAPP_RC_SUCCESS    Operation completed successfully
 
445
 * DMAPP_RC_INVALID_PARAM One or more input parameters is invalid
 
446
 *
 
447
 * Description:
 
448
 * A process can set RMA attributes to control the way that DMAPP handles
 
449
 * various RMA requests. Some attributes can be set only during initialization.
 
450
 * They will be referred to as static attributes. Others can be set multiple 
 
451
 * times over the course of the job, and will be referred to as dynamic attributes. 
 
452
 * Settings dynamic attributes does not affect RMA requests previously issued by
 
453
 * the PE, only subsequent RMA requests. Dynamic attributes include when to 
 
454
 * switch from CPU-based mechanisms for handling RMA requests to using CPU
 
455
 * offload mechanisms.
 
456
 */
 
457
 
 
458
extern dmapp_return_t 
 
459
dmapp_set_rma_attrs(IN  dmapp_rma_attrs_t *requested_attrs,
 
460
                    OUT dmapp_rma_attrs_t *actual_attrs);
 
461
 
 
462
/* dmapp_set_rma_attrs - Set dynamic RMA attributes for a DMAPP job
 
463
 *
 
464
 * Version that accepts and returns the extended dmapp_rma_attrs_ext_t
 
465
 * structure
 
466
 *
 
467
 */
 
468
extern dmapp_return_t
 
469
dmapp_set_rma_attrs_ext(IN  dmapp_rma_attrs_ext_t *requested_attrs,
 
470
                        OUT dmapp_rma_attrs_ext_t *actual_attrs);
 
471
 
 
472
 
 
473
/* 
 
474
 * One-sided RMA Functions:
 
475
 *
 
476
 * All one-sided RMA functions (PUT type, GET type and atomic memory
 
477
 * operations) can be subdivided into three categories:
 
478
 * - blocking (no suffix):
 
479
 *   The process returns from the function only after the side-effects
 
480
 *   of the remote memory access are globally visible in the system.
 
481
 * - non-blocking explicit (suffix _nb):
 
482
 *   A synchronization ID (syncid) is returned to the process,
 
483
 *   the side-effects of the remote memory access are only assured
 
484
 *   to be globally visible in the system after the application has
 
485
 *   determined via an explicit synchronization call
 
486
 *   (dmapp_syncid_test/dmapp_syncid_wait) that the syncid has been
 
487
 *   retired.
 
488
 * - non-blocking implicit (suffix _nbi):
 
489
 *   No explicit synchronization ID is returned to the process, the
 
490
 *   side-effects of the remote memory access are only assured to be
 
491
 *   globally visible in the system following a call to
 
492
 *   dmapp_gsync_test or dmapp_gsync_wait.
 
493
 *   This mode is recommended for performance reasons for applications
 
494
 *   with lots of small messages, where blocking calls or using
 
495
 *   individual synids would be expensive.
 
496
 */
 
497
 
 
498
 
 
499
 
 
500
/* The PUT functions stores a contiguous block of data starting at
 
501
 * address source_addr in local memory into a contiguous block at 
 
502
 * a remote address where this remote address is specified by the
 
503
 * triplet virtual address target_addr, segment descriptor target_seg
 
504
 * and target process target_pe. nelems specifies the number of 
 
505
 * elements of type type to be transferred. The memory region defined 
 
506
 * by target_addr and nelems must be within an exported memory segement
 
507
 * of target_pe.
 
508
 */
 
509
 
 
510
 
 
511
/* dmapp_put_nb - Non-blocking explicit PUT
 
512
 *
 
513
 * Parameters:
 
514
 * IN  target_addr     Address of target buffer
 
515
 *     target_seg      Segment descriptor of target buffer
 
516
 *     target_pe       Target PE
 
517
 *     source_addr     Address of source buffer
 
518
 *     nelems          Number of elements to be transferred
 
519
 *     type            Type of elements to be transferred
 
520
 * OUT syncid          Synchronization ID
 
521
 *
 
522
 * Returns: 
 
523
 * DMAPP_RC_SUCCESS        Operation completed successfully
 
524
 * DMAPP_RC_INVALID_PARAM  One or more input parameters is invalid
 
525
 * DMAPP_RC_RESOURCE_ERROR A resource error occurred
 
526
 * DMAPP_RC_NO_SPACE       The transaction request could not be completed
 
527
 *                         due to insufficient resources; user should
 
528
 *                         increase max_outstanding_nb or sync more often
 
529
 */
 
530
 
 
531
extern dmapp_return_t 
 
532
dmapp_put_nb(IN  void                  *target_addr,
 
533
             IN  dmapp_seg_desc_t      *target_seg,
 
534
             IN  dmapp_pe_t            target_pe,
 
535
             IN  void                  *source_addr,
 
536
             IN  uint64_t              nelems,
 
537
             IN  dmapp_type_t          type,
 
538
             OUT dmapp_syncid_handle_t *syncid);
 
539
 
 
540
 
 
541
/* dmapp_put_nbi - Non-blocking implicit PUT
 
542
 *
 
543
 * Parameters:
 
544
 * IN  target_addr     Address of target buffer
 
545
 *     target_seg      Segment descriptor of target buffer
 
546
 *     target_pe       Target PE
 
547
 *     source_addr     Address of source buffer
 
548
 *     nelems          Number of elements to be transferred
 
549
 *     type            Type of elements to be transferred
 
550
 *
 
551
 * Returns: 
 
552
 * DMAPP_RC_SUCCESS        Operation completed successfully
 
553
 * DMAPP_RC_INVALID_PARAM  One or more input parameters is invalid
 
554
 * DMAPP_RC_RESOURCE_ERROR A resource error occurred
 
555
 * DMAPP_RC_NO_SPACE       The transaction request could not be completed
 
556
 *                         due to insufficient resources; user should
 
557
 *                         increase max_outstanding_nb or sync more often
 
558
 */
 
559
 
 
560
extern dmapp_return_t 
 
561
dmapp_put_nbi(IN  void             *target_addr,
 
562
              IN  dmapp_seg_desc_t *target_seg,
 
563
              IN  dmapp_pe_t       target_pe,
 
564
              IN  void             *source_addr,
 
565
              IN  uint64_t         nelems,
 
566
              IN  dmapp_type_t     type);
 
567
 
 
568
 
 
569
/* dmapp_put - Blocking PUT
 
570
 *
 
571
 * Parameters:
 
572
 * IN  target_addr     Address of target buffer
 
573
 *     target_seg      Segment descriptor of target buffer
 
574
 *     target_pe       Target PE
 
575
 *     source_addr     Address of source buffer
 
576
 *     nelems          Number of elements to be transferred
 
577
 *     type            Type of elements to be transferred
 
578
 *
 
579
 * Returns: 
 
580
 * DMAPP_RC_SUCCESS        Operation completed successfully
 
581
 * DMAPP_RC_INVALID_PARAM  One or more input parameters is invalid
 
582
 * DMAPP_RC_RESOURCE_ERROR A resource error occurred
 
583
 * DMAPP_RC_NO_SPACE       The transaction request could not be completed
 
584
 *                         due to insufficient resources; user should
 
585
 *                         increase max_outstanding_nb or sync more often
 
586
 * DMAPP_RC_TRANSACTION_ERROR A transaction error has occured
 
587
 */
 
588
 
 
589
extern dmapp_return_t 
 
590
dmapp_put(IN  void             *target_addr,
 
591
          IN  dmapp_seg_desc_t *target_seg,
 
592
          IN  dmapp_pe_t       target_pe,
 
593
          IN  void             *source_addr,
 
594
          IN  uint64_t         nelems,
 
595
          IN  dmapp_type_t     type);
 
596
 
 
597
 
 
598
/* The GET functions load from a contiguous block of data starting 
 
599
 * from a remote source address and returning the data into a 
 
600
 * contiguous block starting at address target_addr in local memory. 
 
601
 * The remote address is specified by the triplet virtual address 
 
602
 * source_adddr, segment descriptor source_seg and source process 
 
603
 * source_pe. nelems specifies the number of elements of type type 
 
604
 * to be transferred. The memory region described by the remote
 
605
 * address and nelems must reside in an exported memory of source_pe.
 
606
 * Note that zero-length GETs are not supported. 
 
607
 */
 
608
 
 
609
 
 
610
/* dmapp_get_nb - Non-blocking explicit GET
 
611
 * 
 
612
 * Parameters:
 
613
 * IN  target_addr    Address of target buffer
 
614
 *     source_addr    Address of source buffer
 
615
 *     source_seg     Segment descriptor of source buffer
 
616
 *     source_pe      Source PE
 
617
 *     nelems         Number of elements to be transferred
 
618
 *     type           Type of elements to be transferred
 
619
 * OUT syncid         Synchronization ID
 
620
 *
 
621
 * Returns: 
 
622
 * DMAPP_RC_SUCCESS        Operation completed successfully
 
623
 * DMAPP_RC_INVALID_PARAM  One or more input parameters is invalid
 
624
 * DMAPP_RC_RESOURCE_ERROR A resource error occurred
 
625
 * DMAPP_RC_NO_SPACE       The transaction request could not be completed
 
626
 *                         due to insufficient resources; user should
 
627
 *                         increase max_outstanding_nb or sync more often
 
628
 */
 
629
 
 
630
extern dmapp_return_t 
 
631
dmapp_get_nb(IN  void                  *target_addr,
 
632
             IN  void                  *source_addr,
 
633
             IN  dmapp_seg_desc_t      *source_seg,
 
634
             IN  dmapp_pe_t            source_pe,
 
635
             IN  uint64_t              nelems,
 
636
             IN  dmapp_type_t          type,
 
637
             OUT dmapp_syncid_handle_t *syncid);
 
638
 
 
639
 
 
640
/* dmapp_get_nbi - Non-blocking implicit GET
 
641
 *
 
642
 * Parameters:
 
643
 * IN  target_addr    Address of target buffer
 
644
 *     source_addr    Address of source buffer
 
645
 *     source_seg     Segment descriptor of source buffer
 
646
 *     source_pe      Source PE 
 
647
 *     nelems         Number of elements to be transferred
 
648
 *     type           Type of elements to be transferred
 
649
 *
 
650
 * Returns: 
 
651
 * DMAPP_RC_SUCCESS        Operation completed successfully
 
652
 * DMAPP_RC_INVALID_PARAM  One or more input parameters is invalid
 
653
 * DMAPP_RC_RESOURCE_ERROR A resource error occurred
 
654
 * DMAPP_RC_NO_SPACE       The transaction request could not be completed
 
655
 *                         due to insufficient resources; user should
 
656
 *                         increase max_outstanding_nb or sync more often
 
657
 */
 
658
 
 
659
extern dmapp_return_t 
 
660
dmapp_get_nbi(IN  void             *target_addr,
 
661
              IN  void             *source_addr,
 
662
              IN  dmapp_seg_desc_t *source_seg,
 
663
              IN  dmapp_pe_t       source_pe,
 
664
              IN  uint64_t         nelems,
 
665
              IN  dmapp_type_t     type);
 
666
 
 
667
 
 
668
/* dmapp_get - Blocking GET
 
669
 *
 
670
 * Parameters:
 
671
 * IN  target_addr    Address of target buffer
 
672
 *     source_addr    Address of source buffer
 
673
 *     source_seg     Segment descriptor of source buffer
 
674
 *     source_pe      Source PE
 
675
 *     nelems         Number of elements to be transferred
 
676
 *     type           Type of elements to be transferred
 
677
 *
 
678
 * Returns: 
 
679
 * DMAPP_RC_SUCCESS        Operation completed successfully
 
680
 * DMAPP_RC_INVALID_PARAM  One or more input parameters is invalid
 
681
 * DMAPP_RC_RESOURCE_ERROR A resource error occurred
 
682
 * DMAPP_RC_NO_SPACE       The transaction request could not be completed
 
683
 *                         due to insufficient resources; user should
 
684
 *                         increase max_outstanding_nb or sync more often
 
685
 * DMAPP_RC_TRANSACTION_ERROR A transaction error has occured
 
686
 */
 
687
 
 
688
extern dmapp_return_t 
 
689
dmapp_get(IN  void             *target_addr,
 
690
          IN  void             *source_addr,
 
691
          IN  dmapp_seg_desc_t *source_seg,
 
692
          IN  dmapp_pe_t       source_pe,
 
693
          IN  uint64_t         nelems,
 
694
          IN  dmapp_type_t     type);
 
695
 
 
696
 
 
697
 
 
698
/* The Strided PUT functions deliver data starting at address 
 
699
 * source_addr in local memory to a remote address using a stride
 
700
 * specified by sst at the source and by tst at the target. The
 
701
 * remote address is specified by the triplet virtual address 
 
702
 * target_addr, segment descriptor target_seg and target process 
 
703
 * target_pe. nelems specifies the number of elements of type type 
 
704
 * to be transferred. The memory region defined by target_addr, tst
 
705
 * and nelems must be within an exported memory segement of target_pe.
 
706
 */
 
707
 
 
708
 
 
709
/* dmapp_iput_nb - Non-blocking explicit Strided PUT
 
710
 *
 
711
 * Parameters:
 
712
 * IN  target_addr     Address of target buffer
 
713
 *     target_seg      Segment descriptor of target buffer
 
714
 *     target_pe       Target PE
 
715
 *     source_addr     Address of source buffer
 
716
 *     tst             Target stride (>= 1)
 
717
 *     sst             Source stride (>= 1)
 
718
 *     nelems          Number of elements to be transferred
 
719
 *     type            Type of elements to be transferred
 
720
 * OUT syncid          Synchronization ID
 
721
 *
 
722
 * Returns: 
 
723
 * DMAPP_RC_SUCCESS       Operation completed successfully
 
724
 * DMAPP_RC_INVALID_PARAM One or more input parameter is invalid
 
725
 * DMAPP_RC_NO_SPACE      The transaction request could not be completed
 
726
 *                        due to insufficient resources; user should
 
727
 *                        increase max_outstanding_nb or sync more often
 
728
 */
 
729
 
 
730
extern dmapp_return_t 
 
731
dmapp_iput_nb(IN  void                  *target_addr,
 
732
              IN  dmapp_seg_desc_t      *target_seg,
 
733
              IN  dmapp_pe_t            target_pe,
 
734
              IN  void                  *source_addr,
 
735
              IN  ptrdiff_t             tst,
 
736
              IN  ptrdiff_t             sst,
 
737
              IN  uint64_t              nelems,
 
738
              IN  dmapp_type_t          type,
 
739
              OUT dmapp_syncid_handle_t *syncid);
 
740
 
 
741
 
 
742
/* dmapp_iput_nbi - Non-blocking implicit Strided PUT
 
743
 *
 
744
 * Parameters:
 
745
 * IN  target_addr     Address of target buffer
 
746
 *     target_seg      Segment descriptor of target buffer
 
747
 *     target_pe       Target PE
 
748
 *     source_addr     Address of source buffer
 
749
 *     tst             Target stride
 
750
 *     sst             Source stride
 
751
 *     nelems          Number of elements to be transferred
 
752
 *     type            Type of elements to be transferred
 
753
 *
 
754
 * Returns: 
 
755
 * DMAPP_RC_SUCCESS       Operation completed successfully
 
756
 * DMAPP_RC_INVALID_PARAM One or more input parameters is invalid
 
757
 * DMAPP_RC_NO_SPACE      The transaction request could not be completed
 
758
 *                        due to insufficient resources; user should
 
759
 *                        increase max_outstanding_nb or sync more often
 
760
 */
 
761
 
 
762
extern dmapp_return_t 
 
763
dmapp_iput_nbi(IN  void             *target_addr,
 
764
               IN  dmapp_seg_desc_t *target_seg,
 
765
               IN  dmapp_pe_t       target_pe,
 
766
               IN  void             *source_addr,
 
767
               IN  ptrdiff_t        tst,
 
768
               IN  ptrdiff_t        sst,
 
769
               IN  uint64_t         nelems,
 
770
               IN  dmapp_type_t     type);
 
771
 
 
772
 
 
773
/* dmapp_iput - Blocking Strided PUT
 
774
 *
 
775
 * Parameters:
 
776
 * IN  target_addr     Address of target buffer
 
777
 *     target_seg      Segment descriptor of target buffer
 
778
 *     target_pe       Target PE
 
779
 *     source_addr     Address of source buffer
 
780
 *     tst             Target stride
 
781
 *     sst             Source stride
 
782
 *     nelems          Number of elements to be transferred
 
783
 *     type            Type of elements to be transferred
 
784
 *
 
785
 * Returns: 
 
786
 * DMAPP_RC_SUCCESS       Operation completed successfully
 
787
 * DMAPP_RC_INVALID_PARAM One or more input parameters is invalid
 
788
 * DMAPP_RC_NO_SPACE      The transaction request could not be completed
 
789
 *                        due to insufficient resources; user should
 
790
 *                        increase max_outstanding_nb or sync more often
 
791
 * DMAPP_RC_TRANSACTION_ERROR A transaction error has occured
 
792
 */
 
793
 
 
794
extern dmapp_return_t 
 
795
dmapp_iput(IN  void             *target_addr,
 
796
           IN  dmapp_seg_desc_t *target_seg,
 
797
           IN  dmapp_pe_t       target_pe,
 
798
           IN  void             *source_addr,
 
799
           IN  ptrdiff_t        tst,
 
800
           IN  ptrdiff_t        sst,
 
801
           IN  uint64_t         nelems,
 
802
           IN  dmapp_type_t     type);
 
803
 
 
804
 
 
805
/* The Strided GET functions load data starting from a remote source 
 
806
 * address using the source side stride sst and returning the data to
 
807
 * address target_addr in local memory using the target side stride tst.
 
808
 * The remote address is specified by the triplet virtual address
 
809
 * source_adddr, segment descriptor source_seg and source process
 
810
 * source_pe. nelems specifies the number of elements of type type
 
811
 * to be transferred. The memory region described by the remote
 
812
 * address, sst and nelems must reside in an exported memory of source_pe.
 
813
 */
 
814
 
 
815
/* dmapp_iget_nb - Non-blocking explicit Strided GET
 
816
 *
 
817
 * Parameters:
 
818
 * IN  target_addr    Address of target buffer
 
819
 *     source_addr    Address of source buffer
 
820
 *     source_seg     Segment descriptor of source buffer
 
821
 *     source_pe      Source PE
 
822
 *     tst            Target stride
 
823
 *     sst            Source stride
 
824
 *     nelems         Number of elements to be transferred
 
825
 *     type           Type of elements to be transferred
 
826
 * OUT syncid         Synchronization ID
 
827
 *
 
828
 * Returns: 
 
829
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
830
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
831
 * DMAPP_RC_ALIGNMENT_ERROR Source or target buffer or length not
 
832
 *                          properly (Dword (4 byte)) aligned
 
833
 * DMAPP_RC_RESOURCE_ERROR  A resource error occured
 
834
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
835
 *                          due to insufficient resources; user should
 
836
 *                          increase max_outstanding_nb or sync more often
 
837
 */
 
838
 
 
839
extern dmapp_return_t 
 
840
dmapp_iget_nb(IN  void                  *target_addr,
 
841
              IN  void                  *source_addr,
 
842
              IN  dmapp_seg_desc_t      *source_seg,
 
843
              IN  dmapp_pe_t            source_pe,
 
844
              IN  ptrdiff_t             tst,
 
845
              IN  ptrdiff_t             sst,
 
846
              IN  uint64_t              nelems,
 
847
              IN  dmapp_type_t          type,
 
848
              OUT dmapp_syncid_handle_t *syncid);
 
849
 
 
850
/* dmapp_iget_nbi - Non-blocking implicit Strided GET
 
851
 *
 
852
 * Parameters:
 
853
 * IN  target_addr    Address of target buffer
 
854
 *     source_addr    Address of source buffer
 
855
 *     source_seg     Segment descriptor of source buffer
 
856
 *     source_pe      Source PE
 
857
 *     tst            Target stride
 
858
 *     sst            Source stride
 
859
 *     nelems         Number of elements to be transferred
 
860
 *     type           Type of elements to be transferred
 
861
 *
 
862
 * Returns: 
 
863
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
864
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
865
 * DMAPP_RC_ALIGNMENT_ERROR Source or target buffer or length not
 
866
 *                          properly (Dword (4 byte)) aligned
 
867
 * DMAPP_RC_RESOURCE_ERROR  A resource error occured
 
868
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
869
 *                          due to insufficient resources; user should
 
870
 *                          increase max_outstanding_nb or sync more often
 
871
 */
 
872
 
 
873
extern dmapp_return_t 
 
874
dmapp_iget_nbi(IN  void             *target_addr,
 
875
               IN  void             *source_addr,
 
876
               IN  dmapp_seg_desc_t *source_seg,
 
877
               IN  dmapp_pe_t       source_pe,
 
878
               IN  ptrdiff_t        tst,
 
879
               IN  ptrdiff_t        sst,
 
880
               IN  uint64_t         nelems,
 
881
               IN  dmapp_type_t     type);
 
882
 
 
883
/* dmapp_iget - Blocking Strided GET
 
884
 *
 
885
 * Parameters:
 
886
 * IN  target_addr    Address of target buffer
 
887
 *     source_addr    Address of source buffer
 
888
 *     source_seg     Segment descriptor of source buffer
 
889
 *     source_pe      Source PE
 
890
 *     tst            Target stride (>= 1)
 
891
 *     sst            Source stride (>= 1)
 
892
 *     nelems         Number of elements to be transferred
 
893
 *     type           Type of elements to be transferred
 
894
 *
 
895
 * Returns: 
 
896
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
897
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
898
 * DMAPP_RC_ALIGNMENT_ERROR Source or target buffer or length not
 
899
 *                          properly (Dword (4 byte)) aligned
 
900
 * DMAPP_RC_RESOURCE_ERROR  A resource error occured
 
901
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
902
 *                          due to insufficient resources; user should
 
903
 *                          increase max_outstanding_nb or sync more often
 
904
 * DMAPP_RC_TRANSACTION_ERROR A transaction error has occured
 
905
 */
 
906
 
 
907
extern dmapp_return_t 
 
908
dmapp_iget(IN  void             *target_addr,
 
909
           IN  void             *source_addr,
 
910
           IN  dmapp_seg_desc_t *source_seg,
 
911
           IN  dmapp_pe_t       source_pe,
 
912
           IN  ptrdiff_t        tst,
 
913
           IN  ptrdiff_t        sst,
 
914
           IN  uint64_t         nelems,
 
915
           IN  dmapp_type_t     type);
 
916
 
 
917
 
 
918
/* The Indexed PUT functions scatter a contiguous block 
 
919
 * of data starting at address source_addr in local memory to a remote 
 
920
 * address using offsets specified by the tidx array. The remote 
 
921
 * address is specified by the triplet virtual address target_addr, 
 
922
 * segment descriptor target_seg and target process target_pe. nelems 
 
923
 * specifies the number of elements of type type to be transferred. 
 
924
 * Offsets into the tidx array are in units of type. The memory region 
 
925
 * defined by target_addr, tidx and nelems must be within an exported 
 
926
 * memory segement of target_pe.
 
927
 */
 
928
 
 
929
/* dmapp_ixput_nb - Non-blocking explicit Indexed PUT
 
930
 *
 
931
 * Parameters:
 
932
 * IN  target_addr     Address of target buffer
 
933
 *     target_seg      Segment descriptor of target buffer
 
934
 *     target_pe       Target PE
 
935
 *     source_addr     Address of source buffer
 
936
 *     tidx            Array of positive offsets into target buffer
 
937
 *     nelems          Number of elements to be transferred
 
938
 *     type            Type of elements to be transferred
 
939
 * OUT syncid          Synchronization ID
 
940
 *
 
941
 * Returns: 
 
942
 * DMAPP_RC_SUCCESS       Operation completed successfully
 
943
 * DMAPP_RC_INVALID_PARAM One or more input parameters is invalid
 
944
 * DMAPP_RC_NO_SPACE      The transaction request could not be completed
 
945
 *                        due to insufficient resources; user should
 
946
 *                        increase max_outstanding_nb or sync more often
 
947
 *
 
948
 */
 
949
 
 
950
extern dmapp_return_t 
 
951
dmapp_ixput_nb(IN  void                  *target_addr,
 
952
               IN  dmapp_seg_desc_t      *target_seg,
 
953
               IN  dmapp_pe_t            target_pe,
 
954
               IN  void                  *source_addr,
 
955
               IN  ptrdiff_t             *tidx,
 
956
               IN  uint64_t              nelems,
 
957
               IN  dmapp_type_t          type,
 
958
               OUT dmapp_syncid_handle_t *syncid);
 
959
 
 
960
/* dmapp_ixput_nbi - Non-blocking implicit Indexed PUT
 
961
 *
 
962
 * Parameters:
 
963
 * IN  target_addr     Address of target buffer
 
964
 *     target_seg      Segment descriptor of target buffer
 
965
 *     target_pe       Target PE
 
966
 *     source_addr     Address of source buffer
 
967
 *     tidx            Array of positive offsets into target buffer
 
968
 *     nelems          Number of elements to be transferred
 
969
 *     type            Type of elements to be transferred
 
970
 *
 
971
 * Returns: 
 
972
 * DMAPP_RC_SUCCESS       Operation completed successfully
 
973
 * DMAPP_RC_INVALID_PARAM One or more input parameters is invalid
 
974
 * DMAPP_RC_NO_SPACE      The transaction request could not be completed
 
975
 *                        due to insufficient resources; user should
 
976
 *                        increase max_outstanding_nb or sync more often
 
977
 *
 
978
 */
 
979
 
 
980
extern dmapp_return_t 
 
981
dmapp_ixput_nbi(IN  void             *target_addr,
 
982
                IN  dmapp_seg_desc_t *target_seg,
 
983
                IN  dmapp_pe_t       target_pe,
 
984
                IN  void             *source_addr,
 
985
                IN  ptrdiff_t        *tidx,
 
986
                IN  uint64_t         nelems,
 
987
                IN  dmapp_type_t     type);
 
988
 
 
989
/* dmapp_ixput - Blocking Indexed PUT
 
990
 *
 
991
 * Parameters:
 
992
 * IN  target_addr     Address of target buffer
 
993
 *     target_seg      Segment descriptor of target buffer
 
994
 *     target_pe       Target PE
 
995
 *     source_addr     Address of source buffer
 
996
 *     tidx            Array of positive offsets into target buffer
 
997
 *     nelems          Number of elements to be transferred
 
998
 *     type            Type of elements to be transferred
 
999
 *
 
1000
 * Returns: 
 
1001
 * DMAPP_RC_SUCCESS       Operation completed successfully
 
1002
 * DMAPP_RC_INVALID_PARAM One or more input parameters is invalid
 
1003
 * DMAPP_RC_NO_SPACE      The transaction request could not be completed
 
1004
 *                        due to insufficient resources; user should
 
1005
 *                        increase max_outstanding_nb or sync more often
 
1006
 * DMAPP_RC_TRANSACTION_ERROR A transaction error has occured
 
1007
 */
 
1008
 
 
1009
extern dmapp_return_t 
 
1010
dmapp_ixput(IN  void             *target_addr,
 
1011
            IN  dmapp_seg_desc_t *target_seg,
 
1012
            IN  dmapp_pe_t       target_pe,
 
1013
            IN  void             *source_addr,
 
1014
            IN  ptrdiff_t        *tidx,
 
1015
            IN  uint64_t         nelems,
 
1016
            IN  dmapp_type_t     type);
 
1017
 
 
1018
 
 
1019
/* The Indexed GET functions gather data starting
 
1020
 * from a remote source address using offsets specified by the
 
1021
 * sidx array and returning the data into a contiguous block 
 
1022
 * starting at address target_addr in local memory. The remote 
 
1023
 * address is specified by the triplet virtual address source_adddr, 
 
1024
 * segment descriptor source_seg and source process source_pe. nelems 
 
1025
 * specifies the number of elements of type type to be transferred. 
 
1026
 * Offsets in the sidx array are in units of type. The memory region 
 
1027
 * described by the remote address, sidx and nelems must reside in 
 
1028
 * an exported memory of source_pe.
 
1029
 * Note that the three Indexed Get functions are not supported for
 
1030
 * type DMAPP_BYTE.
 
1031
 */
 
1032
 
 
1033
/* dmapp_ixget_nb - Non-blocking explicit Indexed GET
 
1034
 *
 
1035
 * Parameters:
 
1036
 * IN  target_addr    Address of target buffer
 
1037
 *     source_addr    Address of source buffer
 
1038
 *     source_seg     Segment descriptor of source buffer
 
1039
 *     source_pe      Source PE
 
1040
 *     sidx           Array of positive offsets into source buffer
 
1041
 *     nelems         Number of elements to be transferred
 
1042
 *     type           Type of elements to be transferred,
 
1043
                      DMAPP_BYTE not supported
 
1044
 * OUT syncid         Synchronization ID
 
1045
 *
 
1046
 * Returns: 
 
1047
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
1048
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
1049
 * DMAPP_RC_NOT_IMPLEMENTED Type DMAPP_BYTE was used
 
1050
 * DMAPP_RC_ALIGNMENT_ERROR Source or target buffer or length not
 
1051
 *                          properly (Dword (4 byte)) aligned
 
1052
 * DMAPP_RC_RESOURCE_ERROR  A resource error occured
 
1053
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
1054
 *                          due to insufficient resources; user should
 
1055
 *                          increase max_outstanding_nb or sync more often
 
1056
 */
 
1057
 
 
1058
extern dmapp_return_t 
 
1059
dmapp_ixget_nb(IN  void                  *target_addr,
 
1060
               IN  void                  *source_addr,
 
1061
               IN  dmapp_seg_desc_t      *source_seg,
 
1062
               IN  dmapp_pe_t            source_pe,
 
1063
               IN  ptrdiff_t             *sidx,
 
1064
               IN  uint64_t              nelems,
 
1065
               IN  dmapp_type_t          type,
 
1066
               OUT dmapp_syncid_handle_t *syncid);
 
1067
 
 
1068
/* dmapp_ixget_nbi - Non-blocking implicit Indexed GET
 
1069
 *
 
1070
 * Parameters:
 
1071
 * IN  target_addr    Address of target buffer
 
1072
 *     source_addr    Address of source buffer
 
1073
 *     source_seg     Segment descriptor of source buffer
 
1074
 *     source_pe      Source PE
 
1075
 *     sidx           Array of positive offsets into source buffer
 
1076
 *     nelems         Number of elements to be transferred
 
1077
 *     type           Type of elements to be transferred,
 
1078
                      DMAPP_BYTE not supported
 
1079
 *
 
1080
 * Returns: 
 
1081
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
1082
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
1083
 * DMAPP_RC_NOT_IMPLEMENTED Type DMAPP_BYTE was used
 
1084
 * DMAPP_RC_ALIGNMENT_ERROR Source or target buffer or length not
 
1085
 *                          properly (Dword (4 byte)) aligned
 
1086
 * DMAPP_RC_RESOURCE_ERROR  A resource error occured
 
1087
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
1088
 *                          due to insufficient resources; user should
 
1089
 *                          increase max_outstanding_nb or sync more often
 
1090
 */
 
1091
 
 
1092
extern dmapp_return_t 
 
1093
dmapp_ixget_nbi(IN  void             *target_addr,
 
1094
                IN  void             *source_addr,
 
1095
                IN  dmapp_seg_desc_t *source_seg,
 
1096
                IN  dmapp_pe_t       source_pe,
 
1097
                IN  ptrdiff_t        *sidx,
 
1098
                IN  uint64_t         nelems,
 
1099
                IN  dmapp_type_t     type);
 
1100
 
 
1101
/* dmapp_ixget - Blocking Indexed GET
 
1102
 *
 
1103
 * Parameters:
 
1104
 * IN  target_addr    Address of target buffer
 
1105
 *     source_addr    Address of source buffer
 
1106
 *     source_seg     Segment descriptor of source buffer
 
1107
 *     source_pe      Source PE
 
1108
 *     sidx           Array of positive offsets into source buffer
 
1109
 *     nelems         Number of elements to be transferred
 
1110
 *     type           Type of elements to be transferred,
 
1111
                      DMAPP_BYTE not supported
 
1112
 *
 
1113
 * Returns: 
 
1114
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
1115
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
1116
 * DMAPP_RC_NOT_IMPLEMENTED Type DMAPP_BYTE was used
 
1117
 * DMAPP_RC_ALIGNMENT_ERROR Source or target buffer or length not
 
1118
 *                          properly (Dword (4 byte)) aligned
 
1119
 * DMAPP_RC_RESOURCE_ERROR  A resource error occured
 
1120
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
1121
 *                          due to insufficient resources; user should
 
1122
 *                          increase max_outstanding_nb or sync more often
 
1123
 * DMAPP_RC_TRANSACTION_ERROR A transaction error has occured
 
1124
 */
 
1125
 
 
1126
extern dmapp_return_t 
 
1127
dmapp_ixget(IN  void             *target_addr,
 
1128
            IN  void             *source_addr,
 
1129
            IN  dmapp_seg_desc_t *source_seg,
 
1130
            IN  dmapp_pe_t       source_pe,
 
1131
            IN  ptrdiff_t        *sidx,
 
1132
            IN  uint64_t         nelems,
 
1133
            IN  dmapp_type_t     type);
 
1134
 
 
1135
 
 
1136
/* The PUT with Indexed PE Stride functions deliver data starting 
 
1137
 * at source_addr in local memory to a list of target PEs target_pe_list 
 
1138
 * starting at a remote address in their memories. The remote address 
 
1139
 * is specified by the target virtual address target_addr and the
 
1140
 * segment descriptor target_seg. nelems specifies the number of
 
1141
 * elements of type type to be transferred to each target PE. 
 
1142
 * When the transfer is complete, each target PE will have a copy
 
1143
 * of the contents of the original source buffer. The address
 
1144
 * range specified by target_addr and nelems must be within an 
 
1145
 * exported memory segement of each PE in target_pe_list.
 
1146
 * Note that the remote address must be a symmetric address.
 
1147
 * Also note that this function is not a collective operation. It 
 
1148
 * is best used when a small amount of data needs to be transfered
 
1149
 * to a set of PEs.
 
1150
 */
 
1151
 
 
1152
/* dmapp_put_ixpe_nb - Non-blocking explicit PUT with Indexed PE Stride
 
1153
 *
 
1154
 * Parameters:
 
1155
 * IN  target_addr     Address of target buffer
 
1156
 *     target_seg      Segment descriptor of target buffer
 
1157
 *     target_pe_list  List of target PEs
 
1158
 *     num_target_pes  Number of target PEs
 
1159
 *     source_addr     Address of source buffer
 
1160
 *     nelems          Number of elements to be transferred
 
1161
 *     type            Type of elements to be transferred
 
1162
 * OUT syncid          Synchronization ID
 
1163
 *
 
1164
 * Returns: 
 
1165
 * DMAPP_RC_SUCCESS       Operation completed successfully
 
1166
 * DMAPP_RC_INVALID_PARAM One or more input parameters is invalid
 
1167
 * DMAPP_RC_NO_SPACE      The transaction request could not be completed
 
1168
 *                        due to insufficient resources; user should
 
1169
 *                        increase max_outstanding_nb or sync more often
 
1170
 */
 
1171
 
 
1172
extern dmapp_return_t 
 
1173
dmapp_put_ixpe_nb(IN  void                  *target_addr,
 
1174
                  IN  dmapp_seg_desc_t      *target_seg,
 
1175
                  IN  dmapp_pe_t            *target_pe_list,
 
1176
                  IN  uint32_t              num_target_pes,
 
1177
                  IN  void                  *source_addr,
 
1178
                  IN  uint64_t              nelems,
 
1179
                  IN  dmapp_type_t          type,
 
1180
                  OUT dmapp_syncid_handle_t *syncid);
 
1181
 
 
1182
/* dmapp_put_ixpe_nbi - Non-blocking implicit PUT with Indexed PE Stride
 
1183
 *
 
1184
 * Parameters:
 
1185
 * IN  target_addr     Address of target buffer
 
1186
 *     target_seg      Segment descriptor of target buffer
 
1187
 *     target_pe_list  List of target PEs
 
1188
 *     num_target_pes  Number of target PEs
 
1189
 *     source_addr     Address of source buffer
 
1190
 *     nelems          Number of elements to be transferred
 
1191
 *     type            Type of elements to be transferred
 
1192
 *
 
1193
 * Returns: 
 
1194
 * DMAPP_RC_SUCCESS       Operation completed successfully
 
1195
 * DMAPP_RC_INVALID_PARAM One or more input parameters is invalid
 
1196
 * DMAPP_RC_NO_SPACE      The transaction request could not be completed
 
1197
 *                        due to insufficient resources; user should
 
1198
 *                        increase max_outstanding_nb or sync more often
 
1199
 */
 
1200
 
 
1201
extern dmapp_return_t 
 
1202
dmapp_put_ixpe_nbi(IN  void             *target_addr,
 
1203
                   IN  dmapp_seg_desc_t *target_seg,
 
1204
                   IN  dmapp_pe_t       *target_pe_list,
 
1205
                   IN  uint32_t         num_target_pes,
 
1206
                   IN  void             *source_addr,
 
1207
                   IN  uint64_t         nelems,
 
1208
                   IN  dmapp_type_t     type);
 
1209
 
 
1210
/* dmapp_put_ixpe - Blocking PUT with Indexed PE Stride
 
1211
 *
 
1212
 * Parameters:
 
1213
 * IN  target_addr     Address of target buffer
 
1214
 *     target_seg      Segment descriptor of target buffer
 
1215
 *     target_pe_list  List of target PEs
 
1216
 *     num_target_pes  Number of target PEs
 
1217
 *     source_addr     Address of source buffer
 
1218
 *     nelems          Number of elements to be transferred
 
1219
 *     type            Type of elements to be transferred
 
1220
 *
 
1221
 * Returns: 
 
1222
 * DMAPP_RC_SUCCESS       Operation completed successfully
 
1223
 * DMAPP_RC_INVALID_PARAM One or more input parameters is invalid
 
1224
 * DMAPP_RC_NO_SPACE      The transaction request could not be completed
 
1225
 *                        due to insufficient resources; user should
 
1226
 *                        increase max_outstanding_nb or sync more often
 
1227
 * DMAPP_RC_TRANSACTION_ERROR A transaction error has occured
 
1228
 */
 
1229
 
 
1230
extern dmapp_return_t 
 
1231
dmapp_put_ixpe(IN  void             *target_addr,
 
1232
               IN  dmapp_seg_desc_t *target_seg,
 
1233
               IN  dmapp_pe_t       *target_pe_list,
 
1234
               IN  uint32_t         num_target_pes,
 
1235
               IN  void             *source_addr,
 
1236
               IN  uint64_t         nelems,
 
1237
               IN  dmapp_type_t     type);
 
1238
 
 
1239
 
 
1240
/* The Scatter with Indexed PE Stride functions deliver data starting 
 
1241
 * at source_addr in local memory to a list of target PEs target_pe_list
 
1242
 * starting at a remote address in their memories. The remote address is
 
1243
 * specified by the target virtual address target_addr and the
 
1244
 * segment descriptor target_seg. nelems specifies the number of
 
1245
 * elements of type type to be transferred to each target PE.
 
1246
 * Unlike the dmapp_put_ixpe* functions, the source array 
 
1247
 * specifies an array of size num_target_pes * nelems * sizeof(type).
 
1248
 * The target PE at index i into the target_pe_list will receive
 
1249
 * elements i * nelems to (i+1) * nelems - 1. The address range 
 
1250
 * specified by target_addr and nelems must be within an exported 
 
1251
 * memory segement of each PE in target_pe_list.
 
1252
 * Note that the remote address must be a symmetric address.
 
1253
 * Also note that this function is not a collective operation. It
 
1254
 * is best used when a small amount of data needs to be transfered
 
1255
 * to a set of PEs.
 
1256
 */
 
1257
 
 
1258
/* dmapp_scatter_ixpe_nb - Non-blocking explicit Scatter with Indexed PE Stride
 
1259
 *
 
1260
 * Parameters:
 
1261
 * IN  target_addr     Address of target buffer
 
1262
 *     target_seg      Segment descriptor of target buffer
 
1263
 *     target_pe_list  List of target PEs
 
1264
 *     num_target_pes  Number of target PEs
 
1265
 *     source_addr     Address of source buffer
 
1266
 *     nelems          Number of elements to be transferred
 
1267
 *     type            Type of elements to be transferred
 
1268
 * OUT syncid          Synchronization ID
 
1269
 *
 
1270
 * Returns: 
 
1271
 * DMAPP_RC_SUCCESS    Operation completed successfully
 
1272
 * DMAPP_RC_INVALID_PARAM One or more input parameters is invalid
 
1273
 * DMAPP_RC_NO_SPACE      The transaction request could not be completed
 
1274
 *                        due to insufficient resources; user should
 
1275
 *                        increase max_outstanding_nb or sync more often
 
1276
 */
 
1277
 
 
1278
extern dmapp_return_t 
 
1279
dmapp_scatter_ixpe_nb(IN  void                   *target_addr,
 
1280
                      IN  dmapp_seg_desc_t       *target_seg,
 
1281
                      IN  dmapp_pe_t             *target_pe_list,
 
1282
                      IN  uint32_t               num_target_pes,
 
1283
                      IN  void                   *source_addr,
 
1284
                      IN  uint64_t               nelems,
 
1285
                      IN  dmapp_type_t           type,
 
1286
                      OUT dmapp_syncid_handle_t *syncid);
 
1287
 
 
1288
/* dmapp_scatter_ixpe_nbi - Non-blocking implicit Scatter with Indexed PE Stride
 
1289
 *
 
1290
 * Parameters:
 
1291
 * IN  target_addr     Address of target buffer
 
1292
 *     target_seg      Segment descriptor of target buffer
 
1293
 *     target_pe_list  List of target PEs
 
1294
 *     num_target_pes  Number of target PEs
 
1295
 *     source_addr     Address of source buffer
 
1296
 *     nelems          Number of elements to be transferred
 
1297
 *     type            Type of elements to be transferred
 
1298
 *
 
1299
 * Returns: 
 
1300
 * DMAPP_RC_SUCCESS    Operation completed successfully
 
1301
 * DMAPP_RC_INVALID_PARAM One or more input parameters is invalid
 
1302
 * DMAPP_RC_NO_SPACE      The transaction request could not be completed
 
1303
 *                        due to insufficient resources; user should
 
1304
 *                        increase max_outstanding_nb or sync more often
 
1305
 */
 
1306
 
 
1307
extern dmapp_return_t 
 
1308
dmapp_scatter_ixpe_nbi(IN  void             *target_addr,
 
1309
                       IN  dmapp_seg_desc_t *target_seg,
 
1310
                       IN  dmapp_pe_t       *target_pe_list,
 
1311
                       IN  uint32_t         num_target_pes,
 
1312
                       IN  void             *source_addr,
 
1313
                       IN  uint64_t         nelems,
 
1314
                       IN  dmapp_type_t     type);
 
1315
 
 
1316
/* dmapp_scatter_ixpe - Blocking Scatter with Indexed PE Stride
 
1317
 *
 
1318
 * Parameters:
 
1319
 * IN  target_addr     Address of target buffer
 
1320
 *     target_seg      Segment descriptor of target buffer
 
1321
 *     target_pe_list  List of target PEs
 
1322
 *     num_target_pes  Number of target PEs
 
1323
 *     source_addr     Address of source buffer
 
1324
 *     nelems          Number of elements to be transferred
 
1325
 *     type            Type of elements to be transferred
 
1326
 *
 
1327
 * Returns: 
 
1328
 * DMAPP_RC_SUCCESS       Operation completed successfully
 
1329
 * DMAPP_RC_INVALID_PARAM One or more input parameters is invalid
 
1330
 * DMAPP_RC_NO_SPACE      The transaction request could not be completed
 
1331
 *                        due to insufficient resources; user should
 
1332
 *                        increase max_outstanding_nb or sync more often
 
1333
 * DMAPP_RC_TRANSACTION_ERROR A transaction error has occured
 
1334
 */
 
1335
 
 
1336
extern dmapp_return_t 
 
1337
dmapp_scatter_ixpe(IN  void             *target_addr,
 
1338
                   IN  dmapp_seg_desc_t *target_seg,
 
1339
                   IN  dmapp_pe_t       *target_pe_list,
 
1340
                   IN  uint32_t         num_target_pes,
 
1341
                   IN  void             *source_addr,
 
1342
                   IN  uint64_t         nelems,
 
1343
                   IN  dmapp_type_t     type);
 
1344
 
 
1345
 
 
1346
/* The Gather with Indexed PE Stride functions gather data starting 
 
1347
 * at a remote source address from a list of PEs specified by 
 
1348
 * source_pe_list and concatenates the data in a buffer specified by 
 
1349
 * target_addr in local memory.
 
1350
 * The remote address is specified by the virtual address source_addr
 
1351
 * and segment descriptor source_seg. nelems specifies the number of 
 
1352
 * elements of type type to be collected from each PE. The address
 
1353
 * range described by the remote address and nelems must reside in
 
1354
 * an exported memory of each PE in source_pe_list.
 
1355
 * Note that the remote address must be a symmetric address.
 
1356
 * Also note that this function is not a collective operation. It
 
1357
 * is best used when a small amount of data needs to be transfered
 
1358
 * to a set of PEs.
 
1359
 */
 
1360
 
 
1361
/* dmapp_gather_ixpe_nb - Non-blocking explicit Gather with Indexed PE Stride
 
1362
 *
 
1363
 * Parameters:
 
1364
 * IN  target_addr    Address of target buffer
 
1365
 *     source_addr    Address of source buffer
 
1366
 *     source_seg     Segment descriptor of source buffer
 
1367
 *     source_pe_list List of source PEs
 
1368
 *     num_source_pes Number of source PEs
 
1369
 *     nelems         Number of elements to be transferred
 
1370
 *     type           Type of elements to be transferred
 
1371
 * OUT syncid         Synchronization ID
 
1372
 *
 
1373
 * Returns: 
 
1374
 * DMAPP_RC_SUCCESS       Operation completed successfully
 
1375
 * DMAPP_RC_INVALID_PARAM One or more input parameters is invalid
 
1376
 * DMAPP_RC_NO_SPACE      The transaction request could not be completed
 
1377
 *                        due to insufficient resources; user should
 
1378
 *                        increase max_outstanding_nb or sync more often
 
1379
 */
 
1380
 
 
1381
extern dmapp_return_t 
 
1382
dmapp_gather_ixpe_nb(IN  void                  *target_addr,
 
1383
                     IN  void                  *source_addr,
 
1384
                     IN  dmapp_seg_desc_t      *source_seg,
 
1385
                     IN  dmapp_pe_t            *source_pe_list,
 
1386
                     IN  uint32_t              num_source_pes,
 
1387
                     IN  uint64_t              nelems,
 
1388
                     IN  dmapp_type_t          type,
 
1389
                     OUT dmapp_syncid_handle_t *syncid);
 
1390
 
 
1391
/* dmapp_gather_ixpe_nbi - Non-blocking implicit Gather with Indexed PE Stride
 
1392
 *
 
1393
 * Parameters:
 
1394
 * IN  target_addr    Address of target buffer
 
1395
 *     source_addr    Address of source buffer
 
1396
 *     source_seg     Segment descriptor of source buffer
 
1397
 *     source_pe_list List of source PEs
 
1398
 *     num_source_pes Number of source PEs
 
1399
 *     nelems         Number of elements to be transferred
 
1400
 *     type           Type of elements to be transferred
 
1401
 *
 
1402
 * Returns: 
 
1403
 * DMAPP_RC_SUCCESS       Operation completed successfully
 
1404
 * DMAPP_RC_INVALID_PARAM One or more input parameters is invalid
 
1405
 * DMAPP_RC_NO_SPACE      The transaction request could not be completed
 
1406
 *                        due to insufficient resources; user should
 
1407
 *                        increase max_outstanding_nb or sync more often
 
1408
 */
 
1409
 
 
1410
extern dmapp_return_t 
 
1411
dmapp_gather_ixpe_nbi(IN  void             *target_addr,
 
1412
                      IN  void             *source_addr,
 
1413
                      IN  dmapp_seg_desc_t *source_seg,
 
1414
                      IN  dmapp_pe_t       *source_pe_list,
 
1415
                      IN  uint32_t         num_source_pes,
 
1416
                      IN  uint64_t         nelems,
 
1417
                      IN  dmapp_type_t     type);
 
1418
 
 
1419
/* dmapp_gather_ixpe - Blocking Gather with Indexed PE Stride
 
1420
 *
 
1421
 * Parameters:
 
1422
 * IN  target_addr    Address of target buffer
 
1423
 *     source_addr    Address of source buffer
 
1424
 *     source_seg     Segment descriptor of source buffer
 
1425
 *     source_pe_list List of source PEs
 
1426
 *     num_source_pes Number of source PEs
 
1427
 *     nelems         Number of elements to be transferred
 
1428
 *     type           Type of elements to be transferred
 
1429
 *
 
1430
 * Returns: 
 
1431
 * DMAPP_RC_SUCCESS       Operation completed successfully
 
1432
 * DMAPP_RC_INVALID_PARAM One or more input parameters is invalid
 
1433
 * DMAPP_RC_NO_SPACE      The transaction request could not be completed
 
1434
 *                        due to insufficient resources; user should
 
1435
 *                        increase max_outstanding_nb or sync more often
 
1436
 * DMAPP_RC_TRANSACTION_ERROR A transaction error has occured
 
1437
 */
 
1438
 
 
1439
extern dmapp_return_t 
 
1440
dmapp_gather_ixpe(IN  void             *target_addr,
 
1441
                  IN  void             *source_addr,
 
1442
                  IN  dmapp_seg_desc_t *source_seg,
 
1443
                  IN  dmapp_pe_t       *source_pe_list,
 
1444
                  IN  uint32_t         num_source_pes,
 
1445
                  IN  uint64_t         nelems,
 
1446
                  IN  dmapp_type_t     type);
 
1447
 
 
1448
 
 
1449
 
 
1450
/* 
 
1451
 *  Scalar-Style AMO RMA Functions 
 
1452
 */
 
1453
 
 
1454
/* A set of scalar-type AMO functions is provided. Note that
 
1455
 * AMOs only operate on quad-word entities. For atomic functions 
 
1456
 * with PUT semantics (AADD, AAND, AOR, AXOR) the target memory
 
1457
 * location must reside in an exported memory segment of remote 
 
1458
 * PE target_pe. For atomic functions with GET semantics (AFADD,
 
1459
 * AFAND, AFOR, AFXOR) the source memory location must reside in 
 
1460
 * an exported memory segment of remote PE source_pe.
 
1461
 */
 
1462
 
 
1463
/* dmapp_aadd_qw_nb - Non-blocking explicit atomic ADD
 
1464
 *
 
1465
 * Parameters:
 
1466
 * IN  target_addr    Address of target buffer (qw only)
 
1467
 *     target_seg     Segment descriptor for target buffer
 
1468
 *     target_pe      Target PE
 
1469
 *     operand        Value to be added
 
1470
 * OUT syncid         Synchronization ID
 
1471
 *
 
1472
 * Returns: 
 
1473
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
1474
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
1475
 * DMAPP_RC_ALIGNMENT_ERROR Target buffer not properly (Qword (8 byte)) aligned
 
1476
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
1477
 *                          due to insufficient resources; user should
 
1478
 *                          increase max_outstanding_nb or sync more often
 
1479
 */
 
1480
 
 
1481
extern dmapp_return_t 
 
1482
dmapp_aadd_qw_nb(IN  void                  *target_addr,
 
1483
                 IN  dmapp_seg_desc_t      *target_seg,
 
1484
                 IN  dmapp_pe_t            target_pe,
 
1485
                 IN  int64_t               operand,
 
1486
                 OUT dmapp_syncid_handle_t *syncid);
 
1487
 
 
1488
/* dmapp_aadd_qw_nbi - Non-blocking implicit atomic ADD
 
1489
 *
 
1490
 * Parameters:
 
1491
 * IN  target_addr    Address of target buffer (qw only)
 
1492
 *     target_seg     Segment descriptor for target buffer
 
1493
 *     target_pe      Target PE
 
1494
 *     operand        Value to be added
 
1495
 *
 
1496
 * Returns: 
 
1497
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
1498
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
1499
 * DMAPP_RC_ALIGNMENT_ERROR Target buffer not properly (Qword (8 byte)) aligned
 
1500
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
1501
 *                          due to insufficient resources; user should
 
1502
 *                          increase max_outstanding_nb or sync more often
 
1503
 */
 
1504
 
 
1505
extern dmapp_return_t 
 
1506
dmapp_aadd_qw_nbi(IN  void             *target_addr,
 
1507
                  IN  dmapp_seg_desc_t *target_seg,
 
1508
                  IN  dmapp_pe_t       target_pe,
 
1509
                  IN  int64_t          operand);
 
1510
 
 
1511
/* dmapp_aadd_qw - Blocking atomic ADD
 
1512
 *
 
1513
 * Parameters:
 
1514
 * IN  target_addr    Address of target buffer (qw only)
 
1515
 *     target_seg     Segment descriptor for target buffer
 
1516
 *     target_pe      Target PE
 
1517
 *     operand        Value to be added
 
1518
 *
 
1519
 * Returns: 
 
1520
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
1521
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
1522
 * DMAPP_RC_ALIGNMENT_ERROR Target buffer not properly (Qword (8 byte)) aligned
 
1523
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
1524
 *                          due to insufficient resources; user should
 
1525
 *                          increase max_outstanding_nb or sync more often
 
1526
 * DMAPP_RC_TRANSACTION_ERROR A transaction error has occured
 
1527
 */
 
1528
 
 
1529
extern dmapp_return_t 
 
1530
dmapp_aadd_qw(IN  void             *target_addr,
 
1531
              IN  dmapp_seg_desc_t *target_seg,
 
1532
              IN  dmapp_pe_t       target_pe,
 
1533
              IN  int64_t          operand);
 
1534
 
 
1535
 
 
1536
/* dmapp_aand_qw_nb - Non-blocking explicit atomic AND
 
1537
 *
 
1538
 * Parameters:
 
1539
 * IN  target_addr    Address of target buffer (qw only)
 
1540
 *     target_seg     Segment descriptor for target buffer
 
1541
 *     target_pe      Target PE
 
1542
 *     operand        Operand for the AND
 
1543
 * OUT syncid         Synchronization ID
 
1544
 *
 
1545
 * Returns: 
 
1546
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
1547
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
1548
 * DMAPP_RC_ALIGNMENT_ERROR Target buffer not properly (Qword (8 byte)) aligned
 
1549
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
1550
 *                          due to insufficient resources; user should
 
1551
 *                          increase max_outstanding_nb or sync more often
 
1552
 */
 
1553
 
 
1554
extern dmapp_return_t 
 
1555
dmapp_aand_qw_nb(IN  void                  *target_addr,
 
1556
                 IN  dmapp_seg_desc_t      *target_seg,
 
1557
                 IN  dmapp_pe_t            target_pe,
 
1558
                 IN  int64_t               operand,
 
1559
                 OUT dmapp_syncid_handle_t *syncid);
 
1560
 
 
1561
/* dmapp_aand_qw_nbi - Non-blocking implicit atomic AND
 
1562
 *
 
1563
 * Parameters:
 
1564
 * IN  target_addr    Address of target buffer (qw only)
 
1565
 *     target_seg     Segment descriptor for target buffer
 
1566
 *     target_pe      Target PE
 
1567
 *     operand        Operand for the AND
 
1568
 *
 
1569
 * Returns: 
 
1570
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
1571
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
1572
 * DMAPP_RC_ALIGNMENT_ERROR Target buffer not properly (Qword (8 byte)) aligned
 
1573
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
1574
 *                          due to insufficient resources; user should
 
1575
 *                          increase max_outstanding_nb or sync more often
 
1576
 */
 
1577
 
 
1578
extern dmapp_return_t 
 
1579
dmapp_aand_qw_nbi(IN  void             *target_addr,
 
1580
                  IN  dmapp_seg_desc_t *target_seg,
 
1581
                  IN  dmapp_pe_t       target_pe,
 
1582
                  IN  int64_t          operand);
 
1583
 
 
1584
/* dmapp_aand_qw - Blocking atomic AND
 
1585
 *
 
1586
 * Parameters:
 
1587
 * IN  target_addr    Address of target buffer (qw only)
 
1588
 *     target_seg     Segment descriptor for target buffer
 
1589
 *     target_pe      Target PE
 
1590
 *     operand        Operand for the AND
 
1591
 *
 
1592
 * Returns: 
 
1593
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
1594
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
1595
 * DMAPP_RC_ALIGNMENT_ERROR Target buffer not properly (Qword (8 byte)) aligned
 
1596
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
1597
 *                          due to insufficient resources; user should
 
1598
 *                          increase max_outstanding_nb or sync more often
 
1599
 * DMAPP_RC_TRANSACTION_ERROR A transaction error has occured
 
1600
 */
 
1601
 
 
1602
extern dmapp_return_t 
 
1603
dmapp_aand_qw(IN  void             *target_addr,
 
1604
              IN  dmapp_seg_desc_t *target_seg,
 
1605
              IN  dmapp_pe_t       target_pe,
 
1606
              IN  int64_t          operand);
 
1607
 
 
1608
 
 
1609
/* dmapp_aor_qw_nb - Non-blocking explicit atomic OR
 
1610
 *
 
1611
 * Parameters:
 
1612
 * IN  target_addr    Address of target buffer (qw only)
 
1613
 *     target_seg     Segment descriptor for target buffer
 
1614
 *     target_pe      Target PE
 
1615
 *     operand        Operand for the OR
 
1616
 * OUT syncid         Synchronization ID
 
1617
 *
 
1618
 * Returns: 
 
1619
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
1620
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
1621
 * DMAPP_RC_ALIGNMENT_ERROR Target buffer not properly (Qword (8 byte)) aligned
 
1622
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
1623
 *                          due to insufficient resources; user should
 
1624
 *                          increase max_outstanding_nb or sync more often
 
1625
 */
 
1626
 
 
1627
extern dmapp_return_t 
 
1628
dmapp_aor_qw_nb(IN  void                  *target_addr,
 
1629
                IN  dmapp_seg_desc_t      *target_seg,
 
1630
                IN  dmapp_pe_t            target_pe,
 
1631
                IN  int64_t               operand,
 
1632
                OUT dmapp_syncid_handle_t *syncid);
 
1633
 
 
1634
/* dmapp_aor_qw_nbi - Non-blocking implicit atomic OR
 
1635
 *
 
1636
 * Parameters:
 
1637
 * IN  target_addr    Address of target buffer (qw only)
 
1638
 *     target_seg     Segment descriptor for target buffer
 
1639
 *     target_pe      Target PE
 
1640
 *     operand        Operand for the OR
 
1641
 *
 
1642
 * Returns: 
 
1643
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
1644
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
1645
 * DMAPP_RC_ALIGNMENT_ERROR Target buffer not properly (Qword (8 byte)) aligned
 
1646
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
1647
 *                          due to insufficient resources; user should
 
1648
 *                          increase max_outstanding_nb or sync more often
 
1649
 */
 
1650
 
 
1651
extern dmapp_return_t 
 
1652
dmapp_aor_qw_nbi(IN  void             *target_addr,
 
1653
                 IN  dmapp_seg_desc_t *target_seg,
 
1654
                 IN  dmapp_pe_t       target_pe,
 
1655
                 IN  int64_t          operand);
 
1656
 
 
1657
/* dmapp_aor_qw - Blocking atomic OR
 
1658
 *
 
1659
 * Parameters:
 
1660
 * IN  target_addr    Address of target buffer (qw only)
 
1661
 *     target_seg     Segment descriptor for target buffer
 
1662
 *     target_pe      Target PE
 
1663
 *     operand        Operand for the ORD
 
1664
 *
 
1665
 * Returns: 
 
1666
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
1667
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
1668
 * DMAPP_RC_ALIGNMENT_ERROR Target buffer not properly (Qword (8 byte)) aligned
 
1669
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
1670
 *                          due to insufficient resources; user should
 
1671
 *                          increase max_outstanding_nb or sync more often
 
1672
 * DMAPP_RC_TRANSACTION_ERROR A transaction error has occured
 
1673
 */
 
1674
 
 
1675
extern dmapp_return_t 
 
1676
dmapp_aor_qw(IN  void             *target_addr,
 
1677
             IN  dmapp_seg_desc_t *target_seg,
 
1678
             IN  dmapp_pe_t       target_pe,
 
1679
             IN  int64_t          operand);
 
1680
 
 
1681
 
 
1682
/* dmapp_axor_qw_nb - Non-blocking explicit atomic XOR
 
1683
 *
 
1684
 * Parameters:
 
1685
 * IN  target_addr    Address of target buffer (qw only)
 
1686
 *     target_seg     Segment descriptor for target buffer
 
1687
 *     target_pe      Target PE
 
1688
 *     operand        Operand for the XOR
 
1689
 * OUT syncid         Synchronization ID
 
1690
 *
 
1691
 * Returns: 
 
1692
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
1693
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
1694
 * DMAPP_RC_ALIGNMENT_ERROR Target buffer not properly (Qword (8 byte)) aligned
 
1695
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
1696
 *                          due to insufficient resources; user should
 
1697
 *                          increase max_outstanding_nb or sync more often
 
1698
 */
 
1699
 
 
1700
extern dmapp_return_t 
 
1701
dmapp_axor_qw_nb(IN  void                  *target_addr,
 
1702
                 IN  dmapp_seg_desc_t      *target_seg,
 
1703
                 IN  dmapp_pe_t            target_pe,
 
1704
                 IN  int64_t               operand,
 
1705
                 OUT dmapp_syncid_handle_t *syncid);
 
1706
 
 
1707
/* dmapp_axor_qw_nbi - Non-blocking implicit atomic XOR
 
1708
 *
 
1709
 * Parameters:
 
1710
 * IN  target_addr    Address of target buffer (qw only)
 
1711
 *     target_seg     Segment descriptor for target buffer
 
1712
 *     target_pe      Target PE
 
1713
 *     operand        Operand for the XOR
 
1714
 *
 
1715
 * Returns: 
 
1716
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
1717
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
1718
 * DMAPP_RC_ALIGNMENT_ERROR Target buffer not properly (Qword (8 byte)) aligned
 
1719
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
1720
 *                          due to insufficient resources; user should
 
1721
 *                          increase max_outstanding_nb or sync more often
 
1722
 */
 
1723
 
 
1724
extern dmapp_return_t 
 
1725
dmapp_axor_qw_nbi(IN  void             *target_addr,
 
1726
                  IN  dmapp_seg_desc_t *target_seg,
 
1727
                  IN  dmapp_pe_t       target_pe,
 
1728
                  IN  int64_t          operand);
 
1729
 
 
1730
/* dmapp_axor_qw - Blocking atomic XOR
 
1731
 *
 
1732
 * Parameters:
 
1733
 * IN  target_addr    Address of target buffer (qw only)
 
1734
 *     target_seg     Segment descriptor for target buffer
 
1735
 *     target_pe      Target PE
 
1736
 *     operand        Operand for the XOR
 
1737
 *
 
1738
 * Returns: 
 
1739
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
1740
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
1741
 * DMAPP_RC_ALIGNMENT_ERROR Target buffer not properly (Qword (8 byte)) aligned
 
1742
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
1743
 *                          due to insufficient resources; user should
 
1744
 *                          increase max_outstanding_nb or sync more often
 
1745
 * DMAPP_RC_TRANSACTION_ERROR A transaction error has occured
 
1746
 */
 
1747
 
 
1748
extern dmapp_return_t 
 
1749
dmapp_axor_qw(IN  void             *target_addr,
 
1750
              IN  dmapp_seg_desc_t *target_seg,
 
1751
              IN  dmapp_pe_t       target_pe,
 
1752
              IN  int64_t          operand);
 
1753
 
 
1754
 
 
1755
/* dmapp_afadd_qw_nb - Non-blocking explicit atomic FADD
 
1756
 *
 
1757
 * Parameters:
 
1758
 * IN  target_addr    Address of target buffer where result
 
1759
 *                    is returned (qw only)
 
1760
 *     source_addr    Address of source buffer (qw only)
 
1761
 *     source_seg     Segment descriptor of source buffer
 
1762
 *     source_pe      Source PE
 
1763
 *     operand        Operand for the FADD
 
1764
 * OUT syncid         Synchronization ID
 
1765
 *
 
1766
 * Returns: 
 
1767
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
1768
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
1769
 * DMAPP_RC_ALIGNMENT_ERROR Target or source buffer not properly 
 
1770
 *                          (Qword (8 byte)) aligned
 
1771
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
1772
 *                          due to insufficient resources; user should
 
1773
 *                          increase max_outstanding_nb or sync more often
 
1774
 */
 
1775
 
 
1776
extern dmapp_return_t 
 
1777
dmapp_afadd_qw_nb(IN  void                  *target_addr,
 
1778
                  IN  void                  *source_addr,
 
1779
                  IN  dmapp_seg_desc_t      *source_seg,
 
1780
                  IN  dmapp_pe_t            source_pe,
 
1781
                  IN  int64_t               operand,
 
1782
                  OUT dmapp_syncid_handle_t *syncid);
 
1783
 
 
1784
/* dmapp_afadd_qw_nbi - Non-blocking implicit atomic FADD
 
1785
 *
 
1786
 * Parameters:
 
1787
 * IN  target_addr    Address of target buffer where result 
 
1788
 *                    is returned (qw only)
 
1789
 *     source_addr    Address of source buffer (qw only)
 
1790
 *     source_seg     Segment descriptor of source buffer
 
1791
 *     source_pe      Source PE
 
1792
 *     operand        Operand for the FADD
 
1793
 *
 
1794
 * Returns: 
 
1795
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
1796
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
1797
 * DMAPP_RC_ALIGNMENT_ERROR Target or source buffer not properly
 
1798
 *                          (Qword (8 byte)) aligned
 
1799
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
1800
 *                          due to insufficient resources; user should
 
1801
 *                          increase max_outstanding_nb or sync more often
 
1802
 */
 
1803
 
 
1804
extern dmapp_return_t 
 
1805
dmapp_afadd_qw_nbi(IN  void             *target_addr,
 
1806
                   IN  void             *source_addr,
 
1807
                   IN  dmapp_seg_desc_t *source_seg,
 
1808
                   IN  dmapp_pe_t       source_pe,
 
1809
                   IN  int64_t          operand);
 
1810
 
 
1811
/* dmapp_afadd_qw - Blocking atomic FADD
 
1812
 *
 
1813
 * Parameters:
 
1814
 * IN  target_addr    Address of target buffer where result 
 
1815
 *                    is returned (qw only)
 
1816
 *     source_addr    Address of source buffer (qw only)
 
1817
 *     source_seg     Segment descriptor of source buffer
 
1818
 *     source_pe      Source PE
 
1819
 *     operand        Operand for the FADD
 
1820
 *
 
1821
 * Returns: 
 
1822
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
1823
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
1824
 * DMAPP_RC_ALIGNMENT_ERROR Target or source buffer not properly
 
1825
 *                          (Qword (8 byte)) aligned
 
1826
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
1827
 *                          due to insufficient resources; user should
 
1828
 *                          increase max_outstanding_nb or sync more often
 
1829
 * DMAPP_RC_TRANSACTION_ERROR A transaction error has occured
 
1830
 */
 
1831
 
 
1832
extern dmapp_return_t 
 
1833
dmapp_afadd_qw(IN  void             *target_addr,
 
1834
               IN  void             *source_addr,
 
1835
               IN  dmapp_seg_desc_t *source_seg,
 
1836
               IN  dmapp_pe_t       source_pe,
 
1837
               IN  int64_t          operand);
 
1838
 
 
1839
 
 
1840
/* dmapp_afand_qw_nb - Non-blocking explicit atomic FAND
 
1841
 *
 
1842
 * Parameters:
 
1843
 * IN  target_addr    Address of target buffer where result 
 
1844
 *                    is returned (qw only)
 
1845
 *     source_addr    Address of source buffer (qw only)
 
1846
 *     source_seg     Segment descriptor of source buffer
 
1847
 *     source_pe      Source PE
 
1848
 *     operand        Operand for the FAND
 
1849
 * OUT syncid         Synchronization ID
 
1850
 *
 
1851
 * Returns: 
 
1852
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
1853
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
1854
 * DMAPP_RC_ALIGNMENT_ERROR Target or source buffer not properly
 
1855
 *                          (Qword (8 byte)) aligned
 
1856
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
1857
 *                          due to insufficient resources; user should
 
1858
 *                          increase max_outstanding_nb or sync more often
 
1859
 */
 
1860
 
 
1861
extern dmapp_return_t 
 
1862
dmapp_afand_qw_nb(IN  void                  *target_addr,
 
1863
                  IN  void                  *source_addr,
 
1864
                  IN  dmapp_seg_desc_t      *source_seg,
 
1865
                  IN  dmapp_pe_t            source_pe,
 
1866
                  IN  int64_t               operand,
 
1867
                  OUT dmapp_syncid_handle_t *syncid);
 
1868
 
 
1869
/* dmapp_afand_qw_nbi - Non-blocking implicit atomic FAND
 
1870
 *
 
1871
 * Parameters:
 
1872
 * IN  target_addr    Address of target buffer where result 
 
1873
 *                    is returned (qw only)
 
1874
 *     source_addr    Address of source buffer (qw only)
 
1875
 *     source_seg     Segment descriptor of source buffer
 
1876
 *     source_pe      Source PE
 
1877
 *     operand        Operand for the FAND
 
1878
 *
 
1879
 * Returns: 
 
1880
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
1881
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
1882
 * DMAPP_RC_ALIGNMENT_ERROR Target or source buffer not properly
 
1883
 *                          (Qword (8 byte)) aligned
 
1884
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
1885
 *                          due to insufficient resources; user should
 
1886
 *                          increase max_outstanding_nb or sync more often
 
1887
 */
 
1888
 
 
1889
extern dmapp_return_t 
 
1890
dmapp_afand_qw_nbi(IN  void             *target_addr,
 
1891
                   IN  void             *source_addr,
 
1892
                   IN  dmapp_seg_desc_t *source_seg,
 
1893
                   IN  dmapp_pe_t       source_pe,
 
1894
                   IN  int64_t          operand);
 
1895
 
 
1896
/* dmapp_afand_qw - Blocking atomic FAND
 
1897
 *
 
1898
 * Parameters:
 
1899
 * IN  target_addr    Address of target buffer where result 
 
1900
 *                    is returned (qw only)
 
1901
 *     source_addr    Address of source buffer (qw only)
 
1902
 *     source_seg     Segment descriptor of source buffer
 
1903
 *     source_pe      Source PE
 
1904
 *     operand        Operand for the FAND
 
1905
 *
 
1906
 * Returns: 
 
1907
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
1908
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
1909
 * DMAPP_RC_ALIGNMENT_ERROR Target or source buffer not properly
 
1910
 *                          (Qword (8 byte)) aligned
 
1911
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
1912
 *                          due to insufficient resources; user should
 
1913
 *                          increase max_outstanding_nb or sync more often
 
1914
 * DMAPP_RC_TRANSACTION_ERROR A transaction error has occured
 
1915
 */
 
1916
 
 
1917
extern dmapp_return_t 
 
1918
dmapp_afand_qw(IN  void             *target_addr,
 
1919
               IN  void             *source_addr,
 
1920
               IN  dmapp_seg_desc_t *source_seg,
 
1921
               IN  dmapp_pe_t       source_pe,
 
1922
               IN  int64_t          operand);
 
1923
 
 
1924
 
 
1925
/* dmapp_afxor_qw_nb - Non-blocking explicit atomic FXOR
 
1926
 *
 
1927
 * Parameters:
 
1928
 * IN  target_addr    Address of target buffer where result 
 
1929
 *                    is returned (qw only)
 
1930
 *     source_addr    Address of source buffer (qw only)
 
1931
 *     source_seg     Segment descriptor of source buffer
 
1932
 *     source_pe      Source PE
 
1933
 *     operand        Operand for the FXOR
 
1934
 * OUT syncid         Synchronization ID
 
1935
 *
 
1936
 * Returns: 
 
1937
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
1938
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
1939
 * DMAPP_RC_ALIGNMENT_ERROR Target or source buffer not properly
 
1940
 *                          (Qword (8 byte)) aligned
 
1941
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
1942
 *                          due to insufficient resources; user should
 
1943
 *                          increase max_outstanding_nb or sync more often
 
1944
 */
 
1945
 
 
1946
extern dmapp_return_t 
 
1947
dmapp_afxor_qw_nb(IN  void                  *target_addr,
 
1948
                  IN  void                  *source_addr,
 
1949
                  IN  dmapp_seg_desc_t      *source_seg,
 
1950
                  IN  dmapp_pe_t            source_pe,
 
1951
                  IN  int64_t               operand,
 
1952
                  OUT dmapp_syncid_handle_t *syncid);
 
1953
 
 
1954
/* dmapp_afxor_qw_nbi - Non-blocking implicit atomic FXOR
 
1955
 *
 
1956
 * Parameters:
 
1957
 * IN  target_addr    Address of target buffer where result 
 
1958
 *                    is returned (qw only)
 
1959
 *     source_addr    Address of source buffer (qw only)
 
1960
 *     source_seg     Segment descriptor of source buffer
 
1961
 *     source_pe      Source PE
 
1962
 *     operand        Operand for the FXOR
 
1963
 *
 
1964
 * Returns: 
 
1965
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
1966
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
1967
 * DMAPP_RC_ALIGNMENT_ERROR Target or source buffer not properly
 
1968
 *                          (Qword (8 byte)) aligned
 
1969
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
1970
 *                          due to insufficient resources; user should
 
1971
 *                          increase max_outstanding_nb or sync more often
 
1972
 */
 
1973
 
 
1974
extern dmapp_return_t 
 
1975
dmapp_afxor_qw_nbi(IN  void             *target_addr,
 
1976
                   IN  void             *source_addr,
 
1977
                   IN  dmapp_seg_desc_t *source_seg,
 
1978
                   IN  dmapp_pe_t       source_pe,
 
1979
                   IN  int64_t          operand);
 
1980
 
 
1981
/* dmapp_afxor_qw - Blocking atomic FXOR
 
1982
 *
 
1983
 * Parameters:
 
1984
 * IN  target_addr    Address of target buffer where result 
 
1985
 *                    is returned (qw only)
 
1986
 *     source_addr    Address of source buffer (qw only)
 
1987
 *     source_seg     Segment descriptor of source buffer
 
1988
 *     source_pe      Source PE
 
1989
 *     operand        Operand for the FXOR
 
1990
 *
 
1991
 * Returns: 
 
1992
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
1993
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
1994
 * DMAPP_RC_ALIGNMENT_ERROR Target or source buffer not properly
 
1995
 *                          (Qword (8 byte)) aligned
 
1996
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
1997
 *                          due to insufficient resources; user should
 
1998
 *                          increase max_outstanding_nb or sync more often
 
1999
 * DMAPP_RC_TRANSACTION_ERROR A transaction error has occured
 
2000
 */
 
2001
 
 
2002
extern dmapp_return_t 
 
2003
dmapp_afxor_qw(IN  void             *target_addr,
 
2004
               IN  void             *source_addr,
 
2005
               IN  dmapp_seg_desc_t *source_seg,
 
2006
               IN  dmapp_pe_t       source_pe,
 
2007
               IN  int64_t          operand);
 
2008
 
 
2009
 
 
2010
/* dmapp_afor_qw_nb - Non-blocking explicit atomic FOR
 
2011
 *
 
2012
 * Parameters:
 
2013
 * IN  target_addr    Address of target buffer where result 
 
2014
 *                    is returned (qw only)
 
2015
 *     source_addr    Address of source buffer (qw only)
 
2016
 *     source_seg     Segment descriptor of source buffer
 
2017
 *     source_pe      Source PE
 
2018
 *     operand        Operand for the FOR
 
2019
 * OUT syncid         Synchronization ID
 
2020
 *
 
2021
 * Returns: 
 
2022
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
2023
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
2024
 * DMAPP_RC_ALIGNMENT_ERROR Target or source buffer not properly
 
2025
 *                          (Qword (8 byte)) aligned
 
2026
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
2027
 *                          due to insufficient resources; user should
 
2028
 *                          increase max_outstanding_nb or sync more often
 
2029
 */
 
2030
 
 
2031
extern dmapp_return_t 
 
2032
dmapp_afor_qw_nb(IN  void                  *target_addr,
 
2033
                 IN  void                  *source_addr,
 
2034
                 IN  dmapp_seg_desc_t      *source_seg,
 
2035
                 IN  dmapp_pe_t            source_pe,
 
2036
                 IN  int64_t               operand,
 
2037
                 OUT dmapp_syncid_handle_t *syncid);
 
2038
 
 
2039
/* dmapp_afor_qw_nbi - Non-blocking implicit atomic FOR
 
2040
 *
 
2041
 * Parameters:
 
2042
 * IN  target_addr    Address of target buffer where result 
 
2043
 *                    is returned (qw only)
 
2044
 *     source_addr    Address of source buffer (qw only)
 
2045
 *     source_seg     Segment descriptor of source buffer
 
2046
 *     source_pe      Source PE
 
2047
 *     operand        Operand for the FOR
 
2048
 *
 
2049
 * Returns: 
 
2050
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
2051
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
2052
 * DMAPP_RC_ALIGNMENT_ERROR Target or source buffer not properly
 
2053
 *                          (Qword (8 byte)) aligned
 
2054
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
2055
 *                          due to insufficient resources; user should
 
2056
 *                          increase max_outstanding_nb or sync more often
 
2057
 */
 
2058
 
 
2059
extern dmapp_return_t 
 
2060
dmapp_afor_qw_nbi(IN  void             *target_addr,
 
2061
                  IN  void             *source_addr,
 
2062
                  IN  dmapp_seg_desc_t *source_seg,
 
2063
                  IN  dmapp_pe_t       source_pe,
 
2064
                  IN  int64_t          operand);
 
2065
 
 
2066
/* dmapp_afor_qw - Blocking atomic FOR
 
2067
 *
 
2068
 * Parameters:
 
2069
 * IN  target_addr    Address of target buffer where result 
 
2070
 *                    is returned (qw only)
 
2071
 *     source_addr    Address of source buffer (qw only)
 
2072
 *     source_seg     Segment descriptor of source buffer
 
2073
 *     source_pe      Source PE
 
2074
 *     operand        Operand for the FOR
 
2075
 *
 
2076
 * Returns: 
 
2077
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
2078
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
2079
 * DMAPP_RC_ALIGNMENT_ERROR Target or source buffer not properly
 
2080
 *                          (Qword (8 byte)) aligned
 
2081
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
2082
 *                          due to insufficient resources; user should
 
2083
 *                          increase max_outstanding_nb or sync more often
 
2084
 * DMAPP_RC_TRANSACTION_ERROR A transaction error has occured
 
2085
 */
 
2086
 
 
2087
extern dmapp_return_t 
 
2088
dmapp_afor_qw(IN  void             *target_addr,
 
2089
              IN  void             *source_addr,
 
2090
              IN  dmapp_seg_desc_t *source_seg,
 
2091
              IN  dmapp_pe_t       source_pe,
 
2092
              IN  int64_t          operand);
 
2093
 
 
2094
 
 
2095
 
 
2096
/* 
 
2097
 *  Two-Operand AMO RMA Functions 
 
2098
 */
 
2099
 
 
2100
/* A set of two-operand AMO functions is provided. Note that
 
2101
 * AMOs only operate on quad-word entities.
 
2102
 * For two-operand atomic functions with GET semantics (AFAX,
 
2103
 * ACSWAP) the source memory location must reside in an exported 
 
2104
 * memory segment of remote PE source_pe.
 
2105
 */
 
2106
 
 
2107
/* dmapp_afax_qw_nb - Non-blocking explicit atomic FAX
 
2108
 *
 
2109
 * Parameters:
 
2110
 * IN  target_addr    Address of target buffer where result 
 
2111
 *                    is returned (qw only)
 
2112
 *     source_addr    Address of source buffer (qw only)
 
2113
 *     source_seg     Segment descriptor of source buffer
 
2114
 *     source_pe      Source PE
 
2115
 *     andMask        mask for AND operation
 
2116
 *     xorMask        mask for XOR operation
 
2117
 * OUT syncid         Synchronization ID
 
2118
 *
 
2119
 * Returns: 
 
2120
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
2121
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
2122
 * DMAPP_RC_ALIGNMENT_ERROR Target or source buffer not properly 
 
2123
 *                          (Qword (8 byte)) aligned
 
2124
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
2125
 *                          due to insufficient resources; user should
 
2126
 *                          increase max_outstanding_nb or sync more often
 
2127
 */
 
2128
 
 
2129
extern dmapp_return_t 
 
2130
dmapp_afax_qw_nb(IN  void                  *target_addr,
 
2131
                 IN  void                  *source_addr,
 
2132
                 IN  dmapp_seg_desc_t      *source_seg,
 
2133
                 IN  dmapp_pe_t            source_pe,
 
2134
                 IN  int64_t               andMask,
 
2135
                 IN  int64_t               xorMask,
 
2136
                 OUT dmapp_syncid_handle_t *syncid);
 
2137
 
 
2138
/* dmapp_afax_qw_nbi - Non-blocking implicit atomic FAX
 
2139
 *
 
2140
 * Parameters:
 
2141
 * IN  target_addr    Address of target buffer where result 
 
2142
 *                    is returned (qw only)
 
2143
 *     source_addr    Address of source buffer (qw only)
 
2144
 *     source_seg     Segment descriptor of source buffer
 
2145
 *     source_pe      Source PE
 
2146
 *     andMask        mask for AND operation
 
2147
 *     xorMask        mask for XOR operation
 
2148
 *
 
2149
 * Returns: 
 
2150
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
2151
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
2152
 * DMAPP_RC_ALIGNMENT_ERROR Target or source buffer not properly
 
2153
 *                          (Qword (8 byte)) aligned
 
2154
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
2155
 *                          due to insufficient resources; user should
 
2156
 *                          increase max_outstanding_nb or sync more often
 
2157
 */
 
2158
 
 
2159
extern dmapp_return_t 
 
2160
dmapp_afax_qw_nbi(IN  void             *target_addr,
 
2161
                  IN  void             *source_addr,
 
2162
                  IN  dmapp_seg_desc_t *source_seg,
 
2163
                  IN  dmapp_pe_t       source_pe,
 
2164
                  IN  int64_t          andMask,
 
2165
                  IN  int64_t          xorMask);
 
2166
 
 
2167
/* dmapp_afax_qw - Blocking atomic FAX
 
2168
 *
 
2169
 * Parameters:
 
2170
 * IN  target_addr    Address of target buffer where result 
 
2171
 *                    is returned (qw only)
 
2172
 *     source_addr    Address of source buffer (qw only)
 
2173
 *     source_seg     Segment descriptor of source buffer
 
2174
 *     source_pe      Source PE
 
2175
 *     andMask        mask for AND operation
 
2176
 *     xorMask        mask for XOR operation
 
2177
 *
 
2178
 * Returns: 
 
2179
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
2180
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
2181
 * DMAPP_RC_ALIGNMENT_ERROR Target or source buffer not properly
 
2182
 *                          (Qword (8 byte)) aligned
 
2183
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
2184
 *                          due to insufficient resources; user should
 
2185
 *                          increase max_outstanding_nb or sync more often
 
2186
 * DMAPP_RC_TRANSACTION_ERROR A transaction error has occured
 
2187
 */
 
2188
 
 
2189
extern dmapp_return_t 
 
2190
dmapp_afax_qw(IN  void             *target_addr,
 
2191
              IN  void             *source_addr,
 
2192
              IN  dmapp_seg_desc_t *source_seg,
 
2193
              IN  dmapp_pe_t       source_pe,
 
2194
              IN  int64_t          andMask,
 
2195
              IN  int64_t          xorMask);
 
2196
 
 
2197
 
 
2198
/* dmapp_acswap_qw_nb - Non-blocking explicit atomic CSWAP
 
2199
 *
 
2200
 * Parameters:
 
2201
 * IN  target_addr    Address of target buffer where result 
 
2202
 *                    is returned (qw only)
 
2203
 *     source_addr    Address of source buffer (qw only)
 
2204
 *     source_seg     Segment descriptor of source buffer
 
2205
 *     source_pe      Source PE
 
2206
 *     comperand      Operand against which to compare
 
2207
 *     swaperand      Operand which to swap in
 
2208
 * OUT syncid         Synchronization ID
 
2209
 *
 
2210
 * Returns: 
 
2211
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
2212
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
2213
 * DMAPP_RC_ALIGNMENT_ERROR Target or source buffer not properly
 
2214
 *                          (Qword (8 byte)) aligned
 
2215
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
2216
 *                          due to insufficient resources; user should
 
2217
 *                          increase max_outstanding_nb or sync more often
 
2218
 */
 
2219
 
 
2220
extern dmapp_return_t 
 
2221
dmapp_acswap_qw_nb(IN  void                  *target_addr,
 
2222
                   IN  void                  *source_addr,
 
2223
                   IN  dmapp_seg_desc_t      *source_seg,
 
2224
                   IN  dmapp_pe_t            source_pe,
 
2225
                   IN  int64_t               comperand,
 
2226
                   IN  int64_t               swaperand,
 
2227
                   OUT dmapp_syncid_handle_t *syncid);
 
2228
 
 
2229
/* dmapp_acswap_qw_nbi - Non-blocking implicit atomic CSWAP
 
2230
 *
 
2231
 * Parameters:
 
2232
 * IN  target_addr    Address of target buffer where result 
 
2233
 *                    is returned (qw only)
 
2234
 *     source_addr    Address of source buffer (qw only)
 
2235
 *     source_seg     Segment descriptor of source buffer
 
2236
 *     source_pe      Source PE
 
2237
 *     comperand      Operand against which to compare
 
2238
 *     swaperand      Operand which to swap in
 
2239
 *
 
2240
 * Returns: 
 
2241
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
2242
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
2243
 * DMAPP_RC_ALIGNMENT_ERROR Target or source buffer not properly
 
2244
 *                          (Qword (8 byte)) aligned
 
2245
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
2246
 *                          due to insufficient resources; user should
 
2247
 *                          increase max_outstanding_nb or sync more often
 
2248
 */
 
2249
 
 
2250
extern dmapp_return_t 
 
2251
dmapp_acswap_qw_nbi(IN  void             *target_addr,
 
2252
                    IN  void             *source_addr,
 
2253
                    IN  dmapp_seg_desc_t *source_seg,
 
2254
                    IN  dmapp_pe_t       source_pe,
 
2255
                    IN  int64_t          comperand,
 
2256
                    IN  int64_t          swaperand);
 
2257
 
 
2258
/* dmapp_acswap_qw - Blocking atomic CSWAP
 
2259
 *
 
2260
 * Parameters:
 
2261
 * IN  target_addr    Address of target buffer where result 
 
2262
 *                    is returned (qw only)
 
2263
 *     source_addr    Address of source buffer (qw only)
 
2264
 *     source_seg     Segment descriptor of source buffer
 
2265
 *     source_pe      Source PE
 
2266
 *     comperand      Operand against which to compare
 
2267
 *     swaperand      Operand which to swap in
 
2268
 *
 
2269
 * Returns: 
 
2270
 * DMAPP_RC_SUCCESS         Operation completed successfully
 
2271
 * DMAPP_RC_INVALID_PARAM   One or more input parameters is invalid
 
2272
 * DMAPP_RC_ALIGNMENT_ERROR Target or source buffer not properly
 
2273
 *                          (Qword (8 byte)) aligned
 
2274
 * DMAPP_RC_NO_SPACE        The transaction request could not be completed
 
2275
 *                          due to insufficient resources; user should
 
2276
 *                          increase max_outstanding_nb or sync more often
 
2277
 * DMAPP_RC_TRANSACTION_ERROR A transaction error has occured
 
2278
 */
 
2279
 
 
2280
extern dmapp_return_t 
 
2281
dmapp_acswap_qw(IN  void             *target_addr,
 
2282
                IN  void             *source_addr,
 
2283
                IN  dmapp_seg_desc_t *source_seg,
 
2284
                IN  dmapp_pe_t       source_pe,
 
2285
                IN  int64_t          comperand,
 
2286
                IN  int64_t          swaperand);
 
2287
 
 
2288
 
 
2289
 
 
2290
/* 
 
2291
 *  Synchronization Functions
 
2292
 */
 
2293
 
 
2294
/* DMAPP applications use synchronization functions to determine
 
2295
 * when side-effects of locally initiated, non-blocking RMA requests
 
2296
 * are globally visible. A process can determine when side-effects
 
2297
 * of a non-blocking explicit RMA function are globally visible in
 
2298
 * the system using the following functions.
 
2299
 */
 
2300
 
 
2301
/* dmapp_syncid_test - Test syncid for completion
 
2302
 *
 
2303
 * Parameters:
 
2304
 * IN/OUT syncid Syncid to be tested for completion
 
2305
 * OUT    flag   Flag indicating global visibility
 
2306
 *
 
2307
 * Returns: 
 
2308
 * DMAPP_RC_SUCCESS           Operation completed successfully
 
2309
 * DMAPP_RC_INVALID_PARAM     One or more input parameters is invalid
 
2310
 * DMAPP_RC_TRANSACTION_ERROR The operation encountered a transaction error
 
2311
 * 
 
2312
 * Description:
 
2313
 * Sets *flag to 1 if the remote memory accesses associated with syncid
 
2314
 * are globally visible in the system. If the RMA request associated 
 
2315
 * with the syncid has not completed, *flag is set to 0.
 
2316
 */
 
2317
 
 
2318
extern dmapp_return_t 
 
2319
dmapp_syncid_test(INOUT dmapp_syncid_handle_t *syncid,
 
2320
                  OUT   int                 *flag);
 
2321
 
 
2322
/* dmapp_syncid_wait - Wait for completion of request associated with syncid
 
2323
 *
 
2324
 * Parameters:
 
2325
 * IN/OUT syncid Syncid to be tested for completion
 
2326
 *
 
2327
 * Returns: 
 
2328
 * DMAPP_RC_SUCCESS           Operation completed successfully
 
2329
 * DMAPP_RC_INVALID_PARAM     One or more input parameters is invalid
 
2330
 * DMAPP_RC_TRANSACTION_ERROR The operation encountered a transaction error
 
2331
 *
 
2332
 * Description:
 
2333
 * This is the blocking version of dmapp_syncid_test. The function
 
2334
 * only returns when all remote memory accesses associated with syncid
 
2335
 * are globally visible in the system.
 
2336
 */
 
2337
 
 
2338
extern dmapp_return_t 
 
2339
dmapp_syncid_wait(INOUT dmapp_syncid_handle_t *syncid);
 
2340
 
 
2341
 
 
2342
/* DMAPP applications use synchronization functions to determine
 
2343
 * when side-effects of locally initiated, non-blocking RMA requests
 
2344
 * are globally visible. A process can determine when side-effects
 
2345
 * of one or more non-blocking implicit RMA requests are globally
 
2346
 * visible in the system by using one of the following functions.
 
2347
 * Invoking gsync style functions does not free resources associated
 
2348
 * with non-blocking explicit RMA requests. dmapp_syncid_test or
 
2349
 * dmapp_syncid_wait must still be called for each previously issued
 
2350
 * non-blocking explicit RMA request in order to free up DMAPP internal
 
2351
 * resources.
 
2352
 */
 
2353
 
 
2354
/* dmapp_gsync_test - Test for completion of issued nb implicit requests
 
2355
 *
 
2356
 * Parameters:
 
2357
 * OUT flag   Flag indicating global visibility
 
2358
 *
 
2359
 * Returns: 
 
2360
 * DMAPP_RC_SUCCESS           Operation completed successfully
 
2361
 * DMAPP_RC_TRANSACTION_ERROR An operation encountered a transaction error
 
2362
 *
 
2363
 * Description:
 
2364
 * Sets *flag to 1 if remote memory accesses associated with previously
 
2365
 * issued non-blocking implicit RMA requests are globally visible in the 
 
2366
 * system. Otherwise, *flag is set to 0.
 
2367
 */
 
2368
 
 
2369
extern dmapp_return_t 
 
2370
dmapp_gsync_test(OUT int *flag);
 
2371
 
 
2372
/* dmapp_gsync_wait - Wait for completion of issued nb implicit requests
 
2373
 *
 
2374
 * Returns: 
 
2375
 * DMAPP_RC_SUCCESS           Operation completed successfully
 
2376
 * DMAPP_RC_TRANSACTION_ERROR An operation encountered a transaction error
 
2377
 *
 
2378
 * Description:
 
2379
 * This is the blocking version of dmapp_gsync_test. The function
 
2380
 * only returns when all remote memory accesses associated with 
 
2381
 * previously isused non-blocking implicit RMA requests are globally 
 
2382
 * visible in the system.
 
2383
 */
 
2384
 
 
2385
extern dmapp_return_t 
 
2386
dmapp_gsync_wait(void);
 
2387
 
 
2388
 
 
2389
 
 
2390
/*
 
2391
 * Symmetric Heap Functions
 
2392
 */
 
2393
 
 
2394
/* Allocate size bytes of memory from the symmetric heap. The space 
 
2395
 * returned is left uninitialized. It cannot be assume that the memory
 
2396
 * returned is zeroed out. There are no address equality guarantees 
 
2397
 * across ranks.
 
2398
 */
 
2399
 
 
2400
extern void *
 
2401
dmapp_sheap_malloc(IN size_t size);
 
2402
 
 
2403
/* The dmapp_sheap_malloc function changes the size of the block to which 
 
2404
 * ptr points to the size (in bytes) specified by size. The contents of the 
 
2405
 * block are unchanged up to the lesser of the new and old sizes. If the 
 
2406
 * new size is larger, the value of the newly allocated portion of the block 
 
2407
 * is indeterminate. If ptr is a null pointer, dmapp_sheap_malloc behaves 
 
2408
 * like dmapp_sheap_malloc for the specified size. If size is 0 and ptr is 
 
2409
 * not a null pointer, the block to which it points is freed. Otherwise, if 
 
2410
 * ptr does not match a pointer earlier returned by a symmetric heap function, 
 
2411
 * or if the space has already been deallocated, dmapp_sheap_realloc returns 
 
2412
 * a null pointer. If the space cannot be allocated, the block to which ptr 
 
2413
 * points is unchanged.
 
2414
 */
 
2415
 
 
2416
extern void *
 
2417
dmapp_sheap_realloc(IN void   *ptr, 
 
2418
                    IN size_t size);
 
2419
 
 
2420
/* Free a block allocated by dmapp_sheap_malloc, dmapp_sheap_realloc. */
 
2421
 
 
2422
extern void 
 
2423
dmapp_sheap_free(IN void *ptr);
 
2424
 
 
2425
 
 
2426
/*
 
2427
 * Memory Registration Functions.
 
2428
 */
 
2429
 
 
2430
/* dmapp_mem_register - Register memory other than the statically linked
 
2431
 * data segment or the symmetric heap on the fly with the NIC.
 
2432
 *
 
2433
 * Parameters:
 
2434
 * IN    addr      Starting address of the memory region to be registered.
 
2435
 *                 Must be non-NULL
 
2436
 * IN    length    Length of the memory region in bytes. Must be > 0
 
2437
 * INOUT seg_desc  Pointer to segment descriptor.
 
2438
 *                 Must be non-NULL
 
2439
 *
 
2440
 * Returns:
 
2441
 * DMAPP_RC_SUCCESS   Upon success
 
2442
 *
 
2443
 * Description:
 
2444
 * The memory region described by starting address addr and length 
 
2445
 * length is registered with the NIC on the fly. The content of the
 
2446
 * segment descriptor is updated to reflect actual starting address
 
2447
 * and length of the region which was registered. These values can
 
2448
 * differ from the input values due to, for instance, rounding.
 
2449
 */
 
2450
 
 
2451
extern dmapp_return_t
 
2452
dmapp_mem_register(IN    void             *addr, 
 
2453
                   IN    uint64_t         length,
 
2454
                   INOUT dmapp_seg_desc_t *seg_desc);
 
2455
 
 
2456
 
 
2457
/* dmapp_mem_unregister - Unregister memory other than the statically linked
 
2458
 * data segment or the symmetric heap on the fly from the NIC. 
 
2459
 *
 
2460
 * Parameters:
 
2461
 * IN seg_desc   Pointer to segment descriptor for the region to be unregistered.
 
2462
 *
 
2463
 * Returns:
 
2464
 * DMAPP_RC_SUCCESS   Upon success
 
2465
 *
 
2466
 * Description:
 
2467
 * The memory region described by the segment descriptor will be deregistered
 
2468
 * from the NIC. The memory region must previously have been registered via
 
2469
 * a call to dmapp_mem_register.
 
2470
 */
 
2471
 
 
2472
extern dmapp_return_t
 
2473
dmapp_mem_unregister(INOUT dmapp_seg_desc_t *seg_desc);
 
2474
 
 
2475
 
 
2476
/* dmapp_segdesc_compare - Compares two segment descriptors.
 
2477
 *
 
2478
 * Parameters:
 
2479
 * IN    seg_desc1 Pointer to one segment descriptor.
 
2480
 * IN    seg_desc1 Pointer to second segment descriptor.
 
2481
 * INOUT flag      Pointer to int
 
2482
 *
 
2483
 * Returns:
 
2484
 * DMAPP_RC_SUCCESS if successfuly
 
2485
 * In this case, content of flag will be set to 1 if segment descriptors
 
2486
 * are the same. If they are different, content of flag will be set to zero.
 
2487
 *
 
2488
 * Description:
 
2489
 * The function compares two segment descriptors. If they describe
 
2490
 * the same memory region, 1 is returned in the flag. If they describe
 
2491
 * different memory regions, 0 is returned in the flag.
 
2492
 */
 
2493
 
 
2494
extern dmapp_return_t
 
2495
dmapp_segdesc_compare(IN    dmapp_seg_desc_t *seg_desc1,
 
2496
                      IN    dmapp_seg_desc_t *seg_desc2,
 
2497
                      INOUT int              *flag);
 
2498
 
 
2499
 
 
2500
/* dmapp_checkpoint - DMAPP checkpoint function
 
2501
 *
 
2502
 * Parameters: None
 
2503
 *
 
2504
 * Returns:
 
2505
 * DMAPP_RC_SUCCESS   Upon success
 
2506
 * DMAPP_RC_NOT_DONE  Upper-level software has not quieced the network
 
2507
 *
 
2508
 * Description:
 
2509
 * This function destroys GNI resources and DMAPP internal resources
 
2510
 * that cannot be checkpointed. This is a checkpoint-restart specific
 
2511
 * function and should not be called outside of that feature.
 
2512
 * In a threaded environment, this function should only be called once
 
2513
 * per process.
 
2514
 */
 
2515
 
 
2516
extern dmapp_return_t
 
2517
dmapp_checkpoint(void);
 
2518
 
 
2519
 
 
2520
/* dmapp_restart - DMAPP restart function
 
2521
 *
 
2522
 * Parameters:
 
2523
 * IN    restart_modes
 
2524
 *
 
2525
 * Returns:
 
2526
 * DMAPP_RC_SUCCESS   Upon success
 
2527
 *
 
2528
 * Description:
 
2529
 * This function will reinitialize GNI resources and DMAPP internal
 
2530
 * resources which could not be checkpointed. This is a checkpoint-restart
 
2531
 * specific function and should not be called outside of that feature.
 
2532
 * In a threaded environment, this function should only be called once
 
2533
 * per process.
 
2534
 */
 
2535
 
 
2536
extern dmapp_return_t
 
2537
dmapp_restart(IN uint32_t restart_modes);
 
2538
 
 
2539
 
 
2540
/* dmapp_register_process_cb - Register a progress callback function which DMAPP
 
2541
 *
 
2542
 * Parameters:
 
2543
 * IN progress_cb  Callback function to be registered with DMAPP
 
2544
 * IN data         Pointer to optional data supplied as an argument
 
2545
 *                 to the callback function.  Can be NULL.
 
2546
 *
 
2547
 * Returns:
 
2548
 * DMAPP_RC_SUCCESS           Operation completed successfully
 
2549
 * DMAPP_RC_INVALID_PARAM     One or more input parameters is invalid
 
2550
 * DMAPP_RC_NO_SPACE          Too many callback functions already registered
 
2551
 *
 
2552
 * Description:
 
2553
 * This function provides a means for software with special progress
 
2554
 * requirements to be able to use DMAPP even when invoking DMAPP calls
 
2555
 * which may block internally within DMAPP, e.g. dmapp_get.
 
2556
 *
 
2557
 * A progress callback function should return 0 upon success, -1 upon
 
2558
 * failure.
 
2559
 */
 
2560
 
 
2561
extern dmapp_return_t
 
2562
dmapp_register_progress_cb(IN int (*progress_cb)(void *),IN void *data);
 
2563
 
 
2564
 
 
2565
/* dmapp_deregister_process_cb - Deregisters a progress callback function which DMAPP
 
2566
 *                               which had previously been registered using
 
2567
 *                               dmapp_register_progress_cb
 
2568
 * 
 
2569
 * Parameters:
 
2570
 * IN progress_cb  Callback function to be deregistered
 
2571
 * 
 
2572
 * Returns:
 
2573
 * DMAPP_RC_SUCCESS           Operation completed successfully
 
2574
 * DMAPP_RC_INVALID_PARAM     One or more input parameters is invalid
 
2575
 * DMAPP_RC_NOT_FOUND         Supplied callback was not found in callback list
 
2576
 *
 
2577
 * Description:
 
2578
 * Deregisters a progress callback function which had previously been
 
2579
 * registered with DMAPP.
 
2580
 */
 
2581
 
 
2582
extern dmapp_return_t
 
2583
dmapp_deregister_progress_cb(IN int (*progress_cb)(void *));
 
2584
 
 
2585
/* dmapp_c_pset_create - Create a pset(processs set) to use with DMAPP collective
 
2586
 *                       operations
 
2587
 * 
 
2588
 * Parameters:
 
2589
 * IN pdesc        Pointer to a dmapp_c_pset_desc_t structure 
 
2590
 *                 previously initialized to describe the ranks
 
2591
 *                 contained in the pset
 
2592
 * IN identifier   Unique, non-zero 64-bit identifier to be associated with
 
2593
 *                 this pset.  The same value must be supplied by
 
2594
 *                 all ranks creating the pset.
 
2595
 * IN modes        Used to specify additional information about the
 
2596
 *                 pset.  
 
2597
 * IN attrs        Pointer to a previously initialized attribute structure.
 
2598
 *                 Can be NULL.
 
2599
 * OUT pset        Pointer to an opaque dmapp_c_pset_handle_t structure 
 
2600
 *                 to be used for subsequent DMAPP collective calls.
 
2601
 *
 
2602
 * Returns:
 
2603
 * DMAPP_RC_SUCCESS           Operation completed successfully
 
2604
 * DMAPP_RC_INVALID_PARAM     One or more input parameters is invalid
 
2605
 * DMAPP_RC_NO_SPACE          Too many psets have already been created
 
2606
 * DMAPP_RC_BUSY              The supplied identifier is already in use
 
2607
 * 
 
2608
 * Description:
 
2609
 * This is a purely local function which is used to delimit ranks to be
 
2610
 * involved in particular collective operations. This must be done by all ranks
 
2611
 * in the job which are going to be used in the collective operations involving
 
2612
 * the pset. All ranks must provide the same unique idenitifier value to
 
2613
 * be associated with the pset.  It is an error for ranks not enumerated in
 
2614
 * the pdesc to call this function.  DMAPP_RC_INVALID_PARAM will be returned
 
2615
 * in this case.
 
2616
 *
 
2617
 * Note:
 
2618
 * For psets that are to be used for concatentate operations (dmapp_c_concat_start)
 
2619
 * the DMAPP_C_PSET_MODE_CONCAT mode bit must be set in the mode argument.
 
2620
 *
 
2621
 * Space pointed to by the pdesc and attrs parameters can be reused upon
 
2622
 * return from this function.
 
2623
 * 
 
2624
 */
 
2625
 
 
2626
extern dmapp_return_t 
 
2627
dmapp_c_pset_create(IN dmapp_c_pset_desc_t *pdesc, 
 
2628
                    IN uint64_t identifier,
 
2629
                    IN uint64_t modes,
 
2630
                    IN dmapp_c_pset_attrs_t *attrs,
 
2631
                    OUT dmapp_c_pset_handle_t *pset_hndl);
 
2632
 
 
2633
 
 
2634
/* dmapp_c_pset_export - Export a pset in preparation for use with DMAPP collective
 
2635
 *                       operations
 
2636
 *
 
2637
 * Parameters:
 
2638
 * IN pset_hndl   The dmapp_c_pset_handle_t structure previously
 
2639
 *                returned by a call to dmapp_c_pset_create
 
2640
 *
 
2641
 * Returns:
 
2642
 * DMAPP_RC_SUCCESS           Operation completed successfully
 
2643
 * DMAPP_RC_INVALID_PARAM     One or more input parameters is invalid
 
2644
 * DMAPP_RC_NOT_FOUND         One or more of the input ranks described
 
2645
 *                            by the pset has not invoked dmapp_c_pset_create
 
2646
 *                            for the pset associated with the identifier
 
2647
 *                            supplied in the local dmapp_c_pset_create function
 
2648
 *                            that returned this pset handle
 
2649
 *
 
2650
 * Description:
 
2651
 * Before being used for DMAPP collective operations, the pset must be exported
 
2652
 * using this function. The application must use some out-of-band synchronization mechanism
 
2653
 * after calling dmapp_c_pset_create and before invoking this function.  Without
 
2654
 * this out-of-band synchronization, there is a high probability that for one or
 
2655
 * more ranks, this function will return DMAPP_RC_NOT_FOUND.
 
2656
 *
 
2657
 * Notes:
 
2658
 * This may be a heavy-weight operation and should not be invoked frequently
 
2659
 * by the application.   This is not a synchronizing function.
 
2660
 *
 
2661
 */
 
2662
 
 
2663
extern dmapp_return_t dmapp_c_pset_export(IN dmapp_c_pset_handle_t pset_hndl);
 
2664
 
 
2665
/* dmapp_c_pset_destroy -  Destroy a pset in previously created using
 
2666
 *                         dmapp_c_pset_create
 
2667
 *
 
2668
 * Parameters:
 
2669
 * IN pset_hndl   The dmapp_c_pset_handle_t structure previously
 
2670
 *                returned by a call to dmapp_c_pset_create
 
2671
 *
 
2672
 * Returns:
 
2673
 * DMAPP_RC_SUCCESS           Operation completed successfully
 
2674
 * DMAPP_RC_INVALID_PARAM     Input handle is invalid
 
2675
 * DMAPP_RC_BUSY              The handle is currently in use for
 
2676
 *                            a collective operation
 
2677
 *
 
2678
 * Description:
 
2679
 * This function frees any dmapp internal resources associated with the pset.
 
2680
 * The pset handle cannot be used for any susbsequent DMAPP collective calls.
 
2681
 * DMAPP_RC_BUSY is returned if either the pset is still involved in a
 
2682
 * collective operation, or there are outstanding network transactions
 
2683
 * associated with previous collective operations on the pset.
 
2684
 * In such cases, an application can invoke this function at a later
 
2685
 * time to insure resources are released.
 
2686
 *
 
2687
 * Notes:
 
2688
 * This can be considered a local operation.  This is not an explicitly
 
2689
 * synchronizing function.
 
2690
 *
 
2691
 */
 
2692
 
 
2693
extern dmapp_return_t dmapp_c_pset_destroy(IN dmapp_c_pset_handle_t pset_hndl);
 
2694
 
 
2695
/* dmapp_c_barrier_join -  Initiate a barrier join operation on a pset
 
2696
 *
 
2697
 * Parameters:
 
2698
 * IN pset_hndl            The dmapp_c_pset_handle_t structure from a previously
 
2699
 *                         exported pset
 
2700
 *
 
2701
 * Returns:
 
2702
 * DMAPP_RC_SUCCESS           The join operation completed successfully
 
2703
 * DMAPP_RC_INVALID_PARAM     Input handle is invalid
 
2704
 * DMAPP_RC_BUSY              The handle is currently in use for
 
2705
 *                            another collective operation
 
2706
 *
 
2707
 * Description:
 
2708
 * This function initiates a barrier join operation on a previously
 
2709
 * exported pset.  A successful return from this operation only means
 
2710
 * the barrier operation is proceeding, not that it is complete.
 
2711
 * A return value of DMAPP_RC_BUSY indicates the pset is currently
 
2712
 * in use for another collective operation.
 
2713
 *
 
2714
 */
 
2715
 
 
2716
extern dmapp_return_t dmapp_c_barrier_join(IN dmapp_c_pset_handle_t pset_hndl);
 
2717
 
 
2718
/* dmapp_c_greduce_start -  Initiate a global reduction operation over the pset.
 
2719
 *
 
2720
 * Parameters:
 
2721
 * IN pset_hndl            The dmapp_c_pset_handle_t structure from a previously
 
2722
 *                         exported pset
 
2723
 * IN in                   Pointer to buffer containing this PE's contribution
 
2724
 *                         to the global reduction over the pset
 
2725
 * OUT out                 Pointer to buffer where the result of the global reduction
 
2726
 *                         operation is to be returned
 
2727
 * IN nelems               Number of elements in the global operation  
 
2728
 *
 
2729
 * IN type                 Data type of the elements in the global operation
 
2730
 *
 
2731
 * IN op                   Type of global reduction operation
 
2732
 *
 
2733
 * Returns:
 
2734
 * DMAPP_RC_SUCCESS           The operation was successfully initiated
 
2735
 * DMAPP_RC_INVALID_PARAM     One or more input arguments is invalid
 
2736
 * DMAPP_RC_BUSY              The handle is currently in use for
 
2737
 *                            another collective operation
 
2738
 *
 
2739
 * Description:
 
2740
 * This function initiates a global reduction operation on a previously
 
2741
 * exported pset.  A successful return from this operation only means
 
2742
 * the operation is proceeding, not that it is complete.
 
2743
 * A return value of DMAPP_RC_BUSY indicates the pset is currently
 
2744
 * in use for another collective operation.
 
2745
 *
 
2746
 * Notes:
 
2747
 * The number of elements specified in the nelems argument cannot exceed
 
2748
 * the value returned by dmapp_c_greduce_nelems_max for the given
 
2749
 * data type and operation type.
 
2750
 */
 
2751
 
 
2752
extern dmapp_return_t dmapp_c_greduce_start(IN dmapp_c_pset_handle_t pset,
 
2753
                                            IN void *in,
 
2754
                                            OUT void *out, 
 
2755
                                            IN uint32_t nelems,
 
2756
                                            IN dmapp_c_type_t type, 
 
2757
                                            IN dmapp_c_op_t op);
 
2758
 
 
2759
/* dmapp_c_greduce_nelems_max -  Return the maximum number of elements of a given
 
2760
 *                               data type which can be used for a single global
 
2761
 *                               reduction operation
 
2762
 *
 
2763
 * Parameters:
 
2764
 * IN type                 Data type of the element to be used in a global operation
 
2765
 * OUT nelems_max          Maximum number of elements of the supplied data type
 
2766
 *                         which can be used for a single global reduction operation
 
2767
 *
 
2768
 * Returns:
 
2769
 * DMAPP_RC_SUCCESS           The operation was successfully initiated
 
2770
 * DMAPP_RC_INVALID_PARAM     One or more input arguments is invalid
 
2771
 *
 
2772
 * Description:
 
2773
 * This utility function can be used to determine the maximum number of
 
2774
 * elements of a given data type which can be used for a single global
 
2775
 * reduction operation
 
2776
 *
 
2777
 * Notes:
 
2778
 * This function can be used before dmapp_init or other dmapp initialization
 
2779
 * call is made.
 
2780
 */
 
2781
 
 
2782
extern dmapp_return_t dmapp_c_greduce_nelems_max(IN dmapp_c_type_t type, 
 
2783
                                                 OUT uint32_t *nelems_max);
 
2784
 
 
2785
/* dmapp_c_pset_test - Test for completion of a collective operation
 
2786
 *                     for a given pset
 
2787
 *
 
2788
 * Parameters:
 
2789
 * IN pset_hndl        The dmapp_c_pset_handle_t structure for which
 
2790
 *                     a collective operation has been initiated.
 
2791
 *
 
2792
 * Returns:
 
2793
 * DMAPP_RC_SUCCESS           Collective operation completed successfully
 
2794
 * DMAPP_RC_INVALID_PARAM     One or more input parameters is invalid
 
2795
 * DMAPP_RC_NOT_DONE          Collective operation has not completed
 
2796
 * DMAPP_RC_TRANSACTION_ERROR An unrecoverable network error was encountered
 
2797
 *
 
2798
 * Description:
 
2799
 * This function can be used to test in a non-blocking manner for completion
 
2800
 * of an outstanding collective operation for the given pset.
 
2801
 *
 
2802
 */
 
2803
 
 
2804
extern dmapp_return_t dmapp_c_pset_test(IN dmapp_c_pset_handle_t pset_hndl);
 
2805
 
 
2806
/* dmapp_c_pset_wait - Wait for completion of a collective operation
 
2807
 *                     for a given pset
 
2808
 *
 
2809
 * Parameters:
 
2810
 * IN pset_hndl        The dmapp_c_pset_handle_t structure for which
 
2811
 *                     a collective operation has been initiated.
 
2812
 *
 
2813
 * Returns:
 
2814
 * DMAPP_RC_SUCCESS           Collective operation completed successfully
 
2815
 * DMAPP_RC_INVALID_PARAM     One or more input parameters is invalid
 
2816
 * DMAPP_RC_NOT_DONE          Collective operation has not completed
 
2817
 * DMAPP_RC_TRANSACTION_ERROR An unrecoverable network error was encountered
 
2818
 *
 
2819
 * Description:
 
2820
 * This function is the blocking equivalent of dmapp_c_pset_test.
 
2821
 */
 
2822
 
 
2823
extern dmapp_return_t dmapp_c_pset_wait(IN dmapp_c_pset_handle_t pset_hndl);
 
2824
 
 
2825
/* dmapp_c_pset_cancel_op - Cancel an outstanding collective operation on a pset
 
2826
 *
 
2827
 * Parameters:
 
2828
 * IN pset_hndl   The dmapp_c_pset_handle_t structure previously
 
2829
 *                returned by a call to dmapp_c_pset_create
 
2830
 *
 
2831
 * Returns:
 
2832
 * DMAPP_RC_SUCCESS           Operation completed successfully
 
2833
 * DMAPP_RC_INVALID_PARAM     Input handle is invalid
 
2834
 *
 
2835
 * Description:
 
2836
 * This function cancels an outstanding collective operation on a given
 
2837
 * pset.
 
2838
 *
 
2839
 * Notes:
 
2840
 * The action of this function is purely local.  Successful return
 
2841
 * from this function only means that any local DMAPP internal resources
 
2842
 * associated with the outstanding operation have been released.
 
2843
 * This function is a no-op if there is no outstanding collective
 
2844
 * operation on the pset. Once an operation on a pset has been cancelled,
 
2845
 * the pset cannot be used for any further collective operations.  The
 
2846
 * only allowed operation on the pset after cancellation is to destroy
 
2847
 * the pset.
 
2848
 *
 
2849
 */
 
2850
 
 
2851
dmapp_return_t dmapp_c_pset_cancel_op(IN dmapp_c_pset_handle_t pset_hndl);
 
2852
 
 
2853
#ifdef __cplusplus
 
2854
} /* extern "C" */
 
2855
#endif
 
2856
 
 
2857
#endif /* dmapp.h */