Skip to content

Commit d6bfdf2

Browse files
committed
opal: Update portable_platform file
Update the portable platform file from GASNet, as we had last pulled changes sometime before 2013. At the same time, make the infrastructure slightly easier to make future updates. To simplify updates, we move the GASNet header to opal_portable_platform_real.h and provide wrappers in opal_portable_platform.h and mpi.h to avoid compiler warnings from the GASNet header. In theory, future updates should be as somple as copying gasnet_portable_platform.h into opal_portable_platform_real.h. Somewhere in the last decade, GASNet switched from _STRINGIFY to PLATFORM_STRINGIFY, so update all the places we used _STRINGIFY. Signed-off-by: Brian Barrett <bbarrett@amazon.com>
1 parent cb17568 commit d6bfdf2

File tree

8 files changed

+1213
-396
lines changed

8 files changed

+1213
-396
lines changed

config/opal_check_compiler_version.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ AC_DEFUN([OPAL_CHECK_COMPILER_STRINGIFY], [
105105
FILE * f;
106106
f=fopen("conftestval", "w");
107107
if (!f) exit(1);
108-
fprintf (f, "%s", _STRINGIFY(PLATFORM_COMPILER_$1));
108+
fprintf (f, "%s", PLATFORM_STRINGIFY(PLATFORM_COMPILER_$1));
109109
]])], [
110110
opal_cv_compiler_$1=`cat conftestval`
111111
], [

ompi/include/Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,6 @@ distclean-local:
127127
mpif-sizeof.h \
128128
mpif-c-constants-decl.h mpif-c-constants.h mpif-f08-types.h
129129

130-
mpi_portable_platform.h: $(top_srcdir)/opal/include/opal/opal_portable_platform.h
130+
mpi_portable_platform.h: $(top_srcdir)/opal/include/opal/opal_portable_platform_real.h
131131
-@rm -f mpi_portable_platform.h
132-
$(OMPI_V_LN_S) $(LN_S) $(top_srcdir)/opal/include/opal/opal_portable_platform.h mpi_portable_platform.h
132+
$(OMPI_V_LN_S) $(LN_S) $(top_srcdir)/opal/include/opal/opal_portable_platform_real.h mpi_portable_platform.h

ompi/include/mpi.h.in

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
* Copyright (c) 2017-2019 IBM Corporation. All rights reserved.
2323
* Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
2424
* Copyright (c) 2021 Google, LLC. All rights reserved.
25+
* Copyright (c) 2021 Amazon.com, Inc. or its affiliates. All Rights
26+
* reserved.
2527
* $COPYRIGHT$
2628
*
2729
* Additional copyrights may follow
@@ -78,6 +80,9 @@
7880
/* The size of a `int', as computed by sizeof. */
7981
#undef OPAL_SIZEOF_INT
8082

83+
/* The size of a `void*', as computed by sizeof. */
84+
#undef OPAL_SIZEOF_VOID_P
85+
8186
/* Maximum length of datarep string (default is 128) */
8287
#undef OPAL_MAX_DATAREP_STRING
8388

@@ -249,10 +254,29 @@
249254
#if !OMPI_BUILDING
250255
/*
251256
* Figure out which compiler is being invoked (in order to compare if
252-
* it was different than what OMPI was built with).
257+
* it was different than what OMPI was built with). Do some preprocessor
258+
* hacks to eliminate warnings in the portable_platform.h file.
253259
*/
260+
# ifndef SIZEOF_VOID_P
261+
# define CLEANUP_SIZEOF_VOID_P 1
262+
# define SIZEOF_VOID_P OPAL_SIZEOF_VOID_P
263+
# else
264+
# define CLEANUP_SIZEOF_VOID_P 0
265+
# endif
266+
267+
# ifndef _PORTABLE_PLATFORM_H
268+
# define _PORTABLE_PLATFORM_H 0
269+
# endif
270+
# ifndef PLATFORM_HEADER_VERSION
271+
# define PLATFORM_HEADER_VERSION 0
272+
# endif
273+
254274
# include "mpi_portable_platform.h"
255275

276+
#if CLEANUP_SIZEOF_VOID_P
277+
#undef SIZEOF_VOID_P
278+
#endif
279+
256280
/*
257281
* If we're currently using the same compiler that was used to
258282
* build Open MPI, enable compile-time warning of user-level code

ompi/tools/ompi_info/param.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* Copyright (c) 2014-2019 Research Organization for Information Science
1515
* and Technology (RIST). All rights reserved.
1616
* Copyright (c) 2015-2019 Intel, Inc. All rights reserved.
17-
* Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved.
17+
* Copyright (c) 2018-2021 Amazon.com, Inc. or its affiliates. All Rights reserved.
1818
* Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
1919
* $COPYRIGHT$
2020
*
@@ -287,7 +287,7 @@ void ompi_info_do_config(bool want_all)
287287

288288
if (OMPI_FORTRAN_HAVE_IGNORE_TKR) {
289289
/* OMPI_FORTRAN_IGNORE_TKR_PREDECL is already in quotes; it
290-
didn't work consistently to put it in _STRINGIFY because
290+
didn't work consistently to put it in PLATFORM_STRINGIFY because
291291
sometimes the compiler would actually interpret the pragma
292292
in there before stringify-ing it. */
293293
(void)opal_asprintf(&fortran_have_ignore_tkr, "yes (%s)",
@@ -336,9 +336,9 @@ void ompi_info_do_config(bool want_all)
336336
opal_info_out("C compiler absolute", "compiler:c:absolute",
337337
OPAL_CC_ABSOLUTE);
338338
opal_info_out("C compiler family name", "compiler:c:familyname",
339-
_STRINGIFY(OPAL_BUILD_PLATFORM_COMPILER_FAMILYNAME));
339+
PLATFORM_STRINGIFY(OPAL_BUILD_PLATFORM_COMPILER_FAMILYNAME));
340340
opal_info_out("C compiler version", "compiler:c:version",
341-
_STRINGIFY(OPAL_BUILD_PLATFORM_COMPILER_VERSION_STR));
341+
PLATFORM_STRINGIFY(OPAL_BUILD_PLATFORM_COMPILER_VERSION_STR));
342342

343343
if (want_all) {
344344
opal_info_out_int("C char size", "compiler:c:sizeof:char", sizeof(char));

opal/include/opal/Makefile.am

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# Copyright (c) 2004-2005 The Regents of the University of California.
1111
# All rights reserved.
1212
# Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
13+
# Copyright (c) 2021 Nanook Consulting. All rights reserved.
1314
# $COPYRIGHT$
1415
#
1516
# Additional copyrights may follow
@@ -27,7 +28,8 @@ headers += \
2728
opal/prefetch.h \
2829
opal/hash_string.h \
2930
opal/frameworks.h \
30-
opal/opal_portable_platform.h
31+
opal/opal_portable_platform.h \
32+
opal/opal_portable_platform_real.h
3133

3234
nodist_headers += \
3335
opal/version.h

0 commit comments

Comments
 (0)