JCSDA / spack

A flexible package manager that supports multiple versions, configurations, platforms, and compilers.
https://spack.io
Other
0 stars 14 forks source link

HDF5 FPE fixes. #408

Closed rhoneyager-tomorrow closed 8 months ago

rhoneyager-tomorrow commented 8 months ago

Description

This fixes a bunch of HDF5 floating point exception issues. This patch is backported from HDF5's develop branch. See code notes, and see https://github.com/HDFGroup/hdf5/pull/3837 / https://github.com/spack/spack/pull/42880.

climbfuji commented 8 months ago

I am building spack-stack for https://github.com/JCSDA/spack-stack/pull/1014, which includes this PR in the submodule ptr update. Then I'll run the jedi-bundle ctests to confirm that it solves the FPE issues we've been seeing.

Thanks for the PR!

climbfuji commented 8 months ago

Thanks for this PR! I think the approach the HDF developers took (with the fenv utilities) covers all the platforms we are using except for the Intel based macs. The Intel based mac is actually partly covered by fenv. For the Intel based macs, the fenv utilities cover the "regular" arithmetic pipelines, but not the SSE arithmetic pipelines. The SSE is handled by special macros in xmmintrin.h. Here's an example from oops:

https://github.com/JCSDA/oops/blob/2012398058043bda46db2b9d80a909810df04cea/src/oops/util/signal_trap.cc#L116-147

At this point the Intel based macs are disappearing, and we will eventually stop supporting that platform. Nearly everyone has an M1 or M2 based mac, so I'm not sure it's worth trying to get this into the HDF code.

Just wanted to point this out.

Thanks for the comment. Let's get this merged and deal with the Intel-based macs on our end if we have to.