Skip to content

Commit fa15e0d

Browse files
jjhurseyrhc54
authored andcommitted
Update the PMIx ABI Query attributes to match the standard
* `PMIX_QUERY_STABLE_ABI_VERSION` : Stable ABI version(s) * `PMIX_QUERY_PROVISIONAL_ABI_VERSION` : Provisional ABI version(s) Signed-off-by: Joshua Hursey <jhursey@us.ibm.com>
1 parent dac9573 commit fa15e0d

File tree

9 files changed

+88
-40
lines changed

9 files changed

+88
-40
lines changed

VERSION

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,16 @@ std_major=4
4545
std_minor=1
4646
std_extension=2
4747

48-
# PMIx Standard ABI Compliance Level
49-
# The major and minor numbers indicate the version
48+
# PMIx Standard ABI Compliance Level(s)
49+
# The major and minor numbers (MAJOR.MINOR) indicate the version
5050
# of the official PMIx Standard ABI that is supported
51-
# by this release. Generally, the PMIx Standard ABI
52-
# should match the PMIx Standard Compliance Level
53-
# major/minor levels. However, they are listed separately
54-
# for maximal flexibility.
51+
# by this release. This may be a comma separated list (no spaces)
52+
# if more than one PMIx Standard ABI level is supported.
53+
# The PMIx Standard defines a 'stable' and a 'provisional' ABI.
54+
# Therefore, there are two sets of major/minor values.
5555
# Since no PMIx Standard ABI exists at the moment, set to "0.0"
56-
std_abi_major=0
57-
std_abi_minor=0
56+
std_abi_stable=0.0
57+
std_abi_provisional=0.0
5858

5959
# If repo_rev is empty, then the repository version number will be
6060
# obtained during "make dist" via the "git describe --tags --always"

config/pmix.m4

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,25 @@ AC_DEFUN([PMIX_SETUP_CORE],[
157157
AC_DEFINE_UNQUOTED([PMIX_STD_VERSION], ["$PMIX_STD_VERSION"],
158158
[The PMIx Standard compliance level])
159159

160-
AC_MSG_CHECKING([for pmix standard ABI version])
161-
PMIX_STD_ABI_VERSION="`$PMIX_top_srcdir/config/pmix_get_version.sh $PMIX_top_srcdir/VERSION --std-abi-version`"
160+
AC_MSG_CHECKING([for pmix standard stable ABI version(s)])
161+
PMIX_STD_ABI_STABLE_VERSION="`$PMIX_top_srcdir/config/pmix_get_version.sh $PMIX_top_srcdir/VERSION --std-abi-stable-version`"
162162
if test "$?" != "0"; then
163163
AC_MSG_ERROR([Cannot continue])
164164
fi
165-
AC_MSG_RESULT([$PMIX_STD_ABI_VERSION])
166-
AC_SUBST(PMIX_STD_ABI_VERSION)
167-
AC_DEFINE_UNQUOTED([PMIX_STD_ABI_VERSION], ["$PMIX_STD_ABI_VERSION"],
168-
[The PMIx Standard ABI compliance level])
165+
AC_MSG_RESULT([$PMIX_STD_ABI_STABLE_VERSION])
166+
AC_SUBST(PMIX_STD_ABI_STABLE_VERSION)
167+
AC_DEFINE_UNQUOTED([PMIX_STD_ABI_STABLE_VERSION], ["$PMIX_STD_ABI_STABLE_VERSION"],
168+
[The PMIx Standard Stable ABI compliance level(s)])
169+
170+
AC_MSG_CHECKING([for pmix standard provisional ABI version(s)])
171+
PMIX_STD_ABI_PROVISIONAL_VERSION="`$PMIX_top_srcdir/config/pmix_get_version.sh $PMIX_top_srcdir/VERSION --std-abi-provisional-version`"
172+
if test "$?" != "0"; then
173+
AC_MSG_ERROR([Cannot continue])
174+
fi
175+
AC_MSG_RESULT([$PMIX_STD_ABI_PROVISIONAL_VERSION])
176+
AC_SUBST(PMIX_STD_ABI_PROVISIONAL_VERSION)
177+
AC_DEFINE_UNQUOTED([PMIX_STD_ABI_PROVISIONAL_VERSION], ["$PMIX_STD_ABI_PROVISIONAL_VERSION"],
178+
[The PMIx Standard Provisional ABI compliance level(s)])
169179

170180
PMIX_REPO_REV="`$PMIX_top_srcdir/config/pmix_get_version.sh $PMIX_top_srcdir/VERSION --repo-rev`"
171181
if test "$?" != "0"; then

config/pmix_get_version.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ else
5757
s/^greek/PMIX_GREEK_VERSION/
5858
s/^std_major/PMIX_STD_MAJOR_VERSION/
5959
s/^std_minor/PMIX_STD_MINOR_VERSION/
60-
s/^std_abi_major/PMIX_STD_ABI_MAJOR_VERSION/
61-
s/^std_abi_minor/PMIX_STD_ABI_MINOR_VERSION/
60+
s/^std_abi_stable/PMIX_STD_ABI_STABLE_VERSION/
61+
s/^std_abi_provisional/PMIX_STD_ABI_PROVISIONAL_VERSION/
6262
s/^repo_rev/PMIX_REPO_REV/
6363
s/^tarball_version/PMIX_TARBALL_VERSION/
6464
s/^date/PMIX_RELEASE_DATE/
@@ -72,7 +72,8 @@ else
7272
PMIX_VERSION="${PMIX_VERSION}${PMIX_GREEK_VERSION}"
7373

7474
PMIX_STD_VERSION="$PMIX_STD_MAJOR_VERSION.$PMIX_STD_MINOR_VERSION"
75-
PMIX_STD_ABI_VERSION="$PMIX_STD_ABI_MAJOR_VERSION.$PMIX_STD_ABI_MINOR_VERSION"
75+
PMIX_STD_ABI_STABLE_VERSION="$PMIX_STD_ABI_STABLE_VERSION"
76+
PMIX_STD_ABI_PROVISIONAL_VERSION="$PMIX_STD_ABI_PROVISIONAL_VERSION"
7677

7778
if test "$PMIX_TARBALL_VERSION" = ""; then
7879
PMIX_TARBALL_VERSION=$PMIX_VERSION
@@ -132,8 +133,11 @@ case "$option" in
132133
--std-version)
133134
echo $PMIX_STD_VERSION
134135
;;
135-
--std-abi-version)
136-
echo $PMIX_STD_ABI_VERSION
136+
--std-abi-stable-version)
137+
echo $PMIX_STD_ABI_STABLE_VERSION
138+
;;
139+
--std-abi-provisional-version)
140+
echo $PMIX_STD_ABI_PROVISIONAL_VERSION
137141
;;
138142
--repo-rev)
139143
echo $PMIX_REPO_REV

config/pmix_summary.m4

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ PMIx configuration:
9797
-----------------------
9898
Version: $PMIX_MAJOR_VERSION.$PMIX_MINOR_VERSION.$PMIX_RELEASE_VERSION$PMIX_GREEK_VERSION
9999
PMIx Standard Version: $PMIX_STD_VERSION
100-
PMIx Standard ABI Version: $PMIX_STD_ABI_VERSION
100+
PMIx Standard Stable ABI Version(s): $PMIX_STD_ABI_STABLE_VERSION
101+
PMIx Standard Provisional ABI Version(s): $PMIX_STD_ABI_PROVISIONAL_VERSION
101102
EOF
102103
103104
if test $WANT_DEBUG = 0 ; then

examples/abi_no_init.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ int main(int argc, char **argv) {
2525
pmix_query_t *query = NULL;
2626
EXAMPLES_HIDE_UNUSED_PARAMS(argc, argv);
2727

28-
nqueries = 1;
28+
nqueries = 2;
2929

3030
PMIX_QUERY_CREATE(query, nqueries);
31-
PMIX_ARGV_APPEND(rc, query[0].keys, PMIX_QUERY_ABI_VERSION);
31+
PMIX_ARGV_APPEND(rc, query[0].keys, PMIX_QUERY_STABLE_ABI_VERSION);
32+
PMIX_ARGV_APPEND(rc, query[1].keys, PMIX_QUERY_PROVISIONAL_ABI_VERSION);
3233

3334
rc = PMIx_Query_info(query, nqueries, &info, &ninfo);
3435
if (PMIX_SUCCESS != rc ) {
@@ -39,8 +40,12 @@ int main(int argc, char **argv) {
3940
printf("--> Query returned (ninfo %d)\n", (int)ninfo);
4041
for(i = 0; i < ninfo; ++i) {
4142
printf("--> KEY: %s\n", info[i].key);
42-
if (PMIX_CHECK_KEY(&info[i], PMIX_QUERY_ABI_VERSION)) {
43-
printf("----> ABI: String: %s\n",
43+
if (PMIX_CHECK_KEY(&info[i], PMIX_QUERY_STABLE_ABI_VERSION)) {
44+
printf("----> ABI (Stable): String: %s\n",
45+
info[i].value.data.string);
46+
}
47+
else if (PMIX_CHECK_KEY(&info[i], PMIX_QUERY_PROVISIONAL_ABI_VERSION)) {
48+
printf("----> ABI (Provisional): String: %s\n",
4449
info[i].value.data.string);
4550
}
4651
}

examples/abi_with_init.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,12 @@ int main(int argc, char **argv) {
3030
exit(rc);
3131
}
3232

33-
nqueries = 2;
33+
nqueries = 3;
3434

3535
PMIX_QUERY_CREATE(query, nqueries);
36-
PMIX_ARGV_APPEND(rc, query[0].keys, PMIX_QUERY_ABI_VERSION);
37-
PMIX_ARGV_APPEND(rc, query[1].keys, PMIX_QUERY_NAMESPACES);
36+
PMIX_ARGV_APPEND(rc, query[0].keys, PMIX_QUERY_STABLE_ABI_VERSION);
37+
PMIX_ARGV_APPEND(rc, query[1].keys, PMIX_QUERY_PROVISIONAL_ABI_VERSION);
38+
PMIX_ARGV_APPEND(rc, query[2].keys, PMIX_QUERY_NAMESPACES);
3839

3940
rc = PMIx_Query_info(query, nqueries, &info, &ninfo);
4041
if (PMIX_SUCCESS != rc ) {
@@ -45,8 +46,12 @@ int main(int argc, char **argv) {
4546
printf("--> Query returned (ninfo %d)\n", (int)ninfo);
4647
for(i = 0; i < ninfo; ++i) {
4748
printf("--> KEY: %s\n", info[i].key);
48-
if (PMIX_CHECK_KEY(&info[i], PMIX_QUERY_ABI_VERSION)) {
49-
printf("----> ABI: String: %s\n",
49+
if (PMIX_CHECK_KEY(&info[i], PMIX_QUERY_STABLE_ABI_VERSION)) {
50+
printf("----> ABI (Stable): String: %s\n",
51+
info[i].value.data.string);
52+
}
53+
else if (PMIX_CHECK_KEY(&info[i], PMIX_QUERY_PROVISIONAL_ABI_VERSION)) {
54+
printf("----> ABI (Provisional): String: %s\n",
5055
info[i].value.data.string);
5156
}
5257
else if (PMIX_CHECK_KEY(&info[i], PMIX_QUERY_NAMESPACES)) {

include/pmix_common.h.in

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,9 @@ typedef uint32_t pmix_rank_t;
11241124
// Named values (i.e., values defined by constant names via a
11251125
// typical C-language enum declaration) must be provided as
11261126
// their numerical equivalent.
1127-
#define PMIX_QUERY_ABI_VERSION "pmix.qry.abiversion" // (char*) The PMIx Standard ABI version supported returned in the form "MAJOR.MINOR"
1127+
#define PMIX_QUERY_STABLE_ABI_VERSION "pmix.qry.stabiver" // (char*) The PMIx Standard Stable ABI version supported returned in the form of a comma separated list of "MAJOR.MINOR"
1128+
// This attribute can be used with PMIx_Query_info outside of the init/finalize region.
1129+
#define PMIX_QUERY_PROVISIONAL_ABI_VERSION "pmix.qry.prabiver" // (char*) The PMIx Standard Provisional ABI version supported returned in the form of a comma separated "MAJOR.MINOR"
11281130
// This attribute can be used with PMIx_Query_info outside of the init/finalize region.
11291131

11301132
/**** PROCESS STATE DEFINITIONS ****/

src/client/pmix_client.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,14 @@
5252

5353
#ifdef PMIX_GIT_REPO_BUILD
5454
static const char pmix_version_string[] = "OpenPMIx " PMIX_VERSION ", repo rev: " PMIX_REPO_REV
55-
" (PMIx Standard: " PMIX_STD_VERSION ", ABI: " PMIX_STD_ABI_VERSION ")";
55+
" (PMIx Standard: " PMIX_STD_VERSION ","
56+
" Stable ABI: " PMIX_STD_ABI_STABLE_VERSION ","
57+
" Provisional ABI: " PMIX_STD_ABI_PROVISIONAL_VERSION ")";
5658
#else
5759
static const char pmix_version_string[] = "OpenPMIx " PMIX_VERSION
58-
" (PMIx Standard: " PMIX_STD_VERSION ", ABI: " PMIX_STD_ABI_VERSION ")";
60+
" (PMIx Standard: " PMIX_STD_VERSION ","
61+
" Stable ABI: " PMIX_STD_ABI_STABLE_VERSION ","
62+
" Provisional ABI: " PMIX_STD_ABI_PROVISIONAL_VERSION ")";
5963
#endif
6064
static pmix_status_t pmix_init_result = PMIX_ERR_INIT;
6165

src/common/pmix_query.c

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -472,9 +472,14 @@ static void localquery(int sd, short args, void *cbdata)
472472
for (p = 0; NULL != queries[n].keys[p]; p++) {
473473
cb.key = queries[n].keys[p];
474474
// Locally resolvable keys
475-
if (0 == strcmp(queries[n].keys[p], PMIX_QUERY_ABI_VERSION)) {
475+
if (0 == strcmp(queries[n].keys[p], PMIX_QUERY_STABLE_ABI_VERSION)) {
476476
PMIX_KVAL_NEW(kv, cb.key);
477-
PMIx_Value_load(kv->value, PMIX_STD_ABI_VERSION, PMIX_STRING);
477+
PMIx_Value_load(kv->value, PMIX_STD_ABI_STABLE_VERSION, PMIX_STRING);
478+
pmix_list_append(&cb.kvs, &kv->super);
479+
rc = PMIX_SUCCESS;
480+
} else if (0 == strcmp(queries[n].keys[p], PMIX_QUERY_PROVISIONAL_ABI_VERSION)) {
481+
PMIX_KVAL_NEW(kv, cb.key);
482+
PMIx_Value_load(kv->value, PMIX_STD_ABI_PROVISIONAL_VERSION, PMIX_STRING);
478483
pmix_list_append(&cb.kvs, &kv->super);
479484
rc = PMIX_SUCCESS;
480485
} else {
@@ -860,7 +865,10 @@ PMIX_EXPORT pmix_status_t PMIx_Allocation_request_nb(pmix_alloc_directive_t dire
860865
*/
861866
static bool pmix_query_check_is_local_resolve(const char *key)
862867
{
863-
if (0 == strcmp(key, PMIX_QUERY_ABI_VERSION)) {
868+
if (0 == strcmp(key, PMIX_QUERY_STABLE_ABI_VERSION)) {
869+
return true;
870+
}
871+
else if (0 == strcmp(key, PMIX_QUERY_PROVISIONAL_ABI_VERSION)) {
864872
return true;
865873
}
866874
return false;
@@ -909,12 +917,16 @@ static int pmix_query_resolve_all_pre_init(pmix_query_t queries[], size_t nqueri
909917

910918
// If it does qualify then fill in the results
911919
*nresults = num_info;
912-
PMIX_INFO_CREATE(*results, *nresults);
920+
PMIX_INFO_CREATE((*results), (*nresults));
913921
cur_info = 0;
914922
for (n = 0; n < nqueries; n++) {
915923
for (p = 0; NULL != queries[n].keys[p]; p++) {
916-
if (0 == strcmp(queries[n].keys[p], PMIX_QUERY_ABI_VERSION)) {
917-
PMIx_Info_load(results[cur_info], PMIX_QUERY_ABI_VERSION, PMIX_STD_ABI_VERSION, PMIX_STRING);
924+
if (0 == strcmp(queries[n].keys[p], PMIX_QUERY_STABLE_ABI_VERSION)) {
925+
PMIx_Info_load(&((*results)[cur_info]), PMIX_QUERY_STABLE_ABI_VERSION, PMIX_STD_ABI_STABLE_VERSION, PMIX_STRING);
926+
++cur_info;
927+
}
928+
else if (0 == strcmp(queries[n].keys[p], PMIX_QUERY_PROVISIONAL_ABI_VERSION)) {
929+
PMIx_Info_load(&((*results)[cur_info]), PMIX_QUERY_PROVISIONAL_ABI_VERSION, PMIX_STD_ABI_PROVISIONAL_VERSION, PMIX_STRING);
918930
++cur_info;
919931
}
920932
}
@@ -960,9 +972,14 @@ void pmix_query_local_resolve_cbfunc(pmix_status_t status,
960972
for (n = 0; n < local_cd->orig_nqueries; n++) {
961973
p_idx = 0;
962974
for (p = 0; NULL != local_cd->orig_queries[n].keys[p]; p++) {
963-
if (0 == strcmp(local_cd->orig_queries[n].keys[p], PMIX_QUERY_ABI_VERSION)) {
975+
if (0 == strcmp(local_cd->orig_queries[n].keys[p], PMIX_QUERY_STABLE_ABI_VERSION)) {
976+
PMIx_Info_load(&local_cd->info[n_idx], local_cd->orig_queries[n].keys[p],
977+
PMIX_STD_ABI_STABLE_VERSION, PMIX_STRING);
978+
++p_idx;
979+
}
980+
else if (0 == strcmp(local_cd->orig_queries[n].keys[p], PMIX_QUERY_PROVISIONAL_ABI_VERSION)) {
964981
PMIx_Info_load(&local_cd->info[n_idx], local_cd->orig_queries[n].keys[p],
965-
PMIX_STD_ABI_VERSION, PMIX_STRING);
982+
PMIX_STD_ABI_PROVISIONAL_VERSION, PMIX_STRING);
966983
++p_idx;
967984
}
968985
}

0 commit comments

Comments
 (0)