Skip to content

Commit

Permalink
Panzer: remove use of Fad version of BasisValues
Browse files Browse the repository at this point in the history
-Fixes CurlLaplacian test for cuda, trilinos#3340
-Changes test to use Tpetra instead of Epetra by default
-Revert "Disable PanzerAdaptersSTK_CurlLaplacianExample-ConvTest-Quad-Order-4 on waterman CUDA (trilinos#3340)"

This reverts commit f17f9bd.
  • Loading branch information
rppawlo authored and tjfulle committed Dec 6, 2018
1 parent 09ecf53 commit 342ac7b
Show file tree
Hide file tree
Showing 21 changed files with 1,625 additions and 1,565 deletions.
2 changes: 0 additions & 2 deletions cmake/std/atdm/waterman/tweaks/CUDA_COMMON_TWEAKS.cmake
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
# This test runs out of CUDA memory all on its own (#3340)
ATDM_SET_ENABLE(PanzerAdaptersSTK_CurlLaplacianExample-ConvTest-Quad-Order-4_DISABLE ON)
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@ FOREACH( ORDER 1 2 3 4 )
TRIBITS_ADD_ADVANCED_TEST(
CurlLaplacianExample-ConvTest-Quad-Order-${ORDER}
TEST_0 EXEC CurlLaplacianExample
ARGS --use-epetra --use-twod --cell="Quad" --x-elements=4 --y-elements=4 --z-elements=4 --basis-order=${ORDER}
PASS_REGULAR_EXPRESSION "ALL PASSED: Epetra"
ARGS --use-tpetra --use-twod --cell="Quad" --x-elements=4 --y-elements=4 --z-elements=4 --basis-order=${ORDER}
PASS_REGULAR_EXPRESSION "ALL PASSED: Tpetra"
NUM_MPI_PROCS 4
OUTPUT_FILE MPE-ConvTest-Quad-${ORDER}-04
TEST_1 EXEC CurlLaplacianExample
ARGS --use-epetra --use-twod --cell="Quad" --x-elements=8 --y-elements=8 --z-elements=4 --basis-order=${ORDER}
PASS_REGULAR_EXPRESSION "ALL PASSED: Epetra"
ARGS --use-tpetra --use-twod --cell="Quad" --x-elements=8 --y-elements=8 --z-elements=4 --basis-order=${ORDER}
PASS_REGULAR_EXPRESSION "ALL PASSED: Tpetra"
NUM_MPI_PROCS 4
OUTPUT_FILE MPE-ConvTest-Quad-${ORDER}-08
TEST_2 EXEC CurlLaplacianExample
ARGS --use-epetra --use-twod --cell="Quad" --x-elements=16 --y-elements=16 --z-elements=4 --basis-order=${ORDER}
PASS_REGULAR_EXPRESSION "ALL PASSED: Epetra"
ARGS --use-tpetra --use-twod --cell="Quad" --x-elements=16 --y-elements=16 --z-elements=4 --basis-order=${ORDER}
PASS_REGULAR_EXPRESSION "ALL PASSED: Tpetra"
NUM_MPI_PROCS 4
OUTPUT_FILE MPE-ConvTest-Quad-${ORDER}-16
TEST_3 EXEC CurlLaplacianExample
ARGS --use-epetra --use-twod --cell="Quad" --x-elements=32 --y-elements=32 --z-elements=4 --basis-order=${ORDER}
PASS_REGULAR_EXPRESSION "ALL PASSED: Epetra"
ARGS --use-tpetra --use-twod --cell="Quad" --x-elements=32 --y-elements=32 --z-elements=4 --basis-order=${ORDER}
PASS_REGULAR_EXPRESSION "ALL PASSED: Tpetra"
NUM_MPI_PROCS 4
OUTPUT_FILE MPE-ConvTest-Quad-${ORDER}-32
TEST_4 CMND python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
#include "EpetraExt_RowMatrixOut.h"
#include "EpetraExt_VectorOut.h"

#include "BelosBlockGmresSolMgr.hpp"
#include "BelosPseudoBlockGmresSolMgr.hpp"
#include "BelosTpetraAdapter.hpp"

#include "Example_BCStrategy_Factory.hpp"
Expand Down Expand Up @@ -169,7 +169,7 @@ int main(int argc,char * argv[])
// Build command line processor
////////////////////////////////////////////////////

bool useTpetra = false;
bool useTpetra = true;
bool threeD = false;
int x_elements=20,y_elements=20,z_elements=20;
std::string celltype = "Quad"; // or "Tri" (2d), Hex or Tet (3d)
Expand Down Expand Up @@ -638,11 +638,10 @@ void solveTpetraSystem(panzer::LinearObjContainer & container)
Teuchos::RCP<ProblemType> problem(new ProblemType(tp_container.get_A(), tp_container.get_x(), tp_container.get_f()));
TEUCHOS_ASSERT(problem->setProblem());

typedef Belos::BlockGmresSolMgr<double,MV,OP> SolverType;
typedef Belos::PseudoBlockGmresSolMgr<double,MV,OP> SolverType;

Teuchos::ParameterList belosList;
belosList.set( "Flexible Gmres", false ); // Flexible Gmres will be used to solve this problem
belosList.set( "Num Blocks", 1000 ); // Maximum number of blocks in Krylov factorization
belosList.set( "Num Blocks", 3000 ); // Maximum number of blocks in Krylov factorization
belosList.set( "Block Size", 1 ); // Blocksize to be used by iterative solver
belosList.set( "Maximum Iterations", 5000 ); // Maximum number of iterations allowed
belosList.set( "Maximum Restarts", 1 ); // Maximum number of restarts allowed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ namespace panzer {

fm.evaluateFields<panzer::Traits::Jacobian>(workset);

PHX::MDField<panzer::Traits::Jacobian::ScalarT,panzer::Cell,panzer::BASIS,panzer::IP>
PHX::MDField<panzer::Traits::Residual::ScalarT,panzer::Cell,panzer::BASIS,panzer::IP>
basis(basis_q1->name()+"_"+point_rule->getName()+"_"+"basis",layout->basis);
fm.getFieldData<panzer::Traits::Jacobian>(basis);
out << basis << std::endl;
Expand All @@ -341,7 +341,7 @@ namespace panzer {
for(int i=0;i<4;i++) {
for(int j=0;j<4;j++) {
for(unsigned int k=0;k<bases->basis_scalar.extent(2);k++) {
TEST_FLOATING_EQUALITY(bases->basis_scalar(i,j,k),basis(i,j,k).val(),1e-10);
TEST_FLOATING_EQUALITY(bases->basis_scalar(i,j,k),basis(i,j,k),1e-10);
}
}
}
Expand Down Expand Up @@ -472,16 +472,17 @@ namespace panzer {

fm.evaluateFields<panzer::Traits::Jacobian>(workset);

PHX::MDField<panzer::Traits::Jacobian::ScalarT,Cell,BASIS,IP,Dim>
// NOTE: basis values are always double, not Fad.
PHX::MDField<panzer::Traits::Residual::ScalarT,Cell,BASIS,IP,Dim>
basis(basis_edge->name()+"_"+point_rule->getName()+"_basis",layout->basis_grad);
PHX::MDField<panzer::Traits::Jacobian::ScalarT,Cell,BASIS,IP>
PHX::MDField<panzer::Traits::Residual::ScalarT,Cell,BASIS,IP>
curl_basis(basis_edge->name()+"_"+point_rule->getName()+"_curl_basis",layout->basis);
PHX::MDField<panzer::Traits::Jacobian::ScalarT,Cell,IP,Dim,Dim>
PHX::MDField<panzer::Traits::Residual::ScalarT,Cell,IP,Dim,Dim>
jac_inv("CubaturePoints (Degree=4,volume)_jac_inv",point_rule->dl_tensor);

fm.getFieldData<panzer::Traits::Jacobian,panzer::Traits::Jacobian::ScalarT,Cell,BASIS,IP,Dim>(basis);
fm.getFieldData<panzer::Traits::Jacobian,panzer::Traits::Jacobian::ScalarT,Cell,BASIS,IP>(curl_basis);
fm.getFieldData<panzer::Traits::Jacobian,panzer::Traits::Jacobian::ScalarT,Cell,IP,Dim,Dim>(jac_inv);
fm.getFieldData<panzer::Traits::Jacobian,panzer::Traits::Residual::ScalarT,Cell,BASIS,IP,Dim>(basis);
fm.getFieldData<panzer::Traits::Jacobian,panzer::Traits::Residual::ScalarT,Cell,BASIS,IP>(curl_basis);
fm.getFieldData<panzer::Traits::Jacobian,panzer::Traits::Residual::ScalarT,Cell,IP,Dim,Dim>(jac_inv);

WorksetDetailsAccessor wda;
std::size_t basisIndex = panzer::getBasisIndex(layout->name(), workset, wda);
Expand All @@ -494,7 +495,7 @@ namespace panzer {
for(int j=0;j<4;j++) {
for(unsigned int k=0;k<bases->curl_basis_scalar.extent(2);k++) {
for(unsigned int d=0;d<bases->basis_vector.extent(3);d++) {
TEST_FLOATING_EQUALITY(bases->basis_vector(i,j,k,d),basis(i,j,k,d).val(),1e-10);
TEST_FLOATING_EQUALITY(bases->basis_vector(i,j,k,d),basis(i,j,k,d),1e-10);
}
}
}
Expand All @@ -503,7 +504,7 @@ namespace panzer {
for(int i=0;i<4;i++) {
for(int j=0;j<4;j++) {
for(unsigned int k=0;k<bases->curl_basis_scalar.extent(2);k++) {
TEST_FLOATING_EQUALITY(bases->curl_basis_scalar(i,j,k),curl_basis(i,j,k).val(),1e-10);
TEST_FLOATING_EQUALITY(bases->curl_basis_scalar(i,j,k),curl_basis(i,j,k),1e-10);
}
}
}
Expand Down
Loading

0 comments on commit 342ac7b

Please sign in to comment.