aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2022-03-09 16:31:01 +0100
committerThomas White <taw@physics.org>2022-03-18 16:46:30 +0100
commita4c786d52613063d338ee010f4415e8a6aef0513 (patch)
tree31479897a5099c9872d20dce9d41d133426ea5ab /CMakeLists.txt
parent66c1f2a616ae5082ed73d4cd2cc339b65f0d6f61 (diff)
GUI: Use sbatch/scancel/scontrol instead of Slurm API
This commit strips out all references to the Slurm API, instead making subprocess calls to sbatch and scontrol. Attempting to use the Slurm API seems to have been a mis-step. First, it seems that nowhere has the Slurm headers pre-installed. Literally none of the facilities where there are known deployments of CrystFEL have them. And in a significant fraction of cases, getting them installed is difficult, slow or impossible. In addition, the API doesn't seem to work in all cases, so we already shell out to 'scancel' to abort jobs - see d76fc3495. There are some tricky implications for submitting Slurm jobs from a container via the API. The Slurm REST API offers a solution, but is very new and not widely available. Calls to the Slurm executables are much easier to 'tunnel' out of a container. This isn't a great solution. It's a net increase of only about 40 lines of source code, but it incurs some unpleasant string handling and will probably be less reliable overall. It completely relies on Slurm's not being internationalised. If Slurm's messages start getting translated, we will be in trouble.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt15
1 files changed, 1 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f9073ca6..6002d708 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,11 +17,6 @@ find_package(GSL REQUIRED)
find_package(OpenCL)
find_package(PkgConfig)
-# Find SLURM
-set(CMAKE_REQUIRED_LIBRARIES "-lslurm")
-check_symbol_exists(slurm_api_version "slurm/slurm.h" HAVE_SLURM)
-unset(CMAKE_REQUIRED_LIBRARIES)
-
# Request HDF5 1.10-style API (can't use 1.12-style yet)
add_definitions(-DH5_USE_110_API)
add_definitions(-DH5O_GET_INFO_BY_IDX1)
@@ -389,21 +384,13 @@ if (GTK_FOUND)
src/gui_project.c src/crystfelindexingopts.c src/crystfelmergeopts.c
src/crystfelsymmetryselector.c src/gtk-util-routines.c src/gui_fom.c
src/gui_export.c src/gui_ambi.c src/gui_import.c
- src/gtkmultifilechooserbutton.c)
-
- if (HAVE_SLURM)
- set(CRYSTFEL_GUI_SOURCES ${CRYSTFEL_GUI_SOURCES} src/gui_backend_slurm.c)
- endif (HAVE_SLURM)
+ src/gtkmultifilechooserbutton.c src/gui_backend_slurm.c)
add_executable(crystfel ${CRYSTFEL_GUI_SOURCES}
${CMAKE_CURRENT_BINARY_DIR}/version.c)
target_include_directories(crystfel PRIVATE ${COMMON_INCLUDES} ${GTK_INCLUDE_DIRS})
target_link_libraries (crystfel ${COMMON_LIBRARIES} util ${GTK_LIBRARIES})
- if (HAVE_SLURM)
- target_link_libraries(crystfel slurm)
- endif (HAVE_SLURM)
-
list(APPEND CRYSTFEL_EXECUTABLES crystfel)
endif (GTK_FOUND)