Skip to content

Commit

Permalink
change epc checking logic in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aodongliu committed May 3, 2024
1 parent d6d552b commit 43af2c1
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/libxc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ bool LibxcKernelImpl::is_polarized_() const noexcept {
}

bool LibxcKernelImpl::is_epc_() const noexcept {
//EXCHCXX_BOOL_CHECK("Libxc EPC Wrapper NYI", false);
return false;
int xcNumber = xc_info()->number;
return xcNumber == 328 or xcNumber == 329 or xcNumber == 330 or xcNumber or 331;
}


Expand Down
39 changes: 29 additions & 10 deletions test/xc_kernel_test.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -769,9 +769,8 @@ void compare_libxc_builtin( TestInterface interface, EvalType evaltype,

const int npts = npts_lda;

XCKernel func_builtin( Backend::builtin, kern, polar );
if( func_builtin.is_epc() ) return;
XCKernel func_libxc ( Backend::libxc, kern, polar );
XCKernel func_builtin( Backend::builtin, kern, polar );


const int len_rho = func_libxc.rho_buffer_len( npts );
Expand Down Expand Up @@ -902,20 +901,25 @@ void compare_libxc_builtin( TestInterface interface, EvalType evaltype,
TEST_CASE( "Builtin Corectness Test", "[xc-builtin]" ) {

SECTION( "Unpolarized Regular Eval : EXC" ) {
for( auto kern : builtin_supported_kernels )
for( auto kern : builtin_supported_kernels ) {
if(is_epc(kern)) continue;
compare_libxc_builtin( TestInterface::EXC, EvalType::Regular,
kern, Spin::Unpolarized );
}
}

SECTION( "Unpolarized Regular Eval : EXC + VXC" ) {
for( auto kern : builtin_supported_kernels )
for( auto kern : builtin_supported_kernels ) {
if(is_epc(kern)) continue;
compare_libxc_builtin( TestInterface::EXC_VXC, EvalType::Regular,
kern, Spin::Unpolarized );
}
}

SECTION( "Unpolarized Small Eval : EXC" ) {
for( auto kern : builtin_supported_kernels ) {
if(is_unstable_small(kern)) continue;
if(is_epc(kern)) continue;
compare_libxc_builtin( TestInterface::EXC, EvalType::Small,
kern, Spin::Unpolarized );
}
Expand All @@ -924,21 +928,26 @@ TEST_CASE( "Builtin Corectness Test", "[xc-builtin]" ) {
SECTION( "Unpolarized Small Eval : EXC + VXC" ) {
for( auto kern : builtin_supported_kernels ) {
if(is_unstable_small(kern)) continue;
if(is_epc(kern)) continue;
compare_libxc_builtin( TestInterface::EXC_VXC, EvalType::Small,
kern, Spin::Unpolarized );
}
}

SECTION( "Unpolarized Zero Eval : EXC" ) {
for( auto kern : builtin_supported_kernels )
for( auto kern : builtin_supported_kernels ) {
if(is_epc(kern)) continue;
compare_libxc_builtin( TestInterface::EXC, EvalType::Zero,
kern, Spin::Unpolarized );
}
}

SECTION( "Unpolarized Zero Eval : EXC + VXC" ) {
for( auto kern : builtin_supported_kernels )
for( auto kern : builtin_supported_kernels ) {
if(is_epc(kern)) continue;
compare_libxc_builtin( TestInterface::EXC_VXC, EvalType::Zero,
kern, Spin::Unpolarized );
}
}


Expand All @@ -947,20 +956,25 @@ TEST_CASE( "Builtin Corectness Test", "[xc-builtin]" ) {


SECTION( "Polarized Regular Eval : EXC" ) {
for( auto kern : builtin_supported_kernels )
for( auto kern : builtin_supported_kernels ) {
if(is_epc(kern)) continue;
compare_libxc_builtin( TestInterface::EXC, EvalType::Regular,
kern, Spin::Polarized );
}
}

SECTION( "Polarized Regular Eval : EXC + VXC" ) {
for( auto kern : builtin_supported_kernels )
for( auto kern : builtin_supported_kernels ) {
if(is_epc(kern)) continue;
compare_libxc_builtin( TestInterface::EXC_VXC, EvalType::Regular,
kern, Spin::Polarized );
}
}

SECTION( "Polarized Small Eval : EXC" ) {
for( auto kern : builtin_supported_kernels ) {
if(is_unstable_small(kern)) continue;
if(is_epc(kern)) continue;
compare_libxc_builtin( TestInterface::EXC, EvalType::Small,
kern, Spin::Polarized );
}
Expand All @@ -969,21 +983,26 @@ TEST_CASE( "Builtin Corectness Test", "[xc-builtin]" ) {
SECTION( "Polarized Small Eval : EXC + VXC" ) {
for( auto kern : builtin_supported_kernels ) {
if(is_unstable_small(kern)) continue;
if(is_epc(kern)) continue;
compare_libxc_builtin( TestInterface::EXC_VXC, EvalType::Small,
kern, Spin::Polarized );
}
}

SECTION( "Polarized Zero Eval : EXC" ) {
for( auto kern : builtin_supported_kernels )
for( auto kern : builtin_supported_kernels ) {
if(is_epc(kern)) continue;
compare_libxc_builtin( TestInterface::EXC, EvalType::Zero,
kern, Spin::Polarized );
}
}

SECTION( "Polarized Zero Eval : EXC + VXC" ) {
for( auto kern : builtin_supported_kernels )
for( auto kern : builtin_supported_kernels ) {
if(is_epc(kern)) continue;
compare_libxc_builtin( TestInterface::EXC_VXC, EvalType::Zero,
kern, Spin::Polarized );
}
}

}
Expand Down

0 comments on commit 43af2c1

Please sign in to comment.