From c2dd107cf5df97972e816b01d8d70755da1fb15c Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Thu, 26 May 2022 15:58:10 -0400 Subject: [PATCH 1/4] Message about using --parallel, and how other CWL runners are available. --- cwltool/executors.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cwltool/executors.py b/cwltool/executors.py index 0625c216f..4483f6d0c 100644 --- a/cwltool/executors.py +++ b/cwltool/executors.py @@ -191,6 +191,11 @@ def check_for_abstract_op(tool: CWLObjectType) -> None: return (self.final_output[0], self.final_status[0]) return (None, "permanentFail") + def message_about_other_runners(self): + _logger.info("Need to grow beyond `cwltool` and scale up your workflows on a HPC cluster, or in the cloud?") + _logger.info("Many commercial and open source platforms support CWL. Run your same workflows without having to rewrite anything.") + _logger.info("Visit https://www.commonwl.org/implementations/ to learn more.") + class SingleJobExecutor(JobExecutor): """Default single-threaded CWL reference executor.""" @@ -203,6 +208,8 @@ def run_jobs( runtime_context: RuntimeContext, ) -> None: + _logger.info("Using default serial job executor. Use `cwltool --parallel` to run multiple steps at a time.") + process_run_id = None # type: Optional[str] # define provenance profile for single commandline tool @@ -252,6 +259,7 @@ def run_jobs( else: logger.error("Workflow cannot make any more progress.") break + self.message_about_other_runners() except ( ValidationException, WorkflowException, @@ -416,6 +424,8 @@ def run_jobs( runtime_context: RuntimeContext, ) -> None: + _logger.info("Using parallel job executor. Multiple steps will run at once as hardware resources permit.") + self.taskqueue = TaskQueue( threading.Lock(), psutil.cpu_count() ) # type: TaskQueue @@ -456,6 +466,7 @@ def run_jobs( finally: self.taskqueue.drain() self.taskqueue.join() + self.message_about_other_runners() class NoopJobExecutor(JobExecutor): From f22995bb45d8edf7a846685d9978dd2d1f01fceb Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Thu, 26 May 2022 16:35:00 -0400 Subject: [PATCH 2/4] Reformat --- cwltool/executors.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/cwltool/executors.py b/cwltool/executors.py index 4483f6d0c..4bf994a91 100644 --- a/cwltool/executors.py +++ b/cwltool/executors.py @@ -192,8 +192,12 @@ def check_for_abstract_op(tool: CWLObjectType) -> None: return (None, "permanentFail") def message_about_other_runners(self): - _logger.info("Need to grow beyond `cwltool` and scale up your workflows on a HPC cluster, or in the cloud?") - _logger.info("Many commercial and open source platforms support CWL. Run your same workflows without having to rewrite anything.") + _logger.info( + "Need to grow beyond `cwltool` and scale up your workflows on a HPC cluster, or in the cloud?" + ) + _logger.info( + "Many commercial and open source platforms support CWL. Run your same workflows without having to rewrite anything." + ) _logger.info("Visit https://www.commonwl.org/implementations/ to learn more.") @@ -208,7 +212,9 @@ def run_jobs( runtime_context: RuntimeContext, ) -> None: - _logger.info("Using default serial job executor. Use `cwltool --parallel` to run multiple steps at a time.") + _logger.info( + "Using default serial job executor. Use `cwltool --parallel` to run multiple steps at a time." + ) process_run_id = None # type: Optional[str] @@ -424,7 +430,9 @@ def run_jobs( runtime_context: RuntimeContext, ) -> None: - _logger.info("Using parallel job executor. Multiple steps will run at once as hardware resources permit.") + _logger.info( + "Using parallel job executor. Multiple steps will run at once as hardware resources permit." + ) self.taskqueue = TaskQueue( threading.Lock(), psutil.cpu_count() From 51e5f07bcc418a70734db7f02f4779013b3d1964 Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Thu, 26 May 2022 17:08:20 -0400 Subject: [PATCH 3/4] Fix mypy --- cwltool/executors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cwltool/executors.py b/cwltool/executors.py index 4bf994a91..d573c1679 100644 --- a/cwltool/executors.py +++ b/cwltool/executors.py @@ -191,7 +191,7 @@ def check_for_abstract_op(tool: CWLObjectType) -> None: return (self.final_output[0], self.final_status[0]) return (None, "permanentFail") - def message_about_other_runners(self): + def message_about_other_runners(self) -> None: _logger.info( "Need to grow beyond `cwltool` and scale up your workflows on a HPC cluster, or in the cloud?" ) From b071eff8fb7ab4e40605644a95579295b9c5fc94 Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Fri, 27 May 2022 14:01:18 -0400 Subject: [PATCH 4/4] Tweak the text a bit --- cwltool/executors.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cwltool/executors.py b/cwltool/executors.py index d573c1679..e882cada2 100644 --- a/cwltool/executors.py +++ b/cwltool/executors.py @@ -193,10 +193,10 @@ def check_for_abstract_op(tool: CWLObjectType) -> None: def message_about_other_runners(self) -> None: _logger.info( - "Need to grow beyond `cwltool` and scale up your workflows on a HPC cluster, or in the cloud?" + "Need to grow beyond `cwltool` and scale up your workflows to run on a multi-node cluster, or in the cloud?" ) _logger.info( - "Many commercial and open source platforms support CWL. Run your same workflows without having to rewrite anything." + "CWL workflows are portable and run on many commercial and open source platforms." ) _logger.info("Visit https://www.commonwl.org/implementations/ to learn more.")