idmtools_slurm_utils.watcher module#

Provides facility to watch bridge files.

Copyright 2021, Bill & Melinda Gates Foundation. All rights reserved.

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

Bases: object

Watches the bridge directory and communicates jobs to slurm.

__init__(directory_to_watch: PathLike, directory_for_status: PathLike, check_every: int = 5)[source]#

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()[source]#

Run the watcher.

class idmtools_slurm_utils.watcher.IdmtoolsJobHandler(directory_for_status: PathLike, cleanup_job: bool = True)[source]#

Bases: FileSystemEventHandler

Handles messages about new messages.

__init__(directory_for_status: PathLike, cleanup_job: bool = True)[source]#

Creates handler.

Parameters:
  • directory_for_status – Directory to use for status

  • cleanup_job – Should the job be cleaned up after submission

on_created(event)[source]#

On Created events.

Parameters:

event – Event details.