From 512d04ab794650afecd69d86feba2fce5af8e036 Mon Sep 17 00:00:00 2001 From: fenoyc Date: Fri, 4 Aug 2023 17:04:39 +0200 Subject: [PATCH 1/3] Ensure bjobs gets the right format On sites with non-default bjobs output format, ReFrame fails to detect the state of the job --- reframe/core/schedulers/lsf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reframe/core/schedulers/lsf.py b/reframe/core/schedulers/lsf.py index 999b88f18c..26b376c4df 100644 --- a/reframe/core/schedulers/lsf.py +++ b/reframe/core/schedulers/lsf.py @@ -94,7 +94,8 @@ def poll(self, *jobs): return completed = _run_strict( - f'bjobs -noheader {" ".join(job.jobid for job in jobs)}' + 'bjobs -o "jobid: user:10 stat: queue:" -noheader ' + f'{" ".join(job.jobid for job in jobs)}' ) job_status = {} job_status_lines = completed.stdout.split('\n') From 6246f8ad31bef1fb4484e2beb8c58e639f13b1a5 Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Thu, 24 Aug 2023 00:33:15 +0200 Subject: [PATCH 2/3] Allow users to specify extra LSF options --- docs/config_reference.rst | 8 ++++++++ reframe/core/schedulers/lsf.py | 4 +++- reframe/schemas/config.json | 5 +++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/config_reference.rst b/docs/config_reference.rst index 4dbcab805a..4c5d48feb4 100644 --- a/docs/config_reference.rst +++ b/docs/config_reference.rst @@ -360,6 +360,14 @@ System Partition Configuration If timeout is reached, the test issuing that command will be marked as a failure. +.. py:attribute:: systems.partitions.sched_options.lsf_bjobs_extras + + :required: No + :default: ``[]`` + + List of extra options to be passed to the ``bjobs`` command of the LSF scheduler. + + .. py:attribute:: systems.partitions.sched_options.resubmit_on_errors :required: No diff --git a/reframe/core/schedulers/lsf.py b/reframe/core/schedulers/lsf.py index 26b376c4df..052f207503 100644 --- a/reframe/core/schedulers/lsf.py +++ b/reframe/core/schedulers/lsf.py @@ -93,8 +93,10 @@ def poll(self, *jobs): if not jobs: return + # Retrieve extra options + bjobs_opts = ' '.join(self.get_option('lsf_bjobs_extras')) completed = _run_strict( - 'bjobs -o "jobid: user:10 stat: queue:" -noheader ' + f'bjobs {bjobs_opts} -noheader ' f'{" ".join(job.jobid for job in jobs)}' ) job_status = {} diff --git a/reframe/schemas/config.json b/reframe/schemas/config.json index c699062426..9cce8906b8 100644 --- a/reframe/schemas/config.json +++ b/reframe/schemas/config.json @@ -111,6 +111,10 @@ "properties": { "ignore_reqnodenotavail": {"type": "boolean"}, "job_submit_timeout": {"type": "number"}, + "lsf_bjobs_extras": { + "type": "array", + "items": {"type": "string"} + }, "resubmit_on_errors": { "type": "array", "items": {"type": "string"} @@ -617,6 +621,7 @@ "systems/partitions/extras": {}, "systems*/sched_options/ignore_reqnodenotavail": false, "systems*/sched_options/job_submit_timeout": 60, + "systems*/sched_options/lsf_bjobs_extras": [], "systems*/sched_options/resubmit_on_errors": [], "systems*/sched_options/use_nodes_option": false } From 604a43d834db28b686e7faf9a1105070804d4a3d Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Fri, 25 Aug 2023 21:56:52 +0200 Subject: [PATCH 3/3] Revert "Allow users to specify extra LSF options" This reverts commit 6246f8ad31bef1fb4484e2beb8c58e639f13b1a5. --- docs/config_reference.rst | 8 -------- reframe/core/schedulers/lsf.py | 4 +--- reframe/schemas/config.json | 5 ----- 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/docs/config_reference.rst b/docs/config_reference.rst index 4c5d48feb4..4dbcab805a 100644 --- a/docs/config_reference.rst +++ b/docs/config_reference.rst @@ -360,14 +360,6 @@ System Partition Configuration If timeout is reached, the test issuing that command will be marked as a failure. -.. py:attribute:: systems.partitions.sched_options.lsf_bjobs_extras - - :required: No - :default: ``[]`` - - List of extra options to be passed to the ``bjobs`` command of the LSF scheduler. - - .. py:attribute:: systems.partitions.sched_options.resubmit_on_errors :required: No diff --git a/reframe/core/schedulers/lsf.py b/reframe/core/schedulers/lsf.py index 052f207503..26b376c4df 100644 --- a/reframe/core/schedulers/lsf.py +++ b/reframe/core/schedulers/lsf.py @@ -93,10 +93,8 @@ def poll(self, *jobs): if not jobs: return - # Retrieve extra options - bjobs_opts = ' '.join(self.get_option('lsf_bjobs_extras')) completed = _run_strict( - f'bjobs {bjobs_opts} -noheader ' + 'bjobs -o "jobid: user:10 stat: queue:" -noheader ' f'{" ".join(job.jobid for job in jobs)}' ) job_status = {} diff --git a/reframe/schemas/config.json b/reframe/schemas/config.json index 9cce8906b8..c699062426 100644 --- a/reframe/schemas/config.json +++ b/reframe/schemas/config.json @@ -111,10 +111,6 @@ "properties": { "ignore_reqnodenotavail": {"type": "boolean"}, "job_submit_timeout": {"type": "number"}, - "lsf_bjobs_extras": { - "type": "array", - "items": {"type": "string"} - }, "resubmit_on_errors": { "type": "array", "items": {"type": "string"} @@ -621,7 +617,6 @@ "systems/partitions/extras": {}, "systems*/sched_options/ignore_reqnodenotavail": false, "systems*/sched_options/job_submit_timeout": 60, - "systems*/sched_options/lsf_bjobs_extras": [], "systems*/sched_options/resubmit_on_errors": [], "systems*/sched_options/use_nodes_option": false }