Skip to content

Conversation

@raffenet
Copy link
Contributor

@raffenet raffenet commented Sep 10, 2025

Pull Request Description

MPL_env2str is used to check for CVARs with string or enum type. It returns only 0 or 1 based on whether the environment variable is found. It never returns -1, so we can safely remove the error check.

Author Checklist

  • Provide Description
    Particularly focus on why, not what. Reference background, issues, test failures, xfail entries, etc.
  • Commits Follow Good Practice
    Commits are self-contained and do not do two things at once.
    Commit message is of the form: module: short description
    Commit message explains what's in the commit.
  • Passes All Tests
    Whitespace checker. Warnings test. Additional tests via comments.
  • Contribution Agreement
    For non-Argonne authors, check contribution agreement.
    If necessary, request an explicit comment from your companies PR approval manager.

@raffenet
Copy link
Contributor Author

test:mpich/ch4/most
test:mpich/ch3/most

@raffenet
Copy link
Contributor Author

test:mpich/ch4/ucx

@raffenet raffenet requested a review from yfguo September 17, 2025 13:38
MPL_env2str is used to check for CVARs with string or enum type. It
returns only 0 or 1 based on whether the environment variable is
found. It never returns -1, so we can safely remove the error check.
Whether or not the user has set an environment variable is tracked by
the return codes of various MPL_env2* functions. If a variable is set
and debugging is enabled, the setting gets printed out for the
user. Rename got_rc->is_set to better indicate what the value
represents.
@raffenet
Copy link
Contributor Author

Updated variable name based on today's dev call discussion.

@raffenet raffenet requested a review from hzhou September 18, 2025 15:48
@raffenet
Copy link
Contributor Author

test:mpich/ch4/most
test:mpich/ch3/most

Copy link
Contributor

@hzhou hzhou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the pr is overall a gratuitous/unnecessary change. Suggest drop.

elsif ($p->{type} eq 'string' or $p->{type} eq 'enum') {
print OUTPUT_C <<EOT;
rc = MPL_env2${env_fn}("$env_name", &tmp_str);
MPIR_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","$env_name");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't hurt to leave the error check in. Even though MPL_env2str never returns error, it could in design. I think leave the error check in for uniformity is easier to maintain.

rc = MPL_env2${env_fn}("$env_name", &($var_name));
MPIR_ERR_CHKANDJUMP1((-1 == rc),mpi_errno,MPI_ERR_OTHER,"**envvarparse","**envvarparse %s","$env_name");
got_rc += rc;
is_set += rc;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure the renaming is any better.

I think the pr is overall a gratuitous/unnecessary change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants