Skip to content

Option to execute tasks in scratch area#621

Open
mranst wants to merge 12 commits intodevelopfrom
se/mranst/tse_staging
Open

Option to execute tasks in scratch area#621
mranst wants to merge 12 commits intodevelopfrom
se/mranst/tse_staging

Conversation

@mranst
Copy link
Collaborator

@mranst mranst commented Sep 8, 2025

This PR adds the option to send intermediate and output files to a scratch area such as TSE_staging (addressing #490). This can potentially give better performance by leveraging a faster intermediate directory. At the end of the run, all eligible files (those not deleted by the CleanCycle task), are moved back to the main experiment directory, and deleted from the temporary scratch directory.

In order to try this feature, set the run_in_scratch flag in experiment.yaml to true, and specify the scratch_root (this will default to TSE_staging in advda)

@mranst mranst requested review from Dooruk and ashiklom September 8, 2025 15:09
@mranst mranst added enhancement New feature or request core development design related issues and improvements labels Sep 8, 2025

files = glob.glob(os.path.join(scratch_path, '*'))

command = ['cp', '-r'] + files + [experiment_path]
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not use shutil.copy or shutil.copytree here?

https://docs.python.org/3/library/shutil.html#shutil.copytree

@ashiklom
Copy link
Contributor

ashiklom commented Dec 4, 2025

Haven't tested, but generally looks OK to me. I would just recommend replacing subprocess calls with Python functions (shutil.copy / shutil.copytree) which are more portable across systems and should have cleaner error handling.

@Dooruk
Copy link
Collaborator

Dooruk commented Dec 4, 2025

Sorry this totally fell out of my radar, I don't think everyone has access to a TSE_staging area, only certain project groups have that. So for most people default advda won't work.

Does the TSE survive until the full suite/workflow is completed?

@mranst
Copy link
Collaborator Author

mranst commented Dec 4, 2025

Sorry this totally fell out of my radar, I don't think everyone has access to a TSE_staging area, only certain project groups have that. So for most people default advda won't work.

Does the TSE survive until the full suite/workflow is completed?

Unless the suite fails, the experiment contents are scrubbed after the run. Instead of TSE_staging we could also do TSE_TMPDIR, which everyone on discover should have access to

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core development design related issues and improvements enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants