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

« back to all changes in this revision

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

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

[ Daniel Leidert ]
* debian/watch: Fixed.

[ Andreas Tille ]
* debian/upstream: References

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

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* begin_generated_IBM_copyright_prolog                             */
2
 
/*                                                                  */
3
 
/* --------------------------------------------------------------   */
4
 
/* (C)Copyright IBM Corp. 2007, 2008                                */
5
 
/* IBM BSD License.                                                 */
6
 
/* --------------------------------------------------------------   */
7
 
/* end_generated_IBM_copyright_prolog                               */
8
 
/********************************************************************/
9
 
 
10
 
/* $Id: bgml.h 6904 2010-09-16 18:55:57Z manoj $ */
11
 
 
12
 
/*!
13
 
 * \file bgml.h
14
 
 * \brief Common external message layer interface.
15
 
 */
16
 
#ifndef __bgml_h__
17
 
#define __bgml_h__
18
 
 
19
 
#if HAVE_STDINT_H
20
 
#   include <stdint.h>
21
 
#endif
22
 
 
23
 
#ifdef __cplusplus
24
 
extern "C"
25
 
{
26
 
#endif
27
 
 
28
 
  /**
29
 
   * \brief Message layer operation types
30
 
   */
31
 
 
32
 
  typedef enum
33
 
  {
34
 
    BGML_UNDEFINED_OP = -1,
35
 
    BGML_NOOP,
36
 
    BGML_MAX,
37
 
    BGML_MIN,
38
 
    BGML_SUM,
39
 
    BGML_PROD,
40
 
    BGML_LAND,
41
 
    BGML_LOR,
42
 
    BGML_LXOR,
43
 
    BGML_BAND,
44
 
    BGML_BOR,
45
 
    BGML_BXOR,
46
 
    BGML_MAXLOC,
47
 
    BGML_MINLOC,
48
 
    BGML_OP_COUNT
49
 
  }
50
 
  BGML_Op;
51
 
 
52
 
  /**
53
 
   * \brief Message layer data types
54
 
   */
55
 
 
56
 
  typedef enum
57
 
  {
58
 
    /* Standard/Primative DT's */
59
 
    BGML_UNDEFINED_DT = -1,
60
 
    BGML_SIGNED_CHAR,
61
 
    BGML_UNSIGNED_CHAR,
62
 
    BGML_SIGNED_SHORT,
63
 
    BGML_UNSIGNED_SHORT,
64
 
    BGML_SIGNED_INT,
65
 
    BGML_UNSIGNED_INT,
66
 
    BGML_SIGNED_LONG,
67
 
    BGML_UNSIGNED_LONG,
68
 
    BGML_FLOAT,
69
 
    BGML_DOUBLE,
70
 
    BGML_LONG_DOUBLE,
71
 
    BGML_LOGICAL,
72
 
    BGML_SINGLE_COMPLEX,
73
 
    BGML_DOUBLE_COMPLEX,
74
 
    /* Max/Minloc DT's */
75
 
    BGML_2INT,
76
 
    BGML_SHORT_INT,
77
 
    BGML_FLOAT_INT,
78
 
    BGML_DOUBLE_INT,
79
 
    BGML_2REAL,
80
 
    BGML_2DOUBLE_PRECISION,
81
 
    BGML_DT_COUNT
82
 
  }
83
 
  BGML_Dt;
84
 
 
85
 
  /* ********************************************************************* */
86
 
  /*                                                                       */
87
 
  /*               Generic: messager object                                */
88
 
  /*                                                                       */
89
 
  /* ********************************************************************* */
90
 
 
91
 
  /**
92
 
   * \brief Common BlueGene quad datatype (4 words, 16 bytes)
93
 
   */
94
 
 
95
 
  typedef struct
96
 
  {
97
 
    unsigned w0; /**< Word[0] */
98
 
    unsigned w1; /**< Word[1] */
99
 
    unsigned w2; /**< Word[2] */
100
 
    unsigned w3; /**< Word[3] */
101
 
  }
102
 
  BGQuad __attribute__ ((__aligned__ (16)));
103
 
 
104
 
  /**
105
 
   * \brief completion callback information descriptor. Mostly used to
106
 
   * signal completion of a particular operation to the world outside
107
 
   * the messaging library.
108
 
   */
109
 
 
110
 
  typedef struct BGML_Callback_t
111
 
  {
112
 
    void (*function) (void *);          /**< actual function to call */
113
 
    void *clientdata;                   /**< argument to function */
114
 
  }
115
 
  BGML_Callback_t;
116
 
 
117
 
  /**
118
 
   * \brief Initialize messager singleton. Not thread safe. This
119
 
   * function can be called multiple times.
120
 
   * \return 1 when called the first time; 0 for every subsequent call.
121
 
   */
122
 
 
123
 
  unsigned BGML_Messager_Init ();
124
 
 
125
 
  /**
126
 
   * \brief Finalize messager singleton. Not thread safe. This
127
 
   * function can be called multiple times.
128
 
   * \return 1 when called the first time; 0 for every subsequent call.
129
 
   */
130
 
 
131
 
  unsigned BGML_Messager_Finalize ();
132
 
 
133
 
  /*!
134
 
   * \brief Enter a critical section
135
 
   */
136
 
  
137
 
  inline void BGML_CriticalSection_enter ();
138
 
 
139
 
  /*!
140
 
   * \brief Exit a critical section
141
 
   */
142
 
  
143
 
  inline void BGML_CriticalSection_exit ();
144
 
  
145
 
  /** \brief Messager advance loop. Thread safe. */
146
 
 
147
 
  unsigned BGML_Messager_advance ();
148
 
 
149
 
  /** \brief return linear rank of current node. Reentrant. */
150
 
 
151
 
  unsigned BGML_Messager_rank ();
152
 
 
153
 
  /** \brief return number of processors running current job. Reentrant. */
154
 
 
155
 
  unsigned BGML_Messager_size ();
156
 
 
157
 
  /*! \brief return the geometry of the block. */
158
 
  void BGML_Messager_geometry (unsigned *x, unsigned *y, unsigned *z);
159
 
 
160
 
  /**
161
 
   * \brief map a torus coordinate to a linear rank. Thread safe.
162
 
   * \param x: torus x coordinate
163
 
   * \param y: torus y coordinate
164
 
   * \param z: torus z coordinate
165
 
   * \param t: torus t coordinate
166
 
   * \returns: linear rank or -1 if node (x,y,z,t) is not part of current job
167
 
   */
168
 
 
169
 
  int BGML_Messager_torus2rank (int x, int y, int z, int t);
170
 
 
171
 
  /**
172
 
   * \brief find torus coordinates for a linear rank. Thread safe.
173
 
   * \param rank: linear rank of a node
174
 
   * \param x: returns torus x coordinate of node
175
 
   * \param y: returns torus y coordinate of node
176
 
   * \param z: returns torus z coordinate of node
177
 
   * \param t: returns torus t coordinate of node
178
 
   * \returns 0 if successful; -1 if rank parameter outside of acceptable
179
 
   * range.
180
 
   */
181
 
 
182
 
  int BGML_Messager_rank2torus (int rank, int *x, int *y, int *z, int *t);
183
 
 
184
 
#define     BGML_MESSAGER_VNMODE 0      /**< virtual node mode */
185
 
#define     BGML_MESSAGER_SMMODE 1      /**< shared memory mode */
186
 
#define     BGML_MESSAGER_CPMODE 2      /**< non-coherent coprocessor mode */
187
 
 
188
 
  /**
189
 
   * \brief This should provide information about whether we
190
 
   * are in shared memory/coprocessor mode or virtual node mode
191
 
   * \todo incomplete!!!
192
 
   */
193
 
 
194
 
  int BGML_Messager_mode ();
195
 
 
196
 
#define     BGML_MESSAGER_2S       1   /**< two-sided (MPI) communication */
197
 
#define     BGML_MESSAGER_1S       2   /**< one-sided communication */
198
 
#define     BGML_MESSAGER_TR       4   /**< torus collectives */
199
 
#define     BGML_MESSAGER_TSC      8   /**< torus collectives */
200
 
#define     BGML_MESSAGER_TSRC    16   /**< rectangular torus collectives */
201
 
#define     BGML_MESSAGER_GI      32   /**< global interrupt barrier */
202
 
 
203
 
  /**
204
 
   * \brief Provides list of available subsets in messaging library.
205
 
   * \return a bit mask of available subsystems.
206
 
   */
207
 
 
208
 
  unsigned long long BGML_Messager_available ();
209
 
 
210
 
  /* ********************************************************************* */
211
 
  /*                                                                       */
212
 
  /*  2-sided point-to-point communication: callbacks & initialization     */
213
 
  /*                                                                       */
214
 
  /* ********************************************************************* */
215
 
 
216
 
  /**
217
 
   * \brief Opaque data type that holds all 2-sided message requests
218
 
   * (send & receive).  We allocate 0.5 KBytes of space to hold the
219
 
   * send/receive object's state.  The external API does not reveal the
220
 
   * internal structure of the object. Implementations should verify
221
 
   * that send and receive objects need less space than sizeof(BG_2S_t).
222
 
   */
223
 
 
224
 
  typedef BGQuad BG2S_t[32];
225
 
 
226
 
  /**
227
 
   * \brief Pointer to the 2-sided message opaque data type.
228
 
   */
229
 
 
230
 
  typedef BG2S_t *BG2S_p;
231
 
 
232
 
  /**
233
 
   * \brief callback invoked when a long message arrives to destination.
234
 
   */
235
 
 
236
 
  typedef
237
 
    BG2S_t *(*cb_BG2S_Recv) (const BGQuad * msginfo,
238
 
                             unsigned senderrank,
239
 
                             const unsigned sndlen,
240
 
                             unsigned *rcvlen,
241
 
                             char **rcvbuf, BGML_Callback_t * const cb_info);
242
 
 
243
 
  /**
244
 
   * \brief callback invoked when a short message arrives to destination.
245
 
   */
246
 
 
247
 
  typedef
248
 
    void (*cb_BG2S_RecvShort) (const BGQuad * msginfo,
249
 
                               unsigned senderrank,
250
 
                               const char *sndbuf, const unsigned sndlen);
251
 
 
252
 
  /**
253
 
   * \brief callback invoked when a control message arrives to destination.
254
 
   */
255
 
 
256
 
  typedef
257
 
    void (*cb_BG2S_Control) (unsigned senderrank,
258
 
                             const char *sndbuf, const unsigned sndlen);
259
 
 
260
 
 
261
 
  /**
262
 
   *  \brief Initialize 2-sided communication. Cannot send 2-sided messages
263
 
   * before this function has been invoked. Not thread safe.
264
 
   * \param cb_recvshort: callback invoked for short messages
265
 
   * \param cb_recvlong: callback invoked for long messages
266
 
   * \param cb_control: callback invoked for control messages
267
 
   * !!! open question: should we allocate explicit space for the protocols?
268
 
   */
269
 
 
270
 
  void BG2S_Configure (cb_BG2S_RecvShort cb_recvshort,
271
 
                       cb_BG2S_Recv cb_recvlong, cb_BG2S_Control cb_control);
272
 
 
273
 
  /* ********************************************************************* */
274
 
  /*                                                                       */
275
 
  /*  2-sided point-to-point communication: message sending primitives     */
276
 
  /*                                                                       */
277
 
  /* ********************************************************************* */
278
 
 
279
 
  /**
280
 
   * \brief Send a message. Thread safe if invoked on different
281
 
   * messages. Until the send invokes the callback, it is illegal to
282
 
   * send it again, reset it or touch the attached send buffer.
283
 
   *
284
 
   * \param request: place to keep per-message information, such as
285
 
   * location in send queue, how many bytes have been sent etc.
286
 
   * \param cb_info: function to call when send is *locally* complete
287
 
   * \param msginfo: a "quad" of (to messager, opaque) MPI header information.
288
 
   * \param sndbuf: send data buffer.
289
 
   * \param sndlen: send data length (in bytes).
290
 
   * \param destrank: destination rank.
291
 
   */
292
 
 
293
 
  void BG2S_Send (BG2S_t * request,
294
 
                  const BGML_Callback_t * cb_info,
295
 
                  const BGQuad * msginfo,
296
 
                  const char *sndbuf, unsigned sndlen, unsigned destrank);
297
 
 
298
 
  /**
299
 
   * \brief Create a send request that can be sent later. Reentrant.
300
 
   */
301
 
 
302
 
  void BG2S_Create (BG2S_t * request,
303
 
                    const BGML_Callback_t * cb_info,
304
 
                    const BGQuad * msginfo,
305
 
                    const char *sndbuf, unsigned sndlen, unsigned destrank);
306
 
 
307
 
  /**
308
 
   * \brief reset an existing send request. Set byte counters to zero.
309
 
   * This allows a request to be sent multiple times. Reentrant.
310
 
   */
311
 
 
312
 
  void BG2S_Reset (BG2S_t * request);
313
 
 
314
 
  /**
315
 
   * \brief post a request (i.e. start sending it).
316
 
   * Until the send invokes its callback, it is illegal to reset it
317
 
   * or touch the attached send buffer. Thread safe.
318
 
   */
319
 
 
320
 
  void BG2S_Start (BG2S_t * sender);
321
 
 
322
 
  /**
323
 
   * \brief control message send. message length should be < 200 bytes.
324
 
   */
325
 
 
326
 
  void BG2S_Control (BG2S_t * request,
327
 
                     const BGML_Callback_t * cb_info,
328
 
                     const char *sndbuf, unsigned sndlen, unsigned destrank);
329
 
 
330
 
  /* ********************************************************************* */
331
 
  /*                                                                       */
332
 
  /*     one-sided communication (torus)                                   */
333
 
  /*                                                                       */
334
 
  /* ********************************************************************* */
335
 
 
336
 
  /**
337
 
   * \brief Opaque data type that holds all 1-sided message requests.
338
 
   * The external API does not reveal the internal structure of the object.
339
 
   */
340
 
 
341
 
  typedef BGQuad BG1S_t[32];
342
 
  
343
 
  /**
344
 
   * \brief Generalized I/O vector data type/
345
 
   */
346
 
  
347
 
  typedef struct 
348
 
  {
349
 
    void **src_ptr_ar;  /**< Source starting addresses of each data segment. */
350
 
    void **dst_ptr_ar;  /**< Destination starting addresses of each data segment. */
351
 
    int ptr_ar_len;     /**< Number of data segment. */
352
 
    int bytes;          /**< The length of each segment in bytes. */
353
 
  } BGML_giov_t;
354
 
  
355
 
  /**
356
 
   * \brief execute a one-sided \b put to a destination node. Takes the
357
 
   * combination of base and srcbuf processed by the translation function
358
 
   * and returns the addressed buffer to the originator of request.
359
 
   *
360
 
   * \param[in] request      Data structure holding state of the \b put
361
 
   * \param[in] dstrank      Data destination rank
362
 
   * \param[in] srcbuf       Send (source) buffer on the local node
363
 
   * \param[in] base         Base address of receive (destination) buffer on the remote node
364
 
   * \param[in] dstbuf       Receive (destination) buffer on the remote node
365
 
   * \param[in] bytes        Number of bytes to transfer
366
 
   * \param[in] cb_done      Callback to invoke when message has completed
367
 
   * \param[in] isconsistent Nonzero if consistency is required
368
 
   */
369
 
 
370
 
  int BG1S_Memput (BG1S_t *request,
371
 
                   unsigned dstrank,
372
 
                   const char *srcbuf,
373
 
                   const unsigned base,
374
 
                   char *dstbuf, 
375
 
                   unsigned bytes, 
376
 
                   const BGML_Callback_t * cb_done,
377
 
                   unsigned isconsistent);
378
 
 
379
 
  /**
380
 
   * \brief execute a one-sided \b vector \b put to a destination node. Takes the
381
 
   * combination of srcbase and srcbuf processed by the translation function
382
 
   * and returns the addressed buffer to the originator of request.
383
 
   *
384
 
   * \param[in] request      Data structure holding state of the \b put
385
 
   * \param[in] dstrank      Data destination rank
386
 
   * \param[in] giov_count   Number of generalized IO vector elements describing data to put to the remote node
387
 
   * \param[in] giov_array   Array of generalized IO vectors
388
 
   * \param[in] base         Base address of receive (destination) buffers on the remote node
389
 
   * \param[in] cb_done      Callback to invoke when message has completed
390
 
   * \param[in] isconsistent Nonzero if consistency is required
391
 
   */
392
 
  
393
 
  int BG1S_MemputV (BG1S_t *request,
394
 
                    unsigned dstrank,
395
 
                    unsigned giov_count,
396
 
                    BGML_giov_t *giov_array,
397
 
                    const unsigned base,
398
 
                    const BGML_Callback_t * cb_done,
399
 
                    unsigned isconsistent);
400
 
  
401
 
  /**
402
 
   * \brief execute a one-sided \b strided \b put to a destination node. Takes the
403
 
   * combination of srcbase and srcbuf processed by the translation function
404
 
   * and returns the addressed buffer to the originator of request.
405
 
   *
406
 
   * \param[in] request        Data structure holding state of the \b put
407
 
   * \param[in] dstrank        Data destination rank
408
 
   * \param[in] src_ptr        Pointer to 1st segment at source
409
 
   * \param[in] src_stride_arr Array of strides at source
410
 
   * \param[in] src_ptr        Pointer to 1st segment at destination
411
 
   * \param[in] src_stride_arr Array of strides at destination
412
 
   * \param[in] seg_count      Number of segments at each stride levels: count[0]=bytes
413
 
   * \param[in] stride_levels  Number of stride levels
414
 
   * \param[in] base           Base address of receive (destination) buffers on the remote node
415
 
   * \param[in] cb_done        Callback to invoke when message has completed
416
 
   * \param[in] isconsistent   Nonzero if consistency is required
417
 
   */
418
 
  
419
 
  int BG1S_MemputS (BG1S_t *request,
420
 
                    unsigned dstrank,
421
 
                    void *src_ptr,  
422
 
                    int *src_stride_arr,
423
 
                    void *dst_ptr,       
424
 
                    int *dst_stride_arr,
425
 
                    int *seg_count, 
426
 
                    int stride_levels,   
427
 
                    const unsigned base,
428
 
                    const BGML_Callback_t * cb_done,
429
 
                    unsigned isconsistent);
430
 
  
431
 
  /**
432
 
   * \brief execute a one-sided \b get from a remote node.
433
 
   *
434
 
   * \param[in] request      Data structure holding state of the \b get
435
 
   * \param[in] srcrank      Data source rank
436
 
   * \param[in] dstbuf       Receive (destination) buffer on the local node
437
 
   * \param[in] base         Base address of send (source) buffer on the remote node
438
 
   * \param[in] srcbuf       Send (source) buffer on the remote node
439
 
   * \param[in] bytes        Number of bytes to transfer
440
 
   * \param[in] cb_done      Callback to invoke when message has completed
441
 
   * \param[in] isconsistent Nonzero if consistency is required
442
 
   */
443
 
 
444
 
  int BG1S_Memget (BG1S_t *request,
445
 
                   unsigned srcrank,
446
 
                   char *dstbuf,
447
 
                   const unsigned base,
448
 
                   const char *srcbuf,
449
 
                   unsigned bytes, 
450
 
                   const BGML_Callback_t * cb_done,
451
 
                   unsigned isconsistent);
452
 
    
453
 
  /**
454
 
   * \brief execute a one-sided \b vector \b get from a remote node.
455
 
   *
456
 
   * \param[in] request      Data structure holding state of the \b get
457
 
   * \param[in] srcrank      Data source rank
458
 
   * \param[in] giov_count   Number of generalized IO vector elements describing data to get from the remote node
459
 
   * \param[in] giov_array   Array of generalized IO vectors
460
 
   * \param[in] base         Base address of send (source) buffer on the remote node
461
 
   * \param[in] cb_done      Callback to invoke when message has completed
462
 
   * \param[in] isconsistent Nonzero if consistency is required
463
 
   */
464
 
  
465
 
  int BG1S_MemgetV (BG1S_t *request,
466
 
                    unsigned srcrank,
467
 
                    unsigned giov_count,
468
 
                    BGML_giov_t *giov_array,
469
 
                    const unsigned base,
470
 
                    const BGML_Callback_t * cb_done,
471
 
                    unsigned isconsistent);
472
 
 
473
 
  /**
474
 
   * \brief execute a one-sided \b strided \b get from a remote node.
475
 
   *
476
 
   * \param[in] request        Data structure holding state of the \b get
477
 
   * \param[in] srcrank        Data source rank
478
 
   * \param[in] src_ptr        Pointer to 1st segment at source
479
 
   * \param[in] src_stride_arr Array of strides at source
480
 
   * \param[in] src_ptr        Pointer to 1st segment at destination
481
 
   * \param[in] src_stride_arr Array of strides at destination
482
 
   * \param[in] seg_count      Number of segments at each stride levels: count[0]=bytes
483
 
   * \param[in] stride_levels  Number of stride levels
484
 
   * \param[in] base           Base address of send (source) buffer on the remote node
485
 
   * \param[in] cb_done        Callback to invoke when message has completed
486
 
   * \param[in] isconsistent   Nonzero if consistency is required
487
 
   */
488
 
  
489
 
  int BG1S_MemgetS (BG1S_t *request,
490
 
                    unsigned srcrank,
491
 
                    void *src_ptr,  
492
 
                    int *src_stride_arr,
493
 
                    void *dst_ptr,       
494
 
                    int *dst_stride_arr,
495
 
                    int *seg_count, 
496
 
                    int stride_levels,   
497
 
                    const unsigned base,
498
 
                    const BGML_Callback_t * cb_done,
499
 
                    unsigned isconsistent);
500
 
  
501
 
  /**
502
 
   * \brief Register a callback function to be invoked when all outstanding operations 
503
 
   *        on this node to the remote node have completed accessing local memory.
504
 
   *
505
 
   * \param[in] rank         remote node
506
 
   * \param[in] cb_done      function to invoke when local memory access has completed
507
 
   * \param[in] clientdata   clientdata referenced when \b cb_done is invoked
508
 
   *
509
 
   * \example
510
 
   * \code
511
 
   * void wait_callback (void * clientdata)
512
 
   * {
513
 
   *   unsigned * done = (unsigned *) clientdata;
514
 
   *   *done = 1;
515
 
   * }
516
 
   *
517
 
   * void wait_proc (unsigned rank)
518
 
   * {
519
 
   *   unsigned done = 0;
520
 
   *   BGML_Callback_t cb_wait_proc = {wait_callback, &done};
521
 
   *   if (BG1S_WaitProc (rank, &cb_wait_proc))
522
 
   *   {
523
 
   *     BGML_CriticalSection_enter();
524
 
   *     while (!done) BGML_Messager_advance ();
525
 
   *     BGML_CriticalSection_exit();
526
 
   *   }
527
 
   * }
528
 
   * \endcode
529
 
   */
530
 
 
531
 
  int BG1S_WaitProc (unsigned rank, const BGML_Callback_t * cb_done);
532
 
 
533
 
 
534
 
  /**
535
 
   * \brief Register a callback function to be invoked when all outstanding operations 
536
 
   *        on this node have completed accessing local memory.
537
 
   *
538
 
   * \param[in] cb_done      function to invoke when local memory access has completed
539
 
   * \param[in] clientdata   clientdata referenced when \b cb_done is invoked
540
 
   *
541
 
   *
542
 
   * \example
543
 
   * \code
544
 
   * void wait_callback (void * clientdata)
545
 
   * {
546
 
   *   unsigned * done = (unsigned *) clientdata;
547
 
   *   *done = 1;
548
 
   * }
549
 
   *
550
 
   * void wait_all ()
551
 
   * {
552
 
   *   unsigned done = 0;
553
 
   *   BGML_Callback_t cb_wait_all  = {wait_callback, &done};
554
 
   *   if (BG1S_WaitAll (&cb_wait_all))
555
 
   *   {
556
 
   *     BGML_CriticalSection_enter();
557
 
   *     while (!done) BGML_Messager_advance ();
558
 
   *     BGML_CriticalSection_exit();
559
 
   *   }
560
 
   * }
561
 
   * \endcode
562
 
   */
563
 
 
564
 
  int BG1S_WaitAll (const BGML_Callback_t * cb_done);
565
 
 
566
 
 
567
 
  /**
568
 
   * \brief Execute a \b read-modify-write operation.
569
 
   *
570
 
   * \param[in] request      data structure holding state of the \b rmw
571
 
   * \param[in] rank         remote rank
572
 
   * \param[in] base         base address of destination buffer
573
 
   * \param[in] dstbuf       destination (remote) buffer
574
 
   * \param[in] input        input (local) buffer
575
 
   * \param[in] output       output (local) buffer
576
 
   * \param[in] operation    operation to perfrom on remote node
577
 
   * \param[in] datatype     data type of memory at the destination, input, and output buffers
578
 
   * \param[in] cb_done      function to invoke when reception of all data has been
579
 
   *                         acknowledged by the remote node.
580
 
   * \param[in] clientdata   clientdata referenced when \b cb_done is invoked
581
 
   * \param[in] isconsistent nonzero if consistency is required
582
 
   */
583
 
 
584
 
  int BG1S_rmw (BG1S_t *request,
585
 
                unsigned rank,
586
 
                const unsigned base,
587
 
                void *dstbuf,
588
 
                const void *input,
589
 
                void *output,
590
 
                BGML_Op operation, 
591
 
                BGML_Dt datatype, 
592
 
                const BGML_Callback_t * cb_done,
593
 
                unsigned isconsistent);
594
 
 
595
 
 
596
 
  /**
597
 
   * \brief Execute an \b accumulate operation.
598
 
   *
599
 
   * The accumulate function is dependent on the data type, operand and operations.
600
 
   * <code>dst[i] = (src[i] op1 operand) op2 dst[i]</code>
601
 
   * Takes the
602
 
   * combination of sndbase and sndbuf processed by the translation function
603
 
   * and returns the addressed buffer to the originator of request.
604
 
   *
605
 
   * \param[in] request      Data structure holding state of the \b accumulate
606
 
   * \param[in] rank         Remote processor rank
607
 
   * \param[in] srcbuf       Source (local) buffer
608
 
   * \param[in] operand      Operand (local) buffer
609
 
   * \param[in] base         Base address of destination buffer
610
 
   * \param[in] dstbuf       Destination (remote) buffer
611
 
   * \param[in] count        Number of elements to accumulate
612
 
   * \param[in] datatype     Element data type
613
 
   * \param[in] op1          Operation to transform data as it is sent from the local node
614
 
   * \param[in] op2          Operation to transform data as it is received at the remote node
615
 
   * \param[in] cb_done      Callback to invoke when message has completed
616
 
   * \param[in] isconsistent Nonzero if consistency is required
617
 
   */
618
 
 
619
 
  int BG1S_Accumulate (BG1S_t *request,
620
 
                       unsigned rank,
621
 
                       const char *srcbuf,
622
 
                       const char *operand,
623
 
                       const unsigned dstbase,
624
 
                       char *dstbuf,
625
 
                       unsigned count,
626
 
                       BGML_Dt datatype,
627
 
                       BGML_Op op1,
628
 
                       BGML_Op op2,
629
 
                       const BGML_Callback_t * cb_done,
630
 
                       unsigned isconsistent);
631
 
 
632
 
  /**
633
 
   * \brief Execute a \b vector \b accumulate operation.
634
 
   *
635
 
   * The accumulate function is dependent on the data type, operand and operations.
636
 
   * <code>dst[i] = (src[i] op1 operand) op2 dst[i]</code>
637
 
   * Takes the
638
 
   * combination of sndbase and sndbuf processed by the translation function
639
 
   * and returns the addressed buffer to the originator of request.
640
 
   *
641
 
   * \param[in] request      Data structure holding state of the \b put
642
 
   * \param[in] rank         Remote processor rank
643
 
   * \param[in] giov_count   Number of generalized IO vector elements describing data to accumulate on the remote node
644
 
   * \param[in] giov_array   Array of generalized IO vectors
645
 
   * \param[in] operand      Operand (local) buffer
646
 
   * \param[in] base         Base address of receive (destination) buffers on the remote node
647
 
   * \param[in] datatype     Element data type
648
 
   * \param[in] op1          Operation to transform data as it is sent from the local node
649
 
   * \param[in] op2          Operation to transform data as it is received at the remote node
650
 
   * \param[in] cb_done      Callback to invoke when message has completed
651
 
   * \param[in] isconsistent Nonzero if consistency is required
652
 
   */
653
 
 
654
 
  int BG1S_AccumulateV (BG1S_t *request,
655
 
                        unsigned rank,
656
 
                        unsigned giov_count,
657
 
                        BGML_giov_t *giov_array,
658
 
                        const char *operand,
659
 
                        const unsigned base,
660
 
                        BGML_Dt datatype,
661
 
                        BGML_Op op1,
662
 
                        BGML_Op op2,
663
 
                        const BGML_Callback_t * cb_done,
664
 
                        unsigned isconsistent);
665
 
  
666
 
  /**
667
 
   * \brief Execute a \b strided \b accumulate operation.
668
 
   *
669
 
   * The accumulate function is dependent on the data type, operand and operations.
670
 
   * <code>dst[i] = (src[i] op1 operand) op2 dst[i]</code>
671
 
   * Takes the
672
 
   * combination of sndbase and sndbuf processed by the translation function
673
 
   * and returns the addressed buffer to the originator of request.
674
 
   *
675
 
   * \param[in] request        Data structure holding state of the \b put
676
 
   * \param[in] rank           Remote processor rank
677
 
   * \param[in] src_ptr        Pointer to 1st segment at source
678
 
   * \param[in] src_stride_arr Array of strides at source
679
 
   * \param[in] src_ptr        Pointer to 1st segment at destination
680
 
   * \param[in] src_stride_arr Array of strides at destination
681
 
   * \param[in] seg_count      Number of segments at each stride levels: count[0]=bytes
682
 
   * \param[in] stride_levels  Number of stride levels
683
 
   * \param[in] operand        Operand (local) buffer
684
 
   * \param[in] base           Base address of receive (destination) buffers on the remote node
685
 
   * \param[in] datatype       Element data type
686
 
   * \param[in] op1            Operation to transform data as it is sent from the local node
687
 
   * \param[in] op2            Operation to transform data as it is received at the remote node
688
 
   * \param[in] cb_done        Callback to invoke when message has completed
689
 
   * \param[in] isconsistent   Nonzero if consistency is required
690
 
   */
691
 
  
692
 
  int BG1S_AccumulateS (BG1S_t *request,
693
 
                        unsigned rank,
694
 
                        void *src_ptr,  
695
 
                        int *src_stride_arr,
696
 
                        void *dst_ptr,       
697
 
                        int *dst_stride_arr,
698
 
                        int *seg_count, 
699
 
                        int stride_levels,   
700
 
                        const char *operand,
701
 
                        const unsigned base,
702
 
                        BGML_Dt datatype,
703
 
                        BGML_Op op1,
704
 
                        BGML_Op op2,
705
 
                        const BGML_Callback_t * cb_done,
706
 
                        unsigned isconsistent);
707
 
  
708
 
  
709
 
  /**
710
 
   * \brief Acquire a lock resource.
711
 
   *
712
 
   * The lock request sends an opaque \c lockinfo data structure to the target
713
 
   * node which returns an opaque \c keyinfo data structure to the origin node.
714
 
   * This \c keyinfo information is used to unlock the resource.
715
 
   *
716
 
   * The implementation of the lock and unlock operations is dependent on the 
717
 
   * registered \c cb_lock and \c cb_unlock callback functions.
718
 
   *
719
 
   * \see BG1S_Unlock
720
 
   *
721
 
   * \param[in]  request        Data structure holding state of the message
722
 
   * \param[in]  rank           Remote processor rank
723
 
   * \param[in]  lockinfo       Pointer to opaque lock information
724
 
   * \param[out] keyinfo        Pointer to opaque key information
725
 
   * \param[in]  cb_done        Callback to invoke when message has completed
726
 
   * \param[in]  isconsistent   Nonzero if consistency is required
727
 
   */
728
 
  
729
 
  int BG1S_Lock (BG1S_t *request,
730
 
                 unsigned rank,
731
 
                 const BGQuad * lockinfo,
732
 
                 const BGQuad * keyinfo,
733
 
                 const BGML_Callback_t * cb_done,
734
 
                 unsigned isconsistent);
735
 
  
736
 
  /**
737
 
   * \brief Release a previously acquired lock resource.
738
 
   *
739
 
   * The unlock request sends an opaque \c keyinfo data structure to the target
740
 
   * node which unlocks the resource and allows the next lock request to proceed.
741
 
   *
742
 
   * The implementation of the lock and unlock operations is dependent on the 
743
 
   * registered \c cb_lock and \c cb_unlock callback functions.
744
 
   *
745
 
   * \see BG1S_Lock
746
 
   *
747
 
   * \param[in]  request        Data structure holding state of the message
748
 
   * \param[in]  rank           Remote processor rank
749
 
   * \param[out] keyinfo        Pointer to opaque key information
750
 
   * \param[in]  cb_done        Callback to invoke when message has completed
751
 
   * \param[in]  isconsistent   Nonzero if consistency is required
752
 
   */
753
 
  
754
 
  int BG1S_Unlock (BG1S_t *request,
755
 
                   unsigned rank,
756
 
                   const BGQuad * keyinfo,
757
 
                   const BGML_Callback_t * cb_done,
758
 
                   unsigned isconsistent);
759
 
  
760
 
  
761
 
  /**
762
 
   * \brief One-sided communication consistency models.
763
 
   */
764
 
 
765
 
  typedef enum
766
 
  {
767
 
    BG1S_ConsistencyModel_Relaxed    = 0,  /*!< Message are immediately sent */
768
 
    BG1S_ConsistencyModel_Weak       = 1,  /*!< Messages to the same node preserve order. */
769
 
    BG1S_ConsistencyModel_Sequential = 2,  /*!< Messages to all nodes preserve order. */
770
 
  }
771
 
  BG1S_ConsistencyModel;
772
 
 
773
 
  /**
774
 
   * \brief One-sided communcation configuration.
775
 
   */
776
 
  
777
 
  typedef struct
778
 
  {
779
 
    /** Callback function that is invoked to allocate memory. The first parameter 
780
 
     * is the number of bytes to allocate and the second parameter is the
781
 
     * \c cb_alloc clientdata. */
782
 
    void *(*cb_alloc) (unsigned, void *); 
783
 
    
784
 
    /** Clientdata for the \c cb_alloc callback function */
785
 
    void * cb_alloc_clientdata;
786
 
    
787
 
    /** Callback function that is invoked to free memory previously allocated
788
 
     * by the \c cb_alloc function. The first parameter is the address of the
789
 
     * memory to free and the second parameter is the \c cb_free clientdata. */
790
 
    void (*cb_free) (void *, void *);
791
 
    
792
 
    /** Clientdata for the \c cb_free callback function */
793
 
    void * cb_free_clientdata;
794
 
    
795
 
    /** Callback function that is invoked to map a raw address and base 
796
 
     * value to a memory location. The first parameter is the raw address, 
797
 
     * the second parameter is the base value, and the third parameter is the 
798
 
     * \c cb_map clientdata. */
799
 
    void *(*cb_map) (void *, unsigned, void *);
800
 
    
801
 
    /** Clientdata for the \c cb_map callback function */
802
 
    void * cb_map_clientdata;
803
 
    
804
 
    /** Callback function that is invoked on the target node when a message
805
 
     * is received and when the message completed. 
806
 
     * Parameters: 
807
 
     *   address
808
 
     *   number of bytes
809
 
     *   peer (origin) rank
810
 
     *   message identifier
811
 
     *   message complete flag
812
 
     *   \c cb_notify clientdata
813
 
     */
814
 
    void (*cb_notify) (void *, unsigned, unsigned, unsigned, unsigned, void *);
815
 
    
816
 
    /** Clientdata for the \c cb_notify callback function */
817
 
    void * cb_notify_clientdata;
818
 
    
819
 
    /** Callback function that is invoked to acquire a lock resource.
820
 
     * Parameters:
821
 
     *   Lock request information [in]
822
 
     *   \c cb_lock clientdata [in]
823
 
     *   Lock identifier -OR- Lock key [out] 
824
 
     * Returns:
825
 
     *   \c 0 if the lock was not acquired
826
 
     */
827
 
    unsigned (*cb_lock) (BGQuad *, void *, BGQuad *);
828
 
    
829
 
    /** Clientdata for the \c cb_lock callback function */
830
 
    void * cb_lock_clientdata;
831
 
    
832
 
    /** Callback function that is invoked to release a lock resource.
833
 
     * Parameters:
834
 
     *   Lock key information [in]
835
 
     *   \c cb_unlock clientdata [in]
836
 
     * Returns:
837
 
     *   Lock identifier associated with this key information
838
 
     */
839
 
    BGQuad (*cb_unlock) (BGQuad *, void *);
840
 
    
841
 
    /** Clientdata for the \c cb_lock callback function */
842
 
    void * cb_unlock_clientdata;
843
 
    
844
 
    
845
 
    /** One-sided communication consistency model */
846
 
    BG1S_ConsistencyModel consistency;
847
 
  }
848
 
  BG1S_Configuration_t;
849
 
 
850
 
  
851
 
  /**
852
 
   * \brief Configure one-sided communication.
853
 
   *
854
 
   * \param[in] configuration If \c NULL the configuration is not updated.
855
 
   *
856
 
   * \return The current configuration.
857
 
   */
858
 
 
859
 
  BG1S_Configuration_t BG1S_Configure (BG1S_Configuration_t * configuration);
860
 
 
861
 
  
862
 
  /**
863
 
   * \brief Returns an elapsed time on the calling processor.
864
 
   *
865
 
   * \return Time in seconds since an arbitrary time in the past. 
866
 
   */
867
 
   
868
 
  double BGML_Timer();
869
 
   
870
 
 
871
 
  /* ********************************************************************* */
872
 
  /*                                                                       */
873
 
  /*      Collective communication on tree and GI network                  */
874
 
  /*                                                                       */
875
 
  /* ********************************************************************* */
876
 
 
877
 
  /**
878
 
   * \brief Opaque data type that holds GI message requests.
879
 
   * The external API does not reveal the internal structure of the object.
880
 
   */
881
 
 
882
 
  typedef BGQuad BGGI_t[32];
883
 
 
884
 
  /**
885
 
   * \brief global interrupt barrier
886
 
   *
887
 
   * \note Assert if global interrupts are not available.
888
 
   *
889
 
   * \note do we need a non-blocking version? probably yes.
890
 
   */
891
 
 
892
 
  void BGGI_Barrier ();
893
 
 
894
 
  /**
895
 
   * \brief tree barrier
896
 
   * \param pclass: class route used for operation
897
 
   */
898
 
 
899
 
  void BGTr_Barrier (int pclass);
900
 
 
901
 
  /**
902
 
   * \brief start tree barrier operation
903
 
   * \param cb_info ?
904
 
   * \param pclass: class route used for operation
905
 
   */
906
 
 
907
 
  void BGTr_Barrier_start (const BGML_Callback_t * cb_info, int pclass);
908
 
 
909
 
 
910
 
  /**
911
 
   * \brief tree broadcast
912
 
   * \param root: ?
913
 
   * \param buffer: broadcast data buffer
914
 
   * \param nbytes: number of bytes broadcast
915
 
   * \param pclass: class route used for operation
916
 
   */
917
 
 
918
 
  void BGTr_Bcast (int root, void *buffer, int nbytes, int pclass);
919
 
 
920
 
  /**
921
 
   * \brief start tree broadcast operation
922
 
   * \param cb_info ?
923
 
   * \param buffer broadcast data buffer
924
 
   * \param nbytes number of bytes broadcast
925
 
   * \param pclass class route used for operation
926
 
   */
927
 
 
928
 
  void BGTr_Bcast_start (const BGML_Callback_t * cb_info,
929
 
                         void *buffer, int nbytes, int pclass);
930
 
 
931
 
  /**
932
 
   * \brief tree allreduce
933
 
   * \param sbuffer: send buffer holding non-reduced input data
934
 
   * \param rbuffer: receive buffer, holds results
935
 
   * \param count: number of entries in buffer
936
 
   * \param dt: data type of operation
937
 
   * \param op: reduce operation
938
 
   * \param root: -1 if allreduce, root if reduction
939
 
   * \param pclass: class route used for operation
940
 
   */
941
 
 
942
 
  void BGTr_Allreduce (const void *sbuffer,
943
 
                       void *rbuffer,
944
 
                       unsigned count,
945
 
                       BGML_Dt dt, BGML_Op op, int root, unsigned pclass);
946
 
 
947
 
  /**
948
 
   * \brief start tree allreduce operation
949
 
   * \param cb_info ?
950
 
   * \param sbuffer: send buffer holding non-reduced input data
951
 
   * \param rbuffer: receive buffer, holds results
952
 
   * \param count: number of entries in buffer
953
 
   * \param dt: data type of operation
954
 
   * \param op: reduce operation
955
 
   * \param root: ?
956
 
   * \param pclass: class route used for operation
957
 
   */
958
 
 
959
 
  void BGTr_Allreduce_start (const BGML_Callback_t * cb_info,
960
 
                             const void *sbuffer,
961
 
                             void *rbuffer,
962
 
                             unsigned count,
963
 
                             BGML_Dt dt,
964
 
                             BGML_Op op, int root, unsigned pclass);
965
 
 
966
 
  /**
967
 
   * \brief Configure the tree network.
968
 
   */
969
 
 
970
 
  void BGTr_Configure (unsigned use_coprocessor,
971
 
                       unsigned protocolTreshold, unsigned highPrecision);
972
 
 
973
 
  /* ********************************************************************* */
974
 
  /*                                                                       */
975
 
  /*        Collective communication on torus                              */
976
 
  /*                                                                       */
977
 
  /* ********************************************************************* */
978
 
 
979
 
  /**
980
 
   * \brief Opaque data type for torus collective barrier communication.
981
 
   */
982
 
 
983
 
  typedef BGQuad BGTsC_Barrier_t[64];
984
 
 
985
 
  /**
986
 
   * \brief Opaque data type for torus collective alltoallv communication.
987
 
   */
988
 
 
989
 
  typedef BGQuad BGTsC_Alltoallv_t[1];
990
 
 
991
 
  /**
992
 
   * \brief Initialize a general purpose barrier on the torus.
993
 
   * \param commID: communicator ID, 0 <= ID < N (what is N?)
994
 
   * \param numproc: number of processors participating in barrier
995
 
   * \param ranks: [SORTED] list of all ranks participating in barrier.
996
 
   * Every process initializing a barrier has to specify the same list.
997
 
   * No checking is done to ensure the compatibility of the lists.
998
 
   */
999
 
 
1000
 
  void BGTsC_Barrier_Init (BGTsC_Barrier_t * request,
1001
 
                           unsigned commID,
1002
 
                           unsigned numproc, unsigned *ranks);
1003
 
 
1004
 
  /**
1005
 
   * \brief Start execution of a general purpose barrier.
1006
 
   *
1007
 
   * Calling this function while a barrier is underway results in
1008
 
   * undefined behavior.
1009
 
   *
1010
 
   * \param commID: communicator ID, 0 <= ID < N (what is N?)
1011
 
   * \param cb ?
1012
 
   */
1013
 
 
1014
 
  void BGTsC_Barrier_Start (unsigned commID, const BGML_Callback_t * cb);
1015
 
 
1016
 
  /**
1017
 
   * \brief Execute a general purpose barrier.
1018
 
   *
1019
 
   * \param commID: communicator ID, 0 <= ID < N (what is N?)
1020
 
   */
1021
 
  void BGTsC_Barrier (unsigned commID);
1022
 
 
1023
 
  /**
1024
 
   * \brief Torus alltoallv
1025
 
   * \param request
1026
 
   * \param cb
1027
 
   * \param commID
1028
 
   * \param numproc
1029
 
   * \param ranks
1030
 
   * \param sndbuf
1031
 
   * \param sndlens
1032
 
   * \param sdispls
1033
 
   * \param rcvbuf
1034
 
   * \param rcvlens
1035
 
   * \param rdispls
1036
 
   * \param sndcounters
1037
 
   * \param rcvcounters
1038
 
   */
1039
 
 
1040
 
  void BGTsC_Alltoallv_start (BGTsC_Alltoallv_t * request,
1041
 
                              const BGML_Callback_t * cb,
1042
 
                              unsigned commID,
1043
 
                              const unsigned numproc,
1044
 
                              const unsigned *ranks,
1045
 
                              const char *sndbuf,
1046
 
                              const unsigned *sndlens,
1047
 
                              const unsigned *sdispls,
1048
 
                              const char *rcvbuf,
1049
 
                              const unsigned *rcvlens,
1050
 
                              const unsigned *rdispls,
1051
 
                              unsigned *sndcounters,
1052
 
                              unsigned *rcvcounters);
1053
 
 
1054
 
  /* ********************************************************************* */
1055
 
  /*                                                                       */
1056
 
  /*       Collectives on rectangular communicators on torus.              */
1057
 
  /*                                                                       */
1058
 
  /* ********************************************************************* */
1059
 
 
1060
 
  /**
1061
 
   * \brief Opaque data type for torus rectangular barrier communicator.
1062
 
   */
1063
 
 
1064
 
  typedef BGQuad BGTsRC_Barrier_t[1];
1065
 
 
1066
 
  /**
1067
 
   * \brief Opaque data type for torus rectangular broadcast communicator.
1068
 
   */
1069
 
 
1070
 
  typedef BGQuad BGTsRC_Bcast_t[1];
1071
 
 
1072
 
  /**
1073
 
   * \brief Opaque data type for torus rectangular allreduce communicator.
1074
 
   */
1075
 
 
1076
 
  typedef BGQuad BGTsRC_Allreduce_t[1];
1077
 
 
1078
 
  /**
1079
 
   * \brief Torus rectangular communicator geometry
1080
 
   */
1081
 
 
1082
 
  typedef struct BGTsRC_Geometry_t
1083
 
  {
1084
 
    unsigned x0;      /**< lower left corner, x coordinate */
1085
 
    unsigned y0;      /**< lower left corner, y coordinate */
1086
 
    unsigned z0;      /**< lower left corner, z coordinate */
1087
 
    unsigned t0;      /**< lower left corner, t coordinate */
1088
 
    unsigned xs;      /**< x dimension */
1089
 
    unsigned ys;      /**< y dimension */
1090
 
    unsigned zs;      /**< z dimension */
1091
 
    unsigned ts;      /**< t dimension */
1092
 
    unsigned xr;      /**< x root (for bcast, reduce) */
1093
 
    unsigned yr;      /**< y root (for bcast, reduce) */
1094
 
    unsigned zr;      /**< z root (for bcast, reduce) */
1095
 
    unsigned tr;      /**< t root (for bcast, reduce) */
1096
 
  }
1097
 
  BGTsRC_Geometry_t;
1098
 
 
1099
 
  /**
1100
 
   * \brief Start execution of a torus rectangular communicator barrier.
1101
 
   *
1102
 
   * \param request ?
1103
 
   * \param cb_info ?
1104
 
   * \param commID: communicator ID, 0 <= ID < N (what is N?)
1105
 
   * \param geometry ?
1106
 
   */
1107
 
 
1108
 
  void BGTsRC_Barrier_start (BGTsRC_Barrier_t * request,
1109
 
                             const BGML_Callback_t * cb_info,
1110
 
                             unsigned commID,
1111
 
                             const BGTsRC_Geometry_t * geometry);
1112
 
 
1113
 
  /**
1114
 
   * \brief Start execution of a torus rectangular communicator broadcast.
1115
 
   *
1116
 
   * \param request ?
1117
 
   * \param cb_info ?
1118
 
   * \param commID: communicator ID, 0 <= ID < N (what is N?)
1119
 
   * \param geometry ?
1120
 
   * \param root ?
1121
 
   * \param buffer ?
1122
 
   * \param buflen ?
1123
 
   */
1124
 
 
1125
 
  void BGTsRC_Bcast_start (BGTsRC_Bcast_t * request,
1126
 
                           const BGML_Callback_t * cb_info,
1127
 
                           unsigned commID,
1128
 
                           const BGTsRC_Geometry_t * geometry,
1129
 
                           unsigned root, char *buffer, unsigned buflen);
1130
 
 
1131
 
  /**
1132
 
   * \brief Start execution of a torus rectangular communicator alltoallv.
1133
 
   *
1134
 
   * \param request ?
1135
 
   * \param cb_info ?
1136
 
   * \param commID: communicator ID, 0 <= ID < N (what is N?)
1137
 
   * \param geometry ?
1138
 
   * \param sbuffer ?
1139
 
   * \param rbuffer ?
1140
 
   * \param count ?
1141
 
   * \param dt ?
1142
 
   * \param op ?
1143
 
   */
1144
 
 
1145
 
  void BGTsRC_Allreduce_start (BGTsRC_Allreduce_t * request,
1146
 
                               const BGML_Callback_t * cb_info,
1147
 
                               unsigned commID,
1148
 
                               const BGTsRC_Geometry_t * geometry,
1149
 
                               const void *sbuffer,
1150
 
                               void *rbuffer,
1151
 
                               unsigned count, BGML_Dt dt, BGML_Op op);
1152
 
 
1153
 
 
1154
 
  
1155
 
  
1156
 
  /* ********************************************************************* */
1157
 
  /*                                                                       */
1158
 
  /*          Data types and operation types                               */
1159
 
  /*                                                                       */
1160
 
  /* ********************************************************************* */
1161
 
 
1162
 
  /**
1163
 
   * \brief Structure for the \b BGML_SINGLE_COMPLEX datatype
1164
 
   * \see BGML_Dt
1165
 
   */
1166
 
  typedef struct cmplx64_t
1167
 
  {
1168
 
    float real;         /**< Real part of the complex number */
1169
 
    float imaginary;    /**< Imaginary part of the complex number */
1170
 
  } cmplx64_t;
1171
 
 
1172
 
  /**
1173
 
   * \brief Structure for the \b BGML_DOUBLE_COMPLEX datatype
1174
 
   * \see BGML_Dt
1175
 
   */
1176
 
  typedef struct cmplx128_t
1177
 
  {
1178
 
    double real;        /**< Real part of the complex number */
1179
 
    double imaginary;   /**< Imaginary part of the complex number */
1180
 
  } cmplx128_t;
1181
 
 
1182
 
  /**
1183
 
   * \brief Structure for the \b BGML_2INT datatype
1184
 
   * \see BGML_Dt
1185
 
   */
1186
 
  typedef struct int32int32_t
1187
 
  {
1188
 
    int32_t primary;   /**< Primary part */
1189
 
    int32_t secondary; /**< Secondary part */
1190
 
  } int32int32_t;
1191
 
 
1192
 
  /**
1193
 
   * \brief Structure for the \b BGML_SHORT_INT datatype
1194
 
   * \see BGML_Dt
1195
 
   */
1196
 
  typedef struct int16int32_t
1197
 
  {
1198
 
    int16_t primary;   /**< Primary part */
1199
 
    int32_t secondary; /**< Secondary part */
1200
 
  } int16int32_t;
1201
 
 
1202
 
  /**
1203
 
   * \brief Structure for the \b BGML_FLOAT_INT datatype
1204
 
   * \see BGML_Dt
1205
 
   */
1206
 
  typedef struct fp32int32_t
1207
 
  {
1208
 
    float primary;     /**< Primary part */
1209
 
    int32_t secondary; /**< Secondary part */
1210
 
  } fp32int32_t;
1211
 
 
1212
 
  /**
1213
 
   * \brief Structure for the \b BGML_DOUBLE_INT datatype
1214
 
   * \see BGML_Dt
1215
 
   */
1216
 
  typedef struct fp64int32_t
1217
 
  {
1218
 
    double primary;    /**< Primary part */
1219
 
    int32_t secondary; /**< Secondary part */
1220
 
  } fp64int32_t;
1221
 
 
1222
 
  /**
1223
 
   * \brief Structure for the \b BGML_2REAL datatype
1224
 
   * \see BGML_Dt
1225
 
   */
1226
 
  typedef struct fp32fp32_t
1227
 
  {
1228
 
    float primary;    /**< Primary part */
1229
 
    float secondary;  /**< Secondary part */
1230
 
  } fp32fp32_t;
1231
 
 
1232
 
  /**
1233
 
   * \brief Structure for the \b BGML_2DOUBLE_PRECISION datatype
1234
 
   * \see BGML_Dt
1235
 
   */
1236
 
  typedef struct fp64fp64_t
1237
 
  {
1238
 
    double primary;   /**< Primary part */
1239
 
    double secondary; /**< Secondary part */
1240
 
  } fp64fp64_t;
1241
 
 
1242
 
  /*!
1243
 
   * \brief Array to quickly look up the data size of a data type.
1244
 
   */
1245
 
 
1246
 
  extern unsigned BGML_DatatypeSize[];
1247
 
  
1248
 
#ifdef __cplusplus
1249
 
};
1250
 
#endif
1251
 
 
1252
 
#endif