1
1

Merge pull request #2940 from ggouaillardet/topic/hetero_fixes

misc fixes for heterogeneous cluster support
Этот коммит содержится в:
Gilles Gouaillardet 2017-07-12 11:45:25 +09:00 коммит произвёл GitHub
родитель c18007d095 7a866f754c
Коммит a71d5c9e88
30 изменённых файлов: 579 добавлений и 359 удалений

Просмотреть файл

@ -286,7 +286,22 @@ fi
AC_DEFINE_UNQUOTED(OPAL_ENABLE_DLOPEN_SUPPORT, $OPAL_ENABLE_DLOPEN_SUPPORT,
[Whether we want to enable dlopen support])
opal_want_heterogeneous=0
#
# Heterogeneous support
#
AC_MSG_CHECKING([if want heterogeneous support])
AC_ARG_ENABLE([heterogeneous],
[AC_HELP_STRING([--enable-heterogeneous],
[Enable features required for heterogeneous
platform support (default: disabled)])])
if test "$enable_heterogeneous" = "yes" ; then
AC_MSG_RESULT([yes])
opal_want_heterogeneous=1
else
AC_MSG_RESULT([no])
opal_want_heterogeneous=0
fi
AC_DEFINE_UNQUOTED([OPAL_ENABLE_HETEROGENEOUS_SUPPORT],
[$opal_want_heterogeneous],
[Enable features required for heterogeneous support])

Просмотреть файл

@ -599,7 +599,7 @@ AC_CHECK_HEADERS([alloca.h aio.h arpa/inet.h dirent.h \
sys/types.h sys/uio.h sys/un.h net/uio.h sys/utsname.h sys/vfs.h sys/wait.h syslog.h \
termios.h ulimit.h unistd.h util.h utmp.h malloc.h \
ifaddrs.h crt_externs.h regex.h mntent.h paths.h \
ioLib.h sockLib.h hostLib.h shlwapi.h sys/synch.h db.h ndbm.h zlib.h])
ioLib.h sockLib.h hostLib.h shlwapi.h sys/synch.h db.h ndbm.h zlib.h ieee754.h])
AC_CHECK_HEADERS([sys/mount.h], [], [],
[AC_INCLUDES_DEFAULT

Просмотреть файл

@ -12,6 +12,8 @@
* Copyright (c) 2006-2014 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2012 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -30,12 +32,13 @@
* There are several places in the standard that should be read about
* attributes:
*
* MPI-1: Section 5.7 (pp 167-173)
* MPI-1: Section 7.1 (pp 191-192) predefined attributes in MPI-1
* MPI-2: Section 4.12.7 (pp 57-59) interlanguage attribute
* clarifications
* MPI-2: Section 6.2.2 (pp 112) window predefined attributes
* MPI-2: Section 8.8 (pp 198-208) new attribute caching functions
* MPI-1: Section 5.7 (pp 167-173)
* MPI-1: Section 7.1 (pp 191-192) predefined attributes in MPI-1
* MPI-2: Section 4.12.7 (pp 57-59) interlanguage attribute
* clarifications
* MPI-2: Section 6.2.2 (pp 112) window predefined attributes
* MPI-2: Section 8.8 (pp 198-208) new attribute caching functions
* MPI-3.1: Section 11.2.6 (pp 414-415) window attributes
*
* After reading all of this, note the following:
*
@ -50,6 +53,8 @@
* means writing a pointer to an instance of something; changing the
* value of that instance will make it visible to anyone who reads
* that attribute value).
* - C also internally store some int attributes of a MPI_Win by value,
* and these attributes are read-only (i.e. set once for all)
* - Fortran functions store values by value (i.e., writing an
* attribute value means that anyone who reads that attribute value
* will not be able to affect the value read by anyone else).
@ -60,10 +65,10 @@
* - MPI-2 4.12.7:Example 4.13 (p58) is wrong. The C->Fortran example
* should have the Fortran "val" variable equal to &I.
*
* By the first two of these, there are 9 possible use cases -- 3
* By the first two of these, there are 12 possible use cases -- 4
* possibilities for writing an attribute value, each of which has 3
* possibilities for reading that value back. The following lists
* each of the 9 cases, and what happens in each.
* each of the 12 cases, and what happens in each.
*
* Cases where C writes an attribute value:
* ----------------------------------------
@ -109,22 +114,20 @@
* CALL MPI_COMM_GET_ATTR(..., ret, ierr)
* --> ret will equal &bar
*
* Cases where Fortran MPI-1 writes an attribute value:
* Cases where C writes an int attribute:
* ----------------------------------------------------
*
* In all of these cases, an INTEGER is written by Fortran.
* In all of these cases, an int is written by C.
* This is done internally when writing the attributes of a MPI_Win
*
* Example: INTEGER FOO = 7
* CALL MPI_ATTR_PUT(..., foo, ierr)
* Example: int foo = 7;
* ompi_set_attr_int(..., foo, ...)
*
* 4. C reads the attribute value. The value returned is a pointer
* that points to an INTEGER (i.e., an MPI_Fint) that has a value
* that points to an int that has a value
* of 7.
* --> NOTE: The external MPI interface does not distinguish between
* this case and case 7. It is the programer's responsibility
* to code accordingly.
*
* Example: MPI_Fint *ret;
* Example: int *ret;
* MPI_Attr_get(..., &ret);
* -> *ret will equal 7.
*
@ -143,6 +146,40 @@
* CALL MPI_COMM_GET_ATTR(..., ret, ierr)
* --> ret will equal 7
*
* Cases where Fortran MPI-1 writes an attribute value:
* ----------------------------------------------------
*
* In all of these cases, an INTEGER is written by Fortran.
*
* Example: INTEGER FOO = 7
* CALL MPI_ATTR_PUT(..., foo, ierr)
*
* 7. C reads the attribute value. The value returned is a pointer
* that points to an INTEGER (i.e., an MPI_Fint) that has a value
* of 7.
* --> NOTE: The external MPI interface does not distinguish between
* this case and case 7. It is the programer's responsibility
* to code accordingly.
*
* Example: MPI_Fint *ret;
* MPI_Attr_get(..., &ret);
* -> *ret will equal 7.
*
* 8. Fortran MPI-1 reads the attribute value. This is the unity
* case; the same value is returned.
*
* Example: INTEGER ret
* CALL MPI_ATTR_GET(..., ret, ierr)
* --> ret will equal 7
*
* 9. Fortran MPI-2 reads the attribute value. The same value is
* returned, but potentially sign-extended if sizeof(INTEGER) <
* sizeof(INTEGER(KIND=MPI_ADDRESS_KIND)).
*
* Example: INTEGER(KIND=MPI_ADDRESS_KIND) ret
* CALL MPI_COMM_GET_ATTR(..., ret, ierr)
* --> ret will equal 7
*
* Cases where Fortran MPI-2 writes an attribute value:
* ----------------------------------------------------
*
@ -156,7 +193,7 @@
* INTEGER(KIND=MPI_ADDRESS_KIND) FOO = pow(2, 40)
* CALL MPI_COMM_PUT_ATTR(..., foo, ierr)
*
* 7. C reads the attribute value. The value returned is a pointer
* 10. C reads the attribute value. The value returned is a pointer
* that points to an INTEGER(KIND=MPI_ADDRESS_KIND) (i.e., a void*)
* that has a value of 12.
* --> NOTE: The external MPI interface does not distinguish between
@ -170,7 +207,7 @@
* MPI_Attr_get(..., &ret);
* -> *ret will equal 2^40
*
* 8. Fortran MPI-1 reads the attribute value. The same value is
* 11. Fortran MPI-1 reads the attribute value. The same value is
* returned, but potentially truncated if sizeof(INTEGER) <
* sizeof(INTEGER(KIND=MPI_ADDRESS_KIND)).
*
@ -181,7 +218,7 @@
* CALL MPI_ATTR_GET(..., ret, ierr)
* --> ret will equal 0
*
* 9. Fortran MPI-2 reads the attribute value. This is the unity
* 12. Fortran MPI-2 reads the attribute value. This is the unity
* case; the same value is returned.
*
* Example A: INTEGER(KIND=MPI_ADDRESS_KIND) ret
@ -235,10 +272,10 @@
1. MPI-1 Fortran-style: attribute and extra state arguments are of
type (INTEGER). This is used if both the OMPI_KEYVAL_F77 and
OMPI_KEYVAL_F77_MPI1 flags are set.
OMPI_KEYVAL_F77_INT flags are set.
2. MPI-2 Fortran-style: attribute and extra state arguments are of
type (INTEGER(KIND=MPI_ADDRESS_KIND)). This is used if the
OMPI_KEYVAL_F77 flag is set and the OMPI_KEYVAL_F77_MPI1 flag is
OMPI_KEYVAL_F77 flag is set and the OMPI_KEYVAL_F77_INT flag is
*not* set.
3. C-style: attribute arguments are of type (void*). This is used
if OMPI_KEYVAL_F77 is not set.
@ -252,11 +289,13 @@ do { \
if (0 != (keyval_obj->attr_flag & OMPI_KEYVAL_F77)) { \
MPI_Fint f_key = OMPI_INT_2_FINT(key); \
MPI_Fint f_err; \
MPI_Fint attr_##type##_f; \
attr_##type##_f = OMPI_INT_2_FINT(((ompi_##type##_t *)keyval_obj)->attr_##type##_f); \
/* MPI-1 Fortran-style */ \
if (0 != (keyval_obj->attr_flag & OMPI_KEYVAL_F77_MPI1)) { \
MPI_Fint attr_val = translate_to_fortran_mpi1(attribute); \
(*((keyval_obj->delete_attr_fn).attr_mpi1_fortran_delete_fn)) \
(&(((ompi_##type##_t *)object)->attr_##type##_f), \
if (0 != (keyval_obj->attr_flag & OMPI_KEYVAL_F77_INT)) { \
MPI_Fint attr_val = translate_to_fint(attribute); \
(*((keyval_obj->delete_attr_fn).attr_fint_delete_fn)) \
(&attr_##type##_f, \
&f_key, &attr_val, &keyval_obj->extra_state.f_integer, &f_err); \
if (MPI_SUCCESS != OMPI_FINT_2_INT(f_err)) { \
err = OMPI_FINT_2_INT(f_err); \
@ -264,9 +303,9 @@ do { \
} \
/* MPI-2 Fortran-style */ \
else { \
MPI_Aint attr_val = translate_to_fortran_mpi2(attribute); \
(*((keyval_obj->delete_attr_fn).attr_mpi2_fortran_delete_fn)) \
(&(((ompi_##type##_t *)object)->attr_##type##_f), \
MPI_Aint attr_val = translate_to_aint(attribute); \
(*((keyval_obj->delete_attr_fn).attr_aint_delete_fn)) \
(&attr_##type##_f, \
&f_key, (int*)&attr_val, &keyval_obj->extra_state.f_address, &f_err); \
if (MPI_SUCCESS != OMPI_FINT_2_INT(f_err)) { \
err = OMPI_FINT_2_INT(f_err); \
@ -295,27 +334,31 @@ do { \
MPI_Fint f_err; \
ompi_fortran_logical_t f_flag; \
/* MPI-1 Fortran-style */ \
if (0 != (keyval_obj->attr_flag & OMPI_KEYVAL_F77_MPI1)) { \
MPI_Fint in, out; \
in = translate_to_fortran_mpi1(in_attr); \
(*((keyval_obj->copy_attr_fn).attr_mpi1_fortran_copy_fn)) \
(&(((ompi_##type##_t *)old_object)->attr_##type##_f), \
if (0 != (keyval_obj->attr_flag & OMPI_KEYVAL_F77_INT)) { \
MPI_Fint in, out; \
MPI_Fint attr_##type##_f; \
in = translate_to_fint(in_attr); \
attr_##type##_f = OMPI_INT_2_FINT(((ompi_##type##_t *)old_object)->attr_##type##_f); \
(*((keyval_obj->copy_attr_fn).attr_fint_copy_fn)) \
(&attr_##type##_f, \
&f_key, &keyval_obj->extra_state.f_integer, \
&in, &out, &f_flag, &f_err); \
if (MPI_SUCCESS != OMPI_FINT_2_INT(f_err)) { \
err = OMPI_FINT_2_INT(f_err); \
} else { \
out_attr->av_value = (void*) 0; \
*out_attr->av_integer_pointer = out; \
*out_attr->av_fint_pointer = out; \
flag = OMPI_LOGICAL_2_INT(f_flag); \
} \
} \
/* MPI-2 Fortran-style */ \
else { \
MPI_Aint in, out; \
in = translate_to_fortran_mpi2(in_attr); \
(*((keyval_obj->copy_attr_fn).attr_mpi2_fortran_copy_fn)) \
(&(((ompi_##type##_t *)old_object)->attr_##type##_f), \
MPI_Fint attr_##type##_f; \
in = translate_to_aint(in_attr); \
attr_##type##_f = OMPI_INT_2_FINT(((ompi_##type##_t *)old_object)->attr_##type##_f); \
(*((keyval_obj->copy_attr_fn).attr_aint_copy_fn)) \
(&attr_##type##_f, \
&f_key, &keyval_obj->extra_state.f_address, &in, &out, \
&f_flag, &f_err); \
if (MPI_SUCCESS != OMPI_FINT_2_INT(f_err)) { \
@ -339,17 +382,16 @@ do { \
OPAL_THREAD_LOCK(&attribute_lock); \
} while (0)
/*
* Cases for attribute values
*/
typedef enum ompi_attribute_translate_t {
OMPI_ATTRIBUTE_C,
OMPI_ATTRIBUTE_FORTRAN_MPI1,
OMPI_ATTRIBUTE_FORTRAN_MPI2
OMPI_ATTRIBUTE_INT,
OMPI_ATTRIBUTE_FINT,
OMPI_ATTRIBUTE_AINT
} ompi_attribute_translate_t;
/*
* struct to hold attribute values on each MPI object
*/
@ -357,8 +399,9 @@ typedef struct attribute_value_t {
opal_object_t super;
int av_key;
void *av_value;
MPI_Aint *av_address_kind_pointer;
MPI_Fint *av_integer_pointer;
int *av_int_pointer;
MPI_Fint *av_fint_pointer;
MPI_Aint *av_aint_pointer;
int av_set_from;
int av_sequence;
} attribute_value_t;
@ -377,8 +420,9 @@ static int set_value(ompi_attribute_type_t type, void *object,
static int get_value(opal_hash_table_t *attr_hash, int key,
attribute_value_t **attribute, int *flag);
static void *translate_to_c(attribute_value_t *val);
static MPI_Fint translate_to_fortran_mpi1(attribute_value_t *val);
static MPI_Aint translate_to_fortran_mpi2(attribute_value_t *val);
static MPI_Fint translate_to_fint(attribute_value_t *val);
static MPI_Aint translate_to_aint(attribute_value_t *val);
static int compare_attr_sequence(const void *attr1, const void *attr2);
@ -408,6 +452,7 @@ static opal_hash_table_t *keyval_hash;
static opal_bitmap_t *key_bitmap;
static int attr_sequence;
static unsigned int int_pos = 12345;
static unsigned int integer_pos = 12345;
/*
* MPI attributes are *not* high performance, so just use a One Big Lock
@ -423,8 +468,9 @@ static opal_mutex_t attribute_lock;
static void attribute_value_construct(attribute_value_t *item)
{
item->av_key = MPI_KEYVAL_INVALID;
item->av_address_kind_pointer = (MPI_Aint*) &item->av_value;
item->av_integer_pointer = &(((MPI_Fint*) &item->av_value)[int_pos]);
item->av_aint_pointer = (MPI_Aint*) &item->av_value;
item->av_int_pointer = (int *)&item->av_value + int_pos;
item->av_fint_pointer = (MPI_Fint *)&item->av_value + integer_pos;
item->av_set_from = 0;
item->av_sequence = -1;
}
@ -475,7 +521,7 @@ int ompi_attr_init(void)
{
int ret;
void *bogus = (void*) 1;
MPI_Fint *p = (MPI_Fint*) &bogus;
int *p = (int *) &bogus;
keyval_hash = OBJ_NEW(opal_hash_table_t);
if (NULL == keyval_hash) {
@ -490,13 +536,20 @@ int ompi_attr_init(void)
return OMPI_ERR_OUT_OF_RESOURCE;
}
for (int_pos = 0; int_pos < (sizeof(void*) / sizeof(MPI_Fint));
for (int_pos = 0; int_pos < (sizeof(void*) / sizeof(int));
++int_pos) {
if (p[int_pos] == 1) {
break;
}
}
for (integer_pos = 0; integer_pos < (sizeof(void*) / sizeof(MPI_Fint));
++integer_pos) {
if (p[integer_pos] == 1) {
break;
}
}
OBJ_CONSTRUCT(&attribute_lock, opal_mutex_t);
if (OMPI_SUCCESS != (ret = opal_hash_table_init(keyval_hash,
@ -600,6 +653,9 @@ int ompi_attr_create_keyval_fint(ompi_attribute_type_t type,
ompi_attribute_fortran_ptr_t es_tmp;
es_tmp.f_integer = extra_state;
#if SIZEOF_INT == OMPI_SIZEOF_FORTRAN_INTEGER
flags |= OMPI_KEYVAL_F77_INT;
#endif
return ompi_attr_create_keyval_impl(type, copy_attr_fn, delete_attr_fn,
key, &es_tmp, flags,
bindings_extra_state);
@ -687,13 +743,12 @@ int ompi_attr_set_c(ompi_attribute_type_t type, void *object,
/*
* Front-end function called by the Fortran MPI-1 API functions to set
* an attribute.
* Front-end function internally called by the C API functions to set an
* int attribute.
*/
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)
int ompi_attr_set_int(ompi_attribute_type_t type, void *object,
opal_hash_table_t **attr_hash,
int key, int attribute, bool predefined)
{
int ret;
attribute_value_t *new_attr = OBJ_NEW(attribute_value_t);
@ -704,8 +759,40 @@ int ompi_attr_set_fortran_mpi1(ompi_attribute_type_t type, void *object,
OPAL_THREAD_LOCK(&attribute_lock);
new_attr->av_value = (void *) 0;
*new_attr->av_integer_pointer = attribute;
new_attr->av_set_from = OMPI_ATTRIBUTE_FORTRAN_MPI1;
*new_attr->av_int_pointer = attribute;
new_attr->av_set_from = OMPI_ATTRIBUTE_INT;
ret = set_value(type, object, attr_hash, key, new_attr, predefined);
if (OMPI_SUCCESS != ret) {
OBJ_RELEASE(new_attr);
}
opal_atomic_wmb();
OPAL_THREAD_UNLOCK(&attribute_lock);
return ret;
}
/*
* Front-end function called by the Fortran MPI-1 API functions to set
* an attribute.
*/
int ompi_attr_set_fint(ompi_attribute_type_t type, void *object,
opal_hash_table_t **attr_hash,
int key, MPI_Fint attribute,
bool predefined)
{
int ret;
attribute_value_t *new_attr = OBJ_NEW(attribute_value_t);
if (NULL == new_attr) {
return OMPI_ERR_OUT_OF_RESOURCE;
}
OPAL_THREAD_LOCK(&attribute_lock);
new_attr->av_value = (void *) 0;
*new_attr->av_fint_pointer = attribute;
new_attr->av_set_from = OMPI_ATTRIBUTE_FINT;
ret = set_value(type, object, attr_hash, key, new_attr, predefined);
if (OMPI_SUCCESS != ret) {
OBJ_RELEASE(new_attr);
@ -722,10 +809,10 @@ int ompi_attr_set_fortran_mpi1(ompi_attribute_type_t type, void *object,
* Front-end function called by the Fortran MPI-2 API functions to set
* an attribute.
*/
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)
int ompi_attr_set_aint(ompi_attribute_type_t type, void *object,
opal_hash_table_t **attr_hash,
int key, MPI_Aint attribute,
bool predefined)
{
int ret;
attribute_value_t *new_attr = OBJ_NEW(attribute_value_t);
@ -736,7 +823,7 @@ int ompi_attr_set_fortran_mpi2(ompi_attribute_type_t type, void *object,
OPAL_THREAD_LOCK(&attribute_lock);
new_attr->av_value = (void *) attribute;
new_attr->av_set_from = OMPI_ATTRIBUTE_FORTRAN_MPI2;
new_attr->av_set_from = OMPI_ATTRIBUTE_AINT;
ret = set_value(type, object, attr_hash, key, new_attr, predefined);
if (OMPI_SUCCESS != ret) {
OBJ_RELEASE(new_attr);
@ -777,8 +864,8 @@ int ompi_attr_get_c(opal_hash_table_t *attr_hash, int key,
* Front-end function called by the Fortran MPI-1 API functions to get
* attributes.
*/
int ompi_attr_get_fortran_mpi1(opal_hash_table_t *attr_hash, int key,
MPI_Fint *attribute, int *flag)
int ompi_attr_get_fint(opal_hash_table_t *attr_hash, int key,
MPI_Fint *attribute, int *flag)
{
attribute_value_t *val = NULL;
int ret;
@ -787,7 +874,7 @@ int ompi_attr_get_fortran_mpi1(opal_hash_table_t *attr_hash, int key,
ret = get_value(attr_hash, key, &val, flag);
if (MPI_SUCCESS == ret && 1 == *flag) {
*attribute = translate_to_fortran_mpi1(val);
*attribute = translate_to_fint(val);
}
opal_atomic_wmb();
@ -800,8 +887,8 @@ int ompi_attr_get_fortran_mpi1(opal_hash_table_t *attr_hash, int key,
* Front-end function called by the Fortran MPI-2 API functions to get
* attributes.
*/
int ompi_attr_get_fortran_mpi2(opal_hash_table_t *attr_hash, int key,
MPI_Aint *attribute, int *flag)
int ompi_attr_get_aint(opal_hash_table_t *attr_hash, int key,
MPI_Aint *attribute, int *flag)
{
attribute_value_t *val = NULL;
int ret;
@ -810,7 +897,7 @@ int ompi_attr_get_fortran_mpi2(opal_hash_table_t *attr_hash, int key,
ret = get_value(attr_hash, key, &val, flag);
if (MPI_SUCCESS == ret && 1 == *flag) {
*attribute = translate_to_fortran_mpi2(val);
*attribute = translate_to_aint(val);
}
opal_atomic_wmb();
@ -903,10 +990,10 @@ int ompi_attr_copy_all(ompi_attribute_type_t type, void *old_object,
-- not .TRUE. */
if (1 == flag) {
if (0 != (hash_value->attr_flag & OMPI_KEYVAL_F77)) {
if (0 != (hash_value->attr_flag & OMPI_KEYVAL_F77_MPI1)) {
new_attr->av_set_from = OMPI_ATTRIBUTE_FORTRAN_MPI1;
if (0 != (hash_value->attr_flag & OMPI_KEYVAL_F77_INT)) {
new_attr->av_set_from = OMPI_ATTRIBUTE_FINT;
} else {
new_attr->av_set_from = OMPI_ATTRIBUTE_FORTRAN_MPI2;
new_attr->av_set_from = OMPI_ATTRIBUTE_AINT;
}
} else {
new_attr->av_set_from = OMPI_ATTRIBUTE_C;
@ -1234,19 +1321,21 @@ static void *translate_to_c(attribute_value_t *val)
{
switch (val->av_set_from) {
case OMPI_ATTRIBUTE_C:
/* Case 1: written in C, read in C (unity) */
/* Case 1: wrote a C pointer, read a C pointer
(unity) */
return val->av_value;
break;
case OMPI_ATTRIBUTE_FORTRAN_MPI1:
/* Case 4: written in Fortran MPI-1, read in C */
return (void *) val->av_integer_pointer;
break;
case OMPI_ATTRIBUTE_INT:
/* Case 4: wrote an int, read a C pointer */
return (void *) val->av_int_pointer;
case OMPI_ATTRIBUTE_FORTRAN_MPI2:
/* Case 7: written in Fortran MPI-2, read in C */
return (void *) val->av_address_kind_pointer;
break;
case OMPI_ATTRIBUTE_FINT:
/* Case 7: wrote a MPI_Fint, read a C pointer */
return (void *) val->av_fint_pointer;
case OMPI_ATTRIBUTE_AINT:
/* Case 10: wrote a MPI_Aint, read a C pointer */
return (void *) val->av_aint_pointer;
default:
/* Should never reach here */
@ -1262,24 +1351,25 @@ static void *translate_to_c(attribute_value_t *val)
* This function does not fail -- it is only invoked in "safe"
* situations.
*/
static MPI_Fint translate_to_fortran_mpi1(attribute_value_t *val)
static MPI_Fint translate_to_fint(attribute_value_t *val)
{
switch (val->av_set_from) {
case OMPI_ATTRIBUTE_C:
/* Case 2: written in C, read in Fortran MPI-1 */
return *val->av_integer_pointer;
break;
/* Case 2: wrote a C pointer, read a MPI_Fint */
return (MPI_Fint)*val->av_int_pointer;
case OMPI_ATTRIBUTE_FORTRAN_MPI1:
/* Case 5: written in Fortran MPI-1, read in Fortran MPI-1
case OMPI_ATTRIBUTE_INT:
/* Case 5: wrote an int, read a MPI_Fint */
return (MPI_Fint)*val->av_int_pointer;
case OMPI_ATTRIBUTE_FINT:
/* Case 8: wrote a MPI_Fint, read a MPI_Fint
(unity) */
return *val->av_integer_pointer;
break;
return *val->av_fint_pointer;
case OMPI_ATTRIBUTE_FORTRAN_MPI2:
/* Case 8: written in Fortran MPI-2, read in Fortran MPI-1 */
return *val->av_integer_pointer;
break;
case OMPI_ATTRIBUTE_AINT:
/* Case 11: wrote a MPI_Aint, read a MPI_Fint */
return (MPI_Fint)*val->av_fint_pointer;
default:
/* Should never reach here */
@ -1295,24 +1385,25 @@ static MPI_Fint translate_to_fortran_mpi1(attribute_value_t *val)
* This function does not fail -- it is only invoked in "safe"
* situations.
*/
static MPI_Aint translate_to_fortran_mpi2(attribute_value_t *val)
static MPI_Aint translate_to_aint(attribute_value_t *val)
{
switch (val->av_set_from) {
case OMPI_ATTRIBUTE_C:
/* Case 3: written in C, read in Fortran MPI-2 */
/* Case 3: wrote a C pointer, read a MPI_Aint */
return (MPI_Aint) val->av_value;
break;
case OMPI_ATTRIBUTE_FORTRAN_MPI1:
/* Case 6: written in Fortran MPI-1, read in Fortran MPI-2 */
return (MPI_Aint) *val->av_integer_pointer;
break;
case OMPI_ATTRIBUTE_INT:
/* Case 6: wrote an int, read a MPI_Aint */
return (MPI_Aint) *val->av_int_pointer;
case OMPI_ATTRIBUTE_FORTRAN_MPI2:
/* Case 9: written in Fortran MPI-2, read in Fortran MPI-2
case OMPI_ATTRIBUTE_FINT:
/* Case 9: wrote a MPI_Fint, read a MPI_Aint */
return (MPI_Aint) *val->av_fint_pointer;
case OMPI_ATTRIBUTE_AINT:
/* Case 12: wrote a MPI_Aint, read a MPI_Aint
(unity) */
return (MPI_Aint) val->av_value;
break;
default:
/* Should never reach here */

Просмотреть файл

@ -10,6 +10,8 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -41,7 +43,7 @@
*/
#define OMPI_KEYVAL_PREDEFINED 0x0001
#define OMPI_KEYVAL_F77 0x0002
#define OMPI_KEYVAL_F77_MPI1 0x0004
#define OMPI_KEYVAL_F77_INT 0x0004
BEGIN_C_DECLS
@ -62,14 +64,14 @@ typedef enum ompi_attribute_type_t ompi_attribute_type_t;
delete. These will only be used here and not in the front end
functions. */
typedef void (ompi_mpi1_fortran_copy_attr_function)(MPI_Fint *oldobj,
typedef void (ompi_fint_copy_attr_function)(MPI_Fint *oldobj,
MPI_Fint *keyval,
MPI_Fint *extra_state,
MPI_Fint *attr_in,
MPI_Fint *attr_out,
ompi_fortran_logical_t *flag,
MPI_Fint *ierr);
typedef void (ompi_mpi1_fortran_delete_attr_function)(MPI_Fint *obj,
typedef void (ompi_fint_delete_attr_function)(MPI_Fint *obj,
MPI_Fint *keyval,
MPI_Fint *attr_in,
MPI_Fint *extra_state,
@ -79,18 +81,18 @@ typedef void (ompi_mpi1_fortran_delete_attr_function)(MPI_Fint *obj,
delete. These will only be used here and not in the front end
functions. */
typedef void (ompi_mpi2_fortran_copy_attr_function)(MPI_Fint *oldobj,
MPI_Fint *keyval,
void *extra_state,
void *attr_in,
void *attr_out,
ompi_fortran_logical_t *flag,
MPI_Fint *ierr);
typedef void (ompi_mpi2_fortran_delete_attr_function)(MPI_Fint *obj,
MPI_Fint *keyval,
void *attr_in,
void *extra_state,
MPI_Fint *ierr);
typedef void (ompi_aint_copy_attr_function)(MPI_Fint *oldobj,
MPI_Fint *keyval,
void *extra_state,
void *attr_in,
void *attr_out,
ompi_fortran_logical_t *flag,
MPI_Fint *ierr);
typedef void (ompi_aint_delete_attr_function)(MPI_Fint *obj,
MPI_Fint *keyval,
void *attr_in,
void *extra_state,
MPI_Fint *ierr);
/*
* Internally the copy function for all kinds of MPI objects has one more
* argument, the pointer to the new object. Therefore, we can do on the
@ -124,13 +126,13 @@ union ompi_attribute_fn_ptr_union_t {
/* For Fortran old MPI-1 callback functions */
ompi_mpi1_fortran_delete_attr_function *attr_mpi1_fortran_delete_fn;
ompi_mpi1_fortran_copy_attr_function *attr_mpi1_fortran_copy_fn;
ompi_fint_delete_attr_function *attr_fint_delete_fn;
ompi_fint_copy_attr_function *attr_fint_copy_fn;
/* For Fortran new MPI-2 callback functions */
ompi_mpi2_fortran_delete_attr_function *attr_mpi2_fortran_delete_fn;
ompi_mpi2_fortran_copy_attr_function *attr_mpi2_fortran_copy_fn;
ompi_aint_delete_attr_function *attr_aint_delete_fn;
ompi_aint_copy_attr_function *attr_aint_copy_fn;
};
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,
* If (*attr_hash) == NULL, a new hash will be created and
* initialized.
*
* All three of these functions (ompi_attr_set_c(),
* ompi_attr_set_fortran_mpi1(), and ompi_attr_set_fortran_mpi2())
* All four of these functions (ompi_attr_set_c(), ompi_attr_set_int(),
* ompi_attr_set_fint(), and ompi_attr_set_aint())
* could have been combined into one function that took some kind of
* (void*) and an enum to indicate which way to translate the final
* 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,
opal_hash_table_t **attr_hash,
int key, void *attribute, bool predefined);
/**
* Set an int predefined attribute in a form valid for C.
*
* @param type Type of attribute (COMM/WIN/DTYPE) (IN)
* @param object The actual Comm/Win/Datatype object (IN)
* @param attr_hash The attribute hash table hanging on the object(IN/OUT)
* @param key Key val for the attribute (IN)
* @param attribute The actual attribute value (IN)
* @param predefined Whether the key is predefined or not 0/1 (IN)
* @return OMPI error code
*
* If (*attr_hash) == NULL, a new hash will be created and
* initialized.
*
* All four of these functions (ompi_attr_set_c(), ompi_attr_set_int(),
* ompi_attr_set_fint(), and ompi_attr_set_aint())
* could have been combined into one function that took some kind of
* (void*) and an enum to indicate which way to translate the final
* representation, but that just seemed to make an already complicated
* situation more complicated through yet another layer of
* indirection.
*
* So yes, this is more code, but it's clearer and less error-prone
* (read: better) this way.
*/
int ompi_attr_set_int(ompi_attribute_type_t type, void *object,
opal_hash_table_t **attr_hash,
int key, int attribute, bool predefined);
/**
* Set an attribute on the comm/win/datatype in a form valid for
* Fortran MPI-1.
@ -327,8 +358,8 @@ int ompi_attr_set_c(ompi_attribute_type_t type, void *object,
* If (*attr_hash) == NULL, a new hash will be created and
* initialized.
*
* All three of these functions (ompi_attr_set_c(),
* ompi_attr_set_fortran_mpi1(), and ompi_attr_set_fortran_mpi2())
* All four of these functions (ompi_attr_set_c(), ompi_attr_set_int(),
* ompi_attr_set_fint(), and ompi_attr_set_aint())
* could have been combined into one function that took some kind of
* (void*) and an enum to indicate which way to translate the final
* 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,
* So yes, this is more code, but it's clearer and less error-prone
* (read: better) this way.
*/
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);
OMPI_DECLSPEC int ompi_attr_set_fint(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
@ -358,8 +389,8 @@ OMPI_DECLSPEC int ompi_attr_set_fortran_mpi1(ompi_attribute_type_t type, void *o
* If (*attr_hash) == NULL, a new hash will be created and
* initialized.
*
* All three of these functions (ompi_attr_set_c(),
* ompi_attr_set_fortran_mpi1(), and ompi_attr_set_fortran_mpi2())
* All four of these functions (ompi_attr_set_c(), ompi_attr_set_int(),
* ompi_attr_set_fint(), and ompi_attr_set_aint())
* could have been combined into one function that took some kind of
* (void*) and an enum to indicate which way to translate the final
* 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
* So yes, this is more code, but it's clearer and less error-prone
* (read: better) this way.
*/
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);
OMPI_DECLSPEC int ompi_attr_set_aint(ompi_attribute_type_t type, void *object,
opal_hash_table_t **attr_hash,
int key, MPI_Aint attribute,
bool predefined);
/**
* 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
* @return OMPI error code
*
* All three of these functions (ompi_attr_get_c(),
* ompi_attr_get_fortran_mpi1(), and ompi_attr_get_fortran_mpi2())
* ompi_attr_get_fint(), and ompi_attr_get_aint())
* could have been combined into one function that took some kind of
* (void*) and an enum to indicate which way to translate the final
* 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,
* @return OMPI error code
*
* All three of these functions (ompi_attr_get_c(),
* ompi_attr_get_fortran_mpi1(), and ompi_attr_get_fortran_mpi2())
* ompi_attr_get_fint(), and ompi_attr_get_aint())
* could have been combined into one function that took some kind of
* (void*) and an enum to indicate which way to translate the final
* 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,
* (read: better) this way.
*/
OMPI_DECLSPEC int ompi_attr_get_fortran_mpi1(opal_hash_table_t *attr_hash, int key,
MPI_Fint *attribute, int *flag);
OMPI_DECLSPEC int ompi_attr_get_fint(opal_hash_table_t *attr_hash, int key,
MPI_Fint *attribute, int *flag);
/**
@ -439,7 +470,7 @@ int ompi_attr_get_c(opal_hash_table_t *attr_hash, int key,
* @return OMPI error code
*
* All three of these functions (ompi_attr_get_c(),
* ompi_attr_get_fortran_mpi1(), and ompi_attr_get_fortran_mpi2())
* ompi_attr_get_fint(), and ompi_attr_get_aint())
* could have been combined into one function that took some kind of
* (void*) and an enum to indicate which way to translate the final
* 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,
* (read: better) this way.
*/
OMPI_DECLSPEC int ompi_attr_get_fortran_mpi2(opal_hash_table_t *attr_hash, int key,
MPI_Aint *attribute, int *flag);
OMPI_DECLSPEC int ompi_attr_get_aint(opal_hash_table_t *attr_hash, int key,
MPI_Aint *attribute, int *flag);
/**

Просмотреть файл

@ -11,6 +11,8 @@
* All rights reserved.
* Copyright (c) 2006 University of Houston. All rights reserved.
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -270,8 +272,8 @@ static int free_win(int keyval)
static int set_f(int keyval, MPI_Fint value)
{
return ompi_attr_set_fortran_mpi1(COMM_ATTR, MPI_COMM_WORLD,
&MPI_COMM_WORLD->c_keyhash,
keyval, value,
true);
return ompi_attr_set_fint(COMM_ATTR, MPI_COMM_WORLD,
&MPI_COMM_WORLD->c_keyhash,
keyval, value,
true);
}

Просмотреть файл

@ -6,7 +6,7 @@
* Copyright (c) 2011-2015 INRIA. All rights reserved.
* Copyright (c) 2012-2015 Bordeaux Poytechnic Institute
* Copyright (c) 2015-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2015-2016 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2016 Los Alamos National Security, LLC. All rights
* reserved.
@ -55,7 +55,16 @@
#define MY_STRING_SIZE 64
/*#define __DEBUG__ 1 */
/**
* This function is a allreduce between all processes to detect for oversubscription.
* On each node, the local_procs will be a different array, that contains only the
* local processes. Thus, that process will compute the node oversubscription and will
* bring this value to the operation, while every other process on the node will
* contribute 0.
* Doing an AllReduce might be an overkill for this situation, but it should remain
* more scalable than a star reduction (between the roots of each node (nodes_roots),
* followed by a bcast to all processes.
*/
static int check_oversubscribing(int rank,
int num_nodes,
int num_objs_in_node,
@ -64,48 +73,13 @@ static int check_oversubscribing(int rank,
int *local_procs,
ompi_communicator_t *comm_old)
{
int oversubscribed = 0;
int local_oversub = 0;
int err;
int oversubscribed = 0, local_oversub = 0, err;
/* Only a single process per node, the local root, compute the oversubscription condition */
if (rank == local_procs[0])
if(num_objs_in_node < num_procs_in_node)
local_oversub = 1;
if (rank == 0) {
MPI_Request *reqs = (MPI_Request *)calloc(num_nodes-1, sizeof(MPI_Request));
int *oversub = (int *)calloc(num_nodes, sizeof(int));
int i;
oversub[0] = local_oversub;
for(i = 1; i < num_nodes; i++)
if (OMPI_SUCCESS != ( err = MCA_PML_CALL(irecv(&oversub[i], 1, MPI_INT,
nodes_roots[i], 111, comm_old, &reqs[i-1])))) {
/* NTH: more needs to be done to correctly clean up here */
free (reqs);
free (oversub);
return err;
}
if (OMPI_SUCCESS != ( err = ompi_request_wait_all(num_nodes-1,
reqs, MPI_STATUSES_IGNORE))) {
/* NTH: more needs to be done to correctly clean up here */
free (reqs);
free (oversub);
return err;
}
for(i = 0; i < num_nodes; i++)
oversubscribed += oversub[i];
free(oversub);
free(reqs);
} else {
if (rank == local_procs[0])
if (OMPI_SUCCESS != (err = MCA_PML_CALL(send(&local_oversub, 1, MPI_INT, 0,
111, MCA_PML_BASE_SEND_STANDARD, comm_old))))
return err;
}
if (OMPI_SUCCESS != (err = comm_old->c_coll->coll_bcast(&oversubscribed, 1,
MPI_INT, 0, comm_old,
@ -163,7 +137,7 @@ int mca_topo_treematch_dist_graph_create(mca_topo_base_module_t* topo_module,
int num_procs_in_node = 0;
int rank, size;
int hwloc_err;
int oversubscribing_objs = 0;
int oversubscribing_objs = 0, oversubscribed_pus = 0;
int i, j, idx;
uint32_t val, *pval;
@ -269,8 +243,12 @@ int mca_topo_treematch_dist_graph_create(mca_topo_base_module_t* topo_module,
hwloc_get_cpubind(opal_hwloc_topology,set,0);
num_pus_in_node = hwloc_get_nbobjs_by_type(opal_hwloc_topology, HWLOC_OBJ_PU);
if(hwloc_bitmap_isincluded(root_obj->cpuset,set)){
/* processes are not bound on the machine */
/**
* In all situations (including heterogeneous environments) all processes must execute
* all the calls that involve collective communications, so we have to lay the logic
* accordingly.
*/
if(hwloc_bitmap_isincluded(root_obj->cpuset,set)){ /* processes are not bound on the machine */
#ifdef __DEBUG__
if (0 == rank)
fprintf(stdout,">>>>>>>>>>>>> Process Not bound <<<<<<<<<<<<<<<\n");
@ -285,40 +263,6 @@ int mca_topo_treematch_dist_graph_create(mca_topo_base_module_t* topo_module,
oversubscribing_objs = check_oversubscribing(rank,num_nodes,
num_objs_in_node,num_procs_in_node,
nodes_roots,local_procs,comm_old);
if(oversubscribing_objs) {
#ifdef __DEBUG__
fprintf(stdout,"Oversubscribing OBJ/CORES resources => Trying to use PUs \n");
#endif
int oversubscribed_pus = check_oversubscribing(rank,num_nodes,
num_pus_in_node,num_procs_in_node,
nodes_roots,local_procs,comm_old);
if (oversubscribed_pus){
#ifdef __DEBUG__
fprintf(stdout,"Oversubscribing PUs resources => Rank Reordering Impossible \n");
#endif
FALLBACK();
} else {
obj_rank = ompi_process_info.my_local_rank%num_pus_in_node;
effective_depth = hwloc_topology_get_depth(opal_hwloc_topology) - 1;
num_objs_in_node = num_pus_in_node;
#ifdef __DEBUG__
fprintf(stdout,"Process not bound : binding on PU#%i \n",obj_rank);
#endif
}
} else {
obj_rank = ompi_process_info.my_local_rank%num_objs_in_node;
effective_depth = depth;
object = hwloc_get_obj_by_depth(opal_hwloc_topology,effective_depth,obj_rank);
if( NULL == object) FALLBACK();
hwloc_bitmap_copy(set,object->cpuset);
hwloc_bitmap_singlify(set); /* we don't want the process to move */
hwloc_err = hwloc_set_cpubind(opal_hwloc_topology,set,0);
if( -1 == hwloc_err) FALLBACK();
#ifdef __DEBUG__
fprintf(stdout,"Process not bound : binding on OBJ#%i \n",obj_rank);
#endif
}
} else { /* the processes are already bound */
object = hwloc_get_obj_covering_cpuset(opal_hwloc_topology,set);
obj_rank = object->logical_index;
@ -329,16 +273,60 @@ int mca_topo_treematch_dist_graph_create(mca_topo_base_module_t* topo_module,
oversubscribing_objs = check_oversubscribing(rank,num_nodes,
num_objs_in_node,num_procs_in_node,
nodes_roots,local_procs,comm_old);
if(oversubscribing_objs) {
}
if(oversubscribing_objs) {
if(hwloc_bitmap_isincluded(root_obj->cpuset,set)){ /* processes are not bound on the machine */
#ifdef __DEBUG__
fprintf(stdout,"Oversubscribing OBJ/CORES resources => Rank Reordering Impossible\n");
fprintf(stdout,"Oversubscribing OBJ/CORES resources => Trying to use PUs \n");
#endif
FALLBACK();
oversubscribed_pus = check_oversubscribing(rank,num_nodes,
num_pus_in_node,num_procs_in_node,
nodes_roots,local_procs,comm_old);
} else {
/* Bound processes will participate with the same data as before */
oversubscribed_pus = check_oversubscribing(rank,num_nodes,
num_objs_in_node,num_procs_in_node,
nodes_roots,local_procs,comm_old);
}
if (!oversubscribed_pus) {
/* Update the data used to compute the correct binding */
if(hwloc_bitmap_isincluded(root_obj->cpuset,set)){ /* processes are not bound on the machine */
obj_rank = ompi_process_info.my_local_rank%num_pus_in_node;
effective_depth = hwloc_topology_get_depth(opal_hwloc_topology) - 1;
num_objs_in_node = num_pus_in_node;
#ifdef __DEBUG__
fprintf(stdout,"Process %i bound on OBJ #%i \n",rank,obj_rank);
fprintf(stdout,"=====> Num obj in node : %i | num pus in node : %i\n",num_objs_in_node,num_pus_in_node);
fprintf(stdout,"Process not bound : binding on PU#%i \n",obj_rank);
#endif
}
}
}
if( !oversubscribing_objs && !oversubscribed_pus ) {
if( hwloc_bitmap_isincluded(root_obj->cpuset,set) ) { /* processes are not bound on the machine */
obj_rank = ompi_process_info.my_local_rank%num_objs_in_node;
effective_depth = depth;
object = hwloc_get_obj_by_depth(opal_hwloc_topology,effective_depth,obj_rank);
if( NULL == object) FALLBACK();
hwloc_bitmap_copy(set,object->cpuset);
hwloc_bitmap_singlify(set); /* we don't want the process to move */
hwloc_err = hwloc_set_cpubind(opal_hwloc_topology,set,0);
if( -1 == hwloc_err) FALLBACK();
#ifdef __DEBUG__
fprintf(stdout,"Process not bound : binding on OBJ#%i \n",obj_rank);
#endif
} else {
#ifdef __DEBUG__
fprintf(stdout,"Process %i bound on OBJ #%i \n",rank,obj_rank);
fprintf(stdout,"=====> Num obj in node : %i | num pus in node : %i\n",num_objs_in_node,num_pus_in_node);
#endif
}
} else {
#ifdef __DEBUG__
fprintf(stdout,"Oversubscribing PUs resources => Rank Reordering Impossible \n");
#endif
FALLBACK();
}
reqs = (MPI_Request *)calloc(num_procs_in_node-1,sizeof(MPI_Request));
@ -493,7 +481,6 @@ int mca_topo_treematch_dist_graph_create(mca_topo_base_module_t* topo_module,
for(i = 1; i < num_nodes ; i++)
displs[i] = displs[i-1] + objs_per_node[i-1];
memset(reqs,0,(num_nodes-1)*sizeof(MPI_Request));
memcpy(obj_mapping,obj_to_rank_in_comm,objs_per_node[0]*sizeof(int));
for(i = 1; i < num_nodes ; i++)
if (OMPI_SUCCESS != ( err = MCA_PML_CALL(irecv(obj_mapping + displs[i], objs_per_node[i], MPI_INT,

Просмотреть файл

@ -10,7 +10,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 University of Houston. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -66,12 +66,12 @@ int MPI_Add_error_class(int *errorclass)
** in attribute/attribute.c and attribute/attribute_predefined.c
** why we have to call the fortran attr_set function
*/
rc = ompi_attr_set_fortran_mpi1 (COMM_ATTR,
MPI_COMM_WORLD,
&MPI_COMM_WORLD->c_keyhash,
MPI_LASTUSEDCODE,
ompi_mpi_errcode_lastused,
true);
rc = ompi_attr_set_fint (COMM_ATTR,
MPI_COMM_WORLD,
&MPI_COMM_WORLD->c_keyhash,
MPI_LASTUSEDCODE,
ompi_mpi_errcode_lastused,
true);
if ( MPI_SUCCESS != rc ) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, rc, FUNC_NAME);
}

Просмотреть файл

@ -10,7 +10,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 University of Houston. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -73,12 +73,12 @@ int MPI_Add_error_code(int errorclass, int *errorcode)
** in attribute/attribute.c and attribute/attribute_predefined.c
** why we have to call the fortran attr_set function
*/
rc = ompi_attr_set_fortran_mpi1 (COMM_ATTR,
MPI_COMM_WORLD,
&MPI_COMM_WORLD->c_keyhash,
MPI_LASTUSEDCODE,
ompi_mpi_errcode_lastused,
true);
rc = ompi_attr_set_fint (COMM_ATTR,
MPI_COMM_WORLD,
&MPI_COMM_WORLD->c_keyhash,
MPI_LASTUSEDCODE,
ompi_mpi_errcode_lastused,
true);
if ( MPI_SUCCESS != rc ) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, rc, FUNC_NAME);
}

Просмотреть файл

@ -10,7 +10,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -77,10 +77,10 @@ void ompi_attr_get_f(MPI_Fint *comm, MPI_Fint *keyval,
/* This stuff is very confusing. Be sure to see the comment at
the top of src/attributes/attributes.c. */
c_ierr = ompi_attr_get_fortran_mpi1(c_comm->c_keyhash,
OMPI_FINT_2_INT(*keyval),
attribute_val,
OMPI_LOGICAL_SINGLE_NAME_CONVERT(flag));
c_ierr = ompi_attr_get_fint(c_comm->c_keyhash,
OMPI_FINT_2_INT(*keyval),
attribute_val,
OMPI_LOGICAL_SINGLE_NAME_CONVERT(flag));
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
OMPI_SINGLE_INT_2_LOGICAL(flag);

Просмотреть файл

@ -10,7 +10,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -76,11 +76,11 @@ void ompi_attr_put_f(MPI_Fint *comm, MPI_Fint *keyval, MPI_Fint *attribute_val,
/* This stuff is very confusing. Be sure to see the comment at
the top of src/attributes/attributes.c. */
c_err = ompi_attr_set_fortran_mpi1(COMM_ATTR,
c_comm,
&c_comm->c_keyhash,
OMPI_FINT_2_INT(*keyval),
*attribute_val,
false);
c_err = ompi_attr_set_fint(COMM_ATTR,
c_comm,
&c_comm->c_keyhash,
OMPI_FINT_2_INT(*keyval),
*attribute_val,
false);
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_err);
}

Просмотреть файл

@ -10,7 +10,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015-2016 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -39,7 +39,7 @@ OMPI_GENERATE_F77_BINDINGS (PMPI_COMM_CREATE_KEYVAL,
pmpi_comm_create_keyval_,
pmpi_comm_create_keyval__,
pompi_comm_create_keyval_f,
(ompi_mpi2_fortran_copy_attr_function* comm_copy_attr_fn, ompi_mpi2_fortran_delete_attr_function* comm_delete_attr_fn, MPI_Fint *comm_keyval, MPI_Aint *extra_state, MPI_Fint *ierr),
(ompi_aint_copy_attr_function* comm_copy_attr_fn, ompi_aint_delete_attr_function* comm_delete_attr_fn, MPI_Fint *comm_keyval, MPI_Aint *extra_state, MPI_Fint *ierr),
(comm_copy_attr_fn, comm_delete_attr_fn, comm_keyval, extra_state, ierr) )
#endif
#endif
@ -59,7 +59,7 @@ OMPI_GENERATE_F77_BINDINGS (MPI_COMM_CREATE_KEYVAL,
mpi_comm_create_keyval_,
mpi_comm_create_keyval__,
ompi_comm_create_keyval_f,
(ompi_mpi2_fortran_copy_attr_function* comm_copy_attr_fn, ompi_mpi2_fortran_delete_attr_function* comm_delete_attr_fn, MPI_Fint *comm_keyval, MPI_Aint *extra_state, MPI_Fint *ierr),
(ompi_aint_copy_attr_function* comm_copy_attr_fn, ompi_aint_delete_attr_function* comm_delete_attr_fn, MPI_Fint *comm_keyval, MPI_Aint *extra_state, MPI_Fint *ierr),
(comm_copy_attr_fn, comm_delete_attr_fn, comm_keyval, extra_state, ierr) )
#else
#define ompi_comm_create_keyval_f pompi_comm_create_keyval_f
@ -69,8 +69,8 @@ OMPI_GENERATE_F77_BINDINGS (MPI_COMM_CREATE_KEYVAL,
static const char FUNC_NAME[] = "MPI_Comm_create_keyval_f";
void ompi_comm_create_keyval_f(ompi_mpi2_fortran_copy_attr_function* comm_copy_attr_fn,
ompi_mpi2_fortran_delete_attr_function* comm_delete_attr_fn,
void ompi_comm_create_keyval_f(ompi_aint_copy_attr_function* comm_copy_attr_fn,
ompi_aint_delete_attr_function* comm_delete_attr_fn,
MPI_Fint *comm_keyval,
MPI_Aint *extra_state, MPI_Fint *ierr)
{
@ -79,8 +79,8 @@ void ompi_comm_create_keyval_f(ompi_mpi2_fortran_copy_attr_function* comm_copy_a
ompi_attribute_fn_ptr_union_t copy_fn;
ompi_attribute_fn_ptr_union_t del_fn;
copy_fn.attr_mpi2_fortran_copy_fn = comm_copy_attr_fn;
del_fn.attr_mpi2_fortran_delete_fn = comm_delete_attr_fn;
copy_fn.attr_aint_copy_fn = comm_copy_attr_fn;
del_fn.attr_aint_delete_fn = comm_delete_attr_fn;
/* Note that we only set the "F77" bit and exclude the "F77_OLD"
bit, indicating that the callbacks should use the new MPI-2

Просмотреть файл

@ -10,7 +10,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -78,10 +78,10 @@ void ompi_comm_get_attr_f(MPI_Fint *comm, MPI_Fint *comm_keyval,
/* This stuff is very confusing. Be sure to see the comment at
the top of src/attributes/attributes.c. */
c_ierr = ompi_attr_get_fortran_mpi2(c_comm->c_keyhash,
OMPI_FINT_2_INT(*comm_keyval),
attribute_val,
OMPI_LOGICAL_SINGLE_NAME_CONVERT(flag));
c_ierr = ompi_attr_get_aint(c_comm->c_keyhash,
OMPI_FINT_2_INT(*comm_keyval),
attribute_val,
OMPI_LOGICAL_SINGLE_NAME_CONVERT(flag));
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
OMPI_SINGLE_INT_2_LOGICAL(flag);

Просмотреть файл

@ -10,7 +10,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -76,11 +76,11 @@ void ompi_comm_set_attr_f(MPI_Fint *comm, MPI_Fint *comm_keyval,
/* This stuff is very confusing. Be sure to see the comment at
the top of src/attributes/attributes.c. */
c_ierr = ompi_attr_set_fortran_mpi2(COMM_ATTR,
c_comm,
&c_comm->c_keyhash,
OMPI_FINT_2_INT(*comm_keyval),
*attribute_val,
false);
c_ierr = ompi_attr_set_aint(COMM_ATTR,
c_comm,
&c_comm->c_keyhash,
OMPI_FINT_2_INT(*comm_keyval),
*attribute_val,
false);
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
}

Просмотреть файл

@ -10,7 +10,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015-2016 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -39,7 +39,7 @@ OMPI_GENERATE_F77_BINDINGS (PMPI_KEYVAL_CREATE,
pmpi_keyval_create_,
pmpi_keyval_create__,
pompi_keyval_create_f,
(ompi_mpi1_fortran_copy_attr_function* copy_fn, ompi_mpi1_fortran_delete_attr_function* delete_fn, MPI_Fint *keyval, MPI_Fint *extra_state, MPI_Fint *ierr),
(ompi_fint_copy_attr_function* copy_fn, ompi_fint_delete_attr_function* delete_fn, MPI_Fint *keyval, MPI_Fint *extra_state, MPI_Fint *ierr),
(copy_fn, delete_fn, keyval, extra_state, ierr) )
#endif
#endif
@ -59,7 +59,7 @@ OMPI_GENERATE_F77_BINDINGS (MPI_KEYVAL_CREATE,
mpi_keyval_create_,
mpi_keyval_create__,
ompi_keyval_create_f,
(ompi_mpi1_fortran_copy_attr_function* copy_fn, ompi_mpi1_fortran_delete_attr_function* delete_fn, MPI_Fint *keyval, MPI_Fint *extra_state, MPI_Fint *ierr),
(ompi_fint_copy_attr_function* copy_fn, ompi_fint_delete_attr_function* delete_fn, MPI_Fint *keyval, MPI_Fint *extra_state, MPI_Fint *ierr),
(copy_fn, delete_fn, keyval, extra_state, ierr) )
#else
#define ompi_keyval_create_f pompi_keyval_create_f
@ -68,8 +68,8 @@ OMPI_GENERATE_F77_BINDINGS (MPI_KEYVAL_CREATE,
static const char FUNC_NAME[] = "MPI_keyval_create_f";
void ompi_keyval_create_f(ompi_mpi1_fortran_copy_attr_function* copy_attr_fn,
ompi_mpi1_fortran_delete_attr_function* delete_attr_fn,
void ompi_keyval_create_f(ompi_fint_copy_attr_function* copy_attr_fn,
ompi_fint_delete_attr_function* delete_attr_fn,
MPI_Fint *keyval, MPI_Fint *extra_state,
MPI_Fint *ierr)
{
@ -78,8 +78,8 @@ void ompi_keyval_create_f(ompi_mpi1_fortran_copy_attr_function* copy_attr_fn,
ompi_attribute_fn_ptr_union_t copy_fn;
ompi_attribute_fn_ptr_union_t del_fn;
copy_fn.attr_mpi1_fortran_copy_fn = copy_attr_fn;
del_fn.attr_mpi1_fortran_delete_fn = delete_attr_fn;
copy_fn.attr_fint_copy_fn = copy_attr_fn;
del_fn.attr_fint_delete_fn = delete_attr_fn;
/* Set the "F77_OLD" bit to denote that the callbacks should use
the old MPI-1 INTEGER-parameter functions (as opposed to the
@ -88,7 +88,7 @@ void ompi_keyval_create_f(ompi_mpi1_fortran_copy_attr_function* copy_attr_fn,
ret = ompi_attr_create_keyval_fint(COMM_ATTR, copy_fn, del_fn,
OMPI_SINGLE_NAME_CONVERT(keyval), *extra_state,
OMPI_KEYVAL_F77 | OMPI_KEYVAL_F77_MPI1,
OMPI_KEYVAL_F77,
NULL);
if (MPI_SUCCESS != ret) {

Просмотреть файл

@ -14,6 +14,8 @@
* Copyright (c) 2011-2013 Universite Bordeaux 1
* Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2016-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -120,7 +122,7 @@ PN2(void, MPI_Comm_call_errhandler, mpi_comm_call_errhandler, MPI_COMM_CALL_ERRH
PN2(void, MPI_Comm_compare, mpi_comm_compare, MPI_COMM_COMPARE, (MPI_Fint *comm1, MPI_Fint *comm2, MPI_Fint *result, MPI_Fint *ierr));
PN2(void, MPI_Comm_connect, mpi_comm_connect, MPI_COMM_CONNECT, (char *port_name, MPI_Fint *info, MPI_Fint *root, MPI_Fint *comm, MPI_Fint *newcomm, MPI_Fint *ierr, int port_name_len));
PN2(void, MPI_Comm_create_errhandler, mpi_comm_create_errhandler, MPI_COMM_CREATE_ERRHANDLER, (ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr));
PN2(void, MPI_Comm_create_keyval, mpi_comm_create_keyval, MPI_COMM_CREATE_KEYVAL, (ompi_mpi2_fortran_copy_attr_function* comm_copy_attr_fn, ompi_mpi2_fortran_delete_attr_function* comm_delete_attr_fn, MPI_Fint *comm_keyval, MPI_Aint *extra_state, MPI_Fint *ierr));
PN2(void, MPI_Comm_create_keyval, mpi_comm_create_keyval, MPI_COMM_CREATE_KEYVAL, (ompi_aint_copy_attr_function* comm_copy_attr_fn, ompi_aint_delete_attr_function* comm_delete_attr_fn, MPI_Fint *comm_keyval, MPI_Aint *extra_state, MPI_Fint *ierr));
PN2(void, MPI_Comm_create, mpi_comm_create, MPI_COMM_CREATE, (MPI_Fint *comm, MPI_Fint *group, MPI_Fint *newcomm, MPI_Fint *ierr));
PN2(void, MPI_Comm_create_group, mpi_comm_create_group, MPI_COMM_CREATE_GROUP, (MPI_Fint *comm, MPI_Fint *group, MPI_Fint *tag, MPI_Fint *newcomm, MPI_Fint *ierr));
PN2(void, MPI_Comm_delete_attr, mpi_comm_delete_attr, MPI_COMM_DELETE_ATTR, (MPI_Fint *comm, MPI_Fint *comm_keyval, MPI_Fint *ierr));
@ -303,7 +305,7 @@ PN2(void, MPI_Irsend, mpi_irsend, MPI_IRSEND, (char *buf, MPI_Fint *count, MPI_F
PN2(void, MPI_Isend, mpi_isend, MPI_ISEND, (char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr));
PN2(void, MPI_Issend, mpi_issend, MPI_ISSEND, (char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr));
PN2(void, MPI_Is_thread_main, mpi_is_thread_main, MPI_IS_THREAD_MAIN, (ompi_fortran_logical_t *flag, MPI_Fint *ierr));
PN2(void, MPI_Keyval_create, mpi_keyval_create, MPI_KEYVAL_CREATE, (ompi_mpi1_fortran_copy_attr_function* copy_fn, ompi_mpi1_fortran_delete_attr_function* delete_fn, MPI_Fint *keyval, MPI_Fint *extra_state, MPI_Fint *ierr));
PN2(void, MPI_Keyval_create, mpi_keyval_create, MPI_KEYVAL_CREATE, (ompi_fint_copy_attr_function* copy_fn, ompi_fint_delete_attr_function* delete_fn, MPI_Fint *keyval, MPI_Fint *extra_state, MPI_Fint *ierr));
PN2(void, MPI_Keyval_free, mpi_keyval_free, MPI_KEYVAL_FREE, (MPI_Fint *keyval, MPI_Fint *ierr));
PN2(void, MPI_Lookup_name, mpi_lookup_name, MPI_LOOKUP_NAME, (char *service_name, MPI_Fint *info, char *port_name, MPI_Fint *ierr, int service_name_len, int port_name_len));
PN2(void, MPI_Mprobe, mpi_mprobe, MPI_MPROBE, (MPI_Fint *source, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *message, MPI_Fint *status, MPI_Fint *ierr));
@ -369,7 +371,7 @@ PN2(void, MPI_Type_create_f90_integer, mpi_type_create_f90_integer, MPI_TYPE_CRE
PN2(void, MPI_Type_create_f90_real, mpi_type_create_f90_real, MPI_TYPE_CREATE_F90_REAL, (MPI_Fint *p, MPI_Fint *r, MPI_Fint *newtype, MPI_Fint *ierr));
PN2(void, MPI_Type_create_hindexed, mpi_type_create_hindexed, MPI_TYPE_CREATE_HINDEXED, (MPI_Fint *count, MPI_Fint *array_of_blocklengths, MPI_Aint *array_of_displacements, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr));
PN2(void, MPI_Type_create_hvector, mpi_type_create_hvector, MPI_TYPE_CREATE_HVECTOR, (MPI_Fint *count, MPI_Fint *blocklength, MPI_Aint *stride, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr));
PN2(void, MPI_Type_create_keyval, mpi_type_create_keyval, MPI_TYPE_CREATE_KEYVAL, (ompi_mpi2_fortran_copy_attr_function* type_copy_attr_fn, ompi_mpi2_fortran_delete_attr_function* type_delete_attr_fn, MPI_Fint *type_keyval, MPI_Aint *extra_state, MPI_Fint *ierr));
PN2(void, MPI_Type_create_keyval, mpi_type_create_keyval, MPI_TYPE_CREATE_KEYVAL, (ompi_aint_copy_attr_function* type_copy_attr_fn, ompi_aint_delete_attr_function* type_delete_attr_fn, MPI_Fint *type_keyval, MPI_Aint *extra_state, MPI_Fint *ierr));
PN2(void, MPI_Type_create_indexed_block, mpi_type_create_indexed_block, MPI_TYPE_CREATE_INDEXED_BLOCK, (MPI_Fint *count, MPI_Fint *blocklength, MPI_Fint *array_of_displacements, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr));
PN2(void, MPI_Type_create_hindexed_block, mpi_type_create_hindexed_block, MPI_TYPE_CREATE_HINDEXED_BLOCK, (MPI_Fint *count, MPI_Fint *blocklength, MPI_Aint *array_of_displacements, MPI_Fint *oldtype, MPI_Fint *newtype, MPI_Fint *ierr));
PN2(void, MPI_Type_create_struct, mpi_type_create_struct, MPI_TYPE_CREATE_STRUCT, (MPI_Fint *count, MPI_Fint *array_of_block_lengths, MPI_Aint *array_of_displacements, MPI_Fint *array_of_types, MPI_Fint *newtype, MPI_Fint *ierr));
@ -417,7 +419,7 @@ PN2(void, MPI_Win_complete, mpi_win_complete, MPI_WIN_COMPLETE, (MPI_Fint *win,
PN2(void, MPI_Win_create, mpi_win_create, MPI_WIN_CREATE, (char *base, MPI_Aint *size, MPI_Fint *disp_unit, MPI_Fint *info, MPI_Fint *comm, MPI_Fint *win, MPI_Fint *ierr));
PN2(void, MPI_Win_create_dynamic, mpi_win_create_dynamic, MPI_WIN_CREATE_DYNAMIC, (MPI_Fint *info, MPI_Fint *comm, MPI_Fint *win, MPI_Fint *ierr));
PN2(void, MPI_Win_create_errhandler, mpi_win_create_errhandler, MPI_WIN_CREATE_ERRHANDLER, (ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr));
PN2(void, MPI_Win_create_keyval, mpi_win_create_keyval, MPI_WIN_CREATE_KEYVAL, (ompi_mpi2_fortran_copy_attr_function* win_copy_attr_fn, ompi_mpi2_fortran_delete_attr_function* win_delete_attr_fn, MPI_Fint *win_keyval, MPI_Aint *extra_state, MPI_Fint *ierr));
PN2(void, MPI_Win_create_keyval, mpi_win_create_keyval, MPI_WIN_CREATE_KEYVAL, (ompi_aint_copy_attr_function* win_copy_attr_fn, ompi_aint_delete_attr_function* win_delete_attr_fn, MPI_Fint *win_keyval, MPI_Aint *extra_state, MPI_Fint *ierr));
PN2(void, MPI_Win_delete_attr, mpi_win_delete_attr, MPI_WIN_DELETE_ATTR, (MPI_Fint *win, MPI_Fint *win_keyval, MPI_Fint *ierr));
PN2(void, MPI_Win_detach, mpi_win_detach, MPI_WIN_DETACH, (MPI_Fint *win, char *base, MPI_Fint *ierr));
PN2(void, MPI_Win_fence, mpi_win_fence, MPI_WIN_FENCE, (MPI_Fint *assert, MPI_Fint *win, MPI_Fint *ierr));

Просмотреть файл

@ -10,7 +10,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015-2016 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -39,7 +39,7 @@ OMPI_GENERATE_F77_BINDINGS (PMPI_TYPE_CREATE_KEYVAL,
pmpi_type_create_keyval_,
pmpi_type_create_keyval__,
pompi_type_create_keyval_f,
(ompi_mpi2_fortran_copy_attr_function* type_copy_attr_fn, ompi_mpi2_fortran_delete_attr_function* type_delete_attr_fn, MPI_Fint *type_keyval, MPI_Aint *extra_state, MPI_Fint *ierr),
(ompi_aint_copy_attr_function* type_copy_attr_fn, ompi_aint_delete_attr_function* type_delete_attr_fn, MPI_Fint *type_keyval, MPI_Aint *extra_state, MPI_Fint *ierr),
(type_copy_attr_fn, type_delete_attr_fn, type_keyval, extra_state, ierr) )
#endif
#endif
@ -59,7 +59,7 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_CREATE_KEYVAL,
mpi_type_create_keyval_,
mpi_type_create_keyval__,
ompi_type_create_keyval_f,
(ompi_mpi2_fortran_copy_attr_function* type_copy_attr_fn, ompi_mpi2_fortran_delete_attr_function* type_delete_attr_fn, MPI_Fint *type_keyval, MPI_Aint *extra_state, MPI_Fint *ierr),
(ompi_aint_copy_attr_function* type_copy_attr_fn, ompi_aint_delete_attr_function* type_delete_attr_fn, MPI_Fint *type_keyval, MPI_Aint *extra_state, MPI_Fint *ierr),
(type_copy_attr_fn, type_delete_attr_fn, type_keyval, extra_state, ierr) )
#else
#define ompi_type_create_keyval_f pompi_type_create_keyval_f
@ -68,8 +68,8 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_CREATE_KEYVAL,
static char FUNC_NAME[] = "MPI_Type_create_keyval_f";
void ompi_type_create_keyval_f(ompi_mpi2_fortran_copy_attr_function* type_copy_attr_fn,
ompi_mpi2_fortran_delete_attr_function* type_delete_attr_fn,
void ompi_type_create_keyval_f(ompi_aint_copy_attr_function* type_copy_attr_fn,
ompi_aint_delete_attr_function* type_delete_attr_fn,
MPI_Fint *type_keyval, MPI_Aint *extra_state, MPI_Fint *ierr)
{
int ret, c_ierr;
@ -77,8 +77,8 @@ void ompi_type_create_keyval_f(ompi_mpi2_fortran_copy_attr_function* type_copy_a
ompi_attribute_fn_ptr_union_t copy_fn;
ompi_attribute_fn_ptr_union_t del_fn;
copy_fn.attr_mpi2_fortran_copy_fn = type_copy_attr_fn;
del_fn.attr_mpi2_fortran_delete_fn = type_delete_attr_fn;
copy_fn.attr_aint_copy_fn = type_copy_attr_fn;
del_fn.attr_aint_delete_fn = type_delete_attr_fn;
/* Note that we only set the "F77" bit and exclude the "F77_OLD"
bit, indicating that the callbacks should use the new MPI-2

Просмотреть файл

@ -10,7 +10,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -78,10 +78,10 @@ void ompi_type_get_attr_f(MPI_Fint *type, MPI_Fint *type_keyval,
/* This stuff is very confusing. Be sure to see the comment at
the top of src/attributes/attributes.c. */
c_ierr = ompi_attr_get_fortran_mpi2(c_type->d_keyhash,
OMPI_FINT_2_INT(*type_keyval),
attribute_val,
OMPI_LOGICAL_SINGLE_NAME_CONVERT(flag));
c_ierr = ompi_attr_get_aint(c_type->d_keyhash,
OMPI_FINT_2_INT(*type_keyval),
attribute_val,
OMPI_LOGICAL_SINGLE_NAME_CONVERT(flag));
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
OMPI_SINGLE_INT_2_LOGICAL(flag);

Просмотреть файл

@ -10,7 +10,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -75,11 +75,11 @@ void ompi_type_set_attr_f(MPI_Fint *type, MPI_Fint *type_keyval, MPI_Aint *attri
/* This stuff is very confusing. Be sure to see the comment at
the top of src/attributes/attributes.c. */
c_ierr = ompi_attr_set_fortran_mpi2(TYPE_ATTR,
c_type,
&c_type->d_keyhash,
OMPI_FINT_2_INT(*type_keyval),
*attribute_val,
false);
c_ierr = ompi_attr_set_aint(TYPE_ATTR,
c_type,
&c_type->d_keyhash,
OMPI_FINT_2_INT(*type_keyval),
*attribute_val,
false);
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
}

Просмотреть файл

@ -10,7 +10,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015-2016 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -39,7 +39,7 @@ OMPI_GENERATE_F77_BINDINGS (PMPI_WIN_CREATE_KEYVAL,
pmpi_win_create_keyval_,
pmpi_win_create_keyval__,
pompi_win_create_keyval_f,
(ompi_mpi2_fortran_copy_attr_function* win_copy_attr_fn, ompi_mpi2_fortran_delete_attr_function* win_delete_attr_fn, MPI_Fint *win_keyval, MPI_Aint *extra_state, MPI_Fint *ierr),
(ompi_aint_copy_attr_function* win_copy_attr_fn, ompi_aint_delete_attr_function* win_delete_attr_fn, MPI_Fint *win_keyval, MPI_Aint *extra_state, MPI_Fint *ierr),
(win_copy_attr_fn, win_delete_attr_fn, win_keyval, extra_state, ierr) )
#endif
#endif
@ -59,7 +59,7 @@ OMPI_GENERATE_F77_BINDINGS (MPI_WIN_CREATE_KEYVAL,
mpi_win_create_keyval_,
mpi_win_create_keyval__,
ompi_win_create_keyval_f,
(ompi_mpi2_fortran_copy_attr_function* win_copy_attr_fn, ompi_mpi2_fortran_delete_attr_function* win_delete_attr_fn, MPI_Fint *win_keyval, MPI_Aint *extra_state, MPI_Fint *ierr),
(ompi_aint_copy_attr_function* win_copy_attr_fn, ompi_aint_delete_attr_function* win_delete_attr_fn, MPI_Fint *win_keyval, MPI_Aint *extra_state, MPI_Fint *ierr),
(win_copy_attr_fn, win_delete_attr_fn, win_keyval, extra_state, ierr) )
#else
#define ompi_win_create_keyval_f pompi_win_create_keyval_f
@ -68,8 +68,8 @@ OMPI_GENERATE_F77_BINDINGS (MPI_WIN_CREATE_KEYVAL,
static char FUNC_NAME[] = "MPI_Win_create_keyval";
void ompi_win_create_keyval_f(ompi_mpi2_fortran_copy_attr_function* win_copy_attr_fn,
ompi_mpi2_fortran_delete_attr_function* win_delete_attr_fn,
void ompi_win_create_keyval_f(ompi_aint_copy_attr_function* win_copy_attr_fn,
ompi_aint_delete_attr_function* win_delete_attr_fn,
MPI_Fint *win_keyval, MPI_Aint *extra_state, MPI_Fint *ierr)
{
int ret, c_ierr;
@ -77,8 +77,8 @@ void ompi_win_create_keyval_f(ompi_mpi2_fortran_copy_attr_function* win_copy_att
ompi_attribute_fn_ptr_union_t copy_fn;
ompi_attribute_fn_ptr_union_t del_fn;
copy_fn.attr_mpi2_fortran_copy_fn = win_copy_attr_fn;
del_fn.attr_mpi2_fortran_delete_fn = win_delete_attr_fn;
copy_fn.attr_aint_copy_fn = win_copy_attr_fn;
del_fn.attr_aint_delete_fn = win_delete_attr_fn;
/* Note that we only set the "F77" bit and exclude the "F77_OLD"
bit, indicating that the callbacks should use the new MPI-2

Просмотреть файл

@ -10,7 +10,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -77,10 +77,10 @@ void ompi_win_get_attr_f(MPI_Fint *win, MPI_Fint *win_keyval,
/* This stuff is very confusing. Be sure to see the comment at
the top of src/attributes/attributes.c. */
c_ierr = ompi_attr_get_fortran_mpi2(c_win->w_keyhash,
OMPI_FINT_2_INT(*win_keyval),
attribute_val,
OMPI_LOGICAL_SINGLE_NAME_CONVERT(flag));
c_ierr = ompi_attr_get_aint(c_win->w_keyhash,
OMPI_FINT_2_INT(*win_keyval),
attribute_val,
OMPI_LOGICAL_SINGLE_NAME_CONVERT(flag));
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
OMPI_SINGLE_INT_2_LOGICAL(flag);
}

Просмотреть файл

@ -10,7 +10,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -77,11 +77,11 @@ void ompi_win_set_attr_f(MPI_Fint *win, MPI_Fint *win_keyval,
/* This stuff is very confusing. Be sure to see the comment at
the top of src/attributes/attributes.c. */
c_ierr = ompi_attr_set_fortran_mpi2(WIN_ATTR,
c_win,
&c_win->w_keyhash,
OMPI_FINT_2_INT(*win_keyval),
*attribute_val,
false);
c_ierr = ompi_attr_set_aint(WIN_ATTR,
c_win,
&c_win->w_keyhash,
OMPI_FINT_2_INT(*win_keyval),
*attribute_val,
false);
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
}

Просмотреть файл

@ -10,7 +10,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2011-2014 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015-2016 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -118,7 +118,7 @@ void ompi_win_shared_query_f(MPI_Fint *win, MPI_Fint *rank, MPI_Aint *size,
c_win = PMPI_Win_f2c(*win);
c_ierr = PMPI_Win_shared_query(c_win, OMPI_FINT_2_INT(*rank), size,
OMPI_SINGLE_NAME_CONVERT(disp_unit), baseptr);
OMPI_SINGLE_NAME_CONVERT(disp_unit), baseptr);
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
if (MPI_SUCCESS == c_ierr) {

Просмотреть файл

@ -14,7 +14,7 @@
* Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2015-2016 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
* $COPYRIGHT$
@ -200,25 +200,25 @@ config_window(void *base, size_t size, int disp_unit,
MPI_WIN_BASE, base, true);
if (OMPI_SUCCESS != ret) return ret;
ret = ompi_attr_set_fortran_mpi2(WIN_ATTR, win,
&win->w_keyhash,
MPI_WIN_SIZE, size, true);
ret = ompi_attr_set_aint(WIN_ATTR, win,
&win->w_keyhash,
MPI_WIN_SIZE, size, true);
if (OMPI_SUCCESS != ret) return ret;
ret = ompi_attr_set_fortran_mpi1(WIN_ATTR, win,
&win->w_keyhash,
MPI_WIN_DISP_UNIT, disp_unit,
true);
ret = ompi_attr_set_int(WIN_ATTR, win,
&win->w_keyhash,
MPI_WIN_DISP_UNIT, disp_unit,
true);
if (OMPI_SUCCESS != ret) return ret;
ret = ompi_attr_set_fortran_mpi1(WIN_ATTR, win,
&win->w_keyhash,
MPI_WIN_CREATE_FLAVOR, flavor, true);
ret = ompi_attr_set_int(WIN_ATTR, win,
&win->w_keyhash,
MPI_WIN_CREATE_FLAVOR, flavor, true);
if (OMPI_SUCCESS != ret) return ret;
ret = ompi_attr_set_fortran_mpi1(WIN_ATTR, win,
&win->w_keyhash,
MPI_WIN_MODEL, model, true);
ret = ompi_attr_set_int(WIN_ATTR, win,
&win->w_keyhash,
MPI_WIN_MODEL, model, true);
if (OMPI_SUCCESS != ret) return ret;
win->w_f_to_c_index = opal_pointer_array_add(&ompi_mpi_windows, win);

Просмотреть файл

@ -481,7 +481,9 @@ size_t opal_convertor_compute_remote_size( opal_convertor_t* pConvertor )
pConvertor->remote_size = pConvertor->local_size;
if( OPAL_UNLIKELY(datatype->bdt_used & pConvertor->master->hetero_mask) ) {
pConvertor->flags &= (~CONVERTOR_HOMOGENEOUS);
pConvertor->use_desc = &(datatype->desc);
if (!(pConvertor->flags & CONVERTOR_SEND && pConvertor->flags & OPAL_DATATYPE_FLAG_CONTIGUOUS)) {
pConvertor->use_desc = &(datatype->desc);
}
if( 0 == (pConvertor->flags & CONVERTOR_HAS_REMOTE_SIZE) ) {
/* This is for a single datatype, we must update it with the count */
pConvertor->remote_size = opal_datatype_compute_remote_size(datatype,
@ -570,6 +572,7 @@ int32_t opal_convertor_prepare_for_recv( opal_convertor_t* convertor,
mca_cuda_convertor_init(convertor, pUserBuf);
#endif
assert(! (convertor->flags & CONVERTOR_SEND));
OPAL_CONVERTOR_PREPARE( convertor, datatype, count, pUserBuf );
if( convertor->flags & CONVERTOR_WITH_CHECKSUM ) {

Просмотреть файл

@ -218,6 +218,7 @@ static inline void opal_convertor_get_unpacked_size( const opal_convertor_t* pCo
return;
}
if( 0 == (CONVERTOR_HAS_REMOTE_SIZE & pConv->flags) ) {
assert(! (pConv->flags & CONVERTOR_SEND));
opal_convertor_compute_remote_size( (opal_convertor_t*)pConv);
}
*pSize = pConv->remote_size;

Просмотреть файл

@ -5,6 +5,7 @@
* reserved.
* Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
* Copyright (c) 2015-2017 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -15,6 +16,10 @@
#include "opal_config.h"
#ifdef HAVE_IEEE754_H
#include <ieee754.h>
#endif
#include <stddef.h>
#include <stdint.h>
@ -62,6 +67,68 @@ opal_dt_swap_bytes(void *to_p, const void *from_p, const size_t size, size_t cou
}
}
#ifdef HAVE_IEEE754_H
struct bit128 {
unsigned int mantissa3:32;
unsigned int mantissa2:32;
unsigned int mantissa1:32;
unsigned int mantissa0:16;
unsigned int exponent:15;
unsigned int negative:1;
};
struct bit80 {
unsigned int pad:32;
unsigned int empty:16;
unsigned int negative:1;
unsigned int exponent:15;
unsigned int mantissa0:32;
unsigned int mantissa1:32;
};
static inline void
opal_dt_swap_long_double(void *to_p, const void *from_p, const size_t size, size_t count, uint32_t remoteArch)
{
#ifdef HAVE_IEEE754_H
size_t i;
long double*to = (long double *) to_p;
if ((opal_local_arch&OPAL_ARCH_LDISINTEL) && !(remoteArch&OPAL_ARCH_LDISINTEL)) {
#ifdef __x86_64
for (i=0; i<count; i++, to++) {
union ieee854_long_double ld;
struct bit128 * b = (struct bit128 *)to;
ld.ieee.empty = 0;
ld.ieee.mantissa0 = 0x80000000 | (((unsigned int)b->mantissa0 << 15) & 0x7FFF8000) | ((b->mantissa1 >> 17) & 0x00007FFF);
ld.ieee.mantissa1 = ((b->mantissa1 << 15) & 0xFFFF8000) | ((b->mantissa2 << 17) & 0x000007FFF);
ld.ieee.exponent = b->exponent;
ld.ieee.negative = b->negative;
MEMCPY( to, &ld, sizeof(long double));
}
#endif
} else if (!(opal_local_arch&OPAL_ARCH_LDISINTEL) && (remoteArch&OPAL_ARCH_LDISINTEL)) {
#ifdef __sparcv9
for (i=0; i<count; i++, to++) {
union ieee854_long_double ld;
struct bit80 * b = (struct bit80 *)to;
ld.ieee.mantissa3 = 0;
ld.ieee.mantissa2 = 0;
ld.ieee.mantissa0 = (b->mantissa0 << 1) | (b->mantissa1 & 0x80000000);
ld.ieee.mantissa1 = (b->mantissa1 << 1) & 0xFFFFFFFE;
ld.ieee.exponent = b->exponent;
ld.ieee.negative = b->negative;
MEMCPY( to, &ld, sizeof(long double));
}
#endif
}
#else
assert(0);
#endif
}
#else
#define opal_dt_swap_long_double(to_p, from_p, size, count, remoteArch)
#endif
/**
* BEWARE: Do not use the following macro with composed types such as
* complex. As the swap is done using the entire type sizeof, the
@ -69,6 +136,9 @@ opal_dt_swap_bytes(void *to_p, const void *from_p, const size_t size, size_t cou
* COPY_2SAMETYPE_HETEROGENEOUS.
*/
#define COPY_TYPE_HETEROGENEOUS( TYPENAME, TYPE ) \
COPY_TYPE_HETEROGENEOUS_INTERNAL( TYPENAME, TYPE, 0 )
#define COPY_TYPE_HETEROGENEOUS_INTERNAL( TYPENAME, TYPE, LONG_DOUBLE ) \
static int32_t \
copy_##TYPENAME##_heterogeneous(opal_convertor_t *pConvertor, uint32_t count, \
const char* from, size_t from_len, ptrdiff_t from_extent, \
@ -85,9 +155,15 @@ copy_##TYPENAME##_heterogeneous(opal_convertor_t *pConvertor, uint32_t count,
(opal_local_arch & OPAL_ARCH_ISBIGENDIAN)) { \
if( (to_extent == from_extent) && (to_extent == sizeof(TYPE)) ) { \
opal_dt_swap_bytes(to, from, sizeof(TYPE), count); \
if (LONG_DOUBLE) { \
opal_dt_swap_long_double(to, from, sizeof(TYPE), count, pConvertor->remoteArch);\
} \
} else { \
for( i = 0; i < count; i++ ) { \
opal_dt_swap_bytes(to, from, sizeof(TYPE), 1); \
if (LONG_DOUBLE) { \
opal_dt_swap_long_double(to, from, sizeof(TYPE), 1, pConvertor->remoteArch);\
} \
to += to_extent; \
from += from_extent; \
} \
@ -108,6 +184,9 @@ copy_##TYPENAME##_heterogeneous(opal_convertor_t *pConvertor, uint32_t count,
}
#define COPY_2SAMETYPE_HETEROGENEOUS( TYPENAME, TYPE ) \
COPY_2SAMETYPE_HETEROGENEOUS_INTERNAL( TYPENAME, TYPE, 0)
#define COPY_2SAMETYPE_HETEROGENEOUS_INTERNAL( TYPENAME, TYPE, LONG_DOUBLE) \
static int32_t \
copy_##TYPENAME##_heterogeneous(opal_convertor_t *pConvertor, uint32_t count, \
const char* from, size_t from_len, ptrdiff_t from_extent, \
@ -122,11 +201,17 @@ copy_##TYPENAME##_heterogeneous(opal_convertor_t *pConvertor, uint32_t count,
\
if ((pConvertor->remoteArch & OPAL_ARCH_ISBIGENDIAN) != \
(opal_local_arch & OPAL_ARCH_ISBIGENDIAN)) { \
if( (to_extent == from_extent) && (to_extent == sizeof(TYPE)) ) { \
if( (to_extent == from_extent) && (to_extent == (2 * sizeof(TYPE))) ) { \
opal_dt_swap_bytes(to, from, sizeof(TYPE), 2 * count); \
if (LONG_DOUBLE) { \
opal_dt_swap_long_double(to, from, sizeof(TYPE), 2*count, pConvertor->remoteArch);\
} \
} else { \
for( i = 0; i < count; i++ ) { \
opal_dt_swap_bytes(to, from, sizeof(TYPE), 2); \
if (LONG_DOUBLE) { \
opal_dt_swap_long_double(to, from, sizeof(TYPE), 2, pConvertor->remoteArch);\
} \
to += to_extent; \
from += from_extent; \
} \
@ -333,7 +418,7 @@ COPY_TYPE_HETEROGENEOUS( float16, float )
#elif SIZEOF_DOUBLE == 16
COPY_TYPE_HETEROGENEOUS( float16, double )
#elif HAVE_LONG_DOUBLE && SIZEOF_LONG_DOUBLE == 16
COPY_TYPE_HETEROGENEOUS( float16, long double )
COPY_TYPE_HETEROGENEOUS_INTERNAL( float16, long double, 1)
#else
/* #error No basic type for copy function for opal_datatype_float16 found */
#define copy_float16_heterogeneous NULL
@ -354,7 +439,7 @@ COPY_2SAMETYPE_HETEROGENEOUS( double_complex, double )
#endif
#if HAVE_LONG_DOUBLE__COMPLEX
COPY_2SAMETYPE_HETEROGENEOUS( long_double_complex, long double )
COPY_2SAMETYPE_HETEROGENEOUS_INTERNAL( long_double_complex, long double, 1)
#else
/* #error No basic type for copy function for opal_datatype_long_double_complex found */
#define copy_long_double_complex_heterogeneous NULL

Просмотреть файл

@ -91,6 +91,7 @@ int opal_convertor_create_stack_with_pos_general( opal_convertor_t* pConvertor,
}
/* remove from the main loop all the complete datatypes */
assert (! (pConvertor->flags & CONVERTOR_SEND));
remote_size = opal_convertor_compute_remote_size( pConvertor );
count = (int32_t)(starting_point / remote_size);
resting_place -= (remote_size * count);

Просмотреть файл

@ -12,7 +12,7 @@
* All rights reserved.
* Copyright (c) 2006-2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2016 Research Organization for Information Science
* Copyright (c) 2016-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2016 Intel, Inc. All rights reserved.
*
@ -381,6 +381,7 @@ int mca_btl_tcp_put (mca_btl_base_module_t *btl, struct mca_btl_base_endpoint_t
frag->segments[1].seg_addr.lval = remote_address;
frag->segments[1].seg_len = size;
if (endpoint->endpoint_nbo) MCA_BTL_BASE_SEGMENT_HTON(frag->segments[1]);
frag->base.des_flags = MCA_BTL_DES_FLAGS_BTL_OWNERSHIP | MCA_BTL_DES_SEND_ALWAYS_CALLBACK;
frag->base.des_cbfunc = fake_rdma_complete;

Просмотреть файл

@ -12,7 +12,7 @@
* All rights reserved.
* Copyright (c) 2014 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2015-2016 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2015-2016 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
@ -291,6 +291,7 @@ bool mca_btl_tcp_frag_recv(mca_btl_tcp_frag_t* frag, int sd)
goto repeat;
} else if (frag->iov_idx == 2) {
for( i = 0; i < frag->hdr.count; i++ ) {
if (btl_endpoint->endpoint_nbo) MCA_BTL_BASE_SEGMENT_NTOH(frag->segments[i]);
frag->iov[i+2].iov_base = (IOVBASE_TYPE*)frag->segments[i].seg_addr.pval;
frag->iov[i+2].iov_len = frag->segments[i].seg_len;
}

Просмотреть файл

@ -13,6 +13,8 @@
* All rights reserved.
* Copyright (c) 2010-2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
*
* $COPYRIGHT$
*
@ -32,12 +34,12 @@
* the message came from an external (to
* this component) source
*/
typedef enum {
MCA_OOB_TCP_IDENT,
MCA_OOB_TCP_PROBE,
MCA_OOB_TCP_PING,
MCA_OOB_TCP_USER
} mca_oob_tcp_msg_type_t;
typedef uint8_t mca_oob_tcp_msg_type_t;
#define MCA_OOB_TCP_IDENT 1
#define MCA_OOB_TCP_PROBE 2
#define MCA_OOB_TCP_PING 3
#define MCA_OOB_TCP_USER 4
#define ORTE_MAX_RTD_SIZE 31
@ -54,14 +56,14 @@ typedef struct {
* and let some other module try to send it
*/
orte_process_name_t dst;
/* type of message */
mca_oob_tcp_msg_type_t type;
/* the rml tag where this message is headed */
orte_rml_tag_t tag;
/* the seq number of this message */
uint32_t seq_num;
/* number of bytes in message */
uint32_t nbytes;
/* type of message */
mca_oob_tcp_msg_type_t type;
/* routed module to be used */
char routed[ORTE_MAX_RTD_SIZE+1];
} mca_oob_tcp_hdr_t;
@ -71,7 +73,6 @@ typedef struct {
#define MCA_OOB_TCP_HDR_NTOH(h) \
ORTE_PROCESS_NAME_NTOH((h)->origin); \
ORTE_PROCESS_NAME_NTOH((h)->dst); \
(h)->type = ntohl((h)->type); \
(h)->tag = ORTE_RML_TAG_NTOH((h)->tag); \
(h)->nbytes = ntohl((h)->nbytes);
@ -81,7 +82,6 @@ typedef struct {
#define MCA_OOB_TCP_HDR_HTON(h) \
ORTE_PROCESS_NAME_HTON((h)->origin); \
ORTE_PROCESS_NAME_HTON((h)->dst); \
(h)->type = htonl((h)->type); \
(h)->tag = ORTE_RML_TAG_HTON((h)->tag); \
(h)->nbytes = htonl((h)->nbytes);