Skip to content

OpenMPI: Limit orterunprefix variant to pre-5.x versions#43961

Closed
jack-morrison wants to merge 1 commit intospack:developfrom
jack-morrison:jackm/restrict-orte-by-default-variant
Closed

OpenMPI: Limit orterunprefix variant to pre-5.x versions#43961
jack-morrison wants to merge 1 commit intospack:developfrom
jack-morrison:jackm/restrict-orte-by-default-variant

Conversation

@jack-morrison
Copy link
Copy Markdown
Contributor

OpenMPI 5.x switches to --enable-prte-prefix-by-default instead, which is enabled by default at configure time.

@jack-morrison
Copy link
Copy Markdown
Contributor Author

@hppritcha, separately but related, do I understand correctly that the intention with these is to have +romio default for <5.x and ~romio for 5 and up?

    variant("romio", default=True, when="@:5", description="Enable ROMIO support")
    variant("romio", default=False, when="@5:", description="Enable ROMIO support")

If so, I think the True condition should be when="@:4". If you agree, I'm happy to tack that onto this PR.

@hppritcha
Copy link
Copy Markdown
Contributor

yes. including it in this correction for romio in this PR would be fine with me. nice catch!

@scheibelp scheibelp self-assigned this May 3, 2024
default=False,
when="@:4",
description="Prefix Open MPI to PATH and LD_LIBRARY_PATH on local and remote hosts",
)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If there is a desire to optionally offer the old behavior, we could

  • Keep this variant
  • Useconfig_args.append("--enable-prte-prefix-by-default") For +orterunprefix (not essential, but explicit)
  • Use --disable-... (if available) fort ~orterunprefix

I get the impression though that no one was depending on ~orterunprefix, since it sounds like we would have been effectively ignoring that for @5:.

It would be nice (but not strictly required) to edit logic that looks at +orterunprefix, like

        if spec.satisfies("@1.3:"):
            if spec.satisfies("+orterunprefix"):

(even if you don't change that, the code will still work, but it would be easier to read if for example the range were updated to @1.3:4)

It sounds like you were going to make additional changes based on #43961 (comment), so let me know when that's ready and I can take another look.

Copy link
Copy Markdown
Contributor Author

@jack-morrison jack-morrison May 4, 2024

Choose a reason for hiding this comment

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

Thanks for the feedback @scheibelp! I'll be looping back to this next week and will try to take some of this into account. I agree that for completion we should maybe offer the older behavior in 5.x versions (the ability to do ~, not currently present), even if the default behavior is changing (to +).

You're right that I'd still like to make some changes wrt the romio variant, but am having some trouble. I'll copy here a note that I had put in Slack, and I'd appreciate your expert guidance:

As written now,

variant("romio", default=True, when="@:5", description="Enable ROMIO support")
variant("romio", default=False, when="@5:", description="Enable ROMIO support")

, it's always false. I tried adjusting this to have the True case be @:4 instead [from our discussion above], but then I realized this is the overriding variants situation described in the docs and it continues to (correctly) be False regardless of version.
To switch the +/~ behavior of a variant based on version, does it need to be separately handled or can that be done entirely as variant definitions?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the pointer, and yeah apologies it looks like we don't provide a way to do this with variant declarations. The only way I can think to do this right now is to add some config to etc/spack/defaults/packages.yaml:

packages:
  openmpi:
    prefer:
    - spec: ~romio
      when: @5:

(I'll check internally and get back to you on whether we'd want that sort of change, since we try to keep that scope as concise as possible)

I swear we were talking about adding a prefer directive (so we could encode this in the package itself), but that's not available right now. @alalazo was that you who mentioned this?

Copy link
Copy Markdown
Member

@alalazo alalazo May 17, 2024

Choose a reason for hiding this comment

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

Yes. My take is that we don't want to have prefer directive in package.py, since packages might conflict with each other (and there's no opt-out to a directive). requires is different, cause it's really enforcing something.

Having prefer in packages.yaml is instead fine, cause that is "by user" and not "by package".

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

My take is that we don't want to have prefer directive in package.py

Fine by me, but I'm not following your reasoning

since packages might conflict with each other (and there's no opt-out to a directive

I assume conflicting preferences would have a winner (in terms of weighting) and because the user encoded them as a preference, they'd be fine with any particular one being ignored.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@tgamblin, who I spoke with, is working on a mechanism to adjust the default variant value based on when specs (so that will be a preferred mechanism to support this, vs. adding preferences to the default packages.yaml)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

See #44425

@jack-morrison
Copy link
Copy Markdown
Contributor Author

I haven't abandoned this, just haven't gotten to touching it up just yet.

@scheibelp
Copy link
Copy Markdown
Member

Thanks, I likewise have not yet delivered on my promise:

(I'll check internally and get back to you on whether we'd want that sort of change, since we try to keep that scope as concise as possible)

I probably wont be able to until end of next week (most core team members are busy in the short term)

@tgamblin
Copy link
Copy Markdown
Member

#44425 is (finally) merged, so multiple variant definitions should now work as you'd expect.

@jack-morrison
Copy link
Copy Markdown
Contributor Author

#44425 is (finally) merged, so multiple variant definitions should now work as you'd expect.

thanks @tgamblin, I'll loop back to this one!

@github-actions
Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had
any activity in the last 6 months. It will be closed if there is no further activity.
Thank you for your contributions!

@github-actions github-actions bot added the stale label Jul 11, 2025
@github-actions
Copy link
Copy Markdown
Contributor

This pull request was closed because it had no activity for 30 days after being marked stale.

@github-actions github-actions bot closed this Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants