From 7f87c93a403f46c44405fd320a75748b6eb7e201 Mon Sep 17 00:00:00 2001
From: Lars Bilke <lars.bilke@ufz.de>
Date: Mon, 15 Feb 2021 21:40:27 +0100
Subject: [PATCH] [T] Removed Parsl example test.

We currently stick to Snakemake.
---
 Applications/Utils/ExtractBoundary.py | 95 ---------------------------
 Applications/Utils/Tests.cmake        | 13 +---
 scripts/cmake/Find.cmake              |  1 -
 scripts/cmake/PythonSetup.cmake       |  7 --
 web/data/versions.json                |  1 -
 5 files changed, 1 insertion(+), 116 deletions(-)
 delete mode 100644 Applications/Utils/ExtractBoundary.py

diff --git a/Applications/Utils/ExtractBoundary.py b/Applications/Utils/ExtractBoundary.py
deleted file mode 100644
index 1ca93ddb0a9..00000000000
--- a/Applications/Utils/ExtractBoundary.py
+++ /dev/null
@@ -1,95 +0,0 @@
-# Usage, e.g.:
-#   python3 ExtractBoundary.py ./buildinfo.yaml
-#
-# buildinfo.yaml contains variables such as Data_BINARY_DIR
-
-import os, parsl, sys, yaml
-from parsl import python_app, bash_app
-from parsl.data_provider.files import File
-
-output_path = "FileIO"
-elem_types = ["tri", "quad"]
-
-parsl.load()
-
-config = dict()
-with open(sys.argv[1]) as f:
-    config = yaml.safe_load(f)
-
-os.environ["PATH"] += os.pathsep + os.pathsep.join([config["BIN_DIR"]])
-os.chdir(f"{config['Data_BINARY_DIR']}/{output_path}")
-
-print(f"{config['Data_BINARY_DIR']}/{output_path}")
-
-
-# Apps
-@bash_app
-def generate_meshes(
-    elem_type, outputs=[], stderr=parsl.AUTO_LOGNAME, stdout=parsl.AUTO_LOGNAME
-):
-    return f"""generateStructuredMesh -e {elem_type} \
-            --lx 1 --ly 1 \
-            --nx 10 --ny 10 \
-            -o input_square_1x1_{elem_type}.vtu"""
-
-
-@bash_app
-def extract_boundary(
-    elem_type,
-    inputs=[],
-    outputs=[],
-    stderr=parsl.AUTO_LOGNAME,
-    stdout=parsl.AUTO_LOGNAME,
-):
-    return f"""ExtractBoundary -i {inputs[0].filepath} \
-            -o square_1x1_{elem_type}_boundary.vtu"""
-
-
-# compares the files in inputs[0] and inputs[1]
-@bash_app
-def vtk_diff(
-    fields, inputs=[], outputs=[], stderr=parsl.AUTO_LOGNAME, stdout=parsl.AUTO_LOGNAME
-):
-    import os
-
-    script = ""
-    if os.path.exists(outputs[0]):
-        os.remove(outputs[0])
-    for field in fields:
-        field_a = field[0]
-        offset = 0
-        if len(field) == 4:
-            offset = 1
-        field_b = field[0 + offset]
-        abs_tol = field[1 + offset]
-        rel_tol = field[2 + offset]
-
-        script += f"""vtkdiff {inputs[0]} {inputs[1]} \
-              -a {field_a} -b {field_b} \
-              --abs {abs_tol} --rel {rel_tol} >> {outputs[0]}
-        """
-    return script
-
-
-# Workflow
-for elem_type in elem_types:
-    gm = generate_meshes(elem_type, outputs=[File(f"input_square_1x1_{elem_type}.vtu")])
-    eb = extract_boundary(
-        elem_type,
-        inputs=[gm.outputs[0]],
-        outputs=[File(f"square_1x1_{elem_type}_boundary.vtu")],
-    )
-    diff = vtk_diff(
-        fields=[
-            # second field name can be omitted if identical
-            ["bulk_node_ids", 0, 0],
-            ["bulk_element_ids", 0, 0],
-            ["bulk_face_ids", 0, 0],
-        ],
-        inputs=[
-            eb.outputs[0],
-            f"{config['Data_SOURCE_DIR']}/{output_path}/{eb.outputs[0].filename}",
-        ],
-        outputs=[File(f"square_1x1_{elem_type}_boundary_diff.out")],
-    )
-    print(diff.result())
diff --git a/Applications/Utils/Tests.cmake b/Applications/Utils/Tests.cmake
index 7f7fe8e6795..6c5ab390489 100644
--- a/Applications/Utils/Tests.cmake
+++ b/Applications/Utils/Tests.cmake
@@ -307,18 +307,7 @@ if(SNAKEMAKE AND NOT OGS_USE_MPI)
                  -s ${CMAKE_CURRENT_SOURCE_DIR}/ExtractBoundary.smk
     )
 endif()
-if(PARSL AND NOT OGS_USE_MPI)
-    add_test(NAME parsl_ExtractBoundary
-        COMMAND ${Python3_EXECUTABLE}
-            ${CMAKE_CURRENT_SOURCE_DIR}/ExtractBoundary.py
-            ${PROJECT_BINARY_DIR}/buildinfo.yaml
-    )
-    if(SNAKEMAKE)
-        # Prevent race-condition with snakemake test
-        set_tests_properties(parsl_ExtractBoundary PROPERTIES DEPENDS snakemake_ExtractBoundary)
-    endif()
-endif()
-if(SNAKEMAKE OR PARSL)
+if(SNAKEMAKE)
     add_dependencies(ctest ExtractBoundary)
 endif()
 
diff --git a/scripts/cmake/Find.cmake b/scripts/cmake/Find.cmake
index f49ae383344..3dcb6f4f3dc 100644
--- a/scripts/cmake/Find.cmake
+++ b/scripts/cmake/Find.cmake
@@ -54,7 +54,6 @@ find_program(PANDOC_CITEPROC pandoc-citeproc)
 find_program(MODULE_CMD lmod PATHS /software/lmod/lmod/libexec)
 
 find_program(SNAKEMAKE snakemake HINTS ${LOCAL_VIRTUALENV_BIN_DIRS})
-find_program(PARSL parsl-visualize HINTS ${LOCAL_VIRTUALENV_BIN_DIRS})
 
 find_program(GMSH gmsh)
 
diff --git a/scripts/cmake/PythonSetup.cmake b/scripts/cmake/PythonSetup.cmake
index 7e2dbe63a86..9c681984790 100644
--- a/scripts/cmake/PythonSetup.cmake
+++ b/scripts/cmake/PythonSetup.cmake
@@ -45,13 +45,6 @@ set(LOCAL_VIRTUALENV_BIN_DIRS
 if(POETRY)
     if(BUILD_TESTING)
         list(APPEND PYTHON_PACKAGES snakemake=${ogs.minimum_version.snakemake})
-        if(NOT WIN32)
-            # Parsl is not supported on Windows yet
-            # https://github.com/Parsl/parsl/issues/1878
-            list(APPEND PYTHON_PACKAGES parsl=${ogs.minimum_version.parsl}
-                asn1crypto # module dep of crypthography is missing on CI Linux
-            )
-        endif()
     endif()
     execute_process(COMMAND ${CMD_COMMAND} poetry add ${PYTHON_PACKAGES}
         WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
diff --git a/web/data/versions.json b/web/data/versions.json
index 1e8d67359e9..51e4de5824d 100644
--- a/web/data/versions.json
+++ b/web/data/versions.json
@@ -20,7 +20,6 @@
     "qt": "5.14.2",
     "python": "3.6",
     "snakemake": "5.27.4",
-    "parsl": "1.0.0",
     "hdf5": "1.10.5"
   },
   "tested_version": {
-- 
GitLab