Skip to content

Commit 37cb001

Browse files
committed
Be pedantic to keep some compilers happy.
Remove the use of anonymous unions as it is C11 and we currently only require C99. Signed-off-by: George Bosilca <bosilca@icl.utk.edu>
1 parent e813ad3 commit 37cb001

File tree

4 files changed

+16
-27
lines changed

4 files changed

+16
-27
lines changed

ompi/mca/coll/adapt/coll_adapt_algorithms.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,6 @@
1414
#include "ompi/mca/coll/base/coll_base_functions.h"
1515
#include <math.h>
1616

17-
typedef int (*ompi_mca_coll_adapt_ibcast_function_t)(IBCAST_ARGS);
18-
typedef int (*ompi_mca_coll_adapt_ireduce_function_t)(IREDUCE_ARGS);
19-
20-
typedef struct ompi_coll_adapt_algorithm_index_s {
21-
int algorithm_index;
22-
union {
23-
ompi_mca_coll_adapt_ibcast_function_t ibcast_fn_ptr;
24-
ompi_mca_coll_adapt_ireduce_function_t ireduce_fn_ptr;
25-
};
26-
} ompi_coll_adapt_algorithm_index_t;
27-
2817
/* Bcast */
2918
int ompi_coll_adapt_ibcast_register(void);
3019
int ompi_coll_adapt_ibcast_fini(void);

ompi/mca/coll/han/coll_han.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ typedef struct mca_coll_han_single_collective_fallback_s {
247247
mca_coll_base_module_gather_fn_t gather;
248248
mca_coll_base_module_reduce_fn_t reduce;
249249
mca_coll_base_module_scatter_fn_t scatter;
250-
};
250+
} module_fn;
251251
mca_coll_base_module_t* module;
252252
} mca_coll_han_single_collective_fallback_t;
253253

@@ -316,36 +316,36 @@ OBJ_CLASS_DECLARATION(mca_coll_han_module_t);
316316
* Some defines to stick to the naming used in the other components in terms of
317317
* fallback routines
318318
*/
319-
#define previous_allgather fallback.allgather.allgather
319+
#define previous_allgather fallback.allgather.module_fn.allgather
320320
#define previous_allgather_module fallback.allgather.module
321321

322-
#define previous_allgatherv fallback.allgatherv.allgatherv
322+
#define previous_allgatherv fallback.allgatherv.module_fn.allgatherv
323323
#define previous_allgatherv_module fallback.allgatherv.module
324324

325-
#define previous_allreduce fallback.allreduce.allreduce
325+
#define previous_allreduce fallback.allreduce.module_fn.allreduce
326326
#define previous_allreduce_module fallback.allreduce.module
327327

328-
#define previous_barrier fallback.barrier.barrier
328+
#define previous_barrier fallback.barrier.module_fn.barrier
329329
#define previous_barrier_module fallback.barrier.module
330330

331-
#define previous_bcast fallback.bcast.bcast
331+
#define previous_bcast fallback.bcast.module_fn.bcast
332332
#define previous_bcast_module fallback.bcast.module
333333

334-
#define previous_reduce fallback.reduce.reduce
334+
#define previous_reduce fallback.reduce.module_fn.reduce
335335
#define previous_reduce_module fallback.reduce.module
336336

337-
#define previous_gather fallback.gather.gather
337+
#define previous_gather fallback.gather.module_fn.gather
338338
#define previous_gather_module fallback.gather.module
339339

340-
#define previous_scatter fallback.scatter.scatter
340+
#define previous_scatter fallback.scatter.module_fn.scatter
341341
#define previous_scatter_module fallback.scatter.module
342342

343343

344344
/* macro to correctly load a fallback collective module */
345345
#define HAN_LOAD_FALLBACK_COLLECTIVE(HANM, COMM, COLL) \
346346
do { \
347347
if ( ((COMM)->c_coll->coll_ ## COLL ## _module) == (mca_coll_base_module_t*)(HANM) ) { \
348-
(COMM)->c_coll->coll_ ## COLL = (HANM)->fallback.COLL.COLL; \
348+
(COMM)->c_coll->coll_ ## COLL = (HANM)->fallback.COLL.module_fn.COLL; \
349349
mca_coll_base_module_t *coll_module = (COMM)->c_coll->coll_ ## COLL ## _module; \
350350
(COMM)->c_coll->coll_ ## COLL ## _module = (HANM)->fallback.COLL.module; \
351351
OBJ_RETAIN((COMM)->c_coll->coll_ ## COLL ## _module); \

ompi/mca/coll/han/coll_han_module.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ static int mca_coll_han_module_disable(mca_coll_base_module_t * module,
3232

3333
#define CLEAN_PREV_COLL(HANDLE, NAME) \
3434
do { \
35-
(HANDLE)->fallback.NAME.NAME = NULL; \
35+
(HANDLE)->fallback.NAME.module_fn.NAME = NULL; \
3636
(HANDLE)->fallback.NAME.module = NULL; \
3737
} while (0)
3838

ompi/mca/coll/han/coll_han_subcomms.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@
2626
#include "coll_han.h"
2727
#include "coll_han_dynamic.h"
2828

29-
#define HAN_SUBCOM_SAVE_COLLECTIVE(FALLBACKS, COMM, HANM, COLL) \
29+
#define HAN_SUBCOM_SAVE_COLLECTIVE(FALLBACKS, COMM, HANM, COLL) \
3030
do { \
31-
(FALLBACKS).COLL.COLL = (COMM)->c_coll->coll_ ## COLL; \
31+
(FALLBACKS).COLL.module_fn.COLL = (COMM)->c_coll->coll_ ## COLL; \
3232
(FALLBACKS).COLL.module = (COMM)->c_coll->coll_ ## COLL ## _module; \
33-
(COMM)->c_coll->coll_ ## COLL = (HANM)->fallback.COLL.COLL; \
33+
(COMM)->c_coll->coll_ ## COLL = (HANM)->fallback.COLL.module_fn.COLL; \
3434
(COMM)->c_coll->coll_ ## COLL ## _module = (HANM)->fallback.COLL.module; \
3535
} while(0)
3636

37-
#define HAN_SUBCOM_LOAD_COLLECTIVE(FALLBACKS, COMM, HANM, COLL) \
37+
#define HAN_SUBCOM_LOAD_COLLECTIVE(FALLBACKS, COMM, HANM, COLL) \
3838
do { \
39-
(COMM)->c_coll->coll_ ## COLL = (FALLBACKS).COLL.COLL; \
39+
(COMM)->c_coll->coll_ ## COLL = (FALLBACKS).COLL.module_fn.COLL; \
4040
(COMM)->c_coll->coll_ ## COLL ## _module = (FALLBACKS).COLL.module; \
4141
} while(0)
4242

0 commit comments

Comments
 (0)