Skip to content

Commit 75ec38d

Browse files
author
rhc54
authored
Merge pull request #2609 from rhc54/topic/psrv
Bring across some more patches from the debugger work
2 parents 4774eb8 + ea13320 commit 75ec38d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+5272
-126
lines changed

opal/mca/pmix/ext2x/pmix2x.c

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,9 @@ pmix_persistence_t pmix2x_convert_opalpersist(opal_pmix_persistence_t persist)
733733
void pmix2x_value_load(pmix_value_t *v,
734734
opal_value_t *kv)
735735
{
736+
opal_pmix2x_jobid_trkr_t *job;
737+
bool found;
738+
736739
switch(kv->type) {
737740
case OPAL_UNDEF:
738741
v->type = PMIX_UNDEF;
@@ -829,7 +832,18 @@ void pmix2x_value_load(pmix_value_t *v,
829832
v->type = PMIX_PROC;
830833
/* have to stringify the jobid */
831834
PMIX_PROC_CREATE(v->data.proc, 1);
832-
(void)opal_snprintf_jobid(v->data.proc->nspace, PMIX_MAX_NSLEN, kv->data.name.vpid);
835+
/* see if this job is in our list of known nspaces */
836+
found = false;
837+
OPAL_LIST_FOREACH(job, &mca_pmix_ext2x_component.jobids, opal_pmix2x_jobid_trkr_t) {
838+
if (job->jobid == kv->data.name.jobid) {
839+
(void)strncpy(v->data.proc->nspace, job->nspace, PMIX_MAX_NSLEN);
840+
found = true;
841+
break;
842+
}
843+
}
844+
if (!found) {
845+
(void)opal_snprintf_jobid(v->data.proc->nspace, PMIX_MAX_NSLEN, kv->data.name.vpid);
846+
}
833847
v->data.proc->rank = pmix2x_convert_opalrank(kv->data.name.vpid);
834848
break;
835849
case OPAL_BYTE_OBJECT:
@@ -875,7 +889,8 @@ int pmix2x_value_unload(opal_value_t *kv,
875889
const pmix_value_t *v)
876890
{
877891
int rc=OPAL_SUCCESS;
878-
892+
bool found;
893+
opal_pmix2x_jobid_trkr_t *job;
879894

880895
switch(v->type) {
881896
case PMIX_UNDEF:
@@ -969,8 +984,19 @@ int pmix2x_value_unload(opal_value_t *kv,
969984
break;
970985
case PMIX_PROC:
971986
kv->type = OPAL_NAME;
972-
if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&kv->data.name.jobid, v->data.proc->nspace))) {
973-
return pmix2x_convert_opalrc(rc);
987+
/* see if this job is in our list of known nspaces */
988+
found = false;
989+
OPAL_LIST_FOREACH(job, &mca_pmix_ext2x_component.jobids, opal_pmix2x_jobid_trkr_t) {
990+
if (0 == strncmp(job->nspace, v->data.proc->nspace, PMIX_MAX_NSLEN)) {
991+
kv->data.name.jobid = job->jobid;
992+
found = true;
993+
break;
994+
}
995+
}
996+
if (!found) {
997+
if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&kv->data.name.jobid, v->data.proc->nspace))) {
998+
return pmix2x_convert_opalrc(rc);
999+
}
9741000
}
9751001
kv->data.name.vpid = pmix2x_convert_rank(v->data.proc->rank);
9761002
break;
@@ -1330,18 +1356,20 @@ static void pmix2x_log(opal_list_t *info,
13301356
pmix2x_opcaddy_t *cd;
13311357
pmix_status_t prc;
13321358

1333-
/* setup the operation */
1359+
/* create the caddy */
13341360
cd = OBJ_NEW(pmix2x_opcaddy_t);
1335-
cd->opcbfunc = cbfunc;
1336-
cd->cbdata = cbdata;
1337-
cd->ninfo = ninfo;
13381361

13391362
/* bozo check */
13401363
if (NULL == info || 0 == (ninfo = opal_list_get_size(info))) {
13411364
rc = OPAL_ERR_BAD_PARAM;
13421365
goto CLEANUP;
13431366
}
13441367

1368+
/* setup the operation */
1369+
cd->opcbfunc = cbfunc;
1370+
cd->cbdata = cbdata;
1371+
cd->ninfo = ninfo;
1372+
13451373
/* convert the list to an array of info objects */
13461374
PMIX_INFO_CREATE(cd->info, cd->ninfo);
13471375
n=0;
@@ -1358,6 +1386,7 @@ static void pmix2x_log(opal_list_t *info,
13581386
rc = pmix2x_convert_rc(prc);
13591387
goto CLEANUP;
13601388
}
1389+
13611390
return;
13621391

13631392
CLEANUP:

opal/mca/pmix/ext2x/pmix2x_client.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,6 @@ int pmix2x_spawn(opal_list_t *job_info, opal_list_t *apps, opal_jobid_t *jobid)
892892
n=0;
893893
OPAL_LIST_FOREACH(app, apps, opal_pmix_app_t) {
894894
papps[n].cmd = strdup(app->cmd);
895-
papps[n].argc = app->argc;
896895
papps[n].argv = opal_argv_copy(app->argv);
897896
papps[n].env = opal_argv_copy(app->env);
898897
papps[n].maxprocs = app->maxprocs;
@@ -993,7 +992,6 @@ int pmix2x_spawnnb(opal_list_t *job_info, opal_list_t *apps,
993992
n=0;
994993
OPAL_LIST_FOREACH(app, apps, opal_pmix_app_t) {
995994
op->apps[n].cmd = strdup(app->cmd);
996-
op->apps[n].argc = app->argc;
997995
op->apps[n].argv = opal_argv_copy(app->argv);
998996
op->apps[n].env = opal_argv_copy(app->env);
999997
op->apps[n].maxprocs = app->maxprocs;

opal/mca/pmix/ext2x/pmix2x_component.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
/*
2828
* Public string showing the pmix external component version number
2929
*/
30-
const char *opal_pmix_pmix2x_component_version_string =
31-
"OPAL pmix2x MCA component version " OPAL_VERSION;
30+
const char *opal_pmix_ext2x_component_version_string =
31+
"OPAL ext2x MCA component version " OPAL_VERSION;
3232

3333
/*
3434
* Local function

opal/mca/pmix/ext2x/pmix2x_server_north.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,6 @@ static pmix_status_t server_spawn_fn(const pmix_proc_t *p,
588588
if (NULL != apps[n].cmd) {
589589
app->cmd = strdup(apps[n].cmd);
590590
}
591-
app->argc = apps[n].argc;
592591
if (NULL != apps[n].argv) {
593592
app->argv = opal_argv_copy(apps[n].argv);
594593
}
@@ -785,7 +784,6 @@ static pmix_status_t server_notify_event(pmix_status_t code,
785784

786785
/* convert the source */
787786
if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&src.jobid, source->nspace))) {
788-
opal_output(0, "FILE: %s LINE %d", __FILE__, __LINE__);
789787
OBJ_RELEASE(opalcaddy);
790788
return pmix2x_convert_opalrc(rc);
791789
}
@@ -882,7 +880,6 @@ static pmix_status_t server_query(pmix_proc_t *proct,
882880

883881
/* convert the requestor */
884882
if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&requestor.jobid, proct->nspace))) {
885-
opal_output(0, "FILE: %s LINE %d", __FILE__, __LINE__);
886883
OBJ_RELEASE(opalcaddy);
887884
return pmix2x_convert_opalrc(rc);
888885
}
@@ -923,13 +920,22 @@ static void toolcbfunc(int status,
923920
pmix2x_opalcaddy_t *opalcaddy = (pmix2x_opalcaddy_t*)cbdata;
924921
pmix_status_t rc;
925922
pmix_proc_t p;
923+
opal_pmix2x_jobid_trkr_t *job;
926924

927925
/* convert the status */
928926
rc = pmix2x_convert_opalrc(status);
929927

930-
/* convert the process name */
931-
(void)opal_snprintf_jobid(p.nspace, PMIX_MAX_NSLEN, proc.jobid);
932-
p.rank = pmix2x_convert_opalrank(proc.vpid);
928+
memset(&p, 0, sizeof(pmix_proc_t));
929+
if (OPAL_SUCCESS == status) {
930+
/* convert the process name */
931+
(void)opal_snprintf_jobid(p.nspace, PMIX_MAX_NSLEN, proc.jobid);
932+
p.rank = pmix2x_convert_opalrank(proc.vpid);
933+
/* store this job in our list of known nspaces */
934+
job = OBJ_NEW(opal_pmix2x_jobid_trkr_t);
935+
(void)strncpy(job->nspace, p.nspace, PMIX_MAX_NSLEN);
936+
job->jobid = proc.jobid;
937+
opal_list_append(&mca_pmix_ext2x_component.jobids, &job->super);
938+
}
933939

934940
/* pass it down */
935941
if (NULL != opalcaddy->toolcbfunc) {
@@ -997,7 +1003,6 @@ static void server_log(const pmix_proc_t *proct,
9971003

9981004
/* convert the requestor */
9991005
if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&requestor.jobid, proct->nspace))) {
1000-
opal_output(0, "FILE: %s LINE %d", __FILE__, __LINE__);
10011006
OBJ_RELEASE(opalcaddy);
10021007
ret = pmix2x_convert_opalrc(rc);
10031008
if (NULL != cbfunc) {

opal/mca/pmix/ext2x/pmix2x_server_south.c

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,28 @@ static void errreg_cbfunc (pmix_status_t status,
7171
*active = false;
7272
}
7373

74+
static void opcbfunc(pmix_status_t status, void *cbdata)
75+
{
76+
pmix2x_opcaddy_t *op = (pmix2x_opcaddy_t*)cbdata;
77+
78+
if (NULL != op->opcbfunc) {
79+
op->opcbfunc(pmix2x_convert_rc(status), op->cbdata);
80+
}
81+
if (op->active) {
82+
op->status = status;
83+
op->active = false;
84+
} else {
85+
OBJ_RELEASE(op);
86+
}
87+
}
88+
89+
static void op2cbfunc(pmix_status_t status, void *cbdata)
90+
{
91+
volatile bool *active = (volatile bool*)cbdata;
92+
93+
*active = false;
94+
}
95+
7496
int pmix2x_server_init(opal_pmix_server_module_t *module,
7597
opal_list_t *info)
7698
{
@@ -123,6 +145,12 @@ int pmix2x_server_init(opal_pmix_server_module_t *module,
123145
PMIx_Register_event_handler(NULL, 0, NULL, 0, pmix2x_event_hdlr, errreg_cbfunc, (void*)&active);
124146
PMIX_WAIT_FOR_COMPLETION(active);
125147

148+
/* as we might want to use some client-side functions, be sure
149+
* to register our own nspace */
150+
active = true;
151+
PMIx_server_register_nspace(job->nspace, 1, NULL, 0, op2cbfunc, (void*)&active);
152+
PMIX_WAIT_FOR_COMPLETION(active);
153+
126154
return OPAL_SUCCESS;
127155
}
128156

@@ -163,21 +191,6 @@ int pmix2x_server_gen_ppn(const char *input, char **ppn)
163191
return pmix2x_convert_rc(rc);
164192
}
165193

166-
static void opcbfunc(pmix_status_t status, void *cbdata)
167-
{
168-
pmix2x_opcaddy_t *op = (pmix2x_opcaddy_t*)cbdata;
169-
170-
if (NULL != op->opcbfunc) {
171-
op->opcbfunc(pmix2x_convert_rc(status), op->cbdata);
172-
}
173-
if (op->active) {
174-
op->status = status;
175-
op->active = false;
176-
} else {
177-
OBJ_RELEASE(op);
178-
}
179-
}
180-
181194
static void _reg_nspace(int sd, short args, void *cbdata)
182195
{
183196
pmix2x_threadshift_t *cd = (pmix2x_threadshift_t*)cbdata;
@@ -486,6 +499,7 @@ int pmix2x_server_notify_event(int status,
486499
OPAL_LIST_FOREACH(kv, info, opal_value_t) {
487500
(void)strncpy(pinfo[n].key, kv->key, PMIX_MAX_KEYLEN);
488501
pmix2x_value_load(&pinfo[n].value, kv);
502+
++n;
489503
}
490504
} else {
491505
sz = 0;

opal/mca/pmix/pmix2x/pmix/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# via AC_CONFIG_MACRO_DIR in configure.ac.
2424
ACLOCAL_AMFLAGS = -I ./config
2525

26-
SUBDIRS = config include src
26+
SUBDIRS = config contrib include src
2727

2828

2929
headers =

opal/mca/pmix/pmix2x/pmix/VERSION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ greek=
3030
# command, or with the date (if "git describe" fails) in the form of
3131
# "date<date>".
3232

33-
repo_rev=git9089b99
33+
repo_rev=gitb9778a7
3434

3535
# If tarball_version is not empty, it is used as the version string in
3636
# the tarball filename, regardless of all other versions listed in
@@ -44,7 +44,7 @@ tarball_version=
4444

4545
# The date when this release was created
4646

47-
date="Dec 13, 2016"
47+
date="Dec 19, 2016"
4848

4949
# The shared library version of each of PMIx's public libraries.
5050
# These versions are maintained in accordance with the "Library

opal/mca/pmix/pmix2x/pmix/configure.ac

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ AC_SUBST([CONFIGURE_DEPENDENCIES], ['$(top_srcdir)/VERSION'])
218218
. $srcdir/VERSION
219219
AC_SUBST([libpmix_so_version])
220220

221-
AC_CONFIG_FILES(pmix_config_prefix[examples/Makefile]
221+
AC_CONFIG_FILES(pmix_config_prefix[contrib/Makefile]
222+
pmix_config_prefix[examples/Makefile]
222223
pmix_config_prefix[man/Makefile]
223224
pmix_config_prefix[test/Makefile]
224225
pmix_config_prefix[test/simple/Makefile])
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#
2+
# Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana
3+
# University Research and Technology
4+
# Corporation. All rights reserved.
5+
# Copyright (c) 2004-2005 The University of Tennessee and The University
6+
# of Tennessee Research Foundation. All rights
7+
# reserved.
8+
# Copyright (c) 2004-2009 High Performance Computing Center Stuttgart,
9+
# University of Stuttgart. All rights reserved.
10+
# Copyright (c) 2004-2005 The Regents of the University of California.
11+
# All rights reserved.
12+
# Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
13+
# Copyright (c) 2010 IBM Corporation. All rights reserved.
14+
# Copyright (c) 2010-2011 Oak Ridge National Labs. All rights reserved.
15+
# Copyright (c) 2013-2016 Los Alamos National Security, Inc. All rights
16+
# reserved.
17+
# Copyright (c) 2013-2016 Intel, Inc. All rights reserved.
18+
# $COPYRIGHT$
19+
#
20+
# Additional copyrights may follow
21+
#
22+
# $HEADER$
23+
#
24+
25+
EXTRA_DIST = \
26+
make_dist_tarball \
27+
buildrpm.sh \
28+
cron-run-all-md2nroff.pl \
29+
md2nroff.pl \
30+
platform/optimized \
31+
pmix_jenkins.sh \
32+
pmix-release.sh \
33+
pmix.spec \
34+
update-my-copyright.pl \
35+
whitespace-purge.sh
36+
37+
include perf_tools/Makefile.include
38+
39+
dist_pmixdata_DATA = pmix-valgrind.supp

0 commit comments

Comments
 (0)