OpenMPI 0.1.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

attribute.h
Go to the documentation of this file.
1 /*
2 * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3 * University Research and Technology
4 * Corporation. All rights reserved.
5 * Copyright (c) 2004-2005 The University of Tennessee and The University
6 * of Tennessee Research Foundation. All rights
7 * reserved.
8 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9 * University of Stuttgart. All rights reserved.
10 * Copyright (c) 2004-2005 The Regents of the University of California.
11 * All rights reserved.
12 * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
13 * $COPYRIGHT$
14 *
15 * Additional copyrights may follow
16 *
17 * $HEADER$
18 */
19
20 /** @file
21 *
22 * Implementation for taking care of the attribute that can hang off a comm,
23 * win or datatype.
24 */
25
26 #ifndef OMPI_ATTRIBUTE_H
27 #define OMPI_ATTRIBUTE_H
28
29 #include <string.h>
30 #include "mpi.h"
31
32 #include "ompi_config.h"
33 #include "ompi/constants.h"
34 #include "opal/class/opal_object.h"
35 #include "opal/class/opal_hash_table.h"
36
37 #define ATTR_HASH_SIZE 10
38
39 /*
40 * Flags for keyvals
41 */
42 #define OMPI_KEYVAL_PREDEFINED 0x0001
43 #define OMPI_KEYVAL_F77 0x0002
44 #define OMPI_KEYVAL_F77_MPI1 0x0004
45
46
47 BEGIN_C_DECLS
48
49 enum ompi_attribute_type_t {
50 UNUSED_ATTR = 0, /**< Make the compilers happy when we have to construct
51 * an attribute */
52 COMM_ATTR, /**< The attribute belongs to a comm object. Starts
53 * with 1 so that we can have it initialized to 0
54 * using memset in the constructor */
55 TYPE_ATTR, /**< The attribute belongs to datatype object */
56 WIN_ATTR /**< The attribute belongs to a win object */
57 };
58 typedef enum ompi_attribute_type_t ompi_attribute_type_t;
59
60
61 /* Old-style MPI-1 Fortran function pointer declarations for copy and
62 delete. These will only be used here and not in the front end
63 functions. */
64
65 typedef void (ompi_mpi1_fortran_copy_attr_function)(MPI_Fint *oldobj,
66 MPI_Fint *keyval,
67 MPI_Fint *extra_state,
68 MPI_Fint *attr_in,
69 MPI_Fint *attr_out,
70 ompi_fortran_logical_t *flag,
71 MPI_Fint *ierr);
72 typedef void (ompi_mpi1_fortran_delete_attr_function)(MPI_Fint *obj,
73 MPI_Fint *keyval,
74 MPI_Fint *attr_in,
75 MPI_Fint *extra_state,
76 MPI_Fint *ierr);
77
78 /* New-style MPI-2 Fortran function pointer declarations for copy and
79 delete. These will only be used here and not in the front end
80 functions. */
81
82 typedef void (ompi_mpi2_fortran_copy_attr_function)(MPI_Fint *oldobj,
83 MPI_Fint *keyval,
84 void *extra_state,
85 void *attr_in,
86 void *attr_out,
87 ompi_fortran_logical_t *flag,
88 MPI_Fint *ierr);
89 typedef void (ompi_mpi2_fortran_delete_attr_function)(MPI_Fint *obj,
90 MPI_Fint *keyval,
91 void *attr_in,
92 void *extra_state,
93 MPI_Fint *ierr);
94 /*
95 * Internally the copy function for all kinds of MPI objects has one more
96 * argument, the pointer to the new object. Therefore, we can do on the
97 * flight modifications of the new communicator based on attributes stored
98 * on the main communicator.
99 */
100 typedef int (MPI_Comm_internal_copy_attr_function)(MPI_Comm, int, void *,
101 void *, void *, int *,
102 MPI_Comm);
103 typedef int (MPI_Type_internal_copy_attr_function)(MPI_Datatype, int, void *,
104 void *, void *, int *,
105 MPI_Datatype);
106 typedef int (MPI_Win_internal_copy_attr_function)(MPI_Win, int, void *,
107 void *, void *, int *,
108 MPI_Win);
109
110 typedef void (ompi_attribute_keyval_destructor_fn_t)(int);
111
112 /* Union to take care of proper casting of the function pointers
113 passed from the front end functions depending on the type. This
114 will avoid casting function pointers to void* */
115
116 union ompi_attribute_fn_ptr_union_t {
117 MPI_Comm_delete_attr_function *attr_communicator_delete_fn;
118 MPI_Type_delete_attr_function *attr_datatype_delete_fn;
119 MPI_Win_delete_attr_function *attr_win_delete_fn;
120
121 MPI_Comm_internal_copy_attr_function *attr_communicator_copy_fn;
122 MPI_Type_internal_copy_attr_function *attr_datatype_copy_fn;
123 MPI_Win_internal_copy_attr_function *attr_win_copy_fn;
124
125 /* For Fortran old MPI-1 callback functions */
126
127 ompi_mpi1_fortran_delete_attr_function *attr_mpi1_fortran_delete_fn;
128 ompi_mpi1_fortran_copy_attr_function *attr_mpi1_fortran_copy_fn;
129
130 /* For Fortran new MPI-2 callback functions */
131
132 ompi_mpi2_fortran_delete_attr_function *attr_mpi2_fortran_delete_fn;
133 ompi_mpi2_fortran_copy_attr_function *attr_mpi2_fortran_copy_fn;
134 };
135
136 typedef union ompi_attribute_fn_ptr_union_t ompi_attribute_fn_ptr_union_t;
137
138
139 /**
140 * Union to help convert between Fortran attributes (which must be
141 * stored by value) and C pointers (which is the back-end storage of
142 * all attributes).
143 */
144 union ompi_attribute_fortran_ptr_t {
145 void *c_ptr;
146 MPI_Fint f_integer;
147 MPI_Aint f_address;
148 };
149 /**
150 * Convenience typedef
151 */
152 typedef union ompi_attribute_fortran_ptr_t ompi_attribute_fortran_ptr_t;
153
154 struct ompi_attribute_keyval_t {
155 opal_object_t super;
156 ompi_attribute_type_t attr_type; /**< One of COMM/WIN/DTYPE. This
157 will be used to cast the
158 copy/delete attribute functions
159 properly and error checking */
160 int attr_flag; /**< flag field: contains "OMPI_KEYVAL_PREDEFINED",
161 "OMPI_KEYVAL_F77" */
162 ompi_attribute_fn_ptr_union_t copy_attr_fn; /**< Copy function for the
163 attribute */
164 ompi_attribute_fn_ptr_union_t delete_attr_fn; /**< Delete function for the
165 attribute */
166 ompi_attribute_fortran_ptr_t extra_state; /**< Extra state of the attribute */
167 int key; /**< Keep a track of which key this item belongs to, so that
168 the key can be deleted when this object is destroyed */
169
170 /** Extra state for bindings to hang data on. If non-NULL, will be
171 freed by the C base when the keyval is destroyed. */
172 void *bindings_extra_state;
173 };
174
175 typedef struct ompi_attribute_keyval_t ompi_attribute_keyval_t;
176
177
178 /* Functions */
179
180
181
182 /**
183 * Convenient way to initialize the attribute hash table per MPI-Object
184 */
185
186 static inline
187 int ompi_attr_hash_init(opal_hash_table_t **hash)
188 {
189 *hash = OBJ_NEW(opal_hash_table_t);
190 if (NULL == hash) {
191 fprintf(stderr, "Error while creating the local attribute list\n");
192 return MPI_ERR_SYSRESOURCE;
193 }
194 if (OMPI_SUCCESS != opal_hash_table_init(*hash, ATTR_HASH_SIZE)) {
195 return MPI_ERR_SYSRESOURCE;
196 }
197
198 return MPI_SUCCESS;
199 }
200
201 /**
202 * Initialize the main attribute hash that stores the keyvals and meta data
203 *
204 * @return OMPI return code
205 */
206
207 int ompi_attr_init(void);
208
209 /**
210 * Destroy the main attribute hash that stores the keyvals and meta data
211 */
212
213 int ompi_attr_finalize(void);
214
215
216 /**
217 * Create a new key for use by attribute of Comm/Win/Datatype
218 *
219 * @param type Type of attribute (COMM/WIN/DTYPE) (IN)
220 * @param copy_attr_fn Union variable containing the function pointer
221 * to be used in order to copy the attribute (IN)
222 * @param delete_attr_fn Function pointer to be used for deleting the
223 * attribute (IN)
224 * @param key The newly created key is returned here (OUT)
225 * @param extra_state Extra state to hang off/do some special things (IN)
226 * @param flags Flags for the key -- flags contain OMPI_KEYVAL_F77,
227 * OMPI_KEYVAL_PREDEFINED
228 * @param bindings_extra_state Extra state that, if non-NULL, will
229 * automatically be free()'ed by the C base when
230 * the keyval is destroyed.
231 *
232 * NOTE: I have taken the assumption that user cannot modify/delete
233 * any predefined keys or the attributes attached. To accomplish this,
234 * all MPI* calls will have OMPI_KEYVAL_PREDEFINED set as 0. MPI
235 * implementors who will need to play with the predefined keys and
236 * attributes would call the ompi* functions here and not the MPI*
237 * functions, with OMPI_KEYVAL_PREDEFINED set to 1.
238 * END OF NOTE
239 *
240 * NOTE: For the function pointers, you need to create a variable of the
241 * union type "ompi_attribute_fn_ptr_union_t" and assign the proper field.
242 * to be passed into this function
243 * END OF NOTE
244 *
245 * @return OMPI return code
246
247 *
248 */
249
250 OMPI_DECLSPEC int ompi_attr_create_keyval(ompi_attribute_type_t type,
251 ompi_attribute_fn_ptr_union_t copy_attr_fn,
252 ompi_attribute_fn_ptr_union_t delete_attr_fn,
253 int *key, void *extra_state, int flags,
254 void *bindings_extra_state);
255
256 /**
257 * Same as ompi_attr_create_keyval, but extra_state is a Fortran default integer.
258 */
259
260 OMPI_DECLSPEC int ompi_attr_create_keyval_fint(ompi_attribute_type_t type,
261 ompi_attribute_fn_ptr_union_t copy_attr_fn,
262 ompi_attribute_fn_ptr_union_t delete_attr_fn,
263 int *key, MPI_Fint extra_state, int flags,
264 void *bindings_extra_state);
265
266 /**
267 * Same as ompi_attr_create_keyval, but extra_state is a Fortran address integer.
268 */
269
270 OMPI_DECLSPEC int ompi_attr_create_keyval_aint(ompi_attribute_type_t type,
271 ompi_attribute_fn_ptr_union_t copy_attr_fn,
272 ompi_attribute_fn_ptr_union_t delete_attr_fn,
273 int *key, MPI_Aint extra_state, int flags,
274 void *bindings_extra_state);
275
276 /**
277 * Free an attribute keyval
278 * @param type Type of attribute (COMM/WIN/DTYPE) (IN)
279 * @param key key, which is set to MPI_KEY_INVALID (IN/OUT)
280 * @return OMPI error code
281 */
282
283 int ompi_attr_free_keyval(ompi_attribute_type_t type, int *key,
284 bool predefined);
285
286 /**
287 * Set an attribute on the comm/win/datatype in a form valid for C.
288 *
289 * @param type Type of attribute (COMM/WIN/DTYPE) (IN)
290 * @param object The actual Comm/Win/Datatype object (IN)
291 * @param attr_hash The attribute hash table hanging on the object(IN/OUT)
292 * @param key Key val for the attribute (IN)
293 * @param attribute The actual attribute pointer (IN)
294 * @param predefined Whether the key is predefined or not 0/1 (IN)
295 * @return OMPI error code
296 *
297 * If (*attr_hash) == NULL, a new hash will be created and
298 * initialized.
299 *
300 * All three of these functions (ompi_attr_set_c(),
301 * ompi_attr_set_fortran_mpi1(), and ompi_attr_set_fortran_mpi2())
302 * could have been combined into one function that took some kind of
303 * (void*) and an enum to indicate which way to translate the final
304 * representation, but that just seemed to make an already complicated
305 * situation more complicated through yet another layer of
306 * indirection.
307 *
308 * So yes, this is more code, but it's clearer and less error-prone
309 * (read: better) this way.
310 */
311 int ompi_attr_set_c(ompi_attribute_type_t type, void *object,
312 opal_hash_table_t **attr_hash,
313 int key, void *attribute, bool predefined);
314
315 /**
316 * Set an attribute on the comm/win/datatype in a form valid for
317 * Fortran MPI-1.
318 *
319 * @param type Type of attribute (COMM/WIN/DTYPE) (IN)
320 * @param object The actual Comm/Win/Datatype object (IN)
321 * @param attr_hash The attribute hash table hanging on the object(IN/OUT)
322 * @param key Key val for the attribute (IN)
323 * @param attribute The actual attribute pointer (IN)
324 * @param predefined Whether the key is predefined or not 0/1 (IN)
325 * @return OMPI error code
326 *
327 * If (*attr_hash) == NULL, a new hash will be created and
328 * initialized.
329 *
330 * All three of these functions (ompi_attr_set_c(),
331 * ompi_attr_set_fortran_mpi1(), and ompi_attr_set_fortran_mpi2())
332 * could have been combined into one function that took some kind of
333 * (void*) and an enum to indicate which way to translate the final
334 * representation, but that just seemed to make an already complicated
335 * situation more complicated through yet another layer of
336 * indirection.
337 *
338 * So yes, this is more code, but it's clearer and less error-prone
339 * (read: better) this way.
340 */
341 OMPI_DECLSPEC int ompi_attr_set_fortran_mpi1(ompi_attribute_type_t type, void *object,
342 opal_hash_table_t **attr_hash,
343 int key, MPI_Fint attribute,
344 bool predefined);
345
346 /**
347 * Set an attribute on the comm/win/datatype in a form valid for
348 * Fortran MPI-2.
349 *
350 * @param type Type of attribute (COMM/WIN/DTYPE) (IN)
351 * @param object The actual Comm/Win/Datatype object (IN)
352 * @param attr_hash The attribute hash table hanging on the object(IN/OUT)
353 * @param key Key val for the attribute (IN)
354 * @param attribute The actual attribute pointer (IN)
355 * @param predefined Whether the key is predefined or not 0/1 (IN)
356 * @return OMPI error code
357 *
358 * If (*attr_hash) == NULL, a new hash will be created and
359 * initialized.
360 *
361 * All three of these functions (ompi_attr_set_c(),
362 * ompi_attr_set_fortran_mpi1(), and ompi_attr_set_fortran_mpi2())
363 * could have been combined into one function that took some kind of
364 * (void*) and an enum to indicate which way to translate the final
365 * representation, but that just seemed to make an already complicated
366 * situation more complicated through yet another layer of
367 * indirection.
368 *
369 * So yes, this is more code, but it's clearer and less error-prone
370 * (read: better) this way.
371 */
372 OMPI_DECLSPEC int ompi_attr_set_fortran_mpi2(ompi_attribute_type_t type, void *object,
373 opal_hash_table_t **attr_hash,
374 int key, MPI_Aint attribute,
375 bool predefined);
376
377 /**
378 * Get an attribute on the comm/win/datatype in a form valid for C.
379 *
380 * @param attr_hash The attribute hash table hanging on the object(IN)
381 * @param key Key val for the attribute (IN)
382 * @param attribute The actual attribute pointer (OUT)
383 * @param flag Flag whether an attribute is associated
384 * with the key (OUT)
385 * @return OMPI error code
386 *
387 * All three of these functions (ompi_attr_get_c(),
388 * ompi_attr_get_fortran_mpi1(), and ompi_attr_get_fortran_mpi2())
389 * could have been combined into one function that took some kind of
390 * (void*) and an enum to indicate which way to translate the final
391 * representation, but that just seemed to make an already complicated
392 * situation more complicated through yet another layer of
393 * indirection.
394 *
395 * So yes, this is more code, but it's clearer and less error-prone
396 * (read: better) this way.
397 */
398
399 int ompi_attr_get_c(opal_hash_table_t *attr_hash, int key,
400 void **attribute, int *flag);
401
402
403 /**
404 * Get an attribute on the comm/win/datatype in a form valid for
405 * Fortran MPI-1.
406 *
407 * @param attr_hash The attribute hash table hanging on the object(IN)
408 * @param key Key val for the attribute (IN)
409 * @param attribute The actual attribute pointer (OUT)
410 * @param flag Flag whether an attribute is associated
411 * with the key (OUT)
412 * @return OMPI error code
413 *
414 * All three of these functions (ompi_attr_get_c(),
415 * ompi_attr_get_fortran_mpi1(), and ompi_attr_get_fortran_mpi2())
416 * could have been combined into one function that took some kind of
417 * (void*) and an enum to indicate which way to translate the final
418 * representation, but that just seemed to make an already complicated
419 * situation more complicated through yet another layer of
420 * indirection.
421 *
422 * So yes, this is more code, but it's clearer and less error-prone
423 * (read: better) this way.
424 */
425
426 OMPI_DECLSPEC int ompi_attr_get_fortran_mpi1(opal_hash_table_t *attr_hash, int key,
427 MPI_Fint *attribute, int *flag);
428
429
430 /**
431 * Get an attribute on the comm/win/datatype in a form valid for
432 * Fortran MPI-2.
433 *
434 * @param attrhash The attribute hash table hanging on the object(IN)
435 * @param key Key val for the attribute (IN)
436 * @param attribute The actual attribute pointer (OUT)
437 * @param flag Flag whether an attribute is associated
438 * with the key (OUT)
439 * @return OMPI error code
440 *
441 * All three of these functions (ompi_attr_get_c(),
442 * ompi_attr_get_fortran_mpi1(), and ompi_attr_get_fortran_mpi2())
443 * could have been combined into one function that took some kind of
444 * (void*) and an enum to indicate which way to translate the final
445 * representation, but that just seemed to make an already complicated
446 * situation more complicated through yet another layer of
447 * indirection.
448 *
449 * So yes, this is more code, but it's clearer and less error-prone
450 * (read: better) this way.
451 */
452
453 OMPI_DECLSPEC int ompi_attr_get_fortran_mpi2(opal_hash_table_t *attr_hash, int key,
454 MPI_Aint *attribute, int *flag);
455
456
457 /**
458 * Delete an attribute on the comm/win/datatype
459 * @param type Type of attribute (COMM/WIN/DTYPE) (IN)
460 * @param object The actual Comm/Win/Datatype object (IN)
461 * @param attr_hash The attribute hash table hanging on the object(IN)
462 * @param key Key val for the attribute (IN)
463 * @param predefined Whether the key is predefined or not 0/1 (IN)
464 * @return OMPI error code
465 *
466 */
467
468 int ompi_attr_delete(ompi_attribute_type_t type, void *object,
469 opal_hash_table_t *attr_hash , int key,
470 bool predefined);
471
472
473 /**
474 * This to be used from functions like MPI_*_DUP inorder to copy all
475 * the attributes from the old Comm/Win/Dtype object to a new
476 * object.
477 * @param type Type of attribute (COMM/WIN/DTYPE) (IN)
478 * @param old_object The old COMM/WIN/DTYPE object (IN)
479 * @param new_object The new COMM/WIN/DTYPE object (IN)
480 * @param attr_hash The attribute hash table hanging on old object(IN)
481 * @param newattr_hash The attribute hash table hanging on new object(IN)
482 * @return OMPI error code
483 *
484 */
485
486 int ompi_attr_copy_all(ompi_attribute_type_t type, void *old_object,
487 void *new_object, opal_hash_table_t *oldattr_hash,
488 opal_hash_table_t *newkeyhash);
489
490
491 /**
492 * This to be used to delete all the attributes from the Comm/Win/Dtype
493 * object in one shot
494 * @param type Type of attribute (COMM/WIN/DTYPE) (IN)
495 * @param object The COMM/WIN/DTYPE object (IN)
496 * @param attr_hash The attribute hash table hanging on the object(IN)
497 * @return OMPI error code
498 *
499 */
500
501 int ompi_attr_delete_all(ompi_attribute_type_t type, void *object,
502 opal_hash_table_t *attr_hash);
503
504
505 /**
506 * \internal
507 *
508 * Create all the predefined attributes
509 *
510 * @returns OMPI_SUCCESS
511 */
512 int ompi_attr_create_predefined(void);
513
514 /**
515 * \internal
516 *
517 * Free all the predefined attributes
518 *
519 * @returns OMPI_SUCCESS
520 */
521 int ompi_attr_free_predefined(void);
522
523
524 END_C_DECLS
525
526 #endif /* OMPI_ATTRIBUTE_H */
ompi_attr_delete
int ompi_attr_delete(ompi_attribute_type_t type, void *object, opal_hash_table_t *attr_hash, int key, bool predefined)
Delete an attribute on the comm/win/datatype.
Definition: attribute.c:668
opal_hash_table_t
Definition: opal_hash_table.h:42
ompi_win_t
Definition: win.h:53
ompi_attribute_keyval_t::bindings_extra_state
void * bindings_extra_state
Extra state for bindings to hang data on.
Definition: attribute.h:172
ompi_attr_hash_init
static int ompi_attr_hash_init(opal_hash_table_t **hash)
Convenient way to initialize the attribute hash table per MPI-Object.
Definition: attribute.h:187
ompi_attr_free_keyval
int ompi_attr_free_keyval(ompi_attribute_type_t type, int *key, bool predefined)
Free an attribute keyval.
Definition: attribute.c:634
ompi_attribute_keyval_t::attr_type
ompi_attribute_type_t attr_type
One of COMM/WIN/DTYPE.
Definition: attribute.h:156
ompi_attribute_keyval_t::copy_attr_fn
ompi_attribute_fn_ptr_union_t copy_attr_fn
Copy function for the attribute.
Definition: attribute.h:162
ompi_attr_set_c
int ompi_attr_set_c(ompi_attribute_type_t type, void *object, opal_hash_table_t **attr_hash, int key, void *attribute, bool predefined)
Set an attribute on the comm/win/datatype in a form valid for C.
Definition: attribute.c:759
ompi_datatype_t
Definition: ompi_datatype.h:68
ompi_attribute_keyval_t::extra_state
ompi_attribute_fortran_ptr_t extra_state
Extra state of the attribute.
Definition: attribute.h:166
WIN_ATTR
The attribute belongs to a win object.
Definition: attribute.h:56
COMM_ATTR
The attribute belongs to a comm object.
Definition: attribute.h:52
ompi_attr_create_keyval_fint
OMPI_DECLSPEC int ompi_attr_create_keyval_fint(ompi_attribute_type_t type, ompi_attribute_fn_ptr_union_t copy_attr_fn, ompi_attribute_fn_ptr_union_t delete_attr_fn, int *key, MPI_Fint extra_state, int flags, void *bindings_extra_state)
Same as ompi_attr_create_keyval, but extra_state is a Fortran default integer.
Definition: attribute.c:602
ompi_attribute_fortran_ptr_t
Union to help convert between Fortran attributes (which must be stored by value) and C pointers (whic...
Definition: attribute.h:144
ompi_attr_set_fortran_mpi2
OMPI_DECLSPEC int ompi_attr_set_fortran_mpi2(ompi_attribute_type_t type, void *object, opal_hash_table_t **attr_hash, int key, MPI_Aint attribute, bool predefined)
Set an attribute on the comm/win/datatype in a form valid for Fortran MPI-2.
Definition: attribute.c:801
ompi_attr_copy_all
int ompi_attr_copy_all(ompi_attribute_type_t type, void *old_object, void *new_object, opal_hash_table_t *oldattr_hash, opal_hash_table_t *newkeyhash)
This to be used from functions like MPI_*_DUP inorder to copy all the attributes from the old Comm/Wi...
Definition: attribute.c:878
ompi_attr_init
int ompi_attr_init(void)
Initialize the main attribute hash that stores the keyvals and meta data.
Definition: attribute.c:481
ompi_attribute_keyval_t::key
int key
Keep a track of which key this item belongs to, so that the key can be deleted when this object is de...
Definition: attribute.h:167
ompi_attribute_keyval_t::attr_flag
int attr_flag
flag field: contains "OMPI_KEYVAL_PREDEFINED", "OMPI_KEYVAL_F77"
Definition: attribute.h:160
ompi_attribute_type_t
ompi_attribute_type_t
Definition: attribute.h:49
TYPE_ATTR
The attribute belongs to datatype object.
Definition: attribute.h:55
ompi_attr_create_keyval
OMPI_DECLSPEC int ompi_attr_create_keyval(ompi_attribute_type_t type, ompi_attribute_fn_ptr_union_t copy_attr_fn, ompi_attribute_fn_ptr_union_t delete_attr_fn, int *key, void *extra_state, int flags, void *bindings_extra_state)
Create a new key for use by attribute of Comm/Win/Datatype.
Definition: attribute.c:586
opal_hash_table.h
A hash table that may be indexed with either fixed length (e.g.
ompi_attr_get_c
int ompi_attr_get_c(opal_hash_table_t *attr_hash, int key, void **attribute, int *flag)
Get an attribute on the comm/win/datatype in a form valid for C.
Definition: attribute.c:822
ompi_attr_finalize
int ompi_attr_finalize(void)
Destroy the main attribute hash that stores the keyvals and meta data.
Definition: attribute.c:526
opal_object_t
Base object.
Definition: opal_object.h:182
ompi_attribute_keyval_t
Definition: attribute.h:154
ompi_attr_set_fortran_mpi1
OMPI_DECLSPEC int ompi_attr_set_fortran_mpi1(ompi_attribute_type_t type, void *object, opal_hash_table_t **attr_hash, int key, MPI_Fint attribute, bool predefined)
Set an attribute on the comm/win/datatype in a form valid for Fortran MPI-1.
Definition: attribute.c:779
ompi_attr_get_fortran_mpi1
OMPI_DECLSPEC int ompi_attr_get_fortran_mpi1(opal_hash_table_t *attr_hash, int key, MPI_Fint *attribute, int *flag)
Get an attribute on the comm/win/datatype in a form valid for Fortran MPI-1.
Definition: attribute.c:841
ompi_attr_create_keyval_aint
OMPI_DECLSPEC int ompi_attr_create_keyval_aint(ompi_attribute_type_t type, ompi_attribute_fn_ptr_union_t copy_attr_fn, ompi_attribute_fn_ptr_union_t delete_attr_fn, int *key, MPI_Aint extra_state, int flags, void *bindings_extra_state)
Same as ompi_attr_create_keyval, but extra_state is a Fortran address integer.
Definition: attribute.c:618
ompi_attribute_keyval_t::delete_attr_fn
ompi_attribute_fn_ptr_union_t delete_attr_fn
Delete function for the attribute.
Definition: attribute.h:164
opal_hash_table_init
OPAL_DECLSPEC int opal_hash_table_init(opal_hash_table_t *ht, size_t table_size)
Initializes the table size, must be called before using the table.
Definition: opal_hash_table.c:71
UNUSED_ATTR
Make the compilers happy when we have to construct an attribute.
Definition: attribute.h:50
ompi_attribute_fn_ptr_union_t
Definition: attribute.h:116
ompi_attr_get_fortran_mpi2
OMPI_DECLSPEC int ompi_attr_get_fortran_mpi2(opal_hash_table_t *attr_hash, int key, MPI_Aint *attribute, int *flag)
Get an attribute on the comm/win/datatype in a form valid for Fortran MPI-2.
Definition: attribute.c:860
opal_object.h
A simple C-language object-oriented system with single inheritance and ownership-based memory managem...
ompi_attr_delete_all
int ompi_attr_delete_all(ompi_attribute_type_t type, void *object, opal_hash_table_t *attr_hash)
This to be used to delete all the attributes from the Comm/Win/Dtype object in one shot...
Definition: attribute.c:981
ompi_communicator_t
Definition: communicator.h:118