Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] Add the Firecrest slurm scheduler #3046

Draft
wants to merge 20 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions reframe/core/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -1665,7 +1665,13 @@ def _setup_paths(self):
except OSError as e:
raise PipelineError('failed to set up paths') from e

def _create_job(self, job_type, force_local=False, **job_opts):
def _create_job(
self,
job_type,
force_local=False,
clean_up_stage=False,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain the purpose of this argument?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So my issue was that the job is not aware if it's the first to write in the stage directory of the remote filesystem. If it is, we need to cleanup this directory.

**job_opts
):
'''Setup the job related to this check.'''

if force_local:
Expand All @@ -1692,14 +1698,16 @@ def _create_job(self, job_type, force_local=False, **job_opts):
script_filename=script_name,
workdir=self._stagedir,
sched_access=self._current_partition.access,
clean_up_stage=clean_up_stage,
**job_opts)

def _setup_build_job(self, **job_opts):
self._build_job = self._create_job(
'build', self.local or self.build_locally, **job_opts
)
def _setup_build_job(self, clean_up_stage=False, **job_opts):
self._build_job = self._create_job('build',
self.local or self.build_locally,
clean_up_stage,
**job_opts)

def _setup_run_job(self, **job_opts):
def _setup_run_job(self, clean_up_stage=False, **job_opts):
self._job = self._create_job(f'run', self.local, **job_opts)

def _setup_container_platform(self):
Expand Down Expand Up @@ -1743,7 +1751,7 @@ def setup(self, partition, environ, **job_opts):
self._current_partition = partition
self._current_environ = environ
self._setup_paths()
self._setup_build_job(**job_opts)
self._setup_build_job(clean_up_stage=True, **job_opts)
self._setup_run_job(**job_opts)
self._setup_container_platform()
self._resolve_fixtures()
Expand Down Expand Up @@ -2559,7 +2567,7 @@ def setup(self, partition, environ, **job_opts):
self._current_partition = partition
self._current_environ = environ
self._setup_paths()
self._setup_run_job(**job_opts)
self._setup_run_job(clean_up_stage=True, **job_opts)
self._setup_container_platform()
self._resolve_fixtures()

Expand Down Expand Up @@ -2616,7 +2624,7 @@ def setup(self, partition, environ, **job_opts):
self._current_partition = partition
self._current_environ = environ
self._setup_paths()
self._setup_build_job(**job_opts)
self._setup_build_job(clean_up_stage=True, **job_opts)
self._setup_container_platform()
self._resolve_fixtures()

Expand Down
5 changes: 4 additions & 1 deletion reframe/core/schedulers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,8 @@ def __init__(self,
stderr=None,
sched_flex_alloc_nodes=None,
sched_access=[],
sched_options=None):
sched_options=None,
clean_up_stage=False):

self._cli_options = list(sched_options) if sched_options else []
self._name = name
Expand Down Expand Up @@ -354,6 +355,8 @@ def __init__(self,
# in finished()
self._exception = None

self._clean_up_stage = clean_up_stage

@classmethod
def create(cls, scheduler, launcher, *args, **kwargs):
ret = scheduler.make_job(*args, **kwargs)
Expand Down
Loading