Skip to content

Commit

Permalink
Preserve backward compatibility
Browse files Browse the repository at this point in the history
For earlier versions of PMIx, we won't have access to
the pmix_getline utility - so preserve the static
versions of that function where required for those
earlier versions.

Signed-off-by: Ralph Castain <rhc@pmix.org>
  • Loading branch information
rhc54 committed Dec 6, 2023
1 parent 9c94e2a commit 951af44
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/mca/ess/base/ess_base_bootstrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,23 @@ static pmix_status_t regex_parse_value_range(char *base, char *range,
char ***names);
static pmix_status_t read_file(char *regexp, char ***names);

#if PMIX_NUMERIC_VERSION < 0x00040207
static char *pmix_getline(FILE *fp)
{
char *ret, *buff;
char input[1024];

ret = fgets(input, 1024, fp);
if (NULL != ret) {
input[strlen(input) - 1] = '\0'; /* remove newline */
buff = strdup(input);
return buff;
}

return NULL;
}
#endif

int prte_ess_base_bootstrap(void)
{
char *path, *line, *ptr;
Expand Down
17 changes: 17 additions & 0 deletions src/mca/ras/base/ras_base_allocate.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,23 @@

#include "src/mca/ras/base/ras_private.h"

#if PMIX_NUMERIC_VERSION < 0x00040207
static char *pmix_getline(FILE *fp)
{
char *ret, *buff;
char input[1024];

ret = fgets(input, 1024, fp);
if (NULL != ret) {
input[strlen(input) - 1] = '\0'; /* remove newline */
buff = strdup(input);
return buff;
}

return NULL;
}
#endif

char *prte_ras_base_flag_string(prte_node_t *node)
{
char *tmp, *t3, **t2 = NULL;
Expand Down
17 changes: 17 additions & 0 deletions src/mca/rmaps/rank_file/rmaps_rank_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,23 @@ static int prte_rmaps_rf_process_lsf_affinity_hostfile(prte_job_t *jdata, prte_r

char *prte_rmaps_rank_file_slot_list = NULL;

#if PMIX_NUMERIC_VERSION < 0x00040207
static char *pmix_getline(FILE *fp)
{
char *ret, *buff;
char input[1024];

ret = fgets(input, 1024, fp);
if (NULL != ret) {
input[strlen(input) - 1] = '\0'; /* remove newline */
buff = strdup(input);
return buff;
}

return NULL;
}
#endif

/*
* Local variable
*/
Expand Down
17 changes: 17 additions & 0 deletions src/mca/rmaps/seq/rmaps_seq.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,23 @@ static bool quickmatch(prte_node_t *nd, char *name)
return false;
}

#if PMIX_NUMERIC_VERSION < 0x00040207
static char *pmix_getline(FILE *fp)
{
char *ret, *buff;
char input[1024];

ret = fgets(input, 1024, fp);
if (NULL != ret) {
input[strlen(input) - 1] = '\0'; /* remove newline */
buff = strdup(input);
return buff;
}

return NULL;
}
#endif

/*
* Sequentially map the ranks according to the placement in the
* specified hostfile
Expand Down

0 comments on commit 951af44

Please sign in to comment.