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

Add SLURM interface #96

Merged
merged 11 commits into from
Jan 25, 2024
Merged

Add SLURM interface #96

merged 11 commits into from
Jan 25, 2024

Conversation

rvhonorato
Copy link
Member

@rvhonorato rvhonorato commented Jan 22, 2024

This PR adds a way for the haddock-runner to submit jobs to SLURM. It does so by adding a new parameter to the general section of the configuration file

general:
  # ... 
  use_slurm: true

It makes sure that all scenarios are using local mode:

scenarios:
  # ...
    parameters:
      general:
        mode: local
        # ...

Adds a new SUBMITTED status and some utilitary functions.

TODO:

  • Add customization to CreateJobHeader function
  • Submit the jobs to SLURM in batches

Bonus: I've updated Trunk and added a dev-container with a pre-configured SLURM and HADDOCK3 installations for easier development, the only caveat is that the cns binary must be in .devcontainer/cns before building it.

@rvhonorato rvhonorato linked an issue Jan 22, 2024 that may be closed by this pull request
Copy link

codacy-production bot commented Jan 22, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00% 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (29effac) 1114 1114 100.00%
Head commit (d174dc0) 1213 (+99) 1213 (+99) 100.00% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#96) 100 100 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

You may notice some variations in coverage metrics with the latest Coverage engine update. For more details, visit the documentation

This commit adds the functionality to create a job file and run sbatch. It includes the implementation of the `CreateJobHeader`, `CreateJobBody`, `PrepareJobFile`, and `Sbatch` functions. Tests for these functions have also been added.
This commit adds support for submitting jobs using Slurm. It checks if there is a `job.sh` file in the run directory and if so, it uses `sbatch` to submit the job. Otherwise, it continues to use the existing command to run the job. Additionally, a new method `PrepareJobFile` is added to create the `job.sh` file.
This commit adds a new function called FindNewestLogFile to the utils.go file. This function finds the newest log file in a given directory by comparing the modification times of all the files in the directory. It also includes a corresponding unit test in the utils_test.go file to verify the functionality of the new function.
@rvhonorato rvhonorato marked this pull request as ready for review January 25, 2024 13:02
@rvhonorato rvhonorato self-assigned this Jan 25, 2024
@rvhonorato rvhonorato merged commit b550eaa into main Jan 25, 2024
6 checks passed
@rvhonorato rvhonorato deleted the 95-add-slurm-interface branch January 25, 2024 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add SLURM interface
1 participant