Repository navigation
Fix the -intel- (rt-make-angle) and -nvhpc-mpi- CI failures on master - #1493
aalhossary wants to merge 2 commits into
Conversation
The shortcut compared dpnn with 1.0-epsilon, where PLMD::epsilon is the double epsilon. For T=float that threshold rounds to "exactly 1", so a one-ulp error in dp*nn skips the shortcut: acos(0.99999994f) returns 0.000345267 instead of 0, and pi comes out as 3.14125. That is the intermittent -intel- failure of tools/rt-make-angle (float section only). It reproduces with clang -ffast-math, where 1/sqrt is approximated: the output matches the CI diff exactly, and matches the reference with this change (also -O0, -O3, haswell and skylake-avx512). The double results are unchanged, since T's epsilon is PLMD::epsilon there.
The -nvhpc- job has failed since plumed#1485 added --enable-cxx=20 to this step: building the openacc plugin, nvc++ 24.3 stops with "Internal compiler error. BAD sptr in func_refsym" in core/ActionWithArguments.h. The compiler is the same (24.3) in the last passing and the first failing run. The job's configuration differs only in this step: before, configure could not enable libtorch and libmetatomic under C++17 and dropped them with a warning; now it enables both and builds with -std=c++20, and the plugin inherits PLUMED's flags. The job only checks that the openacc plugin compiles, so skip the step there, which restores what it built before plumed#1485.
|
A note on where the namespace PLMD {
/// \ingroup TOOLBOX
/// Very small non-zero number
constexpr double epsilon(std::numeric_limits<double>::epsilon());It is always the
|
|
Should fix the remaining issues in #1490 |
Description
This fixes the two CI jobs that fail on
master(and so on every PR into it):-intel-and-nvhpc-mpi-. One commit each.1.
-intel-:tools/rt-make-angle(intermittent; 3 of master's last 7 runs). Only thefloatpart of the test fails: two parallel vectors give an angle of0.000345267instead of0, and two antiparallel ones3.14125instead ofpi.Angle::computetakes a shortcut whendpnnis withinepsilonof ±1.PLMD::epsilonis the double epsilon, though, so forT=floatthe threshold1.0-epsilonmeans "exactly 1". A one-ulp error indp*nn(0.99999994f) skips the shortcut, andacos(0.99999994f)is0.000345267. The fix usesstd::numeric_limits<T>::epsilon(). Fordoublethat isPLMD::epsilonitself, so double results cannot change.I reproduced it locally with clang
-ffast-math, which approximates1/sqrtthe way the Intel compiler's default floating-point model may. Without the fix, the output matches the CI diff character for character. With the fix it matches the reference at-O0, at-O3, and with-ffast-mathfor both haswell and skylake-avx512. I have not found why the failure is intermittent with the same compiler (oneAPI 2026.1 in both passing and failing runs); my guess is the runner's CPU.rt-make-angle, the othertools/regtests and the 35 regtests that useAnglepass with this change.2.
-nvhpc-mpi-: internal compiler error. Building the openacc plugin, nvc++ 24.3 stops withInternal compiler error. BAD sptr in func_refsymincore/ActionWithArguments.h. It started with my #1485 (C++20 for the libtorch CI step), oncev2.10was merged intomaster:2f64cb67f) and in every failing one since8743620c3.configurecould not enable libtorch and libmetatomic under C++17 in this job, and dropped them with a warning. Now it enables both and builds with-std=c++20, and the plugin inherits PLUMED's flags.-nvhpc-mpi-included. That run was onv2.10, which has no openacc plugin, so the plugin never met the C++20 configuration until the merge intomaster.This job only checks that the openacc plugin compiles, so the second commit skips the libmetatomic/libtorch step there. That restores exactly what the job built before #1485. I could not reproduce the ICE locally with nvc++ 24.3 and the same flags (C++17 or C++20, with or without MPI, several
-tptargets), so this PR's own-nvhpc-mpi-job is the test of this commit.Found and fixed with the help of Claude.
Target release
I would like my code to appear in release master (neither the float
Angletest nor the openacc plugin exists onv2.10).Type of contribution
Copyright
Tests
No new regtest:
tools/rt-make-anglealready covers it, but it only fails where floating-point math is approximated.