Skip to content

Commit 0a459c0

Browse files
author
kswirydo
committed
Merge branch 'rand-gmres-dev2' of https://github.com/ORNL/ReSolve into rand-gmres-dev2
2 parents 479efe8 + a0d0a0c commit 0a459c0

18 files changed

+243
-725611
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
../tests/functionality/data/* filter=lfs diff=lfs merge=lfs -text
2+
*.mtx filter=lfs diff=lfs merge=lfs -text

build/.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
../tests/functionality/data/SiO2.mtx filter=lfs diff=lfs merge=lfs -text
2+
../tests/functionality/data/SiO2_rhs.mtx filter=lfs diff=lfs merge=lfs -text
3+
*.mtx filter=lfs diff=lfs merge=lfs -text

examples/r_randGMRES.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ int main(int argc, char *argv[])
8989
matrix_handler->setValuesChanged(true, "hip");
9090

9191
Rf->setup(A);
92-
FGMRES->setRestart(800);
93-
FGMRES->setMaxit(800);
92+
FGMRES->setRestart(150);
93+
FGMRES->setMaxit(2500);
9494
FGMRES->setTol(1e-12);
9595
FGMRES->setup(A);
9696
GS->setup(FGMRES->getKrand(), FGMRES->getRestart());

resolve/LinSolverIterativeRandFGMRES.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ namespace ReSolve
155155
{
156156
using namespace constants;
157157

158-
//io::Logger::setVerbosity(io::Logger::EVERYTHING);
158+
io::Logger::setVerbosity(io::Logger::EVERYTHING);
159159

160160
int outer_flag = 1;
161161
int notconv = 1;
@@ -313,7 +313,7 @@ namespace ReSolve
313313
// residual norm estimate
314314
rnorm = fabs(h_rs_[i + 1]);
315315

316-
io::Logger::misc() << "it: "<<it<< "norm of residual "
316+
io::Logger::misc() << "it: "<<it<< " --> norm of the residual "
317317
<< std::scientific << std::setprecision(16)
318318
<< rnorm << "\n";
319319
// check convergence
@@ -371,6 +371,9 @@ namespace ReSolve
371371

372372
rand_manager_->reset();
373373

374+
if (rand_method_ == cs) {
375+
mem_.setZeroArrayOnDevice(d_S_->getData(memory::DEVICE), d_S_->getSize() * d_S_->getNumVectors());
376+
}
374377
vec_v->setData( d_V_->getVectorData(0, memory::DEVICE), memory::DEVICE);
375378
vec_s->setData( d_S_->getVectorData(0, memory::DEVICE), memory::DEVICE);
376379
rand_manager_->Theta(vec_v, vec_s);
@@ -389,7 +392,7 @@ namespace ReSolve
389392
// rnorm = ||V_0||
390393
rnorm = sqrt(rnorm);
391394

392-
io::Logger::misc() << "End of cycle, COMPUTER norm of residual "
395+
io::Logger::misc() << "End of cycle, COMPUTED norm of residual "
393396
<< std::scientific << std::setprecision(16)
394397
<< rnorm << "\n";
395398

tests/functionality/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ if(RESOLVE_USE_HIP)
3737
add_executable(rocsolver_rf_fgmres_test.exe testKLU_RocSolver_FGMRES.cpp)
3838
target_link_libraries(rocsolver_rf_fgmres_test.exe PRIVATE ReSolve)
3939

40+
#rand solver test
41+
add_executable(randGMRES_rocm_test.exe testRandGMRES_Rocm.cpp)
42+
target_link_libraries(randGMRES_rocm_test.exe PRIVATE ReSolve)
4043
endif(RESOLVE_USE_HIP)
4144

4245
# Install tests
@@ -52,7 +55,8 @@ endif(RESOLVE_USE_CUDA)
5255
if(RESOLVE_USE_HIP)
5356
set(installable_tests ${installable_tests}
5457
rocsolver_rf_test.exe
55-
rocsolver_rf_fgmres_test.exe)
58+
rocsolver_rf_fgmres_test.exe
59+
randGMRES_rocm_test.exe)
5660
endif(RESOLVE_USE_HIP)
5761

5862
install(TARGETS ${installable_tests}
@@ -73,4 +77,5 @@ endif(RESOLVE_USE_CUDA)
7377
if(RESOLVE_USE_HIP)
7478
add_test(NAME rocsolver_rf_test COMMAND $<TARGET_FILE:rocsolver_rf_test.exe> "${test_data_dir}")
7579
add_test(NAME rocsolver_rf_fgmres_test COMMAND $<TARGET_FILE:rocsolver_rf_fgmres_test.exe> "${test_data_dir}")
80+
add_test(NAME randGMRES_rocm_test COMMAND $<TARGET_FILE:randGMRES_rocm_test.exe> "${test_data_dir}")
7681
endif(RESOLVE_USE_HIP)

tests/functionality/data/SiO2.mtx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:5aeb3ad1bd2cc0b84f8ebde2ffe9a5792c2720d344b02c854e9fe65defaf17fd
3+
size 185918182

tests/functionality/data/SiO2_rhs.mtx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:d0a26f865d37cb08150e3f4137cdfd4c5499acd62fe4f39d1b6da25b523b00d7
3+
size 2640689

0 commit comments

Comments
 (0)