diff --git a/include/Makefile.am b/include/Makefile.am index 8956f0a0d1..0e2301b96f 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,7 +1,7 @@ # # Copyright (c) 2015-2020 Intel, Inc. All rights reserved. # -# Copyright (c) 2021 Nanook Consulting All rights reserved. +# Copyright (c) 2021-2025 Nanook Consulting All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow diff --git a/src/mca/ess/base/ess_base_bootstrap.c b/src/mca/ess/base/ess_base_bootstrap.c index d87c4b9fd1..fb21ae0115 100644 --- a/src/mca/ess/base/ess_base_bootstrap.c +++ b/src/mca/ess/base/ess_base_bootstrap.c @@ -151,9 +151,15 @@ int prte_ess_base_bootstrap(void) /* identify and cache the option */ if (0 == strcmp(line, "ClusterName")) { + if (NULL != cluster) { + free(cluster); + } cluster = strdup(ptr); } else if (0 == strcmp(line, "DVMControllerHost")) { + if (NULL != ctrlhost) { + free(ctrlhost); + } ctrlhost = strdup(ptr); } else if (0 == strcmp(line, "DVMControllerPort")) { @@ -163,18 +169,33 @@ int prte_ess_base_bootstrap(void) prtedport = strtoul(ptr, NULL, 10); } else if (0 == strcmp(line, "DVMNodes")) { + if (NULL == dvmnodes) { + free(dvmnodes); + } dvmnodes = strdup(ptr); } else if (0 == strcmp(line, "DVMTempDir")) { + if (NULL == dvmtmpdir) { + free(dvmtmpdir); + } dvmtmpdir = strdup(ptr); } else if (0 == strcmp(line, "SessionTmpDir")) { + if (NULL != sessiontmpdir) { + free(sessiontmpdir); + } sessiontmpdir = strdup(ptr); } else if (0 == strcmp(line, "ControllerLogPath")) { + if (NULL != ctrllogpath) { + free(ctrllogpath); + } ctrllogpath = strdup(ptr); } else if (0 == strcmp(line, "PRTEDLogPath")) { + if (NULL != prtedlogpath) { + free(prtedlogpath); + } prtedlogpath = strdup(ptr); } free(line); diff --git a/src/mca/grpcomm/direct/grpcomm_direct_group.c b/src/mca/grpcomm/direct/grpcomm_direct_group.c index 7b21036b04..b89fc4740c 100644 --- a/src/mca/grpcomm/direct/grpcomm_direct_group.c +++ b/src/mca/grpcomm/direct/grpcomm_direct_group.c @@ -586,9 +586,21 @@ void prte_grpcomm_direct_grp_recv(int status, pmix_proc_t *sender, PMIx_Info_list_convert(coll->grpinfo, &darray); info = (pmix_info_t*)darray.array; ninfo = darray.size; - PMIx_Data_pack(NULL, reply, &ninfo, 1, PMIX_SIZE); + rc = PMIx_Data_pack(NULL, reply, &ninfo, 1, PMIX_SIZE); + if (PMIX_SUCCESS != rc) { + PMIX_ERROR_LOG(rc); + PMIX_DATA_BUFFER_RELEASE(reply); + PMIX_RELEASE(sig); + return; + } if (0 < ninfo) { - PMIx_Data_pack(NULL, reply, info, ninfo, PMIX_INFO); + rc = PMIx_Data_pack(NULL, reply, info, ninfo, PMIX_INFO); + if (PMIX_SUCCESS != rc) { + PMIX_ERROR_LOG(rc); + PMIX_DATA_BUFFER_RELEASE(reply); + PMIX_RELEASE(sig); + return; + } } PMIX_DATA_ARRAY_DESTRUCT(&darray); @@ -596,9 +608,21 @@ void prte_grpcomm_direct_grp_recv(int status, pmix_proc_t *sender, PMIx_Info_list_convert(coll->endpts, &darray); info = (pmix_info_t*)darray.array; ninfo = darray.size; - PMIx_Data_pack(NULL, reply, &ninfo, 1, PMIX_SIZE); + rc = PMIx_Data_pack(NULL, reply, &ninfo, 1, PMIX_SIZE); + if (PMIX_SUCCESS != rc) { + PMIX_ERROR_LOG(rc); + PMIX_DATA_BUFFER_RELEASE(reply); + PMIX_RELEASE(sig); + return; + } if (0 < ninfo) { - PMIx_Data_pack(NULL, reply, info, ninfo, PMIX_INFO); + rc = PMIx_Data_pack(NULL, reply, info, ninfo, PMIX_INFO); + if (PMIX_SUCCESS != rc) { + PMIX_ERROR_LOG(rc); + PMIX_DATA_BUFFER_RELEASE(reply); + PMIX_RELEASE(sig); + return; + } } PMIX_DATA_ARRAY_DESTRUCT(&darray); } diff --git a/src/mca/odls/base/odls_base_default_fns.c b/src/mca/odls/base/odls_base_default_fns.c index 2d4203df6c..c089d251cb 100644 --- a/src/mca/odls/base/odls_base_default_fns.c +++ b/src/mca/odls/base/odls_base_default_fns.c @@ -655,8 +655,8 @@ int prte_odls_base_default_construct_child_list(pmix_data_buffer_t *buffer, pmix /* add any cache'd values to the front of the job attributes */ for (m = 0; m < ninfo; m++) { if (0 == strcmp(info[m].key, PMIX_SET_ENVAR)) { - envt.envar = strdup(info[m].value.data.envar.envar); - envt.value = strdup(info[m].value.data.envar.value); + envt.envar = info[m].value.data.envar.envar; + envt.value = info[m].value.data.envar.value; envt.separator = info[m].value.data.envar.separator; prte_prepend_attribute(&jdata->attributes, PRTE_JOB_SET_ENVAR, PRTE_ATTR_GLOBAL, &envt, PMIX_ENVAR); @@ -1112,6 +1112,9 @@ static void process_envars(prte_job_t *jdata, bool found; PMIX_LIST_FOREACH(attr, &jdata->attributes, prte_attribute_t) { + if (PMIX_ENVAR != attr->data.type) { + continue; + } val = &attr->data; envar = &val->data.envar; if (attr->key == PRTE_JOB_SET_ENVAR) { @@ -1186,6 +1189,9 @@ static void process_envars(prte_job_t *jdata, // app trumps job, so do it after the job PMIX_LIST_FOREACH(attr, &app->attributes, prte_attribute_t) { + if (PMIX_ENVAR != attr->data.type) { + continue; + } val = &attr->data; envar = &val->data.envar; if (attr->key == PRTE_APP_SET_ENVAR) { @@ -1252,15 +1258,14 @@ void prte_odls_base_default_launch_local(int fd, short sd, void *cbdata) int j, idx; int total_num_local_procs = 0; prte_odls_launch_local_t *caddy = (prte_odls_launch_local_t *) cbdata; - prte_job_t *jobdat, *parent; + prte_job_t *jobdat; pmix_nspace_t job; prte_odls_base_fork_local_proc_fn_t fork_local = caddy->fork_local; - bool index_argv, inherit; + bool index_argv; char *msg, **xfer; prte_odls_spawn_caddy_t *cd; prte_event_base_t *evb; prte_schizo_base_module_t *schizo; - pmix_proc_t *nptr; PRTE_HIDE_UNUSED_PARAMS(fd, sd); PMIX_ACQUIRE_OBJECT(caddy); @@ -1353,20 +1358,6 @@ void prte_odls_base_default_launch_local(int fd, short sd, void *cbdata) } } - // see if we have a parent in case of inheritance - nptr = NULL; - prte_get_attribute(&jobdat->attributes, PRTE_JOB_LAUNCH_PROXY, (void **) &nptr, PMIX_PROC); - if (NULL != nptr) { - parent = prte_get_job_data_object(nptr->nspace); - if (NULL != parent) { - inherit = prte_get_attribute(&parent->attributes, PRTE_JOB_INHERIT, NULL, PMIX_BOOL); - } else { - inherit = false; - } - } else { - inherit = false; - } - for (j = 0; j < jobdat->apps->size; j++) { app = (prte_app_context_t *) pmix_pointer_array_get_item(jobdat->apps, j); if (NULL == app) { @@ -1410,10 +1401,6 @@ void prte_odls_base_default_launch_local(int fd, short sd, void *cbdata) } // process any provided env directives - if (inherit) { - // start with the parent's directives - process_envars(parent, app); - } process_envars(jobdat, app); diff --git a/src/mca/rmaps/base/rmaps_base_frame.c b/src/mca/rmaps/base/rmaps_base_frame.c index b997eaca86..03a6cbc98e 100644 --- a/src/mca/rmaps/base/rmaps_base_frame.c +++ b/src/mca/rmaps/base/rmaps_base_frame.c @@ -542,7 +542,7 @@ int prte_rmaps_base_set_mapping_policy(prte_job_t *jdata, char *inspec) cptr = strdup(ck[0]); *ptr = '='; // restore the option ++ptr; - if (NULL == ptr) { + if ('\0' == *ptr) { /* malformed option */ pmix_show_help("help-prte-rmaps-base.txt", "unrecognized-policy", true, "mapping", ck[0]); diff --git a/src/mca/rmaps/base/rmaps_base_map_job.c b/src/mca/rmaps/base/rmaps_base_map_job.c index 72944ebe75..5d4c8aecac 100644 --- a/src/mca/rmaps/base/rmaps_base_map_job.c +++ b/src/mca/rmaps/base/rmaps_base_map_job.c @@ -57,6 +57,10 @@ static int map_colocate(prte_job_t *jdata, uint16_t procs_per_target, prte_rmaps_options_t *options); +static void inherit_env_directives(prte_job_t *jdata, + prte_job_t *parent, + pmix_proc_t *proxy); + void prte_rmaps_base_map_job(int fd, short args, void *cbdata) { prte_state_caddy_t *caddy = (prte_state_caddy_t *) cbdata; @@ -70,7 +74,7 @@ void prte_rmaps_base_map_job(int fd, short args, void *cbdata) prte_job_t *parent = NULL; prte_app_context_t *app; bool inherit = false; - pmix_proc_t *nptr, *target_proc; + pmix_proc_t *nptr = NULL, *target_proc; char *tmp, **ck, **env; uint16_t u16 = 0, procs_per_target = 0; uint16_t *u16ptr = &u16; @@ -229,6 +233,11 @@ void prte_rmaps_base_map_job(int fd, short args, void *cbdata) /* if this is a dynamic job launch and they didn't explicitly * request inheritance, then don't inherit the launch directives */ if (prte_get_attribute(&jdata->attributes, PRTE_JOB_LAUNCH_PROXY, (void **) &nptr, PMIX_PROC)) { + if (NULL == nptr) { + PRTE_ERROR_LOG(PRTE_ERR_NOT_FOUND); + PRTE_ACTIVATE_JOB_STATE(jdata, PRTE_JOB_STATE_MAP_FAILED); + goto cleanup; + } /* if the launch proxy is me, then this is the initial launch from * a proxy scenario, so we don't really have a parent */ if (PMIX_CHECK_NSPACE(PRTE_PROC_MY_NAME->nspace, nptr->nspace)) { @@ -263,7 +272,6 @@ void prte_rmaps_base_map_job(int fd, short args, void *cbdata) } else { inherit = true; } - PMIX_PROC_RELEASE(nptr); } else { /* initial launch always takes on default MCA params for non-specified policies */ inherit = true; @@ -309,6 +317,8 @@ void prte_rmaps_base_map_job(int fd, short args, void *cbdata) prte_set_attribute(&jdata->attributes, PRTE_JOB_GPU_SUPPORT, PRTE_ATTR_GLOBAL, fptr, PMIX_BOOL); } } + // copy over any env directives, but do not overwrite anything already specified + inherit_env_directives(jdata, parent, nptr); } else { if (!prte_get_attribute(&jdata->attributes, PRTE_JOB_HWT_CPUS, NULL, PMIX_BOOL) && !prte_get_attribute(&jdata->attributes, PRTE_JOB_CORE_CPUS, NULL, PMIX_BOOL)) { @@ -321,6 +331,9 @@ void prte_rmaps_base_map_job(int fd, short args, void *cbdata) } } } + if (NULL != nptr) { + PMIX_PROC_RELEASE(nptr); + } /* we always inherit a parent's oversubscribe flag unless the job assigned it */ if (NULL != parent && @@ -1250,3 +1263,108 @@ static int map_colocate(prte_job_t *jdata, PMIX_LIST_DESTRUCT(&targets); return ret; } + +static void inherit_env_directives(prte_job_t *jdata, + prte_job_t *parent, + pmix_proc_t *proxy) +{ + prte_app_context_t *app, *app2; + prte_proc_t *p; + prte_attribute_t *attr, *attr2; + pmix_value_t *val, *val2; + pmix_envar_t *envar, *envar2; + int n; + bool exists; + + // deal with job-level attributes first + PMIX_LIST_FOREACH(attr, &parent->attributes, prte_attribute_t) { + if (PMIX_ENVAR != attr->data.type) { + continue; + } + val = &attr->data; + envar = &val->data.envar; + + // do we have a matching attribute in the new job? + exists = false; + PMIX_LIST_FOREACH(attr2, &jdata->attributes, prte_attribute_t) { + if (PMIX_ENVAR != attr->data.type) { + continue; + } + val2 = &attr2->data; + envar2 = &val2->data.envar; + + if (attr->key == attr2->key) { + // operation is same - check if the target envars match + if (0 == strcmp(envar->envar, envar2->envar)) { + // these match, so don't overwrite it + exists = true; + break; + } + } + } + + if (exists) { + // leave this alone + continue; + } + + // if it doesn't exist, then inherit it + prte_prepend_attribute(&jdata->attributes, attr->key, PRTE_ATTR_GLOBAL, + envar, PMIX_ENVAR); + } + + /* There is no one-to-one correlation between the apps, but we can + * inherit the directives from the proc that called spawn, so do that + * much here */ + p = prte_get_proc_object(proxy); + if (NULL == p) { + PRTE_ERROR_LOG(PRTE_ERR_NOT_FOUND); + return; + } + app = (prte_app_context_t*)pmix_pointer_array_get_item(parent->apps, p->app_idx); + if (NULL == app) { + PRTE_ERROR_LOG(PRTE_ERR_NOT_FOUND); + return; + } + for (n=0; n < jdata->apps->size; n++) { + app2 = (prte_app_context_t*)pmix_pointer_array_get_item(jdata->apps, n); + if (NULL == app2) { + continue; + } + PMIX_LIST_FOREACH(attr, &app->attributes, prte_attribute_t) { + if (PMIX_ENVAR != attr->data.type) { + continue; + } + val = &attr->data; + envar = &val->data.envar; + + exists = false; + PMIX_LIST_FOREACH(attr2, &app2->attributes, prte_attribute_t) { + if (PMIX_ENVAR != attr->data.type) { + continue; + } + val2 = &attr2->data; + envar2 = &val2->data.envar; + + if (attr->key == attr2->key) { + // operation is same - check if the target envars match + if (0 == strcmp(envar->envar, envar2->envar)) { + // these match, so don't overwrite it + exists = true; + break; + } + } + } + + if (exists) { + // leave this alone + continue; + } + + // if it doesn't exist, then inherit it + prte_prepend_attribute(&app2->attributes, attr->key, PRTE_ATTR_GLOBAL, + envar, PMIX_ENVAR); + } + } + +} diff --git a/src/mca/rmaps/round_robin/rmaps_rr_mappers.c b/src/mca/rmaps/round_robin/rmaps_rr_mappers.c index 6980d662e0..c175f8dad1 100644 --- a/src/mca/rmaps/round_robin/rmaps_rr_mappers.c +++ b/src/mca/rmaps/round_robin/rmaps_rr_mappers.c @@ -545,9 +545,7 @@ int prte_rmaps_rr_bycpu(prte_job_t *jdata, prte_app_context_t *app, if (PRTE_ERR_SILENT != rc) { pmix_show_help("help-prte-rmaps-rr.txt", "prte-rmaps-rr:not-enough-cpus", true, - (NULL == app) ? "N/A" : app->app, - (NULL == app) ? -1 : app->num_procs, - savecpuset); + app->app, app->num_procs, savecpuset); } if (NULL != savecpuset) { free(savecpuset); diff --git a/src/mca/schizo/ompi/schizo_ompi.c b/src/mca/schizo/ompi/schizo_ompi.c index 5646bc9798..a4e690b076 100644 --- a/src/mca/schizo/ompi/schizo_ompi.c +++ b/src/mca/schizo/ompi/schizo_ompi.c @@ -522,19 +522,19 @@ static int parse_cli(char **argv, pmix_cli_result_t *results, results, "help-schizo-ompi.txt"); if (PMIX_SUCCESS != rc) { PMIX_ARGV_FREE_COMPAT(pargv); - if (PMIX_OPERATION_SUCCEEDED == rc) { - /* pmix cmd line interpreter output result - * successfully - usually means version or - * some other stock output was generated */ - return PRTE_OPERATION_SUCCEEDED; - } - if(warn) { + if (warn) { for(n = 0; n < cur_caught_pos; n++) { free(caught_single_dashes[n]); } free(caught_single_dashes); free(caught_positions); } + if (PMIX_OPERATION_SUCCEEDED == rc) { + /* pmix cmd line interpreter output result + * successfully - usually means version or + * some other stock output was generated */ + return PRTE_OPERATION_SUCCEEDED; + } return prte_pmix_convert_status(rc); } @@ -587,23 +587,23 @@ static int parse_cli(char **argv, pmix_cli_result_t *results, free(orig_args); free(corrected_args); } + } + + // cleanup + if (warn) { for(n = 0; n < cur_caught_pos; n++) { free(caught_single_dashes[n]); } free(caught_single_dashes); + caught_single_dashes = NULL; free(caught_positions); + caught_positions = NULL; } - + PMIX_ARGV_FREE_COMPAT(pargv); /* check for deprecated options - warn and convert them */ rc = convert_deprecated_cli(results, silent); if (PRTE_SUCCESS != rc) { - if (NULL != caught_positions) { - free(caught_positions); - } - if (NULL != caught_single_dashes) { - free(caught_single_dashes); - } return rc; } diff --git a/src/mca/state/base/state_base_options.c b/src/mca/state/base/state_base_options.c index 2eae9e7b54..ed42d7ffb5 100644 --- a/src/mca/state/base/state_base_options.c +++ b/src/mca/state/base/state_base_options.c @@ -260,7 +260,7 @@ int prte_state_base_set_runtime_options(prte_job_t *jdata, char *spec) &flag, PMIX_BOOL); } else if (PMIX_CHECK_CLI_OPTION(options[n], PRTE_CLI_MAX_RESTARTS)) { - if ('\0' == *ptr) { + if (NULL == ptr || '\0' == *ptr) { /* missing the value */ pmix_show_help("help-prte-rmaps-base.txt", "missing-value", true, "runtime options", options[n], "empty"); diff --git a/src/pmix/pmix-internal.h b/src/pmix/pmix-internal.h index 96adf5a866..88eba708c0 100644 --- a/src/pmix/pmix-internal.h +++ b/src/pmix/pmix-internal.h @@ -100,11 +100,13 @@ static inline __prte_attribute_always_inline__ void pmix_proc_hton_intr(pmix_pro #define PRTE_PMIX_CONSTRUCT_LOCK(l) \ do { \ PMIX_CONSTRUCT(&(l)->mutex, pmix_mutex_t); \ + pmix_mutex_lock(&(l)->mutex); \ pthread_cond_init(&(l)->cond, NULL); \ (l)->active = true; \ (l)->status = 0; \ (l)->msg = NULL; \ PMIX_POST_OBJECT((l)); \ + pmix_mutex_unlock(&(l)->mutex); \ } while (0) #define PRTE_PMIX_DESTRUCT_LOCK(l) \ @@ -163,7 +165,7 @@ static inline __prte_attribute_always_inline__ void pmix_proc_hton_intr(pmix_pro # define PRTE_PMIX_RELEASE_THREAD(lck) \ do { \ (lck)->active = false; \ - pthread_cond_broadcast(&(lck)->cond); \ + pthread_cond_signal(&(lck)->cond); \ pmix_mutex_unlock(&(lck)->mutex); \ } while (0) #else @@ -171,7 +173,7 @@ static inline __prte_attribute_always_inline__ void pmix_proc_hton_intr(pmix_pro do { \ assert(0 != pmix_mutex_trylock(&(lck)->mutex)); \ (lck)->active = false; \ - pthread_cond_broadcast(&(lck)->cond); \ + pthread_cond_signal(&(lck)->cond); \ pmix_mutex_unlock(&(lck)->mutex); \ } while (0) #endif @@ -181,7 +183,7 @@ static inline __prte_attribute_always_inline__ void pmix_proc_hton_intr(pmix_pro pmix_mutex_lock(&(lck)->mutex); \ (lck)->active = false; \ PMIX_POST_OBJECT(lck); \ - pthread_cond_broadcast(&(lck)->cond); \ + pthread_cond_signal(&(lck)->cond); \ pmix_mutex_unlock(&(lck)->mutex); \ } while (0) diff --git a/src/prted/Makefile.am b/src/prted/Makefile.am index f092ed3d7a..aa22b84866 100644 --- a/src/prted/Makefile.am +++ b/src/prted/Makefile.am @@ -13,7 +13,7 @@ # Copyright (c) 2014-2020 Cisco Systems, Inc. All rights reserved # Copyright (c) 2015-2020 Intel, Inc. All rights reserved. # Copyright (c) 2018 IBM Corporation. All rights reserved. -# Copyright (c) 2021-2022 Nanook Consulting. All rights reserved. +# Copyright (c) 2021-2025 Nanook Consulting All rights reserved. # Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved. # $COPYRIGHT$ # @@ -26,10 +26,11 @@ headers += \ prted/prted.h - + libprrte_la_SOURCES += \ prted/prted_comm.c \ prted/prte_app_parse.c \ - prted/prun_common.c + prted/prun_common.c \ + prted/prte.c include prted/pmix/Makefile.am diff --git a/src/prted/pmix/pmix_server.c b/src/prted/pmix/pmix_server.c index 189bd28476..fecb37edd2 100644 --- a/src/prted/pmix/pmix_server.c +++ b/src/prted/pmix/pmix_server.c @@ -1389,6 +1389,9 @@ static void pmix_server_dmdx_recv(int status, pmix_proc_t *sender, if (NULL != info) { for (sz = 0; sz < ninfo; sz++) { if (PMIX_CHECK_KEY(&info[sz], PMIX_REQUIRED_KEY)) { + if (NULL != key) { + free(key); + } key = strdup(info[sz].value.data.string); continue; } diff --git a/src/prted/pmix/pmix_server_dyn.c b/src/prted/pmix/pmix_server_dyn.c index 99ba532249..7e0577c1c6 100644 --- a/src/prted/pmix/pmix_server_dyn.c +++ b/src/prted/pmix/pmix_server_dyn.c @@ -714,7 +714,6 @@ int prte_pmix_xfer_app(prte_job_t *jdata, pmix_app_t *papp) app->app = strdup(papp->cmd); } else if (NULL == papp->argv || NULL == papp->argv[0]) { PRTE_ERROR_LOG(PRTE_ERR_BAD_PARAM); - PMIX_RELEASE(jdata); return PRTE_ERR_BAD_PARAM; } else { app->app = strdup(papp->argv[0]); diff --git a/src/tools/prte/prte.c b/src/prted/prte.c similarity index 99% rename from src/tools/prte/prte.c rename to src/prted/prte.c index 5b1283b563..cd57afdfb0 100644 --- a/src/tools/prte/prte.c +++ b/src/prted/prte.c @@ -104,10 +104,10 @@ #include "src/runtime/prte_wait.h" #include "src/runtime/runtime.h" -#include "include/prte.h" #include "src/prted/pmix/pmix_server.h" #include "src/prted/pmix/pmix_server_internal.h" #include "src/prted/prted.h" +#include "include/prte.h" typedef struct { prte_pmix_lock_t lock; @@ -256,7 +256,7 @@ static char *pmix_getline(FILE *fp) } #endif -int main(int argc, char *argv[]) +int prte(int argc, char *argv[]) { int rc = 1, i; char *param, *tpath, *cptr; diff --git a/src/tools/prte/Makefile.am b/src/tools/prte/Makefile.am index 382396128b..12c83cd8c6 100644 --- a/src/tools/prte/Makefile.am +++ b/src/tools/prte/Makefile.am @@ -39,8 +39,8 @@ AM_CFLAGS = \ bin_PROGRAMS = prte -prte_SOURCES = \ - prte.c +prte_SOURCES = \ + main.c prte_LDADD = \ $(prte_libevent_LIBS) \ @@ -53,3 +53,4 @@ install-exec-hook: uninstall-local: rm -f $(DESTDIR)$(bindir)/prterun$(EXEEXT) + rm -f $(DESTDIR)$(bindir)/prte$(EXEEXT) diff --git a/src/tools/prte/main.c b/src/tools/prte/main.c new file mode 100644 index 0000000000..6f746ba951 --- /dev/null +++ b/src/tools/prte/main.c @@ -0,0 +1,49 @@ +/*************************************************************************** + * * + * PRTE: PMIx Reference RunTime Environment (PRTE) * + * * + * https://github.com/openpmix/prte * + * * + ***************************************************************************/ + +#include "include/prte.h" + +int main(int argc, char *argv[]) +{ + return prte(argc, argv); +} + +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2021 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * Copyright (c) 2006-2020 Cisco Systems, Inc. All rights reserved + * Copyright (c) 2007-2009 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2007-2017 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2013-2020 Intel, Inc. All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2020 Geoffroy Vallee. All rights reserved. + * Copyright (c) 2020 IBM Corporation. All rights reserved. + * Copyright (c) 2021-2025 Nanook Consulting All rights reserved. + * Copyright (c) 2021 Amazon.com, Inc. or its affiliates. All Rights + * reserved. + * Copyright (c) 2022-2023 Triad National Security, LLC. All rights + * reserved. + * Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + diff --git a/test/simple_spawn.c b/test/simple_spawn.c index 8460a3ef81..ff3c53640d 100644 --- a/test/simple_spawn.c +++ b/test/simple_spawn.c @@ -18,6 +18,7 @@ int main(int argc, char *argv[]) char hostname[1024]; pmix_value_t *val = NULL; pmix_nspace_t nspace; + char *env; pid = getpid(); gethostname(hostname, 1024); @@ -123,6 +124,9 @@ int main(int argc, char *argv[]) printf("%s.%u: Disconnect complete!\n", myproc.nspace, myproc.rank); } + env = getenv("foo"); + printf("%s.%u: FOO %s\n", myproc.nspace, myproc.rank, (NULL == env) ? "NULL" : env); + done: PMIx_Finalize(NULL, 0); fprintf(stderr, "%d: exiting\n", pid);