Skip to content

Commit 1318c07

Browse files
committed
Cleanup the pnet/sshot code for picky compilers
Signed-off-by: Ralph Castain <[email protected]>
1 parent 60b45ef commit 1318c07

File tree

6 files changed

+29
-13
lines changed

6 files changed

+29
-13
lines changed

src/mca/common/sse/Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
AM_CPPFLAGS = $(LTDLINCL) -I$(top_builddir)/src -I$(top_builddir)/src/include -I$(top_builddir)/include -I$(top_builddir)/include/pmix $(common_sse_CPPFLAGS)
1414
AM_LFLAGS = -Ppmix_util_sse_yy
1515
LEX_OUTPUT_ROOT = lex.pmix_util_sse_yy
16+
# we do NOT want picky compilers down here due to use of flex
17+
CFLAGS = $(PMIX_CFLAGS_BEFORE_PICKY)
1618

1719
headers = \
1820
sse.h \

src/mca/common/sse/sse.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ static void curl_perform(int sd, short args, void *cbdata)
111111
long response_code;
112112
const char *effective_url = NULL;
113113
char *content_type;
114+
PMIX_HIDE_UNUSED_PARAMS(sd, args);
114115

115116
while (1) {
116117
CURLcode res = curl_easy_perform(pcl->curl);
@@ -175,6 +176,7 @@ static void ondataprocessing(char *ptr, size_t size, size_t nmemb, void *cbdata)
175176
/* provide a hook for the curl reply if it is just to be ignored */
176177
static size_t http_ignore_data(char *ptr, size_t size, size_t nmemb, void *userdata)
177178
{
179+
PMIX_HIDE_UNUSED_PARAMS(ptr, userdata);
178180
return size * nmemb;
179181
}
180182

@@ -185,6 +187,7 @@ void pmix_common_on_sse_event(char **inheaders, const char *data, const char *re
185187
pmix_sse_curl_handle_t *reply;
186188
char *result = NULL;
187189
int n;
190+
PMIX_HIDE_UNUSED_PARAMS(inheaders);
188191

189192
/* pass to the user for processing */
190193
if (NULL != pcl->ondata) {

src/mca/pnet/sshot/pnet_fabric.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ pmix_status_t pmix_pnet_sshot_register_fabric(pmix_fabric_t *fabric, const pmix_
305305
static void regcbfunc(long response_code, const char *effective_url, void *cbdata)
306306
{
307307
pmix_sse_request_t *req = (pmix_sse_request_t *) cbdata;
308+
PMIX_HIDE_UNUSED_PARAMS(effective_url);
308309

309310
PMIX_ACQUIRE_OBJECT(req); // ensure the object has been updated
310311

@@ -320,6 +321,7 @@ static void regcbfunc(long response_code, const char *effective_url, void *cbdat
320321
static void ondata(const char *stream, char **result, void *userdata)
321322
{
322323
pmix_cb_t *cb = (pmix_cb_t *) userdata;
324+
PMIX_HIDE_UNUSED_PARAMS(result);
323325

324326
PMIX_ACQUIRE_OBJECT(cb);
325327

@@ -350,6 +352,7 @@ static pmix_status_t ask_fabric_controller(pmix_fabric_t *fabric, const pmix_inf
350352
pmix_sse_request_t *req;
351353
pmix_cb_t *cb;
352354
pmix_status_t rc;
355+
PMIX_HIDE_UNUSED_PARAMS(directives, ndirs);
353356

354357
/* initialize the sse support - it is protected,
355358
* so it doesn't matter if it was already

src/mca/pnet/sshot/pnet_sshot.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,11 @@
4444

4545
static pmix_status_t sshot_init(void);
4646
static void sshot_finalize(void);
47-
static pmix_status_t allocate(pmix_namespace_t *nptr, pmix_info_t info[], size_t ninfo,
47+
static pmix_status_t allocate(pmix_namespace_t *nptr,
48+
pmix_info_t info[], size_t ninfo,
4849
pmix_list_t *ilist);
49-
static pmix_status_t setup_local_network(pmix_namespace_t *nptr, pmix_info_t info[], size_t ninfo);
50+
static pmix_status_t setup_local_network(pmix_nspace_env_cache_t *nptr,
51+
pmix_info_t info[], size_t ninfo);
5052
pmix_pnet_module_t pmix_sshot_module = {
5153
.name = "sshot",
5254
.init = sshot_init,
@@ -165,7 +167,8 @@ static void sshot_finalize(void)
165167
* (c) the final "blob" that is returned to the caller shall be compressed
166168
* prior to adding it to the input "ilist"
167169
*/
168-
static pmix_status_t allocate(pmix_namespace_t *nptr, pmix_info_t info[], size_t ninfo,
170+
static pmix_status_t allocate(pmix_namespace_t *nptr,
171+
pmix_info_t info[], size_t ninfo,
169172
pmix_list_t *ilist)
170173
{
171174
int n, m;
@@ -408,7 +411,8 @@ static pmix_status_t allocate(pmix_namespace_t *nptr, pmix_info_t info[], size_t
408411
* from PMIx_server_setup_application. In this case, we search for a blob
409412
* that our "allocate" function may have included in that info.
410413
*/
411-
static pmix_status_t setup_local_network(pmix_namespace_t *nptr, pmix_info_t info[], size_t ninfo)
414+
static pmix_status_t setup_local_network(pmix_nspace_env_cache_t *nptr,
415+
pmix_info_t info[], size_t ninfo)
412416
{
413417
size_t n, ndevs, m, d, ndims = 3;
414418
pmix_buffer_t bkt;
@@ -442,7 +446,7 @@ static pmix_status_t setup_local_network(pmix_namespace_t *nptr, pmix_info_t inf
442446
"pnet:sshot:setup_local_network with %lu info", (unsigned long) ninfo);
443447

444448
/* setup the namespace for the job */
445-
PMIX_LOAD_NSPACE(proc.nspace, nptr->nspace);
449+
PMIX_LOAD_NSPACE(proc.nspace, nptr->ns->nspace);
446450
/* prep the unpack buffer */
447451
PMIX_CONSTRUCT(&bkt, pmix_buffer_t);
448452

@@ -692,6 +696,8 @@ static pmix_status_t setup_local_network(pmix_namespace_t *nptr, pmix_info_t inf
692696

693697
static void compute_coord(pmix_coord_t *coord, char *xname, pmix_coord_view_t view)
694698
{
699+
PMIX_HIDE_UNUSED_PARAMS(xname);
700+
695701
/* assume three dimensions */
696702
coord->view = view;
697703
coord->coord = (uint32_t *) malloc(3 * sizeof(uint32_t));

src/mca/pnet/sshot/pnet_sshot_component.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "src/include/pmix_config.h"
3131
#include "pmix_common.h"
3232

33+
#include "src/hwloc/pmix_hwloc.h"
3334
#include "pnet_sshot.h"
3435
#include "src/mca/pnet/pnet.h"
3536
#include "src/util/pmix_argv.h"
@@ -73,7 +74,7 @@ static pmix_status_t component_register(void)
7374

7475
(void) pmix_mca_base_component_var_register(
7576
component, "config_file", "Path of file containing Slingshot fabric configuration",
76-
PMIX_MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
77+
PMIX_MCA_BASE_VAR_TYPE_STRING,
7778
&pmix_mca_pnet_sshot_component.configfile);
7879

7980
(void) pmix_mca_base_component_var_register(component, "num_nodes",
@@ -82,7 +83,7 @@ static pmix_status_t component_register(void)
8283
&pmix_mca_pnet_sshot_component.numnodes);
8384
(void) pmix_mca_base_component_var_register(
8485
component, "devs_per_node", "Number of devices/node to simulate (0 = no simulation)",
85-
PMIX_MCA_BASE_VAR_TYPE_INT, NULL, 0, 0, PMIX_INFO_LVL_2, PMIX_MCA_BASE_VAR_SCOPE_READONLY,
86+
PMIX_MCA_BASE_VAR_TYPE_INT,
8687
&pmix_mca_pnet_sshot_component.numdevs);
8788

8889
(void) pmix_mca_base_component_var_register(component, "ppn", "PPN to simulate",
@@ -97,12 +98,12 @@ static pmix_status_t component_open(void)
9798
pmix_status_t rc;
9899

99100
// unsure what this will be registered under, so try multiple codes
100-
rc = pmix_ploc.check_vendor(&pmix_globals.topology, 0x17db, 0x208); // Cray
101+
rc = pmix_hwloc_check_vendor(&pmix_globals.topology, 0x17db, 0x208); // Cray
101102
if (PMIX_SUCCESS != rc) {
102-
rc = pmix_ploc.check_vendor(&pmix_globals.topology, 0x18c8, 0x208); // Cray
103+
rc = pmix_hwloc_check_vendor(&pmix_globals.topology, 0x18c8, 0x208); // Cray
103104
}
104105
if (PMIX_SUCCESS != rc) {
105-
rc = pmix_ploc.check_vendor(&pmix_globals.topology, 0x1590, 0x208); // HPE
106+
rc = pmix_hwloc_check_vendor(&pmix_globals.topology, 0x1590, 0x208); // HPE
106107
}
107108

108109
return rc;

test/sshot/Makefile.am

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
22
# Copyright (c) 2020 Intel, Inc. All rights reserved.
3-
# Copyright (c) 2021 Nanook Consulting. All rights reserved.
3+
# Copyright (c) 2021-2022 Nanook Consulting. All rights reserved.
44
# $COPYRIGHT$
55
#
66
# Additional copyrights may follow
@@ -10,19 +10,20 @@
1010

1111
AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_builddir)/src/include -I$(top_builddir)/include -I$(top_builddir)/include/pmix $(pmix_check_jansson_CPPFLAGS)
1212
# we do NOT want picky compilers down here
13+
CFLAGS = $(PMIX_CFLAGS_BEFORE_PICKY)
1314

1415
if HAVE_JANSSON
1516
noinst_PROGRAMS = generate server daemon testcoord
1617

1718
generate_SOURCES = \
1819
generate.c
1920
generate_LDFLAGS = $(pmix_check_jansson_LDFLAGS)
20-
generate_LDADD = $(pmix_check_jansson_LIBS)
21+
generate_LDADD = -ljansson
2122

2223
server_SOURCES = \
2324
server.c
2425
server_LDFLAGS = $(pmix_check_jansson_LDFLAGS)
25-
server_LDADD = $(pmix_check_jansson_LIBS)
26+
server_LDADD = -ljansson
2627

2728
daemon_SOURCES = \
2829
daemon.c

0 commit comments

Comments
 (0)