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

allow GROMACS log files to report that the code is patched by PLUMED #737

Closed
mabraham opened this issue Sep 9, 2021 · 3 comments · Fixed by #739
Closed

allow GROMACS log files to report that the code is patched by PLUMED #737

mabraham opened this issue Sep 9, 2021 · 3 comments · Fixed by #739

Comments

@mabraham
Copy link
Contributor

mabraham commented Sep 9, 2021

In GROMACS, we have for a few years enabled users to do cmake -DGMX_VERSION_STRING_OF_FORK=PLUMED and that will show up in the GROMACS version string e.g. in log files. This is useful for users running their own forks making sense of their log files later on, as well as for developers reading forum posts or bug reports knowing what versions were used. Troubleshooting GROMACS users' performance questions can go much better if the co-existence of PLUMED is known.

In PLUMED's approach, it seems straightforward to patch the relevant cmake file in GROMACS that declares that variable so that its default value is PLUMED and the GROMACS mechanism will work the same way. Is such a patch to PLUMED welcome? If so, I will prepare it.

Would the PLUMED developers prefer also that the PLUMED version appear there? If so, is there a mechanism for that to be updated each time the PLUMED version is updated?

@GiovanniBussi
Copy link
Member

GiovanniBussi commented Sep 9, 2021

@mabraham it would be great.

Technically, for GROMACS, we still have this patching hack in place, so there are two relevant pieces of information for users:

  • which PLUMED version was used for patching
  • which PLUMED version is loaded at run time (they might differ)

For this reason, I would suggest to show the former in the GROMACS log and the latter in the PLUMED log (as we are already doing).

In PLUMED, the script that takes care of patching is written in bash and is here. It does not have access to the PLUMED version, but that's easy to fix on our side. In addition, for each specific MD code that might be patched, there is a configuration file like this one that we source and we use to add further bash commands.

I would propose the follwing:

  • I take care of making a shell variable containing the PLUMED version available in the script
  • You suggest some simple awk command that could be used to insert that version string in the relevant cmake file. Consider that our patch is expected to be applied on the source root (and not on the build root) directory. The command might look something like this:
mv src/Cmake.txt src/Cmake.txt.preplumed # this is to allow reverting
awk -v version="$PLUMED_VERSION" '{if($1=="whatever") print($0,version)}' src/Cmake.txt.preplumed > src/Cmake.txt
  • I then incorporate those commands in our configuration file.

What do you think?

@mabraham
Copy link
Contributor Author

mabraham commented Sep 9, 2021

Sounds great. The awk approach gives you the necessary flexibility to interpolate the PLUMED version!

GiovanniBussi added a commit that referenced this issue Sep 9, 2021
@GiovanniBussi
Copy link
Member

GiovanniBussi commented Sep 9, 2021

Actually adding the PLUMED_VERSION variable is straightforward (I already added this to PLUMED v2.7 and master)

GiovanniBussi added a commit that referenced this issue Sep 10, 2021
plumed-patch is the script-only version used when cross compiling

See 074ce21

See #737
GiovanniBussi added a commit that referenced this issue Nov 22, 2021
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 a pull request may close this issue.

2 participants