From 7f16c569c5c089f3fbb783b621f19f8178870234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikael=20=C3=96hman?= Date: Fri, 13 Nov 2026 15:54:40 +0100 Subject: [PATCH 1/3] Update to HighFive 3.3 --- cmake/gauxc-dep-versions.cmake | 2 +- tests/2nd_derivative_test.cxx | 26 +++------ tests/c_api_test.cxx | 68 +++++++++++------------- tests/dd_psi_potential_test.cxx | 20 +++---- tests/grid_opt.cxx | 7 +-- tests/hdf5_test_serialization.hpp | 10 +--- tests/hdf5_test_serialization_impl.hpp | 5 +- tests/orbital_evaluator_test.cxx | 4 +- tests/standalone_driver.cxx | 73 +++++++------------------- tests/xc_integrator.cxx | 59 ++++++--------------- 10 files changed, 87 insertions(+), 187 deletions(-) diff --git a/cmake/gauxc-dep-versions.cmake b/cmake/gauxc-dep-versions.cmake index 635a6e739..6e0976289 100644 --- a/cmake/gauxc-dep-versions.cmake +++ b/cmake/gauxc-dep-versions.cmake @@ -17,4 +17,4 @@ set( GAUXC_INTEGRATORXX_REPOSITORY https://github.com/wavefunction91/IntegratorX set( GAUXC_INTEGRATORXX_REVISION 619d26ae4ea421ed9b7a6f80eb0783f9da1ecf7a ) set( GAUXC_HIGHFIVE_REPOSITORY https://github.com/highfive-devs/HighFive.git ) -set( GAUXC_HIGHFIVE_REVISION 805f0e13d09b47c4b01d40682621904aa3b31bb8 ) +set( GAUXC_HIGHFIVE_REVISION v3.3.0 ) diff --git a/tests/2nd_derivative_test.cxx b/tests/2nd_derivative_test.cxx index eedcb27f7..61d133d10 100644 --- a/tests/2nd_derivative_test.cxx +++ b/tests/2nd_derivative_test.cxx @@ -65,32 +65,18 @@ void test_fxc_contractioin(ExecutionSpace ex, const RuntimeEnvironment& rt, fxc_str = "/FXC_SCALAR"; } - auto dset = file.getDataSet(den); - auto dims = dset.getDimensions(); - - P = matrix_type(dims[0], dims[1]); - dset.read(P.data()); + file.getDataSet(den).read(P); if (not rks) { - Pz = matrix_type(dims[0], dims[1]); - dset = file.getDataSet(den2); - dset.read(Pz.data()); + file.getDataSet(den2).read(Pz); } - tP = matrix_type(dims[0], dims[1]); - dset = file.getDataSet(tden_str); - dset.read(tP.data()); - FXC_ref = matrix_type(dims[0], dims[1]); - dset = file.getDataSet(fxc_str); - dset.read(FXC_ref.data()); + file.getDataSet(tden_str).read(tP); + file.getDataSet(fxc_str).read(FXC_ref); if (not rks) { - FXCz_ref = matrix_type(dims[0], dims[1]); - dset = file.getDataSet("/FXC_Z"); - dset.read(FXCz_ref.data()); - tPz = matrix_type(dims[0], dims[1]); - dset = file.getDataSet("/TRIAL_DENSITY_Z"); - dset.read(tPz.data()); + file.getDataSet("/FXC_Z").read(FXCz_ref); + file.getDataSet("/TRIAL_DENSITY_Z").read(tPz); } } diff --git a/tests/c_api_test.cxx b/tests/c_api_test.cxx index 3752a8d28..be04dc446 100644 --- a/tests/c_api_test.cxx +++ b/tests/c_api_test.cxx @@ -1153,7 +1153,7 @@ TEST_CASE("C-API XCIntegrator", "[c-api]") { auto dims = dset.getDimensions(); int64_t m = dims[0], n = dims[1]; std::vector P(m * n); - dset.read(P.data()); + dset.read(P); double den = 0.0; C::gauxc_integrator_integrate_den( @@ -1175,10 +1175,9 @@ TEST_CASE("C-API XCIntegrator", "[c-api]") { auto dims = dset.getDimensions(); int64_t m = dims[0], n = dims[1]; std::vector P(m * n); - dset.read(P.data()); + dset.read(P); - double EXC_ref; - file.getDataSet("/EXC").read(&EXC_ref); + double EXC_ref = file.getDataSet("/EXC").read(); double exc = 0.0; C::gauxc_integrator_eval_exc_rks( @@ -1198,12 +1197,10 @@ TEST_CASE("C-API XCIntegrator", "[c-api]") { auto dims = dset.getDimensions(); int64_t m = dims[0], n = dims[1]; std::vector P(m * n); - dset.read(P.data()); + dset.read(P); - double EXC_ref; - file.getDataSet("/EXC").read(&EXC_ref); - std::vector VXC_ref(m * n); - file.getDataSet("/VXC").read(VXC_ref.data()); + double EXC_ref = file.getDataSet("/EXC").read(); + std::vector VXC_ref = file.getDataSet("/VXC").read>(); double exc = 0.0; std::vector vxc(m * n, 0.0); @@ -1233,7 +1230,7 @@ TEST_CASE("C-API XCIntegrator", "[c-api]") { auto dims = dset.getDimensions(); int64_t m = dims[0], n = dims[1]; std::vector P(m * n); - dset.read(P.data()); + dset.read(P); double exc1 = 0.0, exc2 = 0.0; std::vector vxc1(m * n, 0.0), vxc2(m * n, 0.0); @@ -1263,11 +1260,11 @@ TEST_CASE("C-API XCIntegrator", "[c-api]") { int64_t m = dims[0], n = dims[1]; std::vector Ps(m * n), Pz(m * n); - file.getDataSet("/DENSITY_SCALAR").read(Ps.data()); - file.getDataSet("/DENSITY_Z").read(Pz.data()); + file.getDataSet("/DENSITY_SCALAR").read(Ps); + file.getDataSet("/DENSITY_Z").read(Pz); double EXC_ref; - file.getDataSet("/EXC").read(&EXC_ref); + file.getDataSet("/EXC").read(EXC_ref); double exc = 0.0; C::gauxc_integrator_eval_exc_uks( @@ -1287,15 +1284,14 @@ TEST_CASE("C-API XCIntegrator", "[c-api]") { int64_t m = dims[0], n = dims[1]; std::vector Ps(m * n), Pz(m * n); - file.getDataSet("/DENSITY_SCALAR").read(Ps.data()); - file.getDataSet("/DENSITY_Z").read(Pz.data()); + file.getDataSet("/DENSITY_SCALAR").read(Ps); + file.getDataSet("/DENSITY_Z").read(Pz); - double EXC_ref; - file.getDataSet("/EXC").read(&EXC_ref); + double EXC_ref = file.getDataSet("/EXC").read(); std::vector VXCs_ref(m * n), VXCz_ref(m * n); - file.getDataSet("/VXC_SCALAR").read(VXCs_ref.data()); - file.getDataSet("/VXC_Z").read(VXCz_ref.data()); + file.getDataSet("/VXC_SCALAR").read(VXCs_ref); + file.getDataSet("/VXC_Z").read(VXCz_ref); double exc = 0.0; std::vector vxc_s(m * n, 0.0), vxc_z(m * n, 0.0); @@ -1338,13 +1334,13 @@ TEST_CASE("C-API XCIntegrator", "[c-api]") { int64_t m = dims[0], n = dims[1]; std::vector Ps(m * n), Pz(m * n), Py(m * n), Px(m * n); - file.getDataSet("/DENSITY_SCALAR").read(Ps.data()); - file.getDataSet("/DENSITY_Z").read(Pz.data()); - file.getDataSet("/DENSITY_Y").read(Py.data()); - file.getDataSet("/DENSITY_X").read(Px.data()); + file.getDataSet("/DENSITY_SCALAR").read(Ps); + file.getDataSet("/DENSITY_Z").read(Pz); + file.getDataSet("/DENSITY_Y").read(Py); + file.getDataSet("/DENSITY_X").read(Px); double EXC_ref; - file.getDataSet("/EXC").read(&EXC_ref); + file.getDataSet("/EXC").read(EXC_ref); double exc = 0.0; C::gauxc_integrator_eval_exc_gks( @@ -1375,19 +1371,18 @@ TEST_CASE("C-API XCIntegrator", "[c-api]") { int64_t m = dims[0], n = dims[1]; std::vector Ps(m * n), Pz(m * n), Py(m * n), Px(m * n); - file.getDataSet("/DENSITY_SCALAR").read(Ps.data()); - file.getDataSet("/DENSITY_Z").read(Pz.data()); - file.getDataSet("/DENSITY_Y").read(Py.data()); - file.getDataSet("/DENSITY_X").read(Px.data()); + file.getDataSet("/DENSITY_SCALAR").read(Ps); + file.getDataSet("/DENSITY_Z").read(Pz); + file.getDataSet("/DENSITY_Y").read(Py); + file.getDataSet("/DENSITY_X").read(Px); - double EXC_ref; - file.getDataSet("/EXC").read(&EXC_ref); + double EXC_ref = file.getDataSet("/EXC").read(); std::vector VXCs_ref(m * n), VXCz_ref(m * n), VXCy_ref(m * n), VXCx_ref(m * n); - file.getDataSet("/VXC_SCALAR").read(VXCs_ref.data()); - file.getDataSet("/VXC_Z").read(VXCz_ref.data()); - file.getDataSet("/VXC_Y").read(VXCy_ref.data()); - file.getDataSet("/VXC_X").read(VXCx_ref.data()); + file.getDataSet("/VXC_SCALAR").read(VXCs_ref); + file.getDataSet("/VXC_Z").read(VXCz_ref); + file.getDataSet("/VXC_Y").read(VXCy_ref); + file.getDataSet("/VXC_X").read(VXCx_ref); double exc = 0.0; std::vector vxc_s(m * n, 0.0), vxc_z(m * n, 0.0), @@ -1426,10 +1421,9 @@ TEST_CASE("C-API XCIntegrator", "[c-api]") { auto dims = dset.getDimensions(); int64_t m = dims[0], n = dims[1]; std::vector P(m * n); - dset.read(P.data()); + dset.read(P); - double EXC_ref; - file.getDataSet("/EXC").read(&EXC_ref); + double EXC_ref = file.getDataSet("/EXC").read(); double exc = 0.0; C::gauxc_integrator_eval_exc_rks( diff --git a/tests/dd_psi_potential_test.cxx b/tests/dd_psi_potential_test.cxx index 9af2844e5..e9ed22b88 100644 --- a/tests/dd_psi_potential_test.cxx +++ b/tests/dd_psi_potential_test.cxx @@ -19,6 +19,7 @@ #include #include +#include #include using namespace GauXC; @@ -37,24 +38,15 @@ void test_dd_psi ( HighFive::File file( reference_file, HighFive::File::ReadOnly ); std::string den_str = "/DENSITY"; - auto dset = file.getDataSet(den_str); - auto dims = dset.getDimensions(); - P = matrix_type( dims[0], dims[1] ); - dset.read( P.data() ); + file.getDataSet(den_str).read( P ); int nharmonics = (lmax + 1) * (lmax + 1); - ddX = matrix_type( nharmonics, mol.size() ); - dset = file.getDataSet("/DD_X"); - dset.read(ddX.data()); + file.getDataSet("/DD_X").read( ddX ); - ddPsi_ref = matrix_type( mol.size(), nharmonics ); - dset = file.getDataSet("/DD_PSI"); - dset.read( ddPsi_ref.data()); + file.getDataSet("/DD_PSI").read( ddPsi_ref ); - ddPsi_potential_ref = matrix_type( basis.nbf(), basis.nbf() ); - dset = file.getDataSet("/DD_PSI_POTENTIAL"); - dset.read( ddPsi_potential_ref.data() ); + file.getDataSet("/DD_PSI_POTENTIAL").read( ddPsi_potential_ref ); #ifdef GAUXC_HAS_DEVICE @@ -99,4 +91,4 @@ TEST_CASE( "DD PSI & PSI POTENTIAL", "[dd]" ) { test_dd_psi( GAUXC_REF_DATA_PATH "/c2h4_l8_dd_psi_potential.hdf5" ); } } - \ No newline at end of file + diff --git a/tests/grid_opt.cxx b/tests/grid_opt.cxx index 1fa2237f6..f960d5956 100644 --- a/tests/grid_opt.cxx +++ b/tests/grid_opt.cxx @@ -17,6 +17,7 @@ #include #include +#include #include "ini_input.hpp" #include #define EIGEN_DONT_VECTORIZE @@ -86,16 +87,12 @@ int main(int argc, char** argv) { matrix_type P; { HighFive::File file( ref_file, HighFive::File::ReadOnly ); - auto dset = file.getDataSet("/DENSITY"); - auto dims = dset.getDimensions(); - P = matrix_type( dims[0], dims[1] ); + file.getDataSet("/DENSITY").read( P ); if( P.rows() != P.cols() ) throw std::runtime_error("Density Must Be Square"); if( P.rows() != basis.nbf() ) throw std::runtime_error("Density Not Compatible With Basis"); - - dset.read( P.data() ); } auto run_integration = [&](auto scheme){ diff --git a/tests/hdf5_test_serialization.hpp b/tests/hdf5_test_serialization.hpp index fa7461261..f29f48897 100644 --- a/tests/hdf5_test_serialization.hpp +++ b/tests/hdf5_test_serialization.hpp @@ -51,9 +51,8 @@ inline void read_points_array(std::vector>& pts, return; } - auto dset = file.getDataSet(dset_name); std::vector> pts_2d; - dset.read(pts_2d); + auto dset = file.getDataSet(dset_name).read(pts_2d); pts.resize(pts_2d.size()); for (size_t i = 0; i < pts_2d.size(); ++i) { @@ -180,12 +179,7 @@ inline void read_xctask_vector(std::vector& tasks, HighFive::File file(filename, HighFive::File::ReadOnly); // Read number of tasks - size_t ntasks; - { - auto dset = file.getDataSet(group_name + "/ntasks"); - dset.read(&ntasks); - } - + size_t ntasks = file.getDataSet(group_name + "/ntasks").read(); tasks.resize(ntasks); // Read each task diff --git a/tests/hdf5_test_serialization_impl.hpp b/tests/hdf5_test_serialization_impl.hpp index 99a0c70d8..9a630e1eb 100644 --- a/tests/hdf5_test_serialization_impl.hpp +++ b/tests/hdf5_test_serialization_impl.hpp @@ -61,10 +61,7 @@ inline void read_collocation_data(std::vector& ref_data, // Read number of data entries size_t nentries; - { - auto dset = file.getDataSet("/nentries"); - dset.read(&nentries); - } + file.getDataSet("/nentries").read(nentries); ref_data.resize(nentries); diff --git a/tests/orbital_evaluator_test.cxx b/tests/orbital_evaluator_test.cxx index e0a093832..6ee9ebd9b 100644 --- a/tests/orbital_evaluator_test.cxx +++ b/tests/orbital_evaluator_test.cxx @@ -1482,7 +1482,7 @@ TEST_CASE("write_cube_hdf5 round-trip", "[cube]") { CHECK(dims[2] == static_cast(grid.nz)); std::vector read_field(npts); - ds.read(read_field.data()); + ds.read(read_field); for (int64_t i = 0; i < npts; ++i) { CHECK(read_field[i] == Approx(field[i]).epsilon(1e-14)); } @@ -1520,7 +1520,7 @@ TEST_CASE("write_cube_hdf5 round-trip", "[cube]") { } std::vector coords(mol.size() * 3); - grp_atoms.getDataSet("coords").read(coords.data()); + grp_atoms.getDataSet("coords").read(coords); for (size_t i = 0; i < mol.size(); ++i) { CHECK(coords[3 * i + 0] == Approx(mol[i].x).epsilon(1e-14)); CHECK(coords[3 * i + 1] == Approx(mol[i].y).epsilon(1e-14)); diff --git a/tests/standalone_driver.cxx b/tests/standalone_driver.cxx index f4af33756..b77b97c88 100644 --- a/tests/standalone_driver.cxx +++ b/tests/standalone_driver.cxx @@ -251,44 +251,25 @@ int main(int argc, char** argv) { } - auto dset = file.getDataSet(den_str); - auto dims = dset.getDimensions(); - P = matrix_type( dims[0], dims[1] ); - VXC_ref = matrix_type( dims[0], dims[1] ); - K_ref = matrix_type( dims[0], dims[1] ); - if (not rks) { - Pz = matrix_type( dims[0], dims[1] ); - VXCz_ref = matrix_type( dims[0], dims[1] ); - } - if (gks) { - Py = matrix_type( dims[0], dims[1] ); - VXCy_ref = matrix_type( dims[0], dims[1] ); - Px = matrix_type( dims[0], dims[1] ); - VXCx_ref = matrix_type( dims[0], dims[1] ); - } + file.getDataSet(den_str).read( P ); if( P.rows() != P.cols() ) GAUXC_GENERIC_EXCEPTION("Density Must Be Square"); if( P.rows() != basis.nbf() ) GAUXC_GENERIC_EXCEPTION("Density Not Compatible With Basis"); - dset.read( P.data() ); if( not rks) { - dset = file.getDataSet("/DENSITY_Z"); - dset.read( Pz.data() ); + file.getDataSet("/DENSITY_Z").read( Pz ); } if(gks) { - dset = file.getDataSet("/DENSITY_Y"); - dset.read( Py.data() ); - dset = file.getDataSet("/DENSITY_X"); - dset.read( Px.data() ); + file.getDataSet("/DENSITY_Y").read( Py ); + file.getDataSet("/DENSITY_X").read( Px ); } if( integrate_vxc ) { try { - dset = file.getDataSet(vxc_str); - dset.read( VXC_ref.data() ); + file.getDataSet(vxc_str).read( VXC_ref ); } catch(...) { if(world_rank == 0) { std::cout << "** Warning: Could Not Find Reference VXC" << std::endl; @@ -297,8 +278,7 @@ int main(int argc, char** argv) { } if( not rks ) { try { - dset = file.getDataSet("/VXC_Z"); - dset.read( VXCz_ref.data() ); + file.getDataSet("/VXC_Z").read( VXCz_ref ); } catch(...) { if(world_rank == 0) { std::cout << "** Warning: Could Not Find Reference VXCz" << std::endl; @@ -308,10 +288,8 @@ int main(int argc, char** argv) { } if( gks ) { try { - dset = file.getDataSet("/VXC_Y"); - dset.read( VXCy_ref.data() ); - dset = file.getDataSet("/VXC_X"); - dset.read( VXCx_ref.data() ); + file.getDataSet("/VXC_Y").read( VXCy_ref ); + file.getDataSet("/VXC_X").read( VXCx_ref ); } catch(...) { if(world_rank == 0) { std::cout << "** Warning: Could Not Find Reference VXCy/x" << std::endl; @@ -322,8 +300,7 @@ int main(int argc, char** argv) { } try { - dset = file.getDataSet("/EXC"); - dset.read( &EXC_ref ); + EXC_ref = file.getDataSet("/EXC").read(); } catch(...) { if(world_rank == 0) { std::cout << "** Warning: Could Not Find Reference EXC" << std::endl; @@ -339,7 +316,7 @@ int main(int argc, char** argv) { auto xc_grad_dims = dset.getDimensions(); if( xc_grad_dims[0] != mol.size() or xc_grad_dims[1] != 3 ) GAUXC_GENERIC_EXCEPTION("Incorrect dims for EXC_GRAD"); - dset.read( EXC_GRAD_ref.data() ); + dset.read( EXC_GRAD_ref ); } catch(...) { if(world_rank == 0) { std::cout << "** Warning: Could Not Find Reference EXC_GRAD" @@ -351,8 +328,7 @@ int main(int argc, char** argv) { if( integrate_exx ) { try { - dset = file.getDataSet("/K"); - dset.read( K_ref.data() ); + file.getDataSet("/K").read( K_ref ); } catch(...) { if(world_rank == 0) { std::cout << "** Warning: Could Not Find Reference K" << std::endl; @@ -365,7 +341,7 @@ int main(int argc, char** argv) { ddPsi_ref = matrix_type( mol.size(), nharmonics ); try { dset = file.getDataSet("/DD_PSI"); - dset.read( ddPsi_ref.data()); + dset.read( ddPsi_ref ); auto dd_psi_dims = dset.getDimensions(); if (dd_psi_dims[0] != mol.size() or dd_psi_dims[1] != nharmonics) GAUXC_GENERIC_EXCEPTION("Incorrect dims for DD_PSI"); @@ -386,7 +362,7 @@ int main(int argc, char** argv) { auto dd_x_dims = dset.getDimensions(); if (dd_x_dims[0] != nharmonics or dd_x_dims[1] != mol.size()) GAUXC_GENERIC_EXCEPTION("Incorrect dims for DD_X"); - dset.read(ddX.data()); + dset.read( ddX ); } catch(...) { throw std::runtime_error("Could Not Find Input DD_X for DD_PSI_POTENTIAL"); } @@ -395,7 +371,7 @@ int main(int argc, char** argv) { auto dd_psi_potential_dims = dset.getDimensions(); if (dd_psi_potential_dims[0] != basis.nbf() or dd_psi_potential_dims[1] != basis.nbf()) GAUXC_GENERIC_EXCEPTION("Incorrect dims for DD_PSI_POTENTIAL"); - dset.read(ddPsi_potential_ref.data()); + dset.read( ddPsi_potential_ref ); } catch(...) { if(world_rank == 0) { std::cout << "** Warning: Could Not Find Reference DD_PSI_POTENTIAL" << std::endl; @@ -409,11 +385,11 @@ int main(int argc, char** argv) { dset = file.getDataSet("/FXC"); auto fxc_dims = dset.getDimensions(); FXC_ref = matrix_type( fxc_dims[0], fxc_dims[1] ); - dset.read( FXC_ref.data() ); + dset.read( FXC_ref ); if( not rks ) { dset = file.getDataSet("/FXC_Z"); FXCz_ref = matrix_type( fxc_dims[0], fxc_dims[1] ); - dset.read( FXCz_ref.data() ); + dset.read( FXCz_ref ); } } catch(...) { if(world_rank == 0) { @@ -533,27 +509,18 @@ int main(int argc, char** argv) { } try { - auto dset = file.getDataSet(tden_str); - auto dims = dset.getDimensions(); - tP = matrix_type(dims[0], dims[1]); - dset.read(tP.data()); + file.getDataSet(tden_str).read(tP); if (!rks) { - dset = file.getDataSet("/TRIAL_DENSITY_Z"); - tPz = matrix_type(dims[0], dims[1]); - dset.read(tPz.data()); + file.getDataSet("/TRIAL_DENSITY_Z").read(tPz); } // Also try to read reference FXC matrices if available try { - dset = file.getDataSet(fxc_str); - FXC_ref = matrix_type(dims[0], dims[1]); - dset.read(FXC_ref.data()); + file.getDataSet(fxc_str).read(FXC_ref); if (!rks) { - dset = file.getDataSet("/FXC_Z"); - FXCz_ref = matrix_type(dims[0], dims[1]); - dset.read(FXCz_ref.data()); + file.getDataSet("/FXC_Z").read(FXCz_ref); } } catch(...) { if(world_rank == 0) { diff --git a/tests/xc_integrator.cxx b/tests/xc_integrator.cxx index 08f4ca214..2db409dcc 100644 --- a/tests/xc_integrator.cxx +++ b/tests/xc_integrator.cxx @@ -19,6 +19,7 @@ #include #include +#include #include using namespace GauXC; @@ -72,51 +73,26 @@ void test_xc_integrator( ExecutionSpace ex, const RuntimeEnvironment& rt, gks=true; } - auto dset = file.getDataSet(den); - - auto dims = dset.getDimensions(); - P = matrix_type( dims[0], dims[1] ); - VXC_ref = matrix_type( dims[0], dims[1] ); - if (not rks) { - Pz = matrix_type( dims[0], dims[1] ); - VXCz_ref = matrix_type( dims[0], dims[1] ); - } - if (gks) { - Py = matrix_type( dims[0], dims[1] ); - VXCy_ref = matrix_type( dims[0], dims[1] ); - Px = matrix_type( dims[0], dims[1] ); - VXCx_ref = matrix_type( dims[0], dims[1] ); - } - - - dset.read( P.data() ); - dset = file.getDataSet(vxc); - dset.read( VXC_ref.data() ); + file.getDataSet(den).read( P ); + file.getDataSet(vxc).read( VXC_ref ); if (not rks) { - dset = file.getDataSet(den2); - dset.read( Pz.data() ); - dset = file.getDataSet(vxc2); - dset.read( VXCz_ref.data() ); + file.getDataSet(den2).read( Pz ); + file.getDataSet(vxc2).read( VXCz_ref ); } if (gks) { - dset = file.getDataSet(den3); - dset.read( Py.data() ); - dset = file.getDataSet(vxc3); - dset.read( VXCy_ref.data() ); - dset = file.getDataSet(den4); - dset.read( Px.data() ); - dset = file.getDataSet(vxc4); - dset.read( VXCx_ref.data() ); + file.getDataSet(den3).read( Py ); + file.getDataSet(vxc3).read( VXCy_ref ); + file.getDataSet(den4).read( Px ); + file.getDataSet(vxc4).read( VXCx_ref ); } - dset = file.getDataSet("/EXC"); - dset.read( &EXC_ref ); + file.getDataSet("/EXC").read( EXC_ref ); // Check for new unified /EXC_GRAD dataset with attribute if( file.exist("/EXC_GRAD") ) { - dset = file.getDataSet("/EXC_GRAD"); + auto dset = file.getDataSet("/EXC_GRAD"); EXC_GRAD_ref_Full.resize( 3*mol.size() ); // Check for attribute indicating whether weight derivatives are included @@ -129,32 +105,29 @@ void test_xc_integrator( ExecutionSpace ex, const RuntimeEnvironment& rt, } catch(... ) { } if( exc_grad_includes_weight_derivatives ) { - dset.read( EXC_GRAD_ref_Full.data() ); + dset.read( EXC_GRAD_ref_Full ); has_exc_grad_full = true; } else { - dset.read( EXC_GRAD_ref_HellFey.data() ); + dset.read( EXC_GRAD_ref_HellFey ); has_exc_grad_HellFey = true; } } // Check for other type of EXC_GRAD if( file.exist("/EXC_GRAD_HELLFEY") and not has_exc_grad_HellFey ) { EXC_GRAD_ref_HellFey.resize( 3*mol.size() ); - dset = file.getDataSet("/EXC_GRAD_HELLFEY"); - dset.read( EXC_GRAD_ref_HellFey.data() ); + file.getDataSet("/EXC_GRAD_HELLFEY").read( EXC_GRAD_ref_HellFey ); has_exc_grad_HellFey = true; } if( file.exist("/EXC_GRAD_FULL") and not has_exc_grad_full ) { EXC_GRAD_ref_Full.resize( 3*mol.size() ); - dset = file.getDataSet("/EXC_GRAD_FULL"); - dset.read( EXC_GRAD_ref_Full.data() ); + file.getDataSet("/EXC_GRAD_FULL").read( EXC_GRAD_ref_Full ); has_exc_grad_full = true; } has_k = file.exist("/K"); if(has_k) { K_ref = matrix_type(dims[0], dims[1]); - dset = file.getDataSet("/K"); - dset.read( K_ref.data() ); + file.getDataSet("/K").read( K_ref ); } } From cce2fd8ea6017017db870ee7868cb10c209e739d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikael=20=C3=96hman?= Date: Fri, 13 Nov 2026 19:29:58 +0100 Subject: [PATCH 2/3] Drop unnecessary size --- tests/standalone_driver.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/standalone_driver.cxx b/tests/standalone_driver.cxx index b77b97c88..75d6ba561 100644 --- a/tests/standalone_driver.cxx +++ b/tests/standalone_driver.cxx @@ -384,11 +384,9 @@ int main(int argc, char** argv) { try { dset = file.getDataSet("/FXC"); auto fxc_dims = dset.getDimensions(); - FXC_ref = matrix_type( fxc_dims[0], fxc_dims[1] ); dset.read( FXC_ref ); if( not rks ) { dset = file.getDataSet("/FXC_Z"); - FXCz_ref = matrix_type( fxc_dims[0], fxc_dims[1] ); dset.read( FXCz_ref ); } } catch(...) { From e79ec5f69620982f931b4cc800da3632fb80a3b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikael=20=C3=96hman?= Date: Fri, 13 Nov 2026 19:43:11 +0100 Subject: [PATCH 3/3] Revert inline highfive read to be consistent --- tests/c_api_test.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/c_api_test.cxx b/tests/c_api_test.cxx index be04dc446..db0662bbc 100644 --- a/tests/c_api_test.cxx +++ b/tests/c_api_test.cxx @@ -1200,7 +1200,8 @@ TEST_CASE("C-API XCIntegrator", "[c-api]") { dset.read(P); double EXC_ref = file.getDataSet("/EXC").read(); - std::vector VXC_ref = file.getDataSet("/VXC").read>(); + std::vector VXC_ref(m * n); + file.getDataSet("/VXC").read(VXC); double exc = 0.0; std::vector vxc(m * n, 0.0);