Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
3cc3ae0
tests that are supposed to pass are passing
shakedregev Aug 14, 2025
81fc4a4
fixed typos, removed unnecessary file
shakedregev Aug 14, 2025
c5b898a
Apply pre-commmit fixes
shakedregev Aug 14, 2025
e8d2032
renamed matrix files (not added before accidentally)
shakedregev Aug 14, 2025
9d5df32
removed commented out code
shakedregev Aug 14, 2025
5d6bfff
fixed failing tests
shakedregev Aug 20, 2025
e0ec030
Apply pre-commmit fixes
shakedregev Aug 20, 2025
2b95d98
fixed commented out code
shakedregev Aug 20, 2025
fdfafb4
straggling comment
shakedregev Aug 20, 2025
e8acb76
Update tests/functionality/CMakeLists.txt
shakedregev Aug 20, 2025
85368b7
Update tests/functionality/CMakeLists.txt
shakedregev Aug 20, 2025
ef6f549
Update tests/functionality/CMakeLists.txt
shakedregev Aug 20, 2025
883b88a
fixed data path for lusol
shakedregev Aug 20, 2025
af9bc3f
consumer
shakedregev Aug 20, 2025
65af129
fixed typo
shakedregev Aug 20, 2025
5707b80
changing to sys refactor, which requires a path
shakedregev Aug 20, 2025
8f08701
Fix for resolve_consumer to take in the matrices and right hand sides…
nkoukpaizan Aug 20, 2025
d61e235
adding generic test matrices
shakedregev Aug 22, 2025
a72c93c
modified numbering to suffix
shakedregev Aug 22, 2025
ddf501e
tests failing with well conditioned matrix
shakedregev Aug 22, 2025
abdf871
updating to better conditioned matrices
shakedregev Aug 22, 2025
9010f37
SPD test passes consistently, others don't
shakedregev Aug 22, 2025
746c2bb
still testing
shakedregev Aug 22, 2025
f84bb2e
changed matrices
shakedregev Aug 22, 2025
9e09b87
updated matrices
shakedregev Aug 22, 2025
1c28664
changed test mats
shakedregev Aug 22, 2025
2573468
changed matrices
shakedregev Aug 22, 2025
270d13b
symmetric test passing, asymmetric passing when run separately, but n…
shakedregev Aug 22, 2025
9956b01
changed matrices
shakedregev Aug 22, 2025
9ed9c53
changed tolerance to machine precision, tests pass!
shakedregev Aug 22, 2025
3da9823
Apply pre-commmit fixes
shakedregev Aug 22, 2025
6d8a85d
updated consumer
shakedregev Aug 22, 2025
6b20508
fixed non IR related comments
shakedregev Aug 22, 2025
b273b0c
removed IR check, it passes with IR with the better scaled matrices
shakedregev Aug 22, 2025
7575fc4
Apply pre-commmit fixes
shakedregev Aug 22, 2025
0cfb149
Update tests/functionality/CMakeLists.txt
shakedregev Aug 22, 2025
8383ab6
tests passing
shakedregev Aug 22, 2025
ae4fb5c
Apply pre-commmit fixes
shakedregev Aug 22, 2025
9fa393b
fixed prints
shakedregev Aug 22, 2025
415b81f
set convergence conditions
shakedregev Aug 22, 2025
1da657f
setting convergence condition, but it's overridden
shakedregev Aug 22, 2025
55ee465
set default to relative residual
shakedregev Aug 22, 2025
a1b5d4f
added default conv_cond
shakedregev Aug 22, 2025
ad7b224
Apply pre-commmit fixes
shakedregev Aug 22, 2025
45ff111
Update examples/resolve_consumer/CMakeLists.txt
shakedregev Aug 22, 2025
ef8f5cf
addressed comment
shakedregev Aug 25, 2025
b6a4810
reverted change that made CI test not pass
shakedregev Aug 25, 2025
3222810
made matrices consistent, tolerance too stringent
shakedregev Aug 25, 2025
f5e93d1
tests passing, renamed files to be consistent
shakedregev Aug 25, 2025
40f90ac
addressed all comments, only tested on Frontier
shakedregev Aug 25, 2025
9e64fd3
addressed comments
shakedregev Aug 28, 2025
84693a9
removed straggling print
shakedregev Aug 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,22 @@ install(PROGRAMS test.sh DESTINATION ${CONSUMER_PATH})
# Select consumer app
if(RESOLVE_USE_KLU)
if(RESOLVE_USE_CUDA)
set(RESOLVE_CONSUMER_APP "testRefactor.cpp")
set(RESOLVE_CONSUMER_APP "testSysRefactor.cpp")
elseif(RESOLVE_USE_HIP)
set(RESOLVE_CONSUMER_APP "testRefactor.cpp")
set(RESOLVE_CONSUMER_APP "testSysRefactor.cpp")
else()
set(RESOLVE_CONSUMER_APP "testKlu.cpp")
endif()
else(RESOLVE_USE_KLU)
set(RESOLVE_CONSUMER_APP "testSysGmres.cpp")
endif(RESOLVE_USE_KLU)

set(test_data_dir ${CMAKE_SOURCE_DIR}/tests/functionality)
set(sym_matrix_path /data/matrix_ACTIVSg200_AC_renumbered_add9_)
set(sym_rhs_path /data/rhs_ACTIVSg200_AC_renumbered_add9_ones_)
set(asym_matrix_path /data/A_asymmetric)
set(asym_rhs_path /data/b_asymmetric)

# Install directory with example on how to consume ReSolve
install(DIRECTORY resolve_consumer DESTINATION share/examples)
install(FILES ${PROJECT_SOURCE_DIR}/tests/functionality/${RESOLVE_CONSUMER_APP} DESTINATION share/examples/resolve_consumer RENAME consumer.cpp)
Expand All @@ -98,4 +104,4 @@ install(FILES ${PROJECT_SOURCE_DIR}/tests/functionality/TestHelper.hpp DESTINATI
# Shell script argumets:
# 1. Path to where resolve is installed.
# 2. Path to data directory
add_custom_target(test_install COMMAND ${CONSUMER_PATH}/test.sh ${CMAKE_INSTALL_PREFIX} ${PROJECT_SOURCE_DIR}/tests/functionality/)
add_custom_target(test_install COMMAND ${CONSUMER_PATH}/test.sh ${CMAKE_INSTALL_PREFIX} ${test_data_dir} ${sym_matrix_path} ${sym_rhs_path})
4 changes: 2 additions & 2 deletions examples/resolve_consumer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ target_link_libraries(consume.exe PRIVATE ReSolve::ReSolve)
# Testing of exported Resolve Configurations
enable_testing()

# RESOLVE_DATA is set in test.sh and is the file path the matrix data files used in the testKLU_Rf_FGMRES
add_test(NAME resolve_consumer COMMAND $<TARGET_FILE:consume.exe> "-d" "${RESOLVE_DATA}" "-i")
# RESOLVE_DATA is set in test.sh and is the file path the matrix data files used in the testKLU_Rf_FGMRES.
add_test(NAME resolve_consumer COMMAND $<TARGET_FILE:consume.exe> "-d" "${ReSolve_DATA_DIR}" "-i" "-m" "${ReSolve_MATRICES}" "-r" "${ReSolve_RHS}")
11 changes: 10 additions & 1 deletion examples/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ echo ${ReSolve_DIR}
export DATA_DIR=${2}
echo ${DATA_DIR}

# Defines the input matrices
export MATRICES=${3}
echo ${MATRICES}

# Defines the input right hand sides
export RHS=${4}
echo ${RHS}

# Locate source of the consumer test app
export INSTALL_BUILD_CONSUME=${ReSolve_DIR}/share/examples/resolve_consumer
echo ${INSTALL_BUILD_CONSUME}
Expand All @@ -18,7 +26,8 @@ mkdir -p ${INSTALL_BUILD_CONSUME}/build

rm -rf ${INSTALL_BUILD_CONSUME}/build/* &&

cmake -B ${INSTALL_BUILD_CONSUME}/build -S ${INSTALL_BUILD_CONSUME} -DRESOLVE_DATA=${DATA_DIR} -DReSolve_DIR=${ReSolve_DIR} &&
cmake -B ${INSTALL_BUILD_CONSUME}/build -S ${INSTALL_BUILD_CONSUME} -DReSolve_DATA_DIR=${DATA_DIR} \
-DReSolve_MATRICES=${MATRICES} -DReSolve_RHS=${RHS} -DReSolve_DIR=${ReSolve_DIR} &&

cmake --build ${INSTALL_BUILD_CONSUME}/build -- -j 12 &&

Expand Down
1 change: 0 additions & 1 deletion resolve/LinSolverIterativeFGMRES.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ namespace ReSolve
initial_residual_norm_ = rnorm;
while (outer_flag)
{
// check if maybe residual is already small enough?
if (it == 0)
{
tolrel = tol_ * rnorm;
Expand Down
2 changes: 1 addition & 1 deletion resolve/LinSolverIterativeFGMRES.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ namespace ReSolve
};

index_type restart_{10}; ///< GMRES restart
index_type conv_cond_{0}; ///< GMRES convergence condition
index_type conv_cond_{2}; ///< GMRES convergence condition
bool flexible_{true}; ///< If using flexible GMRES (FGMRES) algorithm

private:
Expand Down
4 changes: 2 additions & 2 deletions resolve/LinSolverIterativeRandFGMRES.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace ReSolve
tol_ = 1e-14; // default
maxit_ = 100; // default
restart_ = 10;
conv_cond_ = 0; // default
conv_cond_ = 2; // default
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary to address in this PR, but is there a rationale for setting member variable to their default values in constructors? I'd double check that it's truly the default and remove the setting of tol_, maxit_ and conv_cond.

flexible_ = true;

matrix_handler_ = matrix_handler;
Expand Down Expand Up @@ -180,10 +180,10 @@ namespace ReSolve
io::Logger::misc() << "it 0: norm of residual "
<< std::scientific << std::setprecision(16)
<< rnorm << " Norm of rhs: " << bnorm << "\n";

initial_residual_norm_ = rnorm;
while (outer_flag)
{
// check if maybe residual is already small enough?
if (it == 0)
{
tolrel = tol_ * rnorm;
Expand Down
2 changes: 1 addition & 1 deletion resolve/LinSolverIterativeRandFGMRES.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ namespace ReSolve
};

index_type restart_{10}; ///< GMRES restart
index_type conv_cond_{0}; ///< GMRES convergence condition
index_type conv_cond_{2}; ///< GMRES convergence condition
bool flexible_{true}; ///< If using flexible GMRES (FGMRES) algorithm

private:
Expand Down
2 changes: 0 additions & 2 deletions resolve/SystemSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#ifdef RESOLVE_USE_KLU
#include <resolve/LinSolverDirectKLU.hpp>
#endif

#include <resolve/LinSolverIterativeRandFGMRES.hpp>

#ifdef RESOLVE_USE_CUDA
Expand Down Expand Up @@ -563,7 +562,6 @@ namespace ReSolve
{
int status = 0;

status += iterativeSolver_->resetMatrix(A_);
status += iterativeSolver_->solve(rhs, x);

return status;
Expand Down
2 changes: 2 additions & 0 deletions resolve/lusol/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# LUSOL disclaimer
LUSOL code is experimental and not actively maintained or supported.
28 changes: 17 additions & 11 deletions tests/functionality/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ if(RESOLVE_USE_KLU)
add_executable(sys_glu_test.exe testSysGLU.cpp)
target_link_libraries(sys_glu_test.exe PRIVATE ReSolve)

add_executable(sys_glu_asym_test.exe testSysGLUAsym.cpp)
target_link_libraries(sys_glu_asym_test.exe PRIVATE ReSolve)

endif(RESOLVE_USE_CUDA)
endif(RESOLVE_USE_KLU)

Expand All @@ -62,7 +59,6 @@ if(RESOLVE_USE_KLU)

if(RESOLVE_USE_CUDA)
list(APPEND installable_tests sys_glu_test.exe)
list(APPEND installable_tests sys_glu_asym_test.exe)
endif(RESOLVE_USE_CUDA)
endif()

Expand All @@ -76,7 +72,13 @@ install(TARGETS ${installable_tests}
# Install directory with data files
install(DIRECTORY data DESTINATION bin/resolve/tests/functionality)

set(test_data_dir ${CMAKE_SOURCE_DIR}/tests/functionality/)
# Set the matrices for the tests.
set(test_data_dir ${CMAKE_SOURCE_DIR}/tests/functionality)
set(sym_matrix_path /data/matrix_ACTIVSg200_AC_renumbered_add9_)
set(sym_rhs_path /data/rhs_ACTIVSg200_AC_renumbered_add9_ones_)
set(asym_matrix_path /data/A_asymmetric)
set(asym_rhs_path /data/b_asymmetric)


add_test(NAME version COMMAND $<TARGET_FILE:version.exe>)

Expand Down Expand Up @@ -117,17 +119,20 @@ add_test(NAME rand_gmres_test COMMAND $<TARGET_FILE:rand_gmres_test.exe>)

if(RESOLVE_USE_KLU)
# Using KLU as refactorization solver
add_test(NAME klu_klu_test COMMAND $<TARGET_FILE:klu_klu_test.exe> "-d" "${test_data_dir}")
add_test(NAME klu_klu_ir_test COMMAND $<TARGET_FILE:klu_klu_test.exe> "-d" "${test_data_dir}" "-i")
add_test(NAME klu_klu_test COMMAND $<TARGET_FILE:klu_klu_test.exe> "-d" "${test_data_dir}" "-m" "${sym_matrix_path}" "-r" "${sym_rhs_path}")
add_test(NAME klu_klu_ir_test COMMAND $<TARGET_FILE:klu_klu_test.exe> "-d" "${test_data_dir}" "-m" "${sym_matrix_path}" "-r" "${sym_rhs_path}" "-i")
add_test(NAME klu_klu_asym_test COMMAND $<TARGET_FILE:klu_klu_test.exe> "-d" "${test_data_dir}" "-m" "${asym_matrix_path}" "-r" "${asym_rhs_path}")
add_test(NAME klu_klu_asym_ir_test COMMAND $<TARGET_FILE:klu_klu_test.exe> "-d" "${test_data_dir}" "-m" "${asym_matrix_path}" "-r" "${asym_rhs_path}" "-i")

# CUDA-SDK specific tests
if(RESOLVE_USE_CUDA)
add_test(NAME klu_rf_cuda_test COMMAND $<TARGET_FILE:klu_rf_test.exe> "-d" "${test_data_dir}")
add_test(NAME klu_rf_ir_cuda_test COMMAND $<TARGET_FILE:klu_rf_test.exe> "-d" "${test_data_dir}" "-i")
add_test(NAME klu_glu_cuda_test COMMAND $<TARGET_FILE:klu_rf_test.exe> "-d" "${test_data_dir}" "-s" "glu")
add_test(NAME sys_refactor_cuda_test COMMAND $<TARGET_FILE:sys_refactor_test.exe> "${test_data_dir}")
add_test(NAME sys_glu_test COMMAND $<TARGET_FILE:sys_glu_test.exe> "${test_data_dir}")
add_test(NAME sys_glu_asym_test COMMAND $<TARGET_FILE:sys_glu_asym_test.exe> "${test_data_dir}")
add_test(NAME sys_refactor_cuda_test COMMAND $<TARGET_FILE:sys_refactor_test.exe> "${test_data_dir}" "-d" "${test_data_dir}" "-m" "${sym_matrix_path}" "-r" "${sym_rhs_path}")
add_test(NAME sys_refactor_cuda_asym_test COMMAND $<TARGET_FILE:sys_refactor_test.exe> "${test_data_dir}" "-d" "${test_data_dir}" "-m" "${asym_matrix_path}" "-r" "${asym_rhs_path}")
add_test(NAME sys_glu_test COMMAND $<TARGET_FILE:sys_glu_test.exe> "${test_data_dir}" "-d" "${test_data_dir}" "-m" "${sym_matrix_path}" "-r" "${sym_rhs_path}")
add_test(NAME sys_glu_asym_test COMMAND $<TARGET_FILE:sys_glu_test.exe> "${test_data_dir}" "-d" "${test_data_dir}" "-m" "${asym_matrix_path}" "-r" "${asym_rhs_path}")
endif(RESOLVE_USE_CUDA)

# ROCm specific tests
Expand All @@ -136,6 +141,7 @@ if(RESOLVE_USE_KLU)
add_test(NAME rocsolver_rf_m1_test COMMAND $<TARGET_FILE:klu_rf_test.exe> "-d" "${test_data_dir}" "-m" "rocsparse_trisolve")
add_test(NAME rocsolver_rf_ir_test COMMAND $<TARGET_FILE:klu_rf_test.exe> "-d" "${test_data_dir}" "-i")
add_test(NAME rocsolver_rf_ir_m1_test COMMAND $<TARGET_FILE:klu_rf_test.exe> "-d" "${test_data_dir}" "-i" "-m" "rocsparse_trisolve")
add_test(NAME sys_refactor_hip_test COMMAND $<TARGET_FILE:sys_refactor_test.exe> "${test_data_dir}")
add_test(NAME sys_refactor_hip_test COMMAND $<TARGET_FILE:sys_refactor_test.exe> "${test_data_dir}" "-d" "${test_data_dir}" "-m" "${sym_matrix_path}" "-r" "${sym_rhs_path}")
add_test(NAME sys_refactor_hip_asym_test COMMAND $<TARGET_FILE:sys_refactor_test.exe> "${test_data_dir}" "-d" "${test_data_dir}" "-m" "${asym_matrix_path}" "-r" "${asym_rhs_path}")
endif(RESOLVE_USE_HIP)
endif(RESOLVE_USE_KLU)
1 change: 0 additions & 1 deletion tests/functionality/TestHelper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ class TestHelper
{
int error_sum = 0;
ReSolve::real_type norm = norm_res_ / norm_rhs_;

if (!std::isfinite(norm))
{
std::cout << "Result is not a finite number!\n";
Expand Down
Loading
Loading