Skip to content
Snippets Groups Projects
Commit 5f8ada6a authored by EXT Jean-Matthieu Etancelin's avatar EXT Jean-Matthieu Etancelin
Browse files

Merge remote-tracking branch 'origin-uppa/add-custom-opencl' into add-custom-opencl

parents 59647ef9 ca99f6e4
No related branches found
No related tags found
1 merge request!34Add custom opencl
Pipeline #94849 passed
......@@ -136,6 +136,7 @@ if [ "$RUN_TESTS" = true ]; then
hysop_test "operator/tests/test_directional_diffusion.py"
hysop_test "operator/tests/test_directional_stretching.py"
hysop_test "operator/tests/test_custom_symbolic.py"
hysop_test "operator/tests/test_custom.py"
hysop_test "operator/tests/test_spectral_derivative.py"
hysop_test "operator/tests/test_spectral_curl.py"
hysop_test "operator/tests/test_diffusion.py"
......
......@@ -44,8 +44,8 @@ if [[ ! -f "${EXAMPLE_FILE}" ]]; then
fi
echo ' Running simulations...'
${PYTHON_EXECUTABLE} "${EXAMPLE_FILE}" ${COMMON_OPTIONS} -S "${TEST_DIR}/checkpoint0.tar" --dump-dir "${TEST_DIR}/run0" --checkpoint-dump-time 0.05 --checkpoint-dump-freq 0
${PYTHON_EXECUTABLE} "${EXAMPLE_FILE}" ${COMMON_OPTIONS} -S "${TEST_DIR}/checkpoint1.tar" --dump-dir "${TEST_DIR}/run1" --checkpoint-dump-time 0.05 --checkpoint-dump-freq 0
${MPIRUN_EXECUTABLE} ${MPIRUN_TASKS_OPTION} 1 ${PYTHON_EXECUTABLE} "${EXAMPLE_FILE}" ${COMMON_OPTIONS} -S "${TEST_DIR}/checkpoint0.tar" --dump-dir "${TEST_DIR}/run0" --checkpoint-dump-time 0.05 --checkpoint-dump-freq 0
${MPIRUN_EXECUTABLE} ${MPIRUN_TASKS_OPTION} 1 ${PYTHON_EXECUTABLE} "${EXAMPLE_FILE}" ${COMMON_OPTIONS} -S "${TEST_DIR}/checkpoint1.tar" --dump-dir "${TEST_DIR}/run1" --checkpoint-dump-time 0.05 --checkpoint-dump-freq 0
echo ' Comparing solutions...'
echo " >debug dumps match"
......@@ -58,8 +58,8 @@ done
echo
echo ' Running simulations from checkpoints...'
${PYTHON_EXECUTABLE} "${EXAMPLE_FILE}" ${COMMON_OPTIONS} -L "${TEST_DIR}/checkpoint0.tar" --dump-dir "${TEST_DIR}/run2"
${PYTHON_EXECUTABLE} "${EXAMPLE_FILE}" ${COMMON_OPTIONS} -L "${TEST_DIR}/checkpoint1.tar" --dump-dir "${TEST_DIR}/run3"
${MPIRUN_EXECUTABLE} ${MPIRUN_TASKS_OPTION} 1 ${PYTHON_EXECUTABLE} "${EXAMPLE_FILE}" ${COMMON_OPTIONS} -L "${TEST_DIR}/checkpoint0.tar" --dump-dir "${TEST_DIR}/run2"
${MPIRUN_EXECUTABLE} ${MPIRUN_TASKS_OPTION} 1 ${PYTHON_EXECUTABLE} "${EXAMPLE_FILE}" ${COMMON_OPTIONS} -L "${TEST_DIR}/checkpoint1.tar" --dump-dir "${TEST_DIR}/run3"
echo ' Comparing solutions...'
compare_files "${TEST_DIR}/run2/dump/run.txt" "${TEST_DIR}/run3/dump/run.txt"
......
......@@ -46,10 +46,7 @@ class TestCustom(object):
@staticmethod
def __analytic_python(F):
(x, y, z) = F.compute_mesh_coords
F.data[0][...] = (x**2)*npw.sin(y)*npw.exp(z)
for _ in range(1, 6):
F.data[0][...] += (x**2)*npw.sin(y)*npw.exp(z*_)
TestCustom.__analytic_init(F.data[0], F.compute_mesh_coords, 0)
__analytic_opencl = """
int3 i_xyz = get_Fi_xyz(i);
......@@ -163,6 +160,12 @@ class TestCustom(object):
msg = 'Test failed for {} on component {} for implementation {}.'.format(iname, i, impl)
raise RuntimeError(msg)
def test(self):
self._test(3, HYSOP_REAL)
def perform_tests(self):
self.test()
if __name__ == '__main__':
TestCustom.setup_class(enable_extra_tests=False,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment