Skip to content

Commit

Permalink
Merge pull request idaholab#11588 from brianmoose/enable-jit
Browse files Browse the repository at this point in the history
Add a TestHarness parameter to skip test based on JIT availability
  • Loading branch information
permcody committed May 24, 2018
2 parents 7bf98a1 + 320eb64 commit 7794b2e
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 5 deletions.
13 changes: 11 additions & 2 deletions framework/src/utils/FunctionParserUtils.C
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ validParams<FunctionParserUtils>()
{
InputParameters params = emptyInputParameters();

#ifdef LIBMESH_HAVE_FPARSER_JIT
params.addParam<bool>(
"enable_jit",
#ifdef LIBMESH_HAVE_FPARSER_JIT
true,
#else
false,
#endif
"Enable just-in-time compilation of function expressions for faster evaluation");
params.addParamNamesToGroup("enable_jit", "Advanced");
#endif
params.addParam<bool>(
"enable_ad_cache", true, "Enable cacheing of function derivatives for faster startup time");
params.addParam<bool>(
Expand Down Expand Up @@ -59,6 +61,13 @@ FunctionParserUtils::FunctionParserUtils(const InputParameters & parameters)
_fail_on_evalerror(parameters.get<bool>("fail_on_evalerror")),
_nan(std::numeric_limits<Real>::quiet_NaN())
{
#ifndef LIBMESH_HAVE_FPARSER_JIT
if (_enable_jit)
{
mooseWarning("Tried to enable FParser JIT but libmesh does not have it compiled in.");
_enable_jit = false;
}
#endif
}

void
Expand Down
1 change: 1 addition & 0 deletions modules/combined/examples/mortar/tests
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# input we can run on something much smaller...
cli_args = 'Mesh/nx=2 Mesh/ny=2'
check_input = True
fparser_jit = True
[../]
[./mortar_gradient]
type = RunApp
Expand Down
2 changes: 2 additions & 0 deletions modules/combined/examples/periodic_strain/tests
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
# input we can run on something much smaller...
cli_args = 'Mesh/nx=2 Mesh/ny=2'
check_input = True
fparser_jit = True
[../]
[./strain_3D]
type = RunApp
input = 'global_strain_pfm_3D.i'
# Checking input on smaller mesh
cli_args = 'Mesh/nx=2 Mesh/ny=2 Mesh/nz=2'
check_input = True
fparser_jit = True
[../]
[]
2 changes: 2 additions & 0 deletions modules/combined/examples/phase_field-mechanics/tests
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
type = RunApp
input = 'Conserved.i'
check_input = True
fparser_jit = True
[../]
[./EBSD_reconstruction_grain_growth_mech]
type = RunApp
Expand All @@ -23,6 +24,7 @@
# it takes to run.
cli_args = 'Mesh/nx=2 Mesh/ny=2'
check_input = True
fparser_jit = True
[../]
[./grain_texture]
type = RunApp
Expand Down
4 changes: 4 additions & 0 deletions modules/combined/test/tests/eigenstrain/tests
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@
type = 'Exodiff'
input = 'variable.i'
exodiff = 'variable_out.e'
fparser_jit = True
[../]
[./variable_finite]
type = 'Exodiff'
input = 'variable_finite.i'
exodiff = 'variable_finite_out.e'
fparser_jit = True
[../]
[./variable_cahnhilliard]
type = 'Exodiff'
input = 'variable_cahnhilliard.i'
exodiff = 'variable_cahnhilliard_out.e'
fparser_jit = True
[../]
[./composite]
type = 'Exodiff'
Expand All @@ -23,5 +26,6 @@
type = 'Exodiff'
input = 'inclusion.i'
exodiff = 'inclusion_out.e'
fparser_jit = True
[../]
[]
2 changes: 2 additions & 0 deletions modules/phase_field/examples/cahn-hilliard/tests
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
type = RunApp
input = 'Parsed_CH.i'
check_input = True
fparser_jit = True
[../]
[./Parsed_SplitCH]
type = RunApp
input = 'Parsed_SplitCH.i'
check_input = True
fparser_jit = True
[../]
[]
2 changes: 2 additions & 0 deletions modules/phase_field/test/tests/MultiPhase/tests
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
type = 'Exodiff'
input = 'derivativetwophasematerial.i'
exodiff = 'derivativetwophasematerial_out.e'
fparser_jit = True
[../]
[./orderparameterfunctionmaterial]
type = 'Exodiff'
Expand Down Expand Up @@ -34,6 +35,7 @@
type = 'Exodiff'
input = 'lagrangemult.i'
exodiff = 'lagrangemult_out.e'
fparser_jit = True
[../]
[./penalty]
type = 'Exodiff'
Expand Down
1 change: 1 addition & 0 deletions modules/phase_field/test/tests/TotalFreeEnergy/tests
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
type = 'Exodiff'
input = 'TotalFreeEnergy_2var_test.i'
exodiff = 'TotalFreeEnergy_2var_test_out.e-s004'
fparser_jit = True
[../]
[]
2 changes: 2 additions & 0 deletions python/TestHarness/TestHarness.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ def __init__(self, argv, moose_dir, app_name=None):
checks['cxx11'] = set(['ALL'])
checks['asio'] = set(['ALL'])
checks['boost'] = set(['ALL'])
checks['fparser_jit'] = set(['ALL'])
else:
checks['compiler'] = util.getCompilers(self.libmesh_dir)
checks['petsc_version'] = util.getPetscVersion(self.libmesh_dir)
Expand All @@ -169,6 +170,7 @@ def __init__(self, argv, moose_dir, app_name=None):
checks['cxx11'] = util.getLibMeshConfigOption(self.libmesh_dir, 'cxx11')
checks['asio'] = util.getIfAsioExists(self.moose_dir)
checks['boost'] = util.getLibMeshConfigOption(self.libmesh_dir, 'boost')
checks['fparser_jit'] = util.getLibMeshConfigOption(self.libmesh_dir, 'fparser_jit')

# Override the MESH_MODE option if using the '--distributed-mesh'
# or (deprecated) '--parallel-mesh' option.
Expand Down
3 changes: 2 additions & 1 deletion python/TestHarness/testers/Tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def validParams():
params.addParam('unique_id', ['ALL'], "A test that runs only if libmesh is configured with --enable-unique-id ('ALL', 'TRUE', 'FALSE')")
params.addParam('cxx11', ['ALL'], "A test that runs only if CXX11 is available ('ALL', 'TRUE', 'FALSE')")
params.addParam('asio', ['ALL'], "A test that runs only if ASIO is available ('ALL', 'TRUE', 'FALSE')")
params.addParam("fparser_jit", ['ALL'], "A test that runs only if FParser JIT is available ('ALL', 'TRUE', 'FALSE')")
params.addParam('depend_files', [], "A test that only runs if all depend files exist (files listed are expected to be relative to the base directory, not the test directory")
params.addParam('env_vars', [], "A test that only runs if all the environment variables listed exist")
params.addParam('should_execute', True, 'Whether or not the executable needs to be run. Use this to chain together multiple tests based off of one executeable invocation')
Expand Down Expand Up @@ -487,7 +488,7 @@ def checkRunnableBase(self, options):

# PETSc and SLEPc is being explicitly checked above
local_checks = ['platform', 'compiler', 'mesh_mode', 'method', 'library_mode', 'dtk', 'unique_ids', 'vtk', 'tecplot', \
'petsc_debug', 'curl', 'tbb', 'superlu', 'cxx11', 'asio', 'unique_id', 'slepc', 'petsc_version_release', 'boost']
'petsc_debug', 'curl', 'tbb', 'superlu', 'cxx11', 'asio', 'unique_id', 'slepc', 'petsc_version_release', 'boost', 'fparser_jit']
for check in local_checks:
test_platforms = set()
operator_display = '!='
Expand Down
2 changes: 1 addition & 1 deletion python/TestHarness/tests/test_ExtraInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def testExtraInfo(self):
'SLEPC_VERSION', 'MESH_MODE', 'METHOD', 'BOOST',
'PETSC_DEBUG', 'LIBRARY_MODE', 'PETSC_VERSION',
'CURL', 'TBB', 'SLEPC', 'VTK', 'UNIQUE_ID',
'COMPILER']
'COMPILER', 'FPARSER_JIT']

# Verify all special TestHarness 'checks' are printed. We
# will use the --ignore feature to force the test to run
Expand Down
2 changes: 1 addition & 1 deletion python/TestHarness/tests/tests
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
type = PythonUnitTest
input = test_Allocations.py
[../]
[./exra_info]
[./extra_info]
type = PythonUnitTest
input = test_ExtraInfo.py
[../]
Expand Down
4 changes: 4 additions & 0 deletions python/TestHarness/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@
'default' : 'FALSE',
'options' : {'TRUE' : '1', 'FALSE' : '0'}
},
'fparser_jit' : { 're_option' : r'#define\s+LIBMESH_HAVE_FPARSER_JIT\s+(\d+)',
'default' : 'FALSE',
'options' : {'TRUE' : '1', 'FALSE' : '0'}
},
}


Expand Down
1 change: 1 addition & 0 deletions test/tests/test_harness/extra_info
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@
cxx11 = true
asio = true
boost = true
fparser_jit = true
[../]
[]

0 comments on commit 7794b2e

Please sign in to comment.