Skip to content

Commit c5a91c5

Browse files
committed
opal/pmix: fix pmix jobid calculation if external PMIx server is used.
1 parent f3c816b commit c5a91c5

File tree

4 files changed

+27
-20
lines changed

4 files changed

+27
-20
lines changed

opal/mca/pmix/ext114/pmix_ext_client.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include <unistd.h>
2525
#endif
2626

27-
#include "opal/hash_string.h"
2827
#include "opal/util/argv.h"
2928
#include "opal/util/proc.h"
3029

@@ -130,7 +129,7 @@ int pmix1_client_init(void)
130129
} else {
131130
/* we were launched by someone else, so make the
132131
* jobid just be the hash of the nspace */
133-
OPAL_HASH_STR(my_proc.nspace, pname.jobid);
132+
OPAL_HASH_JOBID(my_proc.nspace, pname.jobid);
134133
}
135134
/* insert this into our list of jobids - it will be the
136135
* first, and so we'll check it first */
@@ -702,7 +701,7 @@ int pmix1_lookup(opal_list_t *data, opal_list_t *info)
702701
} else {
703702
/* we were launched by someone else, so make the
704703
* jobid just be the hash of the nspace */
705-
OPAL_HASH_STR(pdata[n].proc.nspace, d->proc.jobid);
704+
OPAL_HASH_JOBID(pdata[n].proc.nspace, d->proc.jobid);
706705
}
707706
/* if we don't already have it, add this to our jobid tracker */
708707
job = NULL;
@@ -765,7 +764,7 @@ static void lk_cbfunc(pmix_status_t status,
765764
} else {
766765
/* we were launched by someone else, so make the
767766
* jobid just be the hash of the nspace */
768-
OPAL_HASH_STR(data[n].proc.nspace, d->proc.jobid);
767+
OPAL_HASH_JOBID(data[n].proc.nspace, d->proc.jobid);
769768
}
770769
/* if we don't already have it, add this to our jobid tracker */
771770
job = NULL;
@@ -950,7 +949,7 @@ int pmix1_spawn(opal_list_t *job_info, opal_list_t *apps, opal_jobid_t *jobid)
950949
} else {
951950
/* we were launched by someone else, so make the
952951
* jobid just be the hash of the nspace */
953-
OPAL_HASH_STR(nspace, *jobid);
952+
OPAL_HASH_JOBID(nspace, *jobid);
954953
}
955954
/* add this to our jobid tracker */
956955
job = OBJ_NEW(opal_pmix1_jobid_trkr_t);
@@ -980,7 +979,7 @@ static void spcbfunc(pmix_status_t status,
980979
} else {
981980
/* we were launched by someone else, so make the
982981
* jobid just be the hash of the nspace */
983-
OPAL_HASH_STR(nspace, jobid);
982+
OPAL_HASH_JOBID(nspace, jobid);
984983
}
985984
/* add this to our jobid tracker */
986985
job = OBJ_NEW(opal_pmix1_jobid_trkr_t);
@@ -1265,7 +1264,7 @@ int pmix1_resolve_peers(const char *nodename, opal_jobid_t jobid,
12651264
} else {
12661265
/* we were launched by someone else, so make the
12671266
* jobid just be the hash of the nspace */
1268-
OPAL_HASH_STR(array[n].nspace, nm->name.jobid);
1267+
OPAL_HASH_JOBID(array[n].nspace, nm->name.jobid);
12691268
}
12701269
/* if we don't already have it, add this to our jobid tracker */
12711270
job = NULL;

opal/mca/pmix/ext20/pmix_ext20_client.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include <unistd.h>
2727
#endif
2828

29-
#include "opal/hash_string.h"
3029
#include "opal/util/argv.h"
3130
#include "opal/util/proc.h"
3231

@@ -85,7 +84,7 @@ int ext20_client_init(void)
8584
} else {
8685
/* we were launched by someone else, so make the
8786
* jobid just be the hash of the nspace */
88-
OPAL_HASH_STR(my_proc.nspace, pname.jobid);
87+
OPAL_HASH_JOBID(my_proc.nspace, pname.jobid);
8988
}
9089
/* insert this into our list of jobids - it will be the
9190
* first, and so we'll check it first */
@@ -672,7 +671,7 @@ int ext20_lookup(opal_list_t *data, opal_list_t *info)
672671
} else {
673672
/* we were launched by someone else, so make the
674673
* jobid just be the hash of the nspace */
675-
OPAL_HASH_STR(pdata[n].proc.nspace, d->proc.jobid);
674+
OPAL_HASH_JOBID(pdata[n].proc.nspace, d->proc.jobid);
676675
}
677676
/* if we don't already have it, add this to our jobid tracker */
678677
job = NULL;
@@ -735,7 +734,7 @@ static void lk_cbfunc(pmix_status_t status,
735734
} else {
736735
/* we were launched by someone else, so make the
737736
* jobid just be the hash of the nspace */
738-
OPAL_HASH_STR(data[n].proc.nspace, d->proc.jobid);
737+
OPAL_HASH_JOBID(data[n].proc.nspace, d->proc.jobid);
739738
}
740739
/* if we don't already have it, add this to our jobid tracker */
741740
job = NULL;
@@ -916,7 +915,7 @@ int ext20_spawn(opal_list_t *job_info, opal_list_t *apps, opal_jobid_t *jobid)
916915
} else {
917916
/* we were launched by someone else, so make the
918917
* jobid just be the hash of the nspace */
919-
OPAL_HASH_STR(nspace, *jobid);
918+
OPAL_HASH_JOBID(nspace, *jobid);
920919
}
921920
/* add this to our jobid tracker */
922921
job = OBJ_NEW(opal_ext20_jobid_trkr_t);
@@ -950,7 +949,7 @@ static void spcbfunc(pmix_status_t status,
950949
} else {
951950
/* we were launched by someone else, so make the
952951
* jobid just be the hash of the nspace */
953-
OPAL_HASH_STR(nspace, jobid);
952+
OPAL_HASH_JOBID(nspace, jobid);
954953
}
955954
/* add this to our jobid tracker */
956955
job = OBJ_NEW(opal_ext20_jobid_trkr_t);
@@ -1229,7 +1228,7 @@ int ext20_resolve_peers(const char *nodename, opal_jobid_t jobid,
12291228
} else {
12301229
/* we were launched by someone else, so make the
12311230
* jobid just be the hash of the nspace */
1232-
OPAL_HASH_STR(array[n].nspace, nm->name.jobid);
1231+
OPAL_HASH_JOBID(array[n].nspace, nm->name.jobid);
12331232
}
12341233
/* if we don't already have it, add this to our jobid tracker */
12351234
job = NULL;

opal/mca/pmix/pmix.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "opal/dss/dss.h"
2828
#include "opal/util/error.h"
2929
#include "opal/util/proc.h"
30+
#include "opal/hash_string.h"
3031

3132
#include "opal/mca/pmix/pmix_types.h"
3233
#include "opal/mca/pmix/pmix_server.h"
@@ -42,6 +43,14 @@ extern int opal_pmix_base_exchange(opal_value_t *info,
4243
opal_pmix_pdata_t *pdat,
4344
int timeout);
4445

46+
/*
47+
* Count the fash for the the external RM
48+
*/
49+
#define OPAL_HASH_JOBID( str, hash ){ \
50+
OPAL_HASH_STR( str, hash ); \
51+
hash &= ~(0x8000); \
52+
}
53+
4554
/**
4655
* Provide a simplified macro for sending data via modex
4756
* to other processes. The macro requires four arguments:

opal/mca/pmix/pmix2x/pmix2x_client.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ int pmix2x_client_init(void)
8585
} else {
8686
/* we were launched by someone else, so make the
8787
* jobid just be the hash of the nspace */
88-
OPAL_HASH_STR(my_proc.nspace, pname.jobid);
88+
OPAL_HASH_JOBID(my_proc.nspace, pname.jobid);
8989
}
9090
/* insert this into our list of jobids - it will be the
9191
* first, and so we'll check it first */
@@ -672,7 +672,7 @@ int pmix2x_lookup(opal_list_t *data, opal_list_t *info)
672672
} else {
673673
/* we were launched by someone else, so make the
674674
* jobid just be the hash of the nspace */
675-
OPAL_HASH_STR(pdata[n].proc.nspace, d->proc.jobid);
675+
OPAL_HASH_JOBID(pdata[n].proc.nspace, d->proc.jobid);
676676
}
677677
/* if we don't already have it, add this to our jobid tracker */
678678
job = NULL;
@@ -735,7 +735,7 @@ static void lk_cbfunc(pmix_status_t status,
735735
} else {
736736
/* we were launched by someone else, so make the
737737
* jobid just be the hash of the nspace */
738-
OPAL_HASH_STR(data[n].proc.nspace, d->proc.jobid);
738+
OPAL_HASH_JOBID(data[n].proc.nspace, d->proc.jobid);
739739
}
740740
/* if we don't already have it, add this to our jobid tracker */
741741
job = NULL;
@@ -916,7 +916,7 @@ int pmix2x_spawn(opal_list_t *job_info, opal_list_t *apps, opal_jobid_t *jobid)
916916
} else {
917917
/* we were launched by someone else, so make the
918918
* jobid just be the hash of the nspace */
919-
OPAL_HASH_STR(nspace, *jobid);
919+
OPAL_HASH_JOBID(nspace, *jobid);
920920
}
921921
/* add this to our jobid tracker */
922922
job = OBJ_NEW(opal_pmix2x_jobid_trkr_t);
@@ -950,7 +950,7 @@ static void spcbfunc(pmix_status_t status,
950950
} else {
951951
/* we were launched by someone else, so make the
952952
* jobid just be the hash of the nspace */
953-
OPAL_HASH_STR(nspace, jobid);
953+
OPAL_HASH_JOBID(nspace, jobid);
954954
}
955955
/* add this to our jobid tracker */
956956
job = OBJ_NEW(opal_pmix2x_jobid_trkr_t);
@@ -1229,7 +1229,7 @@ int pmix2x_resolve_peers(const char *nodename, opal_jobid_t jobid,
12291229
} else {
12301230
/* we were launched by someone else, so make the
12311231
* jobid just be the hash of the nspace */
1232-
OPAL_HASH_STR(array[n].nspace, nm->name.jobid);
1232+
OPAL_HASH_JOBID(array[n].nspace, nm->name.jobid);
12331233
}
12341234
/* if we don't already have it, add this to our jobid tracker */
12351235
job = NULL;

0 commit comments

Comments
 (0)