From b7251ce3bf65bcbec7ecbb98a0eb0b3c9abde507 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Fri, 13 Sep 2024 09:35:34 -0400 Subject: Move guard_ macros to core_mem.h * Move core_mem.h below config.h --- include/core.h | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'include/core.h') diff --git a/include/core.h b/include/core.h index ef90e96..614a894 100644 --- a/include/core.h +++ b/include/core.h @@ -21,6 +21,7 @@ #define HTTP_ERROR(X) X >= 400 #include "config.h" +#include "core_mem.h" #include "envctl.h" #include "template.h" #include "utils.h" @@ -42,16 +43,6 @@ #include "github.h" #include "template_func_proto.h" -#define guard_runtime_free(X) do { if (X) { runtime_free(X); X = NULL; } } while (0) -#define guard_strlist_free(X) do { if ((*X)) { strlist_free(X); (*X) = NULL; } } while (0) -#define guard_free(X) do { if (X) { free(X); X = NULL; } } while (0) -#define GENERIC_ARRAY_FREE(ARR) do { \ - for (size_t ARR_I = 0; ARR && ARR[ARR_I] != NULL; ARR_I++) { \ - guard_free(ARR[ARR_I]); \ - } \ - guard_free(ARR); \ -} while (0) - #define COE_CHECK_ABORT(COND, MSG) \ do {\ if (!globals.continue_on_error && COND) { \ @@ -71,6 +62,8 @@ struct STASIS_GLOBAL { bool enable_testing; //!< Enable package testing bool enable_overwrite; //!< Enable release file clobbering bool enable_rewrite_spec_stage_2; //!< Enable automatic @STR@ replacement in output files + long cpu_limit; + long parallel_fail_fast; struct StrList *conda_packages; //!< Conda packages to install after initial activation struct StrList *pip_packages; //!< Pip packages to install after initial activation char *tmpdir; //!< Path to temporary storage directory -- cgit From 63cf3148cc3f60edf5c604a562ec95b40b8cb010 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Fri, 13 Sep 2024 15:01:29 -0400 Subject: Add multiprocessing.h to core.h * Remove multiprocessing.h from other files --- include/core.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/core.h') diff --git a/include/core.h b/include/core.h index 614a894..5011dea 100644 --- a/include/core.h +++ b/include/core.h @@ -22,6 +22,7 @@ #include "config.h" #include "core_mem.h" +#include "multiprocessing.h" #include "envctl.h" #include "template.h" #include "utils.h" -- cgit From f6c504630ecfa38c1516123019bdf67b921f1107 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 2 Oct 2024 14:56:59 -0400 Subject: Allow user to define the time interval for "task is running" message --- include/core.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/core.h') diff --git a/include/core.h b/include/core.h index 5011dea..ae0e8fe 100644 --- a/include/core.h +++ b/include/core.h @@ -65,6 +65,7 @@ struct STASIS_GLOBAL { bool enable_rewrite_spec_stage_2; //!< Enable automatic @STR@ replacement in output files long cpu_limit; long parallel_fail_fast; + int pool_status_interval; //!< Report "Task is running" every n seconds struct StrList *conda_packages; //!< Conda packages to install after initial activation struct StrList *pip_packages; //!< Pip packages to install after initial activation char *tmpdir; //!< Path to temporary storage directory -- cgit From 6fe8c2572fbf73cee3936ab241fcbfbdd54fe633 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 2 Oct 2024 15:00:12 -0400 Subject: Allow user to disable parallel mode (shortcut for --cpu-limit=1) --- include/core.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include/core.h') diff --git a/include/core.h b/include/core.h index ae0e8fe..e09b212 100644 --- a/include/core.h +++ b/include/core.h @@ -63,8 +63,9 @@ struct STASIS_GLOBAL { bool enable_testing; //!< Enable package testing bool enable_overwrite; //!< Enable release file clobbering bool enable_rewrite_spec_stage_2; //!< Enable automatic @STR@ replacement in output files - long cpu_limit; - long parallel_fail_fast; + bool enable_parallel; //!< Enable testing in parallel + long cpu_limit; //!< Limit parallel processing to n cores (default: max - 1) + long parallel_fail_fast; //!< Fail immediately on error int pool_status_interval; //!< Report "Task is running" every n seconds struct StrList *conda_packages; //!< Conda packages to install after initial activation struct StrList *pip_packages; //!< Pip packages to install after initial activation -- cgit