10
10
* Copyright (c) 2004-2005 The Regents of the University of California.
11
11
* All rights reserved.
12
12
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
13
+ * Copyright (c) 2017 Research Organization for Information Science
14
+ * and Technology (RIST). All rights reserved.
13
15
* $COPYRIGHT$
14
16
*
15
17
* Additional copyrights may follow
41
43
*/
42
44
#define OMPI_KEYVAL_PREDEFINED 0x0001
43
45
#define OMPI_KEYVAL_F77 0x0002
44
- #define OMPI_KEYVAL_F77_MPI1 0x0004
46
+ #define OMPI_KEYVAL_F77_INT 0x0004
45
47
46
48
47
49
BEGIN_C_DECLS
@@ -62,14 +64,14 @@ typedef enum ompi_attribute_type_t ompi_attribute_type_t;
62
64
delete. These will only be used here and not in the front end
63
65
functions. */
64
66
65
- typedef void (ompi_mpi1_fortran_copy_attr_function )(MPI_Fint * oldobj ,
67
+ typedef void (ompi_fint_copy_attr_function )(MPI_Fint * oldobj ,
66
68
MPI_Fint * keyval ,
67
69
MPI_Fint * extra_state ,
68
70
MPI_Fint * attr_in ,
69
71
MPI_Fint * attr_out ,
70
72
ompi_fortran_logical_t * flag ,
71
73
MPI_Fint * ierr );
72
- typedef void (ompi_mpi1_fortran_delete_attr_function )(MPI_Fint * obj ,
74
+ typedef void (ompi_fint_delete_attr_function )(MPI_Fint * obj ,
73
75
MPI_Fint * keyval ,
74
76
MPI_Fint * attr_in ,
75
77
MPI_Fint * extra_state ,
@@ -79,18 +81,18 @@ typedef void (ompi_mpi1_fortran_delete_attr_function)(MPI_Fint *obj,
79
81
delete. These will only be used here and not in the front end
80
82
functions. */
81
83
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 );
84
+ typedef void (ompi_aint_copy_attr_function )(MPI_Fint * oldobj ,
85
+ MPI_Fint * keyval ,
86
+ void * extra_state ,
87
+ void * attr_in ,
88
+ void * attr_out ,
89
+ ompi_fortran_logical_t * flag ,
90
+ MPI_Fint * ierr );
91
+ typedef void (ompi_aint_delete_attr_function )(MPI_Fint * obj ,
92
+ MPI_Fint * keyval ,
93
+ void * attr_in ,
94
+ void * extra_state ,
95
+ MPI_Fint * ierr );
94
96
/*
95
97
* Internally the copy function for all kinds of MPI objects has one more
96
98
* argument, the pointer to the new object. Therefore, we can do on the
@@ -124,13 +126,13 @@ union ompi_attribute_fn_ptr_union_t {
124
126
125
127
/* For Fortran old MPI-1 callback functions */
126
128
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
+ ompi_fint_delete_attr_function * attr_fint_delete_fn ;
130
+ ompi_fint_copy_attr_function * attr_fint_copy_fn ;
129
131
130
132
/* For Fortran new MPI-2 callback functions */
131
133
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
+ ompi_aint_delete_attr_function * attr_aint_delete_fn ;
135
+ ompi_aint_copy_attr_function * attr_aint_copy_fn ;
134
136
};
135
137
136
138
typedef union ompi_attribute_fn_ptr_union_t ompi_attribute_fn_ptr_union_t ;
@@ -297,8 +299,8 @@ int ompi_attr_free_keyval(ompi_attribute_type_t type, int *key,
297
299
* If (*attr_hash) == NULL, a new hash will be created and
298
300
* initialized.
299
301
*
300
- * All three of these functions (ompi_attr_set_c(),
301
- * ompi_attr_set_fortran_mpi1 (), and ompi_attr_set_fortran_mpi2 ())
302
+ * All four of these functions (ompi_attr_set_c(), ompi_attr_set_int (),
303
+ * ompi_attr_set_fint (), and ompi_attr_set_aint ())
302
304
* could have been combined into one function that took some kind of
303
305
* (void*) and an enum to indicate which way to translate the final
304
306
* representation, but that just seemed to make an already complicated
@@ -312,6 +314,35 @@ int ompi_attr_set_c(ompi_attribute_type_t type, void *object,
312
314
opal_hash_table_t * * attr_hash ,
313
315
int key , void * attribute , bool predefined );
314
316
317
+ /**
318
+ * Set an int predefined attribute in a form valid for C.
319
+ *
320
+ * @param type Type of attribute (COMM/WIN/DTYPE) (IN)
321
+ * @param object The actual Comm/Win/Datatype object (IN)
322
+ * @param attr_hash The attribute hash table hanging on the object(IN/OUT)
323
+ * @param key Key val for the attribute (IN)
324
+ * @param attribute The actual attribute value (IN)
325
+ * @param predefined Whether the key is predefined or not 0/1 (IN)
326
+ * @return OMPI error code
327
+ *
328
+ * If (*attr_hash) == NULL, a new hash will be created and
329
+ * initialized.
330
+ *
331
+ * All four of these functions (ompi_attr_set_c(), ompi_attr_set_int(),
332
+ * ompi_attr_set_fint(), and ompi_attr_set_aint())
333
+ * could have been combined into one function that took some kind of
334
+ * (void*) and an enum to indicate which way to translate the final
335
+ * representation, but that just seemed to make an already complicated
336
+ * situation more complicated through yet another layer of
337
+ * indirection.
338
+ *
339
+ * So yes, this is more code, but it's clearer and less error-prone
340
+ * (read: better) this way.
341
+ */
342
+ int ompi_attr_set_int (ompi_attribute_type_t type , void * object ,
343
+ opal_hash_table_t * * attr_hash ,
344
+ int key , int attribute , bool predefined );
345
+
315
346
/**
316
347
* Set an attribute on the comm/win/datatype in a form valid for
317
348
* Fortran MPI-1.
@@ -327,8 +358,8 @@ int ompi_attr_set_c(ompi_attribute_type_t type, void *object,
327
358
* If (*attr_hash) == NULL, a new hash will be created and
328
359
* initialized.
329
360
*
330
- * All three of these functions (ompi_attr_set_c(),
331
- * ompi_attr_set_fortran_mpi1 (), and ompi_attr_set_fortran_mpi2 ())
361
+ * All four of these functions (ompi_attr_set_c(), ompi_attr_set_int (),
362
+ * ompi_attr_set_fint (), and ompi_attr_set_aint ())
332
363
* could have been combined into one function that took some kind of
333
364
* (void*) and an enum to indicate which way to translate the final
334
365
* representation, but that just seemed to make an already complicated
@@ -338,10 +369,10 @@ int ompi_attr_set_c(ompi_attribute_type_t type, void *object,
338
369
* So yes, this is more code, but it's clearer and less error-prone
339
370
* (read: better) this way.
340
371
*/
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 );
372
+ OMPI_DECLSPEC int ompi_attr_set_fint (ompi_attribute_type_t type , void * object ,
373
+ opal_hash_table_t * * attr_hash ,
374
+ int key , MPI_Fint attribute ,
375
+ bool predefined );
345
376
346
377
/**
347
378
* Set an attribute on the comm/win/datatype in a form valid for
@@ -358,8 +389,8 @@ OMPI_DECLSPEC int ompi_attr_set_fortran_mpi1(ompi_attribute_type_t type, void *o
358
389
* If (*attr_hash) == NULL, a new hash will be created and
359
390
* initialized.
360
391
*
361
- * All three of these functions (ompi_attr_set_c(),
362
- * ompi_attr_set_fortran_mpi1 (), and ompi_attr_set_fortran_mpi2 ())
392
+ * All four of these functions (ompi_attr_set_c(), ompi_attr_set_int (),
393
+ * ompi_attr_set_fint (), and ompi_attr_set_aint ())
363
394
* could have been combined into one function that took some kind of
364
395
* (void*) and an enum to indicate which way to translate the final
365
396
* representation, but that just seemed to make an already complicated
@@ -369,10 +400,10 @@ OMPI_DECLSPEC int ompi_attr_set_fortran_mpi1(ompi_attribute_type_t type, void *o
369
400
* So yes, this is more code, but it's clearer and less error-prone
370
401
* (read: better) this way.
371
402
*/
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 );
403
+ OMPI_DECLSPEC int ompi_attr_set_aint (ompi_attribute_type_t type , void * object ,
404
+ opal_hash_table_t * * attr_hash ,
405
+ int key , MPI_Aint attribute ,
406
+ bool predefined );
376
407
377
408
/**
378
409
* Get an attribute on the comm/win/datatype in a form valid for C.
@@ -385,7 +416,7 @@ OMPI_DECLSPEC int ompi_attr_set_fortran_mpi2(ompi_attribute_type_t type, void *o
385
416
* @return OMPI error code
386
417
*
387
418
* All three of these functions (ompi_attr_get_c(),
388
- * ompi_attr_get_fortran_mpi1 (), and ompi_attr_get_fortran_mpi2 ())
419
+ * ompi_attr_get_fint (), and ompi_attr_get_aint ())
389
420
* could have been combined into one function that took some kind of
390
421
* (void*) and an enum to indicate which way to translate the final
391
422
* representation, but that just seemed to make an already complicated
@@ -412,7 +443,7 @@ int ompi_attr_get_c(opal_hash_table_t *attr_hash, int key,
412
443
* @return OMPI error code
413
444
*
414
445
* All three of these functions (ompi_attr_get_c(),
415
- * ompi_attr_get_fortran_mpi1 (), and ompi_attr_get_fortran_mpi2 ())
446
+ * ompi_attr_get_fint (), and ompi_attr_get_aint ())
416
447
* could have been combined into one function that took some kind of
417
448
* (void*) and an enum to indicate which way to translate the final
418
449
* representation, but that just seemed to make an already complicated
@@ -423,8 +454,8 @@ int ompi_attr_get_c(opal_hash_table_t *attr_hash, int key,
423
454
* (read: better) this way.
424
455
*/
425
456
426
- OMPI_DECLSPEC int ompi_attr_get_fortran_mpi1 (opal_hash_table_t * attr_hash , int key ,
427
- MPI_Fint * attribute , int * flag );
457
+ OMPI_DECLSPEC int ompi_attr_get_fint (opal_hash_table_t * attr_hash , int key ,
458
+ MPI_Fint * attribute , int * flag );
428
459
429
460
430
461
/**
@@ -439,7 +470,7 @@ int ompi_attr_get_c(opal_hash_table_t *attr_hash, int key,
439
470
* @return OMPI error code
440
471
*
441
472
* All three of these functions (ompi_attr_get_c(),
442
- * ompi_attr_get_fortran_mpi1 (), and ompi_attr_get_fortran_mpi2 ())
473
+ * ompi_attr_get_fint (), and ompi_attr_get_aint ())
443
474
* could have been combined into one function that took some kind of
444
475
* (void*) and an enum to indicate which way to translate the final
445
476
* representation, but that just seemed to make an already complicated
@@ -450,8 +481,8 @@ int ompi_attr_get_c(opal_hash_table_t *attr_hash, int key,
450
481
* (read: better) this way.
451
482
*/
452
483
453
- OMPI_DECLSPEC int ompi_attr_get_fortran_mpi2 (opal_hash_table_t * attr_hash , int key ,
454
- MPI_Aint * attribute , int * flag );
484
+ OMPI_DECLSPEC int ompi_attr_get_aint (opal_hash_table_t * attr_hash , int key ,
485
+ MPI_Aint * attribute , int * flag );
455
486
456
487
457
488
/**
0 commit comments