Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interface for eigensolver on QUDA #561

Merged
merged 32 commits into from
Oct 4, 2023
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
489ee3d
initial commit, interface works with quda
Mar 13, 2023
ee79b0f
moved initQudaforEig into phmc_compute_ev
aniketsen Mar 24, 2023
7a48974
initialize QUDA and eigenvals from QUDA are scaled
aniketsen Mar 24, 2023
e030595
call eigensolver on QUDA if TM_USE_QUDA is defined
aniketsen Mar 24, 2023
14c4e9f
clean up and finalize eigparams for QUDA
aniketsen Mar 24, 2023
cc247bd
fix bug with the array storing the eigenvalues
aniketsen Mar 24, 2023
f4cd278
revert changes in ndrat_monomial, eigenvalues_bi
aniketsen Apr 19, 2023
af6f781
add input option UseExternalEigSolver
aniketsen Apr 19, 2023
f50d533
add parameter external_eigsolver to monomial
aniketsen Apr 19, 2023
40a1602
eigsolveQuda is called based on mnl->external_eigsolver
aniketsen Apr 19, 2023
3922b05
removed initQudaforEig, memory allocation for eigenvalues done in the…
aniketsen Apr 19, 2023
c308510
QUDA and monomial parameters are initialized within the interface
aniketsen Apr 26, 2023
a06e083
removed unnecessary quda_initialized check
aniketsen Apr 26, 2023
291e9bf
Merge remote-tracking branch 'origin/quda_work' into quda_work_eigens…
kostrzewa May 3, 2023
4b7e737
TM_USE_QUDA is checked before calling the interface
aniketsen May 9, 2023
a0d71d3
modifying eigenvalue_precision in the same fashion as eigenvalues_bi
aniketsen May 9, 2023
3919e5c
Merge remote-tracking branch 'origin/quda_work' into quda_work_eigens…
kostrzewa May 24, 2023
f6d68c8
first stab at using polynomial acceleration for the ND eigensolver
kostrzewa May 24, 2023
d1b1c42
Merge pull request #564 from etmc/quda_work_eigensolver_poly_acc
aniketsen Jun 7, 2023
4e6033f
use own QudaInvertParam struct for eig_param.invert_param to not dist…
kostrzewa Jun 9, 2023
3d67264
user input for poly acc settings
aniketsen Jun 17, 2023
362c93b
poly acc inputs updated
aniketsen Jun 21, 2023
6954db9
Merge pull request #569 from etmc/quda_work_eigensolver_poly_acc_sett…
aniketsen Jun 27, 2023
8bbabe6
added support for one flavour solver
aniketsen Jun 27, 2023
721f3ba
fixed bug in setting eig_param.use_poly_acc
aniketsen Jun 28, 2023
9c27ed5
Merge remote-tracking branch 'origin/quda_work' into quda_work_eigens…
aniketsen Jun 28, 2023
a8b0a62
require an output location to be provided externally to eigsolveQuda …
kostrzewa Jul 19, 2023
0626f45
slight modification of verbose readinput output for eigensolver input…
kostrzewa Jul 19, 2023
c5e8a13
the eigenvalues computed by QUDA are complex numbers, of course
kostrzewa Jul 19, 2023
4fe78b7
document QUDA eigensolver for the HMC
kostrzewa Jul 19, 2023
a46c4c6
script for testing eigsolveQuda
aniketsen Aug 2, 2023
3bb6639
Revert "script for testing eigsolveQuda"
kostrzewa Oct 4, 2023
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
40 changes: 22 additions & 18 deletions quda_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ void _setDefaultQudaParam(void){
QudaPrecision cpu_prec = QUDA_DOUBLE_PRECISION;
QudaPrecision cuda_prec = QUDA_DOUBLE_PRECISION;
QudaPrecision cuda_prec_sloppy = QUDA_SINGLE_PRECISION;
QudaPrecision cuda_prec_precondition = QUDA_HALF_PRECISION;
QudaPrecision cuda_prec_precondition = QUDA_SINGLE_PRECISION;

QudaTune tune = QUDA_TUNE_YES;

Expand Down Expand Up @@ -2608,17 +2608,17 @@ double eigsolveQuda(int n, double tol, int blksize, int blkwise, int max_iterati
// it returns if quda is already init
_initQuda();

if ( rel_prec )
inv_param.residual_type = QUDA_L2_RELATIVE_RESIDUAL;
else
inv_param.residual_type = QUDA_L2_ABSOLUTE_RESIDUAL;
if ( rel_prec )
inv_param.residual_type = QUDA_L2_RELATIVE_RESIDUAL;
else
inv_param.residual_type = QUDA_L2_ABSOLUTE_RESIDUAL;

inv_param.kappa = g_kappa;
// figure out which BC tu use (theta, trivial...)
set_boundary_conditions(&compression, &gauge_param);
inv_param.kappa = g_kappa;

// figure out which BC tu use (theta, trivial...)
set_boundary_conditions(&compression, &gauge_param);

set_sloppy_prec(sloppy_precision, refinement_precision, &gauge_param, &inv_param);
set_sloppy_prec(sloppy_precision, refinement_precision, &gauge_param, &inv_param);

// load gauge after setting precision
_loadGaugeQuda(compression);
Expand All @@ -2640,8 +2640,18 @@ double eigsolveQuda(int n, double tol, int blksize, int blkwise, int max_iterati

// create new eig_param
eig_param = newQudaEigParam();

eig_param.invert_param = &inv_param;

// need our own QudaInvertParam for passing the operator properties
Copy link
Member

Choose a reason for hiding this comment

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

@aniketsen note that I've added this just now because the change of precision is performed in the global inv_param, which might have unforeseen consequences in certain situations

Copy link
Member

Choose a reason for hiding this comment

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

this way, the global inv_param is never touched via the pointer

// as we modify the precision below
QudaInvertParam eig_invert_param = newQudaInvertParam();
eig_invert_param = inv_param;
eig_param.invert_param = &eig_invert_param;
/* AS The following two are set to cuda_prec, otherwise
* it gives an error. Such high precision might not be
* necessary. But have not found a way to consistently set
* the different precisions. */
eig_param.invert_param->cuda_prec_eigensolver = inv_param.cuda_prec;
eig_param.invert_param->clover_cuda_prec_eigensolver = inv_param.clover_cuda_prec;

if(tol < 1.e-14) {
eig_param.tol = 1.e-14;
Expand Down Expand Up @@ -2703,12 +2713,6 @@ double eigsolveQuda(int n, double tol, int blksize, int blkwise, int max_iterati
if(maxmin == 1) eig_param.spectrum = QUDA_SPECTRUM_LR_EIG;
else eig_param.spectrum = QUDA_SPECTRUM_SR_EIG;

/* The following two are set to cuda_prec, otherwise
* it gives an error. Such high precision might not be
* necessary. But have not found a way to consistently set
* the different precisions. */
eig_param.invert_param->cuda_prec_eigensolver = inv_param.cuda_prec;
eig_param.invert_param->clover_cuda_prec_eigensolver = inv_param.cuda_prec;

/* At the moment, the eigenvalues and eigenvectors are neither
* written to or read from disk, but if necessary, can be added
Expand Down