Commit 3b642398 authored by Lukas Riedel's avatar Lukas Riedel

added tests for comparing sequential and parallel results. slightly altered...

added tests for comparing sequential and parallel results. slightly altered reference.py for this task
parent b24e6ecb
......@@ -19,7 +19,14 @@ def evaluate(iniinfo,runtime):
raise ValueError("The reference evaluator assumes the key _reference.path to be existent in the inifile")
if not os.path.isfile(reference):
raise RuntimeError("Reference file {} does not exist".format(reference))
try:
reference_new = iniinfo["_reference.path"] + "/" + iniinfo["_reference.name"] + ".pvd"
except KeyError:
raise ValueError("Since there is not a single reference file found that matches the output filename, "
"The reference evaluator assumes the keys _reference.path and _reference.name to be existent in the inifile")
vtks_ref = pvd_reader.read(reference_new)
reference = vtks_ref[-1].path
vtkfile_run = vtkfile.VTKFile(vtks[-1].path)
vtkfile_run.read()
......
......@@ -2,6 +2,20 @@ message(STATUS "Handling system tests")
configure_file(CTestCustom.cmake ${CMAKE_BINARY_DIR} @ONLY)
# create a list of available numbers of cores
include(ProcessorCount)
ProcessorCount(num_proc)
set(num_proc_list "2")
if(num_proc GREATER 2)
# limit number of tests
if(num_proc GREATER 8)
set(num_proc 8)
endif()
foreach(n RANGE 3 ${num_proc})
set(num_proc_list "${num_proc_list}, ${n}")
endforeach()
endif()
function(dorie_add_system_test target metaini)
configure_file(${metaini}.in ${CMAKE_CURRENT_LIST_DIR}/${metaini})
dune_add_system_test(TARGET ${target} INIFILE ${metaini} SCRIPT test_dorie.py)
......@@ -23,6 +37,16 @@ dorie_add_system_test(dorie reference_3d.mini)
dorie_add_system_test(dorie reference_evaporation.mini)
dorie_add_system_test(dorie reference_interpolators.mini)
# dorie in parallel
if(num_proc GREATER 1)
dorie_add_system_test(dorie parallel_reference.mini)
dorie_add_system_test(dorie parallel_reference_compare.mini)
math(EXPR ptest_range "${num_proc} - 2")
foreach(n RANGE ${ptest_range})
dorie_add_system_test_dependency(dorie_parallel_reference_compare_000${n} dorie_parallel_reference)
endforeach()
endif()
# dorie pfg
dorie_add_system_test(dorie-rfg parfield.mini)
dorie_add_system_test(dorie-rfg parfield_muphi.mini)
......
include ${CMAKE_BINARY_DIR}/doc/default_files/config.ini
__name = parallel_reference
_test_command = run
_asset_path = "${CMAKE_CURRENT_LIST_DIR}"
output.fileName = parallel_reference
output.outputPath = parallel_reference
output.verbose = 0
time.end = 1E5
time.maxTimestep = 1E5
time.startTimestep = 1E3
adaptivity.useAdaptivity = false
grid.initialLevel = 1
grid.gridType = rectangular
grid.cells = 20 20
grid.extensions = 1 1
boundary.file = "{_asset_path}/bcs/infiltration_2d.dat"
parameters.arrayFile = "{_asset_path}/parfields/fft_2d_miller.h5"
\ No newline at end of file
include ${CMAKE_BINARY_DIR}/doc/default_files/config.ini
_num_proc = ${num_proc_list} | expand
__name = parallel_reference_compare
_test_command = run
_test_command_options = --parallel {_num_proc} -m=--allow-run-as-root
_asset_path = "${CMAKE_CURRENT_LIST_DIR}"
_evaluation = reference
_reference.path = "${CMAKE_CURRENT_BINARY_DIR}/"
_reference.name = parallel_reference
output.fileName = parallel_reference_compare | unique
output.outputPath = parallel_reference_compare | unique
output.verbose = 0
time.end = 1E5
time.maxTimestep = 1E5
time.startTimestep = 1E3
adaptivity.useAdaptivity = false
grid.initialLevel = 1
grid.gridType = rectangular
grid.cells = 20 20
grid.extensions = 1 1
boundary.file = "{_asset_path}/bcs/infiltration_2d.dat"
parameters.arrayFile = "{_asset_path}/parfields/fft_2d_miller.h5"
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment