slurm-code 0.1.26__tar.gz → 0.1.30__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {slurm_code-0.1.26/src/slurm_code.egg-info → slurm_code-0.1.30}/PKG-INFO +1 -1
- {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/pages/submit.md +2 -2
- {slurm_code-0.1.26 → slurm_code-0.1.30}/pixi.lock +12 -11
- {slurm_code-0.1.26 → slurm_code-0.1.30}/pyproject.toml +3 -2
- {slurm_code-0.1.26 → slurm_code-0.1.30}/src/slurm_code/cli.py +2 -1
- {slurm_code-0.1.26 → slurm_code-0.1.30}/src/slurm_code/core.py +26 -16
- {slurm_code-0.1.26 → slurm_code-0.1.30/src/slurm_code.egg-info}/PKG-INFO +1 -1
- {slurm_code-0.1.26 → slurm_code-0.1.30}/.devcontainer/Dockerfile +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/.devcontainer/README.md +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/.devcontainer/devcontainer.json +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/.devcontainer/init-firewall.sh +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/.devcontainer/mcp-setup/generate-config.sh +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/.devcontainer/mcp-setup/install.sh +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/.devcontainer/mcp-setup/pixi.toml +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/.devcontainer/mcp-setup/servers.txt +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/.devcontainer/mcp-setup/test-servers.sh +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/.gitattributes +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/.github/workflows/conda-release.yml +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/.github/workflows/pypi-release.yml +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/.github/workflows/quarto-publish.yml +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/.gitignore +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/.vscode/vscode.css +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/CHANGELOG.md +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/CLAUDE.md +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/LICENSE +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/README.md +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/conda-build/README.md +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/conda-build/build_env.yaml +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/conda-build/meta.yaml +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/.gitignore +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/README.md +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/_extensions/machow/interlinks/.gitignore +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/_extensions/machow/interlinks/_extension.yml +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/_extensions/machow/interlinks/interlinks.lua +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/_inv/griffe_objects.txt +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/_inv/numpy_objects.txt +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/_inv/python_objects.txt +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/_quarto.yml +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/api/_sidebar.yml +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/api/_styles-quartodoc.css +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/api/functionname.qmd +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/api/index.qmd +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/api/scriptname.qmd +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/autodoc.mustache +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/custom.scss +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/objects.txt +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/pages/example.ipynb +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/pages/getting-started.md +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/pages/managing-jobs.md +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/pages/overview.ipynb +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/pages/profiles.md +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/docs/styles.css +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/scripts/bump_changelog.py +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/scripts/bump_version.py +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/scripts/docs-build-render.sh +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/scripts/docs-run-notebooks.sh +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/scripts/git-commit.sh +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/scripts/github-release.sh +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/scripts/rename.py +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/scripts/tmux-project.sh +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/setup.cfg +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/src/slurm_code/__init__.py +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/src/slurm_code/config.py +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/src/slurm_code/gdk-code.py +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/src/slurm_code.egg-info/SOURCES.txt +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/src/slurm_code.egg-info/dependency_links.txt +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/src/slurm_code.egg-info/entry_points.txt +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/src/slurm_code.egg-info/requires.txt +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/src/slurm_code.egg-info/top_level.txt +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/test/__init__.py +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/test/test_dummy.py +0 -0
- {slurm_code-0.1.26 → slurm_code-0.1.30}/test/test_modulename.py +0 -0
|
@@ -104,7 +104,7 @@ slurm-code submit -A my_account
|
|
|
104
104
|
|
|
105
105
|
#### SLURM environment variables
|
|
106
106
|
|
|
107
|
-
When a `DIRECTORY` is given, slurm-code writes the job's SLURM environment variables (such as `
|
|
107
|
+
When a `DIRECTORY` is given, slurm-code writes the job's SLURM environment variables (such as `VS_SLURM_JOB_ID`, `VS_SLURM_CPUS_PER_TASK`, `VS_SLURM_MEM_PER_CPU`, etc.) to `<DIRECTORY>/.slurm-code-slurm-env.sh`. These use a `VS_` prefix to avoid colliding with native SLURM variables (which would interfere with `sbatch` and `srun`). The variables are available in VSCode integrated terminals, which would otherwise not have them since they run outside the job's process tree.
|
|
108
108
|
|
|
109
109
|
#### Pixi activation
|
|
110
110
|
|
|
@@ -120,7 +120,7 @@ On first use, you will be prompted to add a source line to `~/.bashrc` on the cl
|
|
|
120
120
|
|
|
121
121
|
The bashrc hook does two things:
|
|
122
122
|
|
|
123
|
-
1. Sources `~/.slurm-code-env.sh` (a loader that is overwritten on each submit with absolute paths to the current project's SLURM env script). This provides
|
|
123
|
+
1. Sources `~/.slurm-code-env.sh` (a loader that is overwritten on each submit with absolute paths to the current project's SLURM env script). This provides variables like `VS_SLURM_JOB_ID` and `VS_SLURM_MEM_PER_CPU` in every shell.
|
|
124
124
|
2. Sources `.slurm-code-pixi-env.sh` using a **relative** path, so pixi activation only happens when the shell starts in the project directory (as VSCode integrated terminals do). A regular SSH login starts in `~` and is unaffected.
|
|
125
125
|
|
|
126
126
|
### Profiles
|
|
@@ -279,7 +279,7 @@ environments:
|
|
|
279
279
|
- conda: https://conda.anaconda.org/conda-forge/linux-64/tokenizers-0.22.2-py313h4d6fefd_0.conda
|
|
280
280
|
- conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.3.0-pyhcf101f3_0.conda
|
|
281
281
|
- conda: https://conda.anaconda.org/conda-forge/linux-64/tornado-6.5.3-py313h07c4f96_0.conda
|
|
282
|
-
- conda: https://conda.anaconda.org/conda-forge/noarch/tqdm-4.67.
|
|
282
|
+
- conda: https://conda.anaconda.org/conda-forge/noarch/tqdm-4.67.3-pyh8f84b5b_0.conda
|
|
283
283
|
- conda: https://conda.anaconda.org/conda-forge/noarch/traitlets-5.14.3-pyhd8ed1ab_1.conda
|
|
284
284
|
- conda: https://conda.anaconda.org/conda-forge/noarch/typer-slim-0.20.0-pyhcf101f3_1.conda
|
|
285
285
|
- conda: https://conda.anaconda.org/conda-forge/noarch/typing-extensions-4.15.0-h396c80c_0.conda
|
|
@@ -603,7 +603,7 @@ environments:
|
|
|
603
603
|
- conda: https://conda.anaconda.org/conda-forge/osx-arm64/tokenizers-0.22.2-py313h4bd1e59_0.conda
|
|
604
604
|
- conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.3.0-pyhcf101f3_0.conda
|
|
605
605
|
- conda: https://conda.anaconda.org/conda-forge/osx-arm64/tornado-6.5.3-py313h6535dbc_0.conda
|
|
606
|
-
- conda: https://conda.anaconda.org/conda-forge/noarch/tqdm-4.67.
|
|
606
|
+
- conda: https://conda.anaconda.org/conda-forge/noarch/tqdm-4.67.3-pyh8f84b5b_0.conda
|
|
607
607
|
- conda: https://conda.anaconda.org/conda-forge/noarch/traitlets-5.14.3-pyhd8ed1ab_1.conda
|
|
608
608
|
- conda: https://conda.anaconda.org/conda-forge/noarch/typer-slim-0.20.0-pyhcf101f3_1.conda
|
|
609
609
|
- conda: https://conda.anaconda.org/conda-forge/noarch/typing-extensions-4.15.0-h396c80c_0.conda
|
|
@@ -9187,17 +9187,18 @@ packages:
|
|
|
9187
9187
|
- pkg:pypi/tornado?source=hash-mapping
|
|
9188
9188
|
size: 880049
|
|
9189
9189
|
timestamp: 1765836649731
|
|
9190
|
-
- conda: https://conda.anaconda.org/conda-forge/noarch/tqdm-4.67.
|
|
9191
|
-
sha256:
|
|
9192
|
-
md5:
|
|
9190
|
+
- conda: https://conda.anaconda.org/conda-forge/noarch/tqdm-4.67.3-pyh8f84b5b_0.conda
|
|
9191
|
+
sha256: 9ef8e47cf00e4d6dcc114eb32a1504cc18206300572ef14d76634ba29dfe1eb6
|
|
9192
|
+
md5: e5ce43272193b38c2e9037446c1d9206
|
|
9193
9193
|
depends:
|
|
9194
|
-
-
|
|
9195
|
-
-
|
|
9196
|
-
|
|
9194
|
+
- python >=3.10
|
|
9195
|
+
- __unix
|
|
9196
|
+
- python
|
|
9197
|
+
license: MPL-2.0 and MIT
|
|
9197
9198
|
purls:
|
|
9198
|
-
- pkg:pypi/tqdm?source=
|
|
9199
|
-
size:
|
|
9200
|
-
timestamp:
|
|
9199
|
+
- pkg:pypi/tqdm?source=compressed-mapping
|
|
9200
|
+
size: 94132
|
|
9201
|
+
timestamp: 1770153424136
|
|
9201
9202
|
- conda: https://conda.anaconda.org/conda-forge/noarch/tqdm-4.67.3-pyha7b4d00_0.conda
|
|
9202
9203
|
sha256: 63cc2def6e168622728c7800ed6b3c1761ceecb18b354c81cee1a0a94c09900a
|
|
9203
9204
|
md5: af77160f8428924c17db94e04aa69409
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "slurm-code"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.30"
|
|
8
8
|
description = "Project description"
|
|
9
9
|
authors = [
|
|
10
10
|
{name = "Your Name", email = "your@email.com"}
|
|
@@ -61,6 +61,7 @@ ipython = "*"
|
|
|
61
61
|
seaborn = "*"
|
|
62
62
|
nbdime = "*"
|
|
63
63
|
r-rsvg = "*"
|
|
64
|
+
tqdm = ">=4.67.3,<5"
|
|
64
65
|
|
|
65
66
|
# [tool.pixi.pypi-dependencies]
|
|
66
67
|
# slurm-code = { path = ".", editable = true }
|
|
@@ -72,7 +73,7 @@ default = {solve-group = "default"}
|
|
|
72
73
|
cmd = "python ./scripts/rename.py && gh repo set-default https://github.com/munch-group/$(basename $(git rev-parse --show-toplevel)) && git add src && git add -u"
|
|
73
74
|
|
|
74
75
|
[tool.pixi.tasks.install-dev]
|
|
75
|
-
cmd = "
|
|
76
|
+
cmd = "pip install --no-build-isolation --force-reinstall --no-deps ."
|
|
76
77
|
description = "Install phasic in development mode with FFI support"
|
|
77
78
|
|
|
78
79
|
[tool.pixi.tasks.notebook]
|
|
@@ -12,6 +12,7 @@ from slurm_code.config import (
|
|
|
12
12
|
load_config,
|
|
13
13
|
)
|
|
14
14
|
from slurm_code.core import (
|
|
15
|
+
JOB_NAME_PREFIX,
|
|
15
16
|
add_bashrc_hook,
|
|
16
17
|
build_sbatch_command,
|
|
17
18
|
cancel_managed_jobs,
|
|
@@ -289,7 +290,7 @@ def reconnect(ctx, directory):
|
|
|
289
290
|
from slurm_code.core import expand_node_list, get_job_node
|
|
290
291
|
|
|
291
292
|
running_jobs = list_managed_jobs(host, all_states=False)
|
|
292
|
-
matches = [j for j in running_jobs if j["name"].
|
|
293
|
+
matches = [j for j in running_jobs if j["name"].startswith(f"{JOB_NAME_PREFIX}{basename}")]
|
|
293
294
|
|
|
294
295
|
if not matches:
|
|
295
296
|
click.echo(
|
|
@@ -64,12 +64,16 @@ def check_remote_directory(directory, host="gdk"):
|
|
|
64
64
|
def derive_job_name(directory=None):
|
|
65
65
|
"""Derive a job name from a directory path, or from a timestamp if no directory.
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
A short timestamp suffix ensures uniqueness when multiple jobs target
|
|
68
|
+
the same directory.
|
|
69
|
+
|
|
70
|
+
E.g. ~/projects/my-analysis -> sc-my-analysis-0318-1430
|
|
68
71
|
None -> sc-20260302-143022
|
|
69
72
|
"""
|
|
73
|
+
ts = datetime.now().strftime("%m%d-%H%M")
|
|
70
74
|
if directory:
|
|
71
75
|
basename = os.path.basename(directory.rstrip("/"))
|
|
72
|
-
return f"{JOB_NAME_PREFIX}{basename}"
|
|
76
|
+
return f"{JOB_NAME_PREFIX}{basename}-{ts}"
|
|
73
77
|
return f"{JOB_NAME_PREFIX}{datetime.now().strftime('%Y%m%d-%H%M%S')}"
|
|
74
78
|
|
|
75
79
|
|
|
@@ -183,15 +187,15 @@ LOADER_SCRIPT = ".slurm-code-env.sh" # written to ~ on each submit
|
|
|
183
187
|
|
|
184
188
|
# Mapping from scontrol field names to SLURM environment variable names
|
|
185
189
|
_SCONTROL_TO_ENV = {
|
|
186
|
-
"JobId": "
|
|
187
|
-
"JobName": "
|
|
188
|
-
"Partition": "
|
|
189
|
-
"Account": "
|
|
190
|
-
"NumNodes": "
|
|
191
|
-
"NumCPUs": "
|
|
192
|
-
"NodeList": "
|
|
193
|
-
"TimeLimit": "
|
|
194
|
-
"WorkDir": "
|
|
190
|
+
"JobId": "VS_SLURM_JOB_ID",
|
|
191
|
+
"JobName": "VS_SLURM_JOB_NAME",
|
|
192
|
+
"Partition": "VS_SLURM_JOB_PARTITION",
|
|
193
|
+
"Account": "VS_SLURM_JOB_ACCOUNT",
|
|
194
|
+
"NumNodes": "VS_SLURM_JOB_NUM_NODES",
|
|
195
|
+
"NumCPUs": "VS_SLURM_CPUS_ON_NODE",
|
|
196
|
+
"NodeList": "VS_SLURM_JOB_NODELIST",
|
|
197
|
+
"TimeLimit": "VS_SLURM_TIMELIMIT",
|
|
198
|
+
"WorkDir": "VS_SLURM_SUBMIT_DIR",
|
|
195
199
|
}
|
|
196
200
|
|
|
197
201
|
|
|
@@ -239,17 +243,17 @@ def setup_slurm_env(jobid, directory, host="gdk"):
|
|
|
239
243
|
unit = match.group(2).upper()
|
|
240
244
|
multipliers = {"": 1, "K": 1, "M": 1, "G": 1024, "T": 1024 * 1024}
|
|
241
245
|
mb_value = num * multipliers.get(unit, 1)
|
|
242
|
-
lines.append(f"export
|
|
246
|
+
lines.append(f"export VS_SLURM_MEM_PER_CPU={mb_value!r}")
|
|
243
247
|
|
|
244
248
|
# CPUs per task from ReqTRES or TresPerTask
|
|
245
249
|
cpus_per_task = fields.get("CPUs/Task")
|
|
246
250
|
if cpus_per_task:
|
|
247
|
-
lines.append(f"export
|
|
251
|
+
lines.append(f"export VS_SLURM_CPUS_PER_TASK={cpus_per_task!r}")
|
|
248
252
|
|
|
249
253
|
# NTasks
|
|
250
254
|
ntasks = fields.get("NumTasks")
|
|
251
255
|
if ntasks:
|
|
252
|
-
lines.append(f"export
|
|
256
|
+
lines.append(f"export VS_SLURM_NTASKS={ntasks!r}")
|
|
253
257
|
|
|
254
258
|
script_content = "\n".join(lines) + "\n"
|
|
255
259
|
script_path = f"{directory}/{SLURM_ENV_SCRIPT}"
|
|
@@ -537,8 +541,14 @@ def cancel_managed_jobs(host="gdk", job_id=None, job_name=None, cancel_all=False
|
|
|
537
541
|
# If user passed a bare name without any known prefix, add the current one
|
|
538
542
|
if not _is_managed_job(job_name):
|
|
539
543
|
job_name = f"{JOB_NAME_PREFIX}{job_name}"
|
|
540
|
-
|
|
541
|
-
|
|
544
|
+
# Names now include a timestamp suffix, so match by prefix
|
|
545
|
+
jobs = list_managed_jobs(host, all_states=True)
|
|
546
|
+
matches = [j for j in jobs if j["name"].startswith(job_name)]
|
|
547
|
+
if not matches:
|
|
548
|
+
raise RuntimeError(f"No jobs found matching '{job_name}'")
|
|
549
|
+
match_ids = " ".join(j["jobid"] for j in matches)
|
|
550
|
+
run_remote(f"scancel {match_ids}", host)
|
|
551
|
+
print(f"Cancelled {len(matches)} job(s) matching '{job_name}'")
|
|
542
552
|
elif cancel_all:
|
|
543
553
|
jobs = list_managed_jobs(host, all_states=True)
|
|
544
554
|
if not jobs:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|