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

Trilinos Master Merge PR Generator: Auto PR created to promote from master_merge_20210726_000548 branch to master #9485

Merged
merged 21 commits into from
Jul 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f37579e
Tpetra: Fix compiling and running with SYCL and MPI
masterleinad Jun 17, 2021
53c2cce
Tempus: FSA - updated to use IntegratorBasic
Jun 6, 2021
c3f4da1
Removed deprecated code from trilinos couplins
Jul 22, 2021
6de8a4f
Tpetra: Add/fix convert method for MV and CrsMatrix
cgcgcg Jul 22, 2021
642971c
Xpetra TpetraHalfPrecisionOperator: Use Tpetra's convert methods
cgcgcg Jul 22, 2021
a8c80c7
Fixed typo and warning
Jul 23, 2021
0a43b1f
Fixed review comments
Jul 23, 2021
7524ee9
Tpetra: Remove failing check in CrsMatrix::convert
cgcgcg Jul 22, 2021
2e8770b
Tpetra: Add MixedScalarMultiplyOp
cgcgcg Jul 22, 2021
4ed5ec5
Stratimikos & Ifpack2: Add half-precision preconditioners, test Ifpac…
cgcgcg Jul 22, 2021
fa12ca9
Tempus: FSA - update nonmember function name to meet standard
Jul 22, 2021
5cb3fd8
Tempus: PFSA - convert IntegratorBasicOld to IntegratorBasic
Jul 1, 2021
36bc532
Merge pull request #9299 from masterleinad/tpetra_sycl_mpi
brian-kelley Jul 23, 2021
59a9531
Tempus: FSA - update the documentation
Jul 23, 2021
e998751
Tempus: PFSA - update nonmember function name to meet standard
Jul 23, 2021
8560bbe
Merge Pull Request #9473 from cgcgcg/Trilinos/tpetraMP
trilinos-autotester Jul 23, 2021
6cee0bb
Merge Pull Request #9450 from trilinos/Trilinos/8932-tempus-convert-i…
trilinos-autotester Jul 23, 2021
2176101
Merge Pull Request #9478 from trilinos/Trilinos/7358-tempus-sensitivi…
trilinos-autotester Jul 24, 2021
ac41558
Merge Pull Request #9374 from trilinos/Trilinos/9362-tempus-convert-I…
trilinos-autotester Jul 24, 2021
46d1177
Merge Pull Request #9470 from trilinos/Trilinos/trilinos-couplilings-…
trilinos-autotester Jul 24, 2021
42c4b38
Zoltan2 no UVM testing (#9441)
bathmatt Jul 24, 2021
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
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ set (Sacado_ENABLE_TESTS OFF CACHE BOOL "Turn off tests for non-UVM build")
set (SEACAS_ENABLE_TESTS OFF CACHE BOOL "Turn off tests for non-UVM build")
set (ShyLU_DD_ENABLE_TESTS OFF CACHE BOOL "Turn off tests for non-UVM build")
set (STK_ENABLE_TESTS OFF CACHE BOOL "Turn off tests for non-UVM build")
set (Zoltan2_ENABLE_TESTS OFF CACHE BOOL "Turn off tests for non-UVM build")


# ShyLU_DD UVM = OFF tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#include "Ifpack2_Parameters.hpp"

#include "Tpetra_RowMatrix.hpp"
#include "Tpetra_MixedScalarMultiplyOp.hpp"

#include "Teuchos_TestForException.hpp"
#include "Teuchos_Assert.hpp"
Expand Down Expand Up @@ -160,6 +161,10 @@ void Ifpack2PreconditionerFactory<MatrixType>::initializePrec(

// Process parameter list

bool useHalfPrecision = false;
if (paramList_->isParameter("half precision"))
useHalfPrecision = paramList_->get<bool>("half precision");

Teuchos::RCP<const Teuchos::ParameterList> constParamList = paramList_;
if (constParamList.is_null ()) {
constParamList = getValidParameters ();
Expand Down Expand Up @@ -195,11 +200,41 @@ void Ifpack2PreconditionerFactory<MatrixType>::initializePrec(
}
timer.start(true);

Teuchos::RCP<LinearOpBase<scalar_type> > thyraPrecOp;

typedef Ifpack2::Preconditioner<scalar_type, local_ordinal_type, global_ordinal_type, node_type> Ifpack2Prec;
typedef Tpetra::RowMatrix<scalar_type, local_ordinal_type,
global_ordinal_type, node_type> row_matrix_type;
const Teuchos::RCP<Ifpack2Prec> concretePrecOp =
Ifpack2::Factory::create<row_matrix_type> (preconditionerType, tpetraFwdMatrix);
Teuchos::RCP<Ifpack2Prec> concretePrecOp;

#if defined(HAVE_TPETRA_INST_DOUBLE) && defined(HAVE_TPETRA_INST_FLOAT)
// CAG: There is nothing special about the combination double-float,
// except that I feel somewhat confident that Trilinos builds
// with both scalar types.
typedef typename Teuchos::ScalarTraits<scalar_type>::halfPrecision half_scalar_type;
typedef Ifpack2::Preconditioner<half_scalar_type, local_ordinal_type, global_ordinal_type, node_type> HalfIfpack2Prec;
Teuchos::RCP<HalfIfpack2Prec> concretePrecOpHalf;
#endif

if (useHalfPrecision) {
#if defined(HAVE_TPETRA_INST_DOUBLE) && defined(HAVE_TPETRA_INST_FLOAT)
if (Teuchos::nonnull(out) && Teuchos::includesVerbLevel(verbLevel, Teuchos::VERB_LOW)) {
Teuchos::OSTab(out).o() << "> Creating half precision preconditioner\n";
}


typedef Tpetra::RowMatrix<half_scalar_type, local_ordinal_type,
global_ordinal_type, node_type> row_matrix_type;
auto tpetraFwdMatrixHalf = tpetraFwdMatrix->template convert<half_scalar_type>();
concretePrecOpHalf =
Ifpack2::Factory::create<row_matrix_type> (preconditionerType, tpetraFwdMatrixHalf);
#else
TEUCHOS_TEST_FOR_EXCEPT(true);
#endif
} else {
typedef Tpetra::RowMatrix<scalar_type, local_ordinal_type,
global_ordinal_type, node_type> row_matrix_type;
concretePrecOp =
Ifpack2::Factory::create<row_matrix_type> (preconditionerType, tpetraFwdMatrix);
}

timer.stop();
if (Teuchos::nonnull(out) && Teuchos::includesVerbLevel(verbLevel, Teuchos::VERB_LOW)) {
Expand All @@ -208,13 +243,25 @@ void Ifpack2PreconditionerFactory<MatrixType>::initializePrec(

// Initialize and compute the initial preconditioner

concretePrecOp->setParameters(*packageParamList);
concretePrecOp->initialize();
concretePrecOp->compute();
if (useHalfPrecision) {
#if defined(HAVE_TPETRA_INST_DOUBLE) && defined(HAVE_TPETRA_INST_FLOAT)
concretePrecOpHalf->setParameters(*packageParamList);
concretePrecOpHalf->initialize();
concretePrecOpHalf->compute();

// Wrap concrete preconditioner
RCP<TpetraLinOp> wrappedOp = rcp(new Tpetra::MixedScalarMultiplyOp<scalar_type,half_scalar_type,local_ordinal_type,global_ordinal_type,node_type>(concretePrecOpHalf));

thyraPrecOp = Thyra::createLinearOp(wrappedOp);
#endif
} else {
concretePrecOp->setParameters(*packageParamList);
concretePrecOp->initialize();
concretePrecOp->compute();

// Wrap concrete preconditioner
thyraPrecOp = Thyra::createLinearOp(Teuchos::RCP<TpetraLinOp>(concretePrecOp));
}

const Teuchos::RCP<LinearOpBase<scalar_type> > thyraPrecOp = Thyra::createLinearOp(Teuchos::RCP<TpetraLinOp>(concretePrecOp));
defaultPrec->initializeUnspecified(thyraPrecOp);

totalTimer.stop();
Expand Down Expand Up @@ -321,6 +368,10 @@ Ifpack2PreconditionerFactory<MatrixType>::getValidParameters() const
"Number of rows/columns overlapped between subdomains in different"
"\nprocesses in the additive Schwarz-type domain-decomposition preconditioners."
);
validParamList->set(
"half precision", false,
"Whether a half-precision preconditioner should be built."
);
Teuchos::ParameterList &packageParamList = validParamList->sublist(
"Ifpack2 Settings", false,
"Preconditioner settings that are passed onto the Ifpack preconditioners themselves."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,10 @@ namespace Thyra {
if (useHalfPrecision) {
#if defined(HAVE_MUELU_TPETRA) && defined(HAVE_TPETRA_INST_DOUBLE) && defined(HAVE_TPETRA_INST_FLOAT)

// CAG: There is nothing special about the combination double-float,
// except that I feel somewhat confident that Trilinos builds
// with both scalar types.

// convert to half precision
RCP<XphMat> halfA = Xpetra::convertToHalfPrecision(A);
const std::string userName = "user data";
Expand Down
2 changes: 1 addition & 1 deletion packages/piro/src/Piro_TempusIntegrator_Def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Piro::TempusIntegrator<Scalar>::TempusIntegrator(Teuchos::RCP< Teuchos::Paramete
else if (sens_method == FORWARD) {
//forward sensitivities
basicIntegrator_ = Teuchos::null;
fwdSensIntegrator_ = Tempus::integratorForwardSensitivity<Scalar>(pList, model);
fwdSensIntegrator_ = Tempus::createIntegratorForwardSensitivity<Scalar>(pList, model);
adjSensIntegrator_ = Teuchos::null;
}
else if (sens_method == ADJOINT) {
Expand Down
10 changes: 5 additions & 5 deletions packages/rol/example/tempus/ROL_TempusReducedObjective.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#include "Teuchos_RCP.hpp"
#include "Teuchos_ParameterList.hpp"

#include "Tempus_IntegratorBasicOld.hpp"
#include "Tempus_IntegratorBasic.hpp"
#include "Tempus_IntegratorForwardSensitivity.hpp"
#include "Tempus_IntegratorAdjointSensitivity.hpp"
#include "Tempus_IntegratorPseudoTransientForwardSensitivity.hpp"
Expand Down Expand Up @@ -361,7 +361,7 @@ run_tempus(const Thyra::ModelEvaluatorBase::InArgs<Real>& inArgs,
// Create and run integrator
if (dgdp != Teuchos::null && sensitivity_method_ == "Forward") {
RCP<Tempus::IntegratorForwardSensitivity<Real> > integrator =
Tempus::integratorForwardSensitivity<Real>(tempus_params_, wrapped_model);
Tempus::createIntegratorForwardSensitivity<Real>(tempus_params_, wrapped_model);
const bool integratorStatus = integrator->advanceTime();
TEUCHOS_TEST_FOR_EXCEPTION(
!integratorStatus, std::logic_error, "Integrator failed!");
Expand Down Expand Up @@ -389,7 +389,7 @@ run_tempus(const Thyra::ModelEvaluatorBase::InArgs<Real>& inArgs,
else if (dgdp != Teuchos::null &&
sensitivity_method_ == "Pseudotransient Forward") {
RCP<Tempus::IntegratorPseudoTransientForwardSensitivity<Real> > integrator =
Tempus::integratorPseudoTransientForwardSensitivity<Real>(tempus_params_,
Tempus::createIntegratorPseudoTransientForwardSensitivity<Real>(tempus_params_,
wrapped_model);
const bool integratorStatus = integrator->advanceTime();
TEUCHOS_TEST_FOR_EXCEPTION(
Expand Down Expand Up @@ -425,8 +425,8 @@ run_tempus(const Thyra::ModelEvaluatorBase::InArgs<Real>& inArgs,
<< " and Pseudotransient Adjoint.");
}
else {
RCP<Tempus::IntegratorBasicOld<Real> > integrator =
Tempus::integratorBasic<Real>(tempus_params_, wrapped_model);
RCP<Tempus::IntegratorBasic<Real> > integrator =
Tempus::createIntegratorBasic<Real>(tempus_params_, wrapped_model);
const bool integratorStatus = integrator->advanceTime();
TEUCHOS_TEST_FOR_EXCEPTION(
!integratorStatus, std::logic_error, "Integrator failed!");
Expand Down
4 changes: 2 additions & 2 deletions packages/rol/example/tempus/example_01.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
#include "Teuchos_GlobalMPISession.hpp"
#include "Teuchos_XMLParameterListHelpers.hpp"

#include "Tempus_IntegratorBasicOld.hpp"
#include "Tempus_IntegratorBasic.hpp"

#include <fstream>

Expand Down Expand Up @@ -96,7 +96,7 @@ int main(int argc, char *argv[]) {
RCP<Teuchos::ParameterList> tempusParList = sublist(parList, "Tempus", true);
RCP<SinCosModelEvaluator<RealT>> model = Teuchos::rcp(new SinCosModelEvaluator<RealT>());

RCP<Tempus::IntegratorBasicOld<RealT> > integrator = Tempus::integratorBasic<RealT>(tempusParList, model);
RCP<Tempus::IntegratorBasic<RealT> > integrator = Tempus::createIntegratorBasic<RealT>(tempusParList, model);

integrator->advanceTime();

Expand Down
6 changes: 1 addition & 5 deletions packages/rol/example/tempus/example_parabolic.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<Parameter name="Initial Condition Consistency Check" type="bool" value="false"/>
<Parameter name="Zero Initial Guess" type="bool" value="0"/>
<Parameter name="Solver Name" type="string" value="Default Solver"/>
<Parameter name="Predictor Name" type="string" value="Default Predictor"/>
<Parameter name="Predictor Stepper Type" type="string" value="Forward Euler"/>

<ParameterList name="Default Solver">
<ParameterList name="NOX">
Expand Down Expand Up @@ -122,10 +122,6 @@
</ParameterList>
</ParameterList>

<ParameterList name="Default Predictor">
<Parameter name="Stepper Type" type="string" value="Forward Euler"/>
</ParameterList>

</ParameterList>

</ParameterList>
Expand Down
4 changes: 2 additions & 2 deletions packages/rol/example/tempus/example_parabolic_modeleval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

#include "Teuchos_GlobalMPISession.hpp"

#include "Tempus_IntegratorBasicOld.hpp"
#include "Tempus_IntegratorBasic.hpp"

#include "ROL_Stream.hpp"
#include "ROL_ParameterList.hpp"
Expand Down Expand Up @@ -114,7 +114,7 @@ int main(int argc, char *argv[]) {

// Create Tempus Integrator from ModelEvaluator.
ROL::Ptr<Tempus::Integrator<RealT>> integrator =
ROL::makePtr<Tempus::IntegratorBasicOld<RealT>>(ROL::makePtrFromRef(pl_tempus), meval);
Tempus::createIntegratorBasic<RealT>(ROL::makePtrFromRef(pl_tempus), meval);

// Initialize objective function.
ROL::Ptr<ROL::DynamicObjective<RealT>> dyn_obj =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

#include "Teuchos_GlobalMPISession.hpp"

#include "Tempus_IntegratorBasicOld.hpp"
#include "Tempus_IntegratorBasic.hpp"

#include "ROL_Stream.hpp"
#include "ROL_ParameterList.hpp"
Expand Down Expand Up @@ -118,11 +118,11 @@ int main(int argc, char *argv[]) {

// Create FORWARD Tempus Integrator from ModelEvaluator.
ROL::Ptr<Tempus::Integrator<RealT>> forward_integrator =
ROL::makePtr<Tempus::IntegratorBasicOld<RealT>>(ROL::makePtrFromRef(pl_tempus), forward_meval);
Tempus::createIntegratorBasic<RealT>(ROL::makePtrFromRef(pl_tempus), forward_meval);

// Create ADJOINT Tempus Integrator from ModelEvaluator.
ROL::Ptr<Tempus::Integrator<RealT>> adjoint_integrator =
ROL::makePtr<Tempus::IntegratorBasicOld<RealT>>(ROL::makePtrFromRef(pl_tempus), adjoint_meval);
Tempus::createIntegratorBasic<RealT>(ROL::makePtrFromRef(pl_tempus), adjoint_meval);

// Initialize objective function.
ROL::Ptr<ROL::DynamicObjective<RealT>> dyn_obj =
Expand Down
6 changes: 1 addition & 5 deletions packages/rol/example/tempus/example_sincos.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<Parameter name="Stepper Type" type="string" value="Backward Euler"/>
<Parameter name="Zero Initial Guess" type="bool" value="0"/>
<Parameter name="Solver Name" type="string" value="Default Solver"/>
<Parameter name="Predictor Name" type="string" value="Default Predictor"/>
<Parameter name="Predictor Stepper Type" type="string" value="Forward Euler"/>

<ParameterList name="Default Solver">
<ParameterList name="NOX">
Expand Down Expand Up @@ -106,10 +106,6 @@
</ParameterList>
</ParameterList>

<ParameterList name="Default Predictor">
<Parameter name="Stepper Type" type="string" value="Forward Euler"/>
</ParameterList>

</ParameterList>

</ParameterList>
Expand Down
36 changes: 34 additions & 2 deletions packages/stratimikos/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ TRIBITS_INCLUDE_DIRECTORIES(REQUIRED_DURING_INSTALLATION_TESTING ${PACKAGE_SOURC
ASSERT_DEFINED(${PACKAGE_NAME}_ENABLE_Amesos)
IF (${PACKAGE_NAME}_ENABLE_Belos)
TRIBITS_ADD_EXECUTABLE_AND_TEST(
Belos_GCRODR_strattest
Belos_GCRODR_strattest
SOURCES
test_belos_gcrodr.cpp
${TEUCHOS_STD_UNIT_TEST_MAIN}
Expand Down Expand Up @@ -56,7 +56,7 @@ IF (${PACKAGE_NAME}_ENABLE_Amesos)
TRIBITS_ADD_TEST(
test_single_stratimikos_solver_driver
NAME test_single_stratimikos_solver_driver_amesos
ARGS
ARGS
"--input-file=FourByFour.xml --show-timer-summary"
"--input-file=FourByFour.amesos.xml --show-timer-summary"
COMM serial mpi
Expand Down Expand Up @@ -165,9 +165,41 @@ ASSERT_DEFINED(${PACKAGE_NAME}_ENABLE_ThyraTpetraAdapters)
ASSERT_DEFINED(${PROJECT_NAME}_ENABLE_Tpetra)
IF (${PROJECT_NAME}_ENABLE_Tpetra)
ASSERT_DEFINED(Tpetra_INST_DOUBLE)
ASSERT_DEFINED(Tpetra_INST_FLOAT)
ASSERT_DEFINED(Tpetra_INST_INT_INT)
ENDIF()

IF (${PACKAGE_NAME}_ENABLE_Ifpack2 AND ${PACKAGE_NAME}_ENABLE_ThyraTpetraAdapters AND Tpetra_INST_DOUBLE)

TRIBITS_COPY_FILES_TO_BINARY_DIR(Stratimikos_cp
SOURCE_FILES stratimikos_jacobi.xml stratimikos_jacobi_half.xml
)

TRIBITS_ADD_EXECUTABLE(
GaleriDriver
SOURCES galeri_driver.cpp
COMM serial mpi
)

TRIBITS_ADD_TEST(
GaleriDriver
NAME "Galeri_Jacobi"
ARGS "--xml=stratimikos_jacobi.xml"
NUM_MPI_PROCS 4
)

IF (Tpetra_INST_FLOAT)
TRIBITS_ADD_TEST(
GaleriDriver
NAME "Galeri_Jacobi_HalfPrecision"
ARGS "--xml=stratimikos_jacobi_half.xml"
NUM_MPI_PROCS 4
)
ENDIF()

ENDIF ()


IF (${PACKAGE_NAME}_ENABLE_Ifpack2 AND ${PACKAGE_NAME}_ENABLE_ThyraTpetraAdapters AND Tpetra_INST_DOUBLE AND Tpetra_INST_INT_INT)
TRIBITS_ADD_EXECUTABLE(
issue_535
Expand Down
Loading