Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Breaking] Prefix amrex_ to each plotfile Tool #3600

Merged
merged 2 commits into from
Nov 1, 2023

Conversation

ax3l
Copy link
Member

@ax3l ax3l commented Oct 18, 2023

Summary

Packaging AMReX for Conda, we received feedback that our plotfile tool names are too generic and can collide with other packages.

Thus, we propose to rename them with a common prefix.

  • decide prefix or suffix (suffix: <TAB> completion will work; prefix: easier for new users)
  • decide name: plt/amrex/amr/...
    • Weiqun and Axel prefer amrex_ so far
  • also change for GNUmake
  • update user-facing documentation for tools
  • update tutorials?

Additional background

conda-forge/staged-recipes#24294

Checklist

The proposed changes:

  • fix a bug or incorrect behavior in AMReX
  • add new capabilities to AMReX
  • changes answers in the test suite to more than roundoff level
  • are likely to significantly affect the results of downstream AMReX users
  • include documentation in the code and/or rst files, if appropriate

Tools/Plotfile/CMakeLists.txt Outdated Show resolved Hide resolved
@ax3l ax3l force-pushed the plotfile-tools-suffix branch from e53009f to 95a86c7 Compare October 18, 2023 18:34
ax3l added a commit to ax3l/staged-recipes that referenced this pull request Oct 18, 2023
A later, breaking change will introduce tools:
AMReX-Codes/amrex#3600

Co-authored-by: Isuru Fernando <[email protected]>
# Add suffix to each tool's name to make them unique when installed.
# This avoids potential collisions of names on user systems, e.g., in
# software packages (Spack/Conda/Debian/...).
set_target_properties(${_exe} PROPERTIES OUTPUT_NAME "${_exe}_amrex")
Copy link

Choose a reason for hiding this comment

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

Wouldn't this change the executable name from foo.exe to foo_amrex? i.e. drop the .exe suffix?

Copy link
Member

Choose a reason for hiding this comment

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

The old name does not have .exe either.

Copy link
Member

Choose a reason for hiding this comment

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

I think using prefix here is better because all the amrex files will then be grouped together by default (by ls for example).

Copy link
Member Author

@ax3l ax3l Oct 19, 2023

Choose a reason for hiding this comment

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

The output name is before the executable suffix in cmake. It will keep .exe on Windows and none on Unix.

Refs.:

Packaging AMReX for Conda, we received feedback that our plotfile tool
names are too generic and can collide with other packages.

Thus, we propose to rename them with a common prefix.
@ax3l ax3l force-pushed the plotfile-tools-suffix branch from 95a86c7 to 54c7cf0 Compare October 19, 2023 17:31
@ax3l ax3l changed the title [Breaking] Append _amrex to each plotfile Tool [Breaking] Prefix amrex_ to each plotfile Tool Oct 19, 2023
@ax3l
Copy link
Member Author

ax3l commented Oct 19, 2023

This change might break workflows, in particular:

  • tests
  • tutorials
  • Python test harness by @zingale

and coordinated updates are welcome after/with merge :)

@WeiqunZhang
Copy link
Member

We do not need to change the GNU Make build. Currently the names are like fcompare.gnu.ex for GNU Make. So they have never consistent.

As for documentation, we only used gnumake as an example. https://amrex-codes.github.io/amrex/docs_html/Post_Processing.html#fextract Maybe we can add a paragraph about building these tools with cmake. We have already mentioned the build option here https://amrex-codes.github.io/amrex/docs_html/BuildingAMReX.html#id2. Maybe we can say something about they will be installed at <amrex_installation_directdory>/bin/ and what the names are.

@WeiqunZhang
Copy link
Member

I did a case insensitive grep of plotfile_tools, tools/plotfile and fcompare in amrex-tutorials. Nothing showed up.

@WeiqunZhang
Copy link
Member

Re: regression_testing, even when cmake is used to build the application code and amrex, we still use gnumake built plotfile tools. See https://ccse.lbl.gov/pub/RegressionTesting1/MFIX-Exa/2023-10-19/BENCH01-Size0001.html.

Compilation command:
cmake_3.20 --build /scratch/AMReX_RegTesting/mfix/builddir -j 8 -- mfix

...

/scratch/AMReX_RegTesting/amrex/Tools/Plotfile//fcompare.gnu.ex ...

@WeiqunZhang
Copy link
Member

@jrood-nrel amr-wind and pele need to be updated after this is merged.

@WeiqunZhang
Copy link
Member

@ax3l if we do not change gnu make, this PR should be ready for merge.

@maxpkatz
Copy link
Member

I support leaving GNU make alone.

@ax3l
Copy link
Member Author

ax3l commented Oct 20, 2023

I think producing different artifacts for the different build systems - and documenting the tools with inconsistent names - will cause a lot of confusion. Especially since we build with CMake for all user-facing package managers (e.g., Spack, Conda).

#3600 (comment)
That sounds good. The tools will actually be in PATH after install and generally available to users.
If we change the docs to (prominently/primarily? because users) refer to the CMake names that people will encounter, and leave GNUmake for hard-core devs with legacy names, I would feel better as well. But my primary concern is users getting confused.

In the end, we can avoid this though and future confusion by synchronizing the tool names...

@WeiqunZhang
Copy link
Member

I don't think the potential confusion is an issue if we clearly document it, especially since they end up in very different directories. The names have always been inconsistent. I think should just leave GNU make alone.

In any case, we need to update the documentation. Do you want to do it in this PR or a separate PR?

@ax3l
Copy link
Member Author

ax3l commented Nov 1, 2023

Currently on an airplane. Let's merge this and have a follow-up PR on docs? I can do that end of the week.

@WeiqunZhang WeiqunZhang merged commit 606a94c into AMReX-Codes:development Nov 1, 2023
69 checks passed
guj pushed a commit to guj/amrex that referenced this pull request Dec 13, 2023
## Summary

Packaging AMReX for Conda, we received feedback that our plotfile tool
names are too generic and can collide with other packages.

Thus, we propose to rename them with a common prefix.

- [x] decide prefix or suffix (suffix: `<TAB>` completion will work;
prefix: easier for new users)
- [x] decide name: `plt`/`amrex`/`amr`/...
  - Weiqun and Axel prefer `amrex_` so far
- [ ] also change for GNUmake
- [ ] update [test
harness](https://github.com/AMReX-Codes/regression_testing)
- [ ] update user-facing documentation for tools
- [x] ~update
[tutorials](https://github.com/AMReX-Codes/amrex-tutorials)?~

## Additional background

conda-forge/staged-recipes#24294

## Checklist

The proposed changes:
- [ ] fix a bug or incorrect behavior in AMReX
- [ ] add new capabilities to AMReX
- [ ] changes answers in the test suite to more than roundoff level
- [ ] are likely to significantly affect the results of downstream AMReX
users
- [ ] include documentation in the code and/or rst files, if appropriate

---------

Co-authored-by: Weiqun Zhang <[email protected]>
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.

4 participants