1
1

Fix some minor errors in the predefined MPI_Op's

This commit was SVN r2880.
Этот коммит содержится в:
Jeff Squyres 2004-09-29 21:08:29 +00:00
родитель d3adf8d816
Коммит f9e1c172c6
2 изменённых файлов: 21 добавлений и 1 удалений

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

@ -391,6 +391,7 @@ int ompi_op_init(void)
ompi_op_ddt_map[DT_SHORT] = OMPI_OP_TYPE_SHORT;
ompi_op_ddt_map[DT_UNSIGNED_SHORT] = OMPI_OP_TYPE_UNSIGNED_SHORT;
ompi_op_ddt_map[DT_INT] = OMPI_OP_TYPE_INT;
ompi_op_ddt_map[DT_UNSIGNED_INT] = OMPI_OP_TYPE_UNSIGNED;
ompi_op_ddt_map[DT_LONG] = OMPI_OP_TYPE_LONG;
ompi_op_ddt_map[DT_UNSIGNED_LONG] = OMPI_OP_TYPE_UNSIGNED_LONG;
ompi_op_ddt_map[DT_FLOAT] = OMPI_OP_TYPE_FLOAT;

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

@ -304,7 +304,7 @@ LOC_STRUCT(float_int, float, int)
LOC_STRUCT(double_int, double, int)
LOC_STRUCT(long_int, long, int)
LOC_STRUCT(2int, int, int)
LOC_STRUCT(short_int, short, short)
LOC_STRUCT(short_int, short, int)
LOC_STRUCT(long_double_int, long double, int)
/*************************************************************************
@ -318,7 +318,26 @@ LOC_FUNC(maxloc, float_int, >)
LOC_FUNC(maxloc, double_int, >)
LOC_FUNC(maxloc, long_int, >)
LOC_FUNC(maxloc, 2int, >)
#if 0
#define LOC_FUNC(name, type_name, op) \
LOC_FUNC(maxloc, short_int, >)
#else
void ompi_mpi_op_maxloc_short_int(void *in, void *out, int *count,
MPI_Datatype *dtype)
{
int i;
ompi_op_predefined_short_int_t *a = (ompi_op_predefined_short_int_t*) in;
ompi_op_predefined_short_int_t *b = (ompi_op_predefined_short_int_t*) out;
for (i = 0; i < *count; ++i, a++, b++ ) {
if (a->v > b->v) {
b->v = a->v;
b->k = a->k;
} else if (a->v == b->v) {
b->k = (b->k < a->k ? b->k : a->k);
}
}
}
#endif
LOC_FUNC(maxloc, long_double_int, >)
/*************************************************************************