idmtools_slurm_utils.watcher module

Provides facility to watch bridge files.

class idmtools_slurm_utils.watcher.IdmtoolsJobWatcher(directory_to_watch: PathLike, directory_for_status: PathLike, check_every: int = 5)

Bases: object

Watches the bridge directory and communicates jobs to slurm.

__init__(directory_to_watch: PathLike, directory_for_status: PathLike, check_every: int = 5)

Creates our watcher.

Parameters:
  • directory_to_watch – Directory to sync from

  • directory_for_status – Directory for status messages

  • check_every – How often should directory be synced

run()

Run the watcher.

class idmtools_slurm_utils.watcher.IdmtoolsJobHandler(directory_for_status: PathLike, cleanup_job: bool = True)

Bases: FileSystemEventHandler

Handles messages about new messages.

__init__(directory_for_status: PathLike, cleanup_job: bool = True)

Creates handler.

Parameters:
  • directory_for_status – Directory to use for status

  • cleanup_job – Should the job be cleaned up after submission

on_created(event)

On Created events.

Parameters:

event – Event details.