Skip to content

[RFC] Test the trajectories and proxy forces using stub#852

Merged
jhenin merged 18 commits into
Colvars:masterfrom
HanatoK:test_stub_output
Oct 13, 2025
Merged

[RFC] Test the trajectories and proxy forces using stub#852
jhenin merged 18 commits into
Colvars:masterfrom
HanatoK:test_stub_output

Conversation

@HanatoK

@HanatoK HanatoK commented Sep 4, 2025

Copy link
Copy Markdown
Member

This PR tries to compare the stub test results with reference files in AutoDiff, and also outputs the stub proxy forces for testing. The reference files will be useful for testing the GPU stub proxy in #826.


#include <iostream>

#define STUB_OUTPUT_FORCE

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.

Are there strong reasons not to make this a runtime flag passed to read_frame_xyz? It would seem simpler to me, and I don't see a critical performance consideration there.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

There is already an optional argument for the output prefix. I wonder if I add another one, it may become difficault to maintain in the future due to added complexity, if a 3rd argument parser is not used. What's the best way to add such a runtime flag?

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.

I think you're right. With 3 or more arguments, it's hard to remember how to use them in the correct order.

Maybe we can use the gflags library or something similar to allow for flags?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

There are many choices. Personally I would like to use CLI11 since it is header only and can be used with a single header (https://github.com/CLIUtils/CLI11?tab=readme-ov-file#install). I am not familiar with gflags but it looks like linking to the library is required.

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.

Sure, I think that qualifies as "something similar" :-)

A header only library that is only used by our command-line tool should be no trouble at all.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done in 80d012e.
Currently, the tests failed because

  1. The Clang++ 3.4 is too old;
  2. The Oracle/Sun compiler is too old.

I suggest to give up the two outdated and buggy compilers, and use -Wshadow in GCC and Clang. However, this is up to @giacomofiorin .

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.

I suggest to give up the two outdated and buggy compilers, and use -Wshadow in GCC and Clang. However, this is up to @giacomofiorin .

I checked: we do have this already #557 Although it's not quite the same thing as the Sun checks, we are probably quite close to abandoning C++11 as well, which would rule that out.

Dropping all CentOS 7 stuff in an upcoming PR.

@HanatoK HanatoK marked this pull request as ready for review September 5, 2025 21:43
@giacomofiorin giacomofiorin force-pushed the test_stub_output branch 2 times, most recently from abc6f6c to 5c00187 Compare September 9, 2025 00:50
@giacomofiorin giacomofiorin added the testing Only affects CI; not listed in outside PRs label Sep 9, 2025
@jhenin jhenin merged commit dfe58a1 into Colvars:master Oct 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Only affects CI; not listed in outside PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants