1010 * Copyright (c) 2004-2005 The Regents of the University of California.
1111 * All rights reserved.
1212 * 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.
1315 * $COPYRIGHT$
1416 *
1517 * Additional copyrights may follow
4143 */
4244#define OMPI_KEYVAL_PREDEFINED 0x0001
4345#define OMPI_KEYVAL_F77 0x0002
44- #define OMPI_KEYVAL_F77_MPI1 0x0004
46+ #define OMPI_KEYVAL_F77_INT 0x0004
4547
4648
4749BEGIN_C_DECLS
@@ -62,14 +64,14 @@ typedef enum ompi_attribute_type_t ompi_attribute_type_t;
6264 delete. These will only be used here and not in the front end
6365 functions. */
6466
65- typedef void (ompi_mpi1_fortran_copy_attr_function )(MPI_Fint * oldobj ,
67+ typedef void (ompi_fint_copy_attr_function )(MPI_Fint * oldobj ,
6668 MPI_Fint * keyval ,
6769 MPI_Fint * extra_state ,
6870 MPI_Fint * attr_in ,
6971 MPI_Fint * attr_out ,
7072 ompi_fortran_logical_t * flag ,
7173 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 ,
7375 MPI_Fint * keyval ,
7476 MPI_Fint * attr_in ,
7577 MPI_Fint * extra_state ,
@@ -79,18 +81,18 @@ typedef void (ompi_mpi1_fortran_delete_attr_function)(MPI_Fint *obj,
7981 delete. These will only be used here and not in the front end
8082 functions. */
8183
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 );
9496/*
9597 * Internally the copy function for all kinds of MPI objects has one more
9698 * argument, the pointer to the new object. Therefore, we can do on the
@@ -124,13 +126,13 @@ union ompi_attribute_fn_ptr_union_t {
124126
125127 /* For Fortran old MPI-1 callback functions */
126128
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 ;
129131
130132 /* For Fortran new MPI-2 callback functions */
131133
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 ;
134136};
135137
136138typedef 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,
297299 * If (*attr_hash) == NULL, a new hash will be created and
298300 * initialized.
299301 *
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 ())
302304 * could have been combined into one function that took some kind of
303305 * (void*) and an enum to indicate which way to translate the final
304306 * 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,
312314 opal_hash_table_t * * attr_hash ,
313315 int key , void * attribute , bool predefined );
314316
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+
315346/**
316347 * Set an attribute on the comm/win/datatype in a form valid for
317348 * Fortran MPI-1.
@@ -327,8 +358,8 @@ int ompi_attr_set_c(ompi_attribute_type_t type, void *object,
327358 * If (*attr_hash) == NULL, a new hash will be created and
328359 * initialized.
329360 *
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 ())
332363 * could have been combined into one function that took some kind of
333364 * (void*) and an enum to indicate which way to translate the final
334365 * 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,
338369 * So yes, this is more code, but it's clearer and less error-prone
339370 * (read: better) this way.
340371 */
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 );
345376
346377/**
347378 * 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
358389 * If (*attr_hash) == NULL, a new hash will be created and
359390 * initialized.
360391 *
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 ())
363394 * could have been combined into one function that took some kind of
364395 * (void*) and an enum to indicate which way to translate the final
365396 * 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
369400 * So yes, this is more code, but it's clearer and less error-prone
370401 * (read: better) this way.
371402 */
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 );
376407
377408/**
378409 * 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
385416 * @return OMPI error code
386417 *
387418 * 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 ())
389420 * could have been combined into one function that took some kind of
390421 * (void*) and an enum to indicate which way to translate the final
391422 * 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,
412443 * @return OMPI error code
413444 *
414445 * 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 ())
416447 * could have been combined into one function that took some kind of
417448 * (void*) and an enum to indicate which way to translate the final
418449 * 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,
423454 * (read: better) this way.
424455 */
425456
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 );
428459
429460
430461/**
@@ -439,7 +470,7 @@ int ompi_attr_get_c(opal_hash_table_t *attr_hash, int key,
439470 * @return OMPI error code
440471 *
441472 * 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 ())
443474 * could have been combined into one function that took some kind of
444475 * (void*) and an enum to indicate which way to translate the final
445476 * 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,
450481 * (read: better) this way.
451482 */
452483
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 );
455486
456487
457488/**
0 commit comments