Skip to content

Commit 8427757

Browse files
authored
Merge pull request #8780 from awlauria/fix_ops_segv
Fix unimplemented op functions for MPI_LONG.
2 parents 470eaca + ff9f03c commit 8427757

File tree

3 files changed

+72
-0
lines changed

3 files changed

+72
-0
lines changed

ompi/mca/op/base/op_base_functions.c

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ FUNC_FUNC(max, int32_t, int32_t)
161161
FUNC_FUNC(max, uint32_t, uint32_t)
162162
FUNC_FUNC(max, int64_t, int64_t)
163163
FUNC_FUNC(max, uint64_t, uint64_t)
164+
FUNC_FUNC(max, long, long)
165+
FUNC_FUNC(max, unsigned_long, long)
166+
164167
/* Fortran integer */
165168
#if OMPI_HAVE_FORTRAN_INTEGER
166169
FUNC_FUNC(max, fortran_integer, ompi_fortran_integer_t)
@@ -224,6 +227,9 @@ FUNC_FUNC(min, int32_t, int32_t)
224227
FUNC_FUNC(min, uint32_t, uint32_t)
225228
FUNC_FUNC(min, int64_t, int64_t)
226229
FUNC_FUNC(min, uint64_t, uint64_t)
230+
FUNC_FUNC(min, long, long)
231+
FUNC_FUNC(min, unsigned_long, long)
232+
227233
/* Fortran integer */
228234
#if OMPI_HAVE_FORTRAN_INTEGER
229235
FUNC_FUNC(min, fortran_integer, ompi_fortran_integer_t)
@@ -284,6 +290,9 @@ OP_FUNC(sum, int32_t, int32_t, +=)
284290
OP_FUNC(sum, uint32_t, uint32_t, +=)
285291
OP_FUNC(sum, int64_t, int64_t, +=)
286292
OP_FUNC(sum, uint64_t, uint64_t, +=)
293+
OP_FUNC(sum, long, long, +=)
294+
OP_FUNC(sum, unsigned_long, long, +=)
295+
287296
/* Fortran integer */
288297
#if OMPI_HAVE_FORTRAN_INTEGER
289298
OP_FUNC(sum, fortran_integer, ompi_fortran_integer_t, +=)
@@ -353,6 +362,9 @@ OP_FUNC(prod, int32_t, int32_t, *=)
353362
OP_FUNC(prod, uint32_t, uint32_t, *=)
354363
OP_FUNC(prod, int64_t, int64_t, *=)
355364
OP_FUNC(prod, uint64_t, uint64_t, *=)
365+
OP_FUNC(prod, long, long, *=)
366+
OP_FUNC(prod, unsigned_long, long, *=)
367+
356368
/* Fortran integer */
357369
#if OMPI_HAVE_FORTRAN_INTEGER
358370
OP_FUNC(prod, fortran_integer, ompi_fortran_integer_t, *=)
@@ -424,6 +436,9 @@ FUNC_FUNC(land, int32_t, int32_t)
424436
FUNC_FUNC(land, uint32_t, uint32_t)
425437
FUNC_FUNC(land, int64_t, int64_t)
426438
FUNC_FUNC(land, uint64_t, uint64_t)
439+
FUNC_FUNC(land, long, long)
440+
FUNC_FUNC(land, unsigned_long, long)
441+
427442
/* Logical */
428443
#if OMPI_HAVE_FORTRAN_LOGICAL
429444
FUNC_FUNC(land, fortran_logical, ompi_fortran_logical_t)
@@ -446,6 +461,9 @@ FUNC_FUNC(lor, int32_t, int32_t)
446461
FUNC_FUNC(lor, uint32_t, uint32_t)
447462
FUNC_FUNC(lor, int64_t, int64_t)
448463
FUNC_FUNC(lor, uint64_t, uint64_t)
464+
FUNC_FUNC(lor, long, long)
465+
FUNC_FUNC(lor, unsigned_long, long)
466+
449467
/* Logical */
450468
#if OMPI_HAVE_FORTRAN_LOGICAL
451469
FUNC_FUNC(lor, fortran_logical, ompi_fortran_logical_t)
@@ -468,6 +486,10 @@ FUNC_FUNC(lxor, int32_t, int32_t)
468486
FUNC_FUNC(lxor, uint32_t, uint32_t)
469487
FUNC_FUNC(lxor, int64_t, int64_t)
470488
FUNC_FUNC(lxor, uint64_t, uint64_t)
489+
FUNC_FUNC(lxor, long, long)
490+
FUNC_FUNC(lxor, unsigned_long, long)
491+
492+
471493
/* Logical */
472494
#if OMPI_HAVE_FORTRAN_LOGICAL
473495
FUNC_FUNC(lxor, fortran_logical, ompi_fortran_logical_t)
@@ -490,6 +512,9 @@ FUNC_FUNC(band, int32_t, int32_t)
490512
FUNC_FUNC(band, uint32_t, uint32_t)
491513
FUNC_FUNC(band, int64_t, int64_t)
492514
FUNC_FUNC(band, uint64_t, uint64_t)
515+
FUNC_FUNC(band, long, long)
516+
FUNC_FUNC(band, unsigned_long, long)
517+
493518
/* Fortran integer */
494519
#if OMPI_HAVE_FORTRAN_INTEGER
495520
FUNC_FUNC(band, fortran_integer, ompi_fortran_integer_t)
@@ -527,6 +552,9 @@ FUNC_FUNC(bor, int32_t, int32_t)
527552
FUNC_FUNC(bor, uint32_t, uint32_t)
528553
FUNC_FUNC(bor, int64_t, int64_t)
529554
FUNC_FUNC(bor, uint64_t, uint64_t)
555+
FUNC_FUNC(bor, long, long)
556+
FUNC_FUNC(bor, unsigned_long, long)
557+
530558
/* Fortran integer */
531559
#if OMPI_HAVE_FORTRAN_INTEGER
532560
FUNC_FUNC(bor, fortran_integer, ompi_fortran_integer_t)
@@ -564,6 +592,9 @@ FUNC_FUNC(bxor, int32_t, int32_t)
564592
FUNC_FUNC(bxor, uint32_t, uint32_t)
565593
FUNC_FUNC(bxor, int64_t, int64_t)
566594
FUNC_FUNC(bxor, uint64_t, uint64_t)
595+
FUNC_FUNC(bxor, long, long)
596+
FUNC_FUNC(bxor, unsigned_long, long)
597+
567598
/* Fortran integer */
568599
#if OMPI_HAVE_FORTRAN_INTEGER
569600
FUNC_FUNC(bxor, fortran_integer, ompi_fortran_integer_t)
@@ -605,6 +636,7 @@ LOC_STRUCT(long_int, long, int)
605636
LOC_STRUCT(2int, int, int)
606637
LOC_STRUCT(short_int, short, int)
607638
LOC_STRUCT(long_double_int, long double, int)
639+
LOC_STRUCT(unsigned_long, unsigned long, int)
608640

609641
/*************************************************************************
610642
* Max location
@@ -789,6 +821,9 @@ FUNC_FUNC_3BUF(max, int32_t, int32_t)
789821
FUNC_FUNC_3BUF(max, uint32_t, uint32_t)
790822
FUNC_FUNC_3BUF(max, int64_t, int64_t)
791823
FUNC_FUNC_3BUF(max, uint64_t, uint64_t)
824+
FUNC_FUNC_3BUF(max, long, long)
825+
FUNC_FUNC_3BUF(max, unsigned_long, long)
826+
792827
/* Fortran integer */
793828
#if OMPI_HAVE_FORTRAN_INTEGER
794829
FUNC_FUNC_3BUF(max, fortran_integer, ompi_fortran_integer_t)
@@ -852,6 +887,9 @@ FUNC_FUNC_3BUF(min, int32_t, int32_t)
852887
FUNC_FUNC_3BUF(min, uint32_t, uint32_t)
853888
FUNC_FUNC_3BUF(min, int64_t, int64_t)
854889
FUNC_FUNC_3BUF(min, uint64_t, uint64_t)
890+
FUNC_FUNC_3BUF(min, long, long)
891+
FUNC_FUNC_3BUF(min, unsigned_long, long)
892+
855893
/* Fortran integer */
856894
#if OMPI_HAVE_FORTRAN_INTEGER
857895
FUNC_FUNC_3BUF(min, fortran_integer, ompi_fortran_integer_t)
@@ -912,6 +950,9 @@ OP_FUNC_3BUF(sum, int32_t, int32_t, +)
912950
OP_FUNC_3BUF(sum, uint32_t, uint32_t, +)
913951
OP_FUNC_3BUF(sum, int64_t, int64_t, +)
914952
OP_FUNC_3BUF(sum, uint64_t, uint64_t, +)
953+
OP_FUNC_3BUF(sum, long, long, +)
954+
OP_FUNC_3BUF(sum, unsigned_long, long, +)
955+
915956
/* Fortran integer */
916957
#if OMPI_HAVE_FORTRAN_INTEGER
917958
OP_FUNC_3BUF(sum, fortran_integer, ompi_fortran_integer_t, +)
@@ -981,6 +1022,9 @@ OP_FUNC_3BUF(prod, int32_t, int32_t, *)
9811022
OP_FUNC_3BUF(prod, uint32_t, uint32_t, *)
9821023
OP_FUNC_3BUF(prod, int64_t, int64_t, *)
9831024
OP_FUNC_3BUF(prod, uint64_t, uint64_t, *)
1025+
OP_FUNC_3BUF(prod, long, long, *)
1026+
OP_FUNC_3BUF(prod, unsigned_long, long, *)
1027+
9841028
/* Fortran integer */
9851029
#if OMPI_HAVE_FORTRAN_INTEGER
9861030
OP_FUNC_3BUF(prod, fortran_integer, ompi_fortran_integer_t, *)
@@ -1052,6 +1096,9 @@ FUNC_FUNC_3BUF(land, int32_t, int32_t)
10521096
FUNC_FUNC_3BUF(land, uint32_t, uint32_t)
10531097
FUNC_FUNC_3BUF(land, int64_t, int64_t)
10541098
FUNC_FUNC_3BUF(land, uint64_t, uint64_t)
1099+
FUNC_FUNC_3BUF(land, long, long)
1100+
FUNC_FUNC_3BUF(land, unsigned_long, long)
1101+
10551102
/* Logical */
10561103
#if OMPI_HAVE_FORTRAN_LOGICAL
10571104
FUNC_FUNC_3BUF(land, fortran_logical, ompi_fortran_logical_t)
@@ -1074,6 +1121,9 @@ FUNC_FUNC_3BUF(lor, int32_t, int32_t)
10741121
FUNC_FUNC_3BUF(lor, uint32_t, uint32_t)
10751122
FUNC_FUNC_3BUF(lor, int64_t, int64_t)
10761123
FUNC_FUNC_3BUF(lor, uint64_t, uint64_t)
1124+
FUNC_FUNC_3BUF(lor, long, long)
1125+
FUNC_FUNC_3BUF(lor, unsigned_long, long)
1126+
10771127
/* Logical */
10781128
#if OMPI_HAVE_FORTRAN_LOGICAL
10791129
FUNC_FUNC_3BUF(lor, fortran_logical, ompi_fortran_logical_t)
@@ -1096,6 +1146,9 @@ FUNC_FUNC_3BUF(lxor, int32_t, int32_t)
10961146
FUNC_FUNC_3BUF(lxor, uint32_t, uint32_t)
10971147
FUNC_FUNC_3BUF(lxor, int64_t, int64_t)
10981148
FUNC_FUNC_3BUF(lxor, uint64_t, uint64_t)
1149+
FUNC_FUNC_3BUF(lxor, long, long)
1150+
FUNC_FUNC_3BUF(lxor, unsigned_long, long)
1151+
10991152
/* Logical */
11001153
#if OMPI_HAVE_FORTRAN_LOGICAL
11011154
FUNC_FUNC_3BUF(lxor, fortran_logical, ompi_fortran_logical_t)
@@ -1118,6 +1171,9 @@ FUNC_FUNC_3BUF(band, int32_t, int32_t)
11181171
FUNC_FUNC_3BUF(band, uint32_t, uint32_t)
11191172
FUNC_FUNC_3BUF(band, int64_t, int64_t)
11201173
FUNC_FUNC_3BUF(band, uint64_t, uint64_t)
1174+
FUNC_FUNC_3BUF(band, long, long)
1175+
FUNC_FUNC_3BUF(band, unsigned_long, long)
1176+
11211177
/* Fortran integer */
11221178
#if OMPI_HAVE_FORTRAN_INTEGER
11231179
FUNC_FUNC_3BUF(band, fortran_integer, ompi_fortran_integer_t)
@@ -1155,6 +1211,9 @@ FUNC_FUNC_3BUF(bor, int32_t, int32_t)
11551211
FUNC_FUNC_3BUF(bor, uint32_t, uint32_t)
11561212
FUNC_FUNC_3BUF(bor, int64_t, int64_t)
11571213
FUNC_FUNC_3BUF(bor, uint64_t, uint64_t)
1214+
FUNC_FUNC_3BUF(bor, long, long)
1215+
FUNC_FUNC_3BUF(bor, unsigned_long, long)
1216+
11581217
/* Fortran integer */
11591218
#if OMPI_HAVE_FORTRAN_INTEGER
11601219
FUNC_FUNC_3BUF(bor, fortran_integer, ompi_fortran_integer_t)
@@ -1192,6 +1251,9 @@ FUNC_FUNC_3BUF(bxor, int32_t, int32_t)
11921251
FUNC_FUNC_3BUF(bxor, uint32_t, uint32_t)
11931252
FUNC_FUNC_3BUF(bxor, int64_t, int64_t)
11941253
FUNC_FUNC_3BUF(bxor, uint64_t, uint64_t)
1254+
FUNC_FUNC_3BUF(bxor, long, long)
1255+
FUNC_FUNC_3BUF(bxor, unsigned_long, long)
1256+
11951257
/* Fortran integer */
11961258
#if OMPI_HAVE_FORTRAN_INTEGER
11971259
FUNC_FUNC_3BUF(bxor, fortran_integer, ompi_fortran_integer_t)
@@ -1293,6 +1355,8 @@ LOC_FUNC_3BUF(minloc, long_double_int, <)
12931355
[OMPI_OP_BASE_TYPE_INT32_T] = ompi_op_base_##ftype##_##name##_int32_t, \
12941356
[OMPI_OP_BASE_TYPE_UINT32_T] = ompi_op_base_##ftype##_##name##_uint32_t, \
12951357
[OMPI_OP_BASE_TYPE_INT64_T] = ompi_op_base_##ftype##_##name##_int64_t, \
1358+
[OMPI_OP_BASE_TYPE_LONG] = ompi_op_base_##ftype##_##name##_long, \
1359+
[OMPI_OP_BASE_TYPE_UNSIGNED_LONG] = ompi_op_base_##ftype##_##name##_unsigned_long, \
12961360
[OMPI_OP_BASE_TYPE_UINT64_T] = ompi_op_base_##ftype##_##name##_uint64_t
12971361

12981362
/** All the Fortran integers ********************************************/

ompi/mca/op/op.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,11 @@ enum {
191191
/** 2 location C: long double int */
192192
OMPI_OP_BASE_TYPE_LONG_DOUBLE_INT,
193193

194+
/** long */
195+
OMPI_OP_BASE_TYPE_LONG,
196+
/** unsigned long */
197+
OMPI_OP_BASE_TYPE_UNSIGNED_LONG,
198+
194199
/** 2 location C: wchar_t */
195200
OMPI_OP_BASE_TYPE_WCHAR,
196201

ompi/op/op.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,9 @@ int ompi_op_init(void)
228228
ompi_op_ddt_map[OMPI_DATATYPE_MPI_SHORT_FLOAT] = OMPI_OP_BASE_TYPE_SHORT_FLOAT;
229229
ompi_op_ddt_map[OMPI_DATATYPE_MPI_C_SHORT_FLOAT_COMPLEX] = OMPI_OP_BASE_TYPE_C_SHORT_FLOAT_COMPLEX;
230230

231+
ompi_op_ddt_map[OMPI_DATATYPE_MPI_LONG] = OMPI_OP_BASE_TYPE_LONG;
232+
ompi_op_ddt_map[OMPI_DATATYPE_MPI_UNSIGNED_LONG] = OMPI_OP_BASE_TYPE_UNSIGNED_LONG;
233+
231234
/* Create the intrinsic ops */
232235

233236
if (OMPI_SUCCESS !=

0 commit comments

Comments
 (0)