ezpz.jobs
¶
Helpers for persisting and replaying scheduler job environments.
jobs.py
add_to_jobslog(hostfile=None)
¶
Append the current job directory to the jobs log if it is new.
Source code in src/ezpz/jobs.py
check_scheduler(scheduler=None)
¶
Ensure the detected scheduler is supported.
Parameters¶
scheduler:
Optional override. When None
the value from
:func:ezpz.configs.get_scheduler
is used.
Returns¶
bool
True
when the scheduler is recognised, otherwise a TypeError
is
raised.
Source code in src/ezpz/jobs.py
get_jobdir_from_env()
¶
Return the directory used to persist job metadata on the login node.
Source code in src/ezpz/jobs.py
get_jobdir_from_jobslog(idx=-1)
¶
Return the most recent job directory (or the idx
entry).
Source code in src/ezpz/jobs.py
get_jobdirs_from_jobslog()
¶
Return all previously recorded job directories from the jobs log.
Source code in src/ezpz/jobs.py
get_jobenv(framework=None, hostfile=None, verbose=None, verbose_dist_info=None, verbose_pbs_env=None)
¶
Collect runtime information describing the active batch job.
Source code in src/ezpz/jobs.py
get_jobfile_ext(ext)
¶
Return the path to the stored job metadata with a given extension.
Source code in src/ezpz/jobs.py
get_jobfile_json()
¶
Return jobenv.json
creating parent directories as needed.
get_jobfile_sh()
¶
Return jobenv.sh
creating parent directories as needed.
get_jobfile_yaml()
¶
Return jobenv.yaml
creating parent directories as needed.
get_jobid()
¶
get_jobslog_file()
¶
Return the path to the rolling job history log in $HOME
.
Source code in src/ezpz/jobs.py
loadjobenv(jobdir=None)
¶
Load job environment metadata from the cache under jobdir
.
Source code in src/ezpz/jobs.py
loadjobenv_from_yaml(jobdir=None, idx=-1)
¶
Load a job environment dictionary from YAML stored in jobdir
.
Source code in src/ezpz/jobs.py
main(hostfile=None)
¶
Entry point that captures the current job environment and saves it.
Source code in src/ezpz/jobs.py
save_to_dotenv_file(jobenv=None, hostfile=None, verbose=None)
¶
Write a .jobenv
file capturing scheduler environment variables.
Source code in src/ezpz/jobs.py
savejobenv(verbose=None, framework=None, hostfile=None, print_jobenv=None, verbose_dotenv=None, verbose_get_jobenv=None, verbose_dist_info=None, verbose_pbs_env=None)
¶
Persist job metadata to disk and optionally echo the environment.
Source code in src/ezpz/jobs.py
377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 |
|
savejobenv_json(jobenv=None)
¶
Write jobenv.json
containing the captured job metadata.
Source code in src/ezpz/jobs.py
savejobenv_sh(jobenv=None)
¶
Write jobenv.sh
exporting scheduler environment variables.
Source code in src/ezpz/jobs.py
savejobenv_yaml(jobenv=None)
¶
Write jobenv.yaml
containing the captured job metadata.
Source code in src/ezpz/jobs.py
write_launch_shell_script()
¶
Create ~/.local/bin/launch.sh
exporting the launch alias.