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

Amesos2 :: add option to turn off matching for Pardiso_MKL #12959

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Changes from all commits
Commits
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
28 changes: 26 additions & 2 deletions packages/amesos2/src/Amesos2_PardisoMKL_def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,27 +291,31 @@ namespace Amesos2 {

RCP<const Teuchos::ParameterList> valid_params = getValidParameters_impl();

// Fill-in reordering: 0 = minimum degree, 2 = METIS 4.0.1 (default), 3 = METIS 5.1, 4 = AMD,
if( parameterList->isParameter("IPARM(2)") )
{
RCP<const ParameterEntryValidator> fillin_validator = valid_params->getEntry("IPARM(2)").validator();
parameterList->getEntry("IPARM(2)").setValidator(fillin_validator);
iparm_[1] = getIntegralValue<int>(*parameterList, "IPARM(2)");
}

// Iterative-direct algorithm
if( parameterList->isParameter("IPARM(4)") )
{
RCP<const ParameterEntryValidator> prec_validator = valid_params->getEntry("IPARM(4)").validator();
parameterList->getEntry("IPARM(4)").setValidator(prec_validator);
iparm_[3] = getIntegralValue<int>(*parameterList, "IPARM(4)");
}

// Max numbers of iterative refinement steps
if( parameterList->isParameter("IPARM(8)") )
{
RCP<const ParameterEntryValidator> refine_validator = valid_params->getEntry("IPARM(8)").validator();
parameterList->getEntry("IPARM(8)").setValidator(refine_validator);
iparm_[7] = getIntegralValue<int>(*parameterList, "IPARM(8)");
}


// Perturb the pivot elements
if( parameterList->isParameter("IPARM(10)") )
{
RCP<const ParameterEntryValidator> pivot_perturb_validator = valid_params->getEntry("IPARM(10)").validator();
Expand All @@ -323,34 +327,47 @@ namespace Amesos2 {
// Then solver specific options can override this.
iparm_[11] = this->control_.useTranspose_ ? 2 : 0;

// Normal solve (0), or a transpose solve (1)
if( parameterList->isParameter("IPARM(12)") )
{
RCP<const ParameterEntryValidator> trans_validator = valid_params->getEntry("IPARM(12)").validator();
parameterList->getEntry("IPARM(12)").setValidator(trans_validator);
iparm_[11] = getIntegralValue<int>(*parameterList, "IPARM(12)");
}

// (Non-)symmetric matchings : detault 1 for nonsymmetric and 0 for symmetric matrix (default is nonsymmetric)
if( parameterList->isParameter("IPARM(13)") )
{
RCP<const ParameterEntryValidator> trans_validator = valid_params->getEntry("IPARM(13)").validator();
parameterList->getEntry("IPARM(13)").setValidator(trans_validator);
iparm_[12] = getIntegralValue<int>(*parameterList, "IPARM(13)");
}

// Output: Number of nonzeros in the factor LU
if( parameterList->isParameter("IPARM(18)") )
{
RCP<const ParameterEntryValidator> report_validator = valid_params->getEntry("IPARM(18)").validator();
parameterList->getEntry("IPARM(18)").setValidator(report_validator);
iparm_[17] = getIntegralValue<int>(*parameterList, "IPARM(18)");
}

// Scheduling method for the parallel numerical factorization
if( parameterList->isParameter("IPARM(24)") )
{
RCP<const ParameterEntryValidator> par_fact_validator = valid_params->getEntry("IPARM(24)").validator();
parameterList->getEntry("IPARM(24)").setValidator(par_fact_validator);
iparm_[23] = getIntegralValue<int>(*parameterList, "IPARM(24)");
}

// Parallelization scheme for the forward and backward solv
if( parameterList->isParameter("IPARM(25)") )
{
RCP<const ParameterEntryValidator> par_fbsolve_validator = valid_params->getEntry("IPARM(25)").validator();
parameterList->getEntry("IPARM(25)").setValidator(par_fbsolve_validator);
iparm_[24] = getIntegralValue<int>(*parameterList, "IPARM(25)");
}

// Graph compression scheme for METIS.
if( parameterList->isParameter("IPARM(60)") )
{
RCP<const ParameterEntryValidator> ooc_validator = valid_params->getEntry("IPARM(60)").validator();
Expand Down Expand Up @@ -433,7 +450,14 @@ PardisoMKL<Matrix,Vector>::getValidParameters_impl() const
"Transposed"),
tuple<int>(0, 1, 2),
pl.getRawPtr());


setStringToIntegralParameter<int>("IPARM(13)", toString(iparm_temp[12]),
"Use weighted matching",
tuple<string>("0", "1"),
tuple<string>("No matching", "Use matching"),
tuple<int>(0, 1),
pl.getRawPtr());

setStringToIntegralParameter<int>("IPARM(24)", toString(iparm_temp[23]),
"Parallel factorization control",
tuple<string>("0", "1"),
Expand Down
Loading