Skip to content

Commit 62fea07

Browse files
Remove Cereal from GauXC (#163)
1 parent d9cdad3 commit 62fea07

36 files changed

Lines changed: 545 additions & 390 deletions

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ for flexible and agile development in the field of KS-DFT.
5151
* [Gau2Grid](https://github.com/dgasmith/gau2grid) (pregenerated source packaged with GauXC)
5252
* MPI (Optional)
5353
* OpenMP (CPU parallelism, Optional)
54-
* [Cereal](https://github.com/USCiLab/cereal) (Optional)
5554
* [HDF5](https://www.hdfgroup.org/solutions/hdf5/) (Optional)
5655
* [Eigen3](https://eigen.tuxfamily.org/dox/) (Testing Only)
5756
* [CUDA](https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html)/[cuBLAS](https://docs.nvidia.com/cuda/cublas/index.html) (Required only if CUDA enabled)

cmake/BuildFindCereal.cmake

Lines changed: 0 additions & 32 deletions
This file was deleted.

cmake/gauxc-cereal.cmake

Lines changed: 0 additions & 1 deletion
This file was deleted.

cmake/gauxc-dep-versions.cmake

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
set( GAUXC_LINALG_MODULES_REPOSITORY https://github.com/wavefunction91/linalg-cmake-modules.git )
22
set( GAUXC_LINALG_MODULES_REVISION 9d2c273a671d6811e9fd432f6a4fa3d915b144b8 )
33

4-
set( GAUXC_CEREAL_REPOSITORY https://github.com/USCiLab/cereal.git )
5-
set( GAUXC_CEREAL_REVISION v1.3.0 )
6-
74
set( GAUXC_CUB_REPOSITORY https://github.com/NVIDIA/cub.git )
85
set( GAUXC_CUB_REVISION 1.10.0 )
96

include/gauxc/atom.hpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,6 @@ struct Atom {
4646
Atom( AtomicNumber _Z, double _x, double _y, double _z ) :
4747
Z(_Z), x(_x), y(_y), z(_z) { }
4848

49-
/**
50-
* @brief (De)serialize an atom object to/from a particular cereal archive
51-
*
52-
* @tparam Archive Cereal archive type
53-
*
54-
* @param[in/out] ar Cereal archive
55-
*/
56-
template <typename Archive>
57-
void serialize( Archive& ar ) {
58-
ar( Z, x, y, z );
59-
}
60-
6149
}; // struct Atom
6250

6351
/**

include/gauxc/external/cereal.hpp

Lines changed: 0 additions & 16 deletions
This file was deleted.

tests/CMakeLists.txt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ else()
3939
endif()
4040

4141
include( gauxc-eigen3 )
42-
include( gauxc-cereal )
4342

4443
#add_library( catch2_main STATIC ut_main.cxx)
4544
#target_link_libraries( catch2_main PUBLIC gauxc_catch2 )
@@ -68,7 +67,7 @@ add_executable( gauxc_test
6867
dd_psi_potential_test.cxx
6968
2nd_derivative_test.cxx
7069
)
71-
target_link_libraries( gauxc_test PUBLIC gauxc gauxc_catch2 Eigen3::Eigen cereal )
70+
target_link_libraries( gauxc_test PUBLIC gauxc gauxc_catch2 Eigen3::Eigen )
7271
if(GAUXC_ENABLE_CUTLASS)
7372
include(gauxc-cutlass)
7473
target_link_libraries(gauxc_test PUBLIC gauxc_cutlass)
@@ -82,19 +81,15 @@ target_include_directories( gauxc_test PRIVATE ${PROJECT_SOURCE_DIR}/tests )
8281

8382

8483
add_executable( standalone_driver standalone_driver.cxx standards.cxx basis/parse_basis.cxx ini_input.cxx )
85-
target_link_libraries( standalone_driver PUBLIC gauxc gauxc_catch2 Eigen3::Eigen cereal )
84+
target_link_libraries( standalone_driver PUBLIC gauxc gauxc_catch2 Eigen3::Eigen )
8685
target_include_directories( standalone_driver PRIVATE ${PROJECT_BINARY_DIR}/tests )
8786
target_include_directories( standalone_driver PRIVATE ${PROJECT_SOURCE_DIR}/tests )
8887

8988
#add_executable( grid_opt grid_opt.cxx standards.cxx basis/parse_basis.cxx ini_input.cxx )
90-
#target_link_libraries( grid_opt PUBLIC gauxc gauxc_catch2 Eigen3::Eigen cereal )
89+
#target_link_libraries( grid_opt PUBLIC gauxc gauxc_catch2 Eigen3::Eigen )
9190
#target_include_directories( grid_opt PRIVATE ${PROJECT_BINARY_DIR}/tests )
9291
#target_include_directories( grid_opt PRIVATE ${PROJECT_SOURCE_DIR}/tests )
9392

94-
#add_executable( conv_cereal_to_hdf5 conv_cereal_to_hdf5.cxx standards.cxx basis/parse_basis.cxx )
95-
#target_link_libraries( conv_cereal_to_hdf5 PUBLIC gauxc gauxc_catch2 Eigen3::Eigen cereal )
96-
#target_include_directories( conv_cereal_to_hdf5 PRIVATE ${PROJECT_BINARY_DIR}/tests )
97-
#target_include_directories( conv_cereal_to_hdf5 PRIVATE ${PROJECT_SOURCE_DIR}/tests )
9893

9994
add_test( NAME GAUXC_SERIAL_TEST COMMAND $<TARGET_FILE:gauxc_test> )
10095
if( GAUXC_ENABLE_MPI )

tests/collocation.cxx

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,64 +37,66 @@ TEST_CASE( "Water / cc-pVDZ", "[collocation]" ) {
3737

3838
#ifdef GENERATE_TESTS
3939

40-
std::ofstream ref_data( "water_cc-pVDZ_collocation.bin", std::ios::binary );
41-
generate_collocation_data( mol, basis, ref_data );
40+
generate_collocation_data( mol, basis, "water_cc-pVDZ_collocation.hdf5" );
4241

4342
#else
4443

45-
std::ifstream ref_data( GAUXC_REF_DATA_PATH "/water_cc-pVDZ_collocation.bin",
46-
std::ios::binary );
44+
std::string ref_file = GAUXC_REF_DATA_PATH "/water_cc-pVDZ_collocation.hdf5";
4745

4846
#ifdef GAUXC_HAS_HOST
4947
SECTION( "Host Eval" ) {
50-
test_host_collocation( basis, ref_data );
48+
test_host_collocation( basis, ref_file );
5149
}
5250

5351
SECTION( "Host Eval Grad" ) {
54-
test_host_collocation_deriv1( basis, ref_data );
52+
test_host_collocation_deriv1( basis, ref_file );
5553
}
5654

5755
SECTION( "Host Eval Hessian" ) {
58-
test_host_collocation_deriv2( basis, ref_data );
56+
test_host_collocation_deriv2( basis, ref_file );
57+
}
58+
59+
SECTION( "Host Eval Laplacian Gradient" ) {
60+
test_host_collocation_deriv3( basis, ref_file );
5961
}
6062
#endif
6163

6264
#ifdef GAUXC_HAS_CUDA
6365
BasisSetMap basis_map( basis, mol );
6466
SECTION( "CUDA Eval" ) {
65-
test_cuda_collocation( basis, ref_data );
67+
test_cuda_collocation( basis, ref_file );
6668
}
6769
SECTION( "CUDA Shell to Task Eval" ) {
68-
test_cuda_collocation_shell_to_task( basis, basis_map, ref_data );
70+
test_cuda_collocation_shell_to_task( basis, basis_map, ref_file );
6971
}
7072

7173
SECTION( "CUDA Eval Grad" ) {
72-
test_cuda_collocation_deriv1( basis, ref_data );
74+
test_cuda_collocation_deriv1( basis, ref_file );
7375
}
7476
SECTION( "CUDA Shell to Task Eval Grad" ) {
75-
test_cuda_collocation_shell_to_task_gradient( basis, basis_map, ref_data );
77+
test_cuda_collocation_shell_to_task_gradient( basis, basis_map, ref_file );
7678
}
7779

7880
SECTION( "CUDA Shell to Task Eval Hessian" ) {
79-
test_cuda_collocation_shell_to_task_hessian( basis, basis_map, ref_data );
81+
test_cuda_collocation_shell_to_task_hessian( basis, basis_map, ref_file );
8082
}
8183

8284
SECTION( "CUDA Shell to Task Eval Laplacian" ) {
83-
test_cuda_collocation_shell_to_task_laplacian( basis, basis_map, ref_data );
85+
test_cuda_collocation_shell_to_task_laplacian( basis, basis_map, ref_file );
8486
}
8587

8688
SECTION( "CUDA Shell to Task Eval Laplacian Gradient" ) {
87-
test_cuda_collocation_shell_to_task_lapgrad( basis, basis_map, ref_data );
89+
test_cuda_collocation_shell_to_task_lapgrad( basis, basis_map, ref_file );
8890
}
8991
#endif // GAUXC_HAS_CUDA
9092

9193
#ifdef GAUXC_HAS_HIP
9294
SECTION( "HIP Eval" ) {
93-
test_hip_collocation( basis, ref_data );
95+
test_hip_collocation( basis, ref_file );
9496
}
9597

9698
SECTION( "HIP Eval Grad" ) {
97-
test_hip_collocation_deriv1( basis, ref_data );
99+
test_hip_collocation_deriv1( basis, ref_file );
98100
}
99101
#endif // GAUXC_HAS_HIP
100102

tests/collocation_common.hpp

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,20 @@ struct ref_collocation_data {
4949

5050
};
5151

52-
void check_collocation_transpose( int npts, int nbf, const double* ref_val, const double* comp_val, std::string msg = "" ) {
52+
// Weights reference data structure
53+
struct ref_weights_data {
54+
Molecule mol;
55+
std::shared_ptr<MolMeta> meta;
56+
std::vector<XCTask> tasks_unm;
57+
std::vector<XCTask> tasks_mod;
58+
59+
template <typename Archive>
60+
void serialize( Archive& ar ) {
61+
ar( mol, tasks_unm, tasks_mod );
62+
}
63+
};
64+
65+
inline void check_collocation_transpose( int npts, int nbf, const double* ref_val, const double* comp_val, std::string msg = "" ) {
5366

5467
// Check transpose
5568
for( int i = 0; i < nbf; ++i )
@@ -60,7 +73,7 @@ void check_collocation_transpose( int npts, int nbf, const double* ref_val, cons
6073

6174
}
6275

63-
void check_collocation( int npts, int nbf, const double* ref_val, const double* comp_val ) {
76+
inline void check_collocation( int npts, int nbf, const double* ref_val, const double* comp_val ) {
6477

6578
for( int i = 0; i < nbf; ++i )
6679
for( int j = 0; j < npts; ++j ) {

tests/collocation_cuda.hpp

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
*/
1212
#ifdef GAUXC_HAS_CUDA
1313
#include "collocation_common.hpp"
14+
#include "hdf5_test_serialization.hpp"
15+
#include "hdf5_test_serialization_impl.hpp"
1416
#include "device/common/collocation_device.hpp"
1517
#include "device_specific/cuda_util.hpp"
1618
#include <gauxc/basisset_map.hpp>
@@ -215,16 +217,12 @@ void cuda_check_collocation( const std::vector<XCDeviceTask>& tasks,
215217

216218

217219

218-
void test_cuda_collocation_masked_combined( const BasisSet<double>& basis, std::ifstream& in_file, bool grad ) {
220+
void test_cuda_collocation_masked_combined( const BasisSet<double>& basis, const std::string& filename, bool grad ) {
219221

220222

221223

222224
std::vector<ref_collocation_data> ref_data;
223-
224-
{
225-
cereal::BinaryInputArchive ar( in_file );
226-
ar( ref_data );
227-
}
225+
read_collocation_data(ref_data, filename);
228226

229227

230228
device_queue stream( std::make_shared<util::cuda_stream>() );
@@ -264,15 +262,16 @@ void test_cuda_collocation_masked_combined( const BasisSet<double>& basis, std::
264262
}
265263

266264
void test_cuda_collocation( const BasisSet<double>& basis,
267-
std::ifstream& in_file ) {
265+
const std::string& filename ) {
268266

269-
test_cuda_collocation_masked_combined( basis, in_file, false );
267+
test_cuda_collocation_masked_combined( basis, filename, false );
270268

271269
}
270+
272271
void test_cuda_collocation_deriv1( const BasisSet<double>& basis,
273-
std::ifstream& in_file ) {
272+
const std::string& filename ) {
274273

275-
test_cuda_collocation_masked_combined( basis, in_file, true );
274+
test_cuda_collocation_masked_combined( basis, filename, true );
276275

277276
}
278277

@@ -291,14 +290,11 @@ void test_cuda_collocation_deriv1( const BasisSet<double>& basis,
291290

292291

293292
void test_cuda_collocation_shell_to_task( const BasisSet<double>& basis, const BasisSetMap& basis_map,
294-
std::ifstream& in_file, bool grad, bool hess, bool lapl, bool lapl_grad) {
293+
const std::string& filename, bool grad, bool hess, bool lapl, bool lapl_grad) {
295294

296295
// Load reference data
297296
std::vector<ref_collocation_data> ref_data;
298-
{
299-
cereal::BinaryInputArchive ar( in_file );
300-
ar( ref_data );
301-
}
297+
read_collocation_data(ref_data, filename);
302298

303299
// Populate base task information
304300
device_queue stream( std::make_shared<util::cuda_stream>() );
@@ -435,35 +431,35 @@ void test_cuda_collocation_shell_to_task( const BasisSet<double>& basis, const
435431

436432

437433
void test_cuda_collocation_shell_to_task( const BasisSet<double>& basis,
438-
const BasisSetMap& basis_map, std::ifstream& in_file) {
434+
const BasisSetMap& basis_map, const std::string& filename) {
439435

440-
test_cuda_collocation_shell_to_task(basis,basis_map,in_file,false, false, false, false);
436+
test_cuda_collocation_shell_to_task(basis,basis_map,filename,false, false, false, false);
441437

442438
}
443439
void test_cuda_collocation_shell_to_task_gradient( const BasisSet<double>& basis,
444-
const BasisSetMap& basis_map, std::ifstream& in_file) {
440+
const BasisSetMap& basis_map, const std::string& filename) {
445441

446-
test_cuda_collocation_shell_to_task(basis,basis_map,in_file,true, false, false, false);
442+
test_cuda_collocation_shell_to_task(basis,basis_map,filename,true, false, false, false);
447443

448444
}
449445
void test_cuda_collocation_shell_to_task_hessian( const BasisSet<double>& basis,
450-
const BasisSetMap& basis_map, std::ifstream& in_file) {
446+
const BasisSetMap& basis_map, const std::string& filename) {
451447

452-
test_cuda_collocation_shell_to_task(basis,basis_map,in_file,true, true, false, false);
448+
test_cuda_collocation_shell_to_task(basis,basis_map,filename,true, true, false, false);
453449

454450
}
455451

456452
void test_cuda_collocation_shell_to_task_laplacian( const BasisSet<double>& basis,
457-
const BasisSetMap& basis_map, std::ifstream& in_file) {
453+
const BasisSetMap& basis_map, const std::string& filename) {
458454

459-
test_cuda_collocation_shell_to_task(basis,basis_map,in_file,true, false, true, false);
455+
test_cuda_collocation_shell_to_task(basis,basis_map,filename,true, false, true, false);
460456

461457
}
462458

463459
void test_cuda_collocation_shell_to_task_lapgrad( const BasisSet<double>& basis,
464-
const BasisSetMap& basis_map, std::ifstream& in_file) {
460+
const BasisSetMap& basis_map, const std::string& filename) {
465461

466-
test_cuda_collocation_shell_to_task(basis,basis_map,in_file,true, true, true, true);
462+
test_cuda_collocation_shell_to_task(basis,basis_map,filename,true, true, true, true);
467463

468464
}
469465

0 commit comments

Comments
 (0)