adaptive_scheduler._mock_scheduler module¶

class adaptive_scheduler._mock_scheduler.MockScheduler(*, startup_delay=3, max_running_jobs=4, refresh_interval=0.1, bash='bash', url=None)[source]¶

Bases: object

Emulates a HPC-like scheduler.

Start an instance of MockScheduler and then you are able to do ` python _mock_scheduler.py --queue python _mock_scheduler.py --submit JOB_NAME_HERE script_here.sh  # returns JOB_ID python _mock_scheduler.py --cancel JOB_ID `

Parameters:
  • startup_delay (int) – The waiting before starting the process.

  • max_running_jobs (int) – Maximum number of simultaneously running jobs.

  • refresh_interval (float) – Refresh interval of checking whether proccesses are still running.

  • bash (str) – bash executable.

  • url (str | None) – The URL of the socket. Defaults to {DEFAULT_URL}.

cancel(job_id)[source]¶
Return type:

None

queue(*, me_only=True)[source]¶

Return the current queue.

Return type:

dict[str, dict[str, Any]]

submit(job_name, fname)[source]¶
Return type:

str

adaptive_scheduler._mock_scheduler.cancel(job_id, url='tcp://127.0.0.1:60547')[source]¶
Return type:

None

adaptive_scheduler._mock_scheduler.queue(url='tcp://127.0.0.1:60547')[source]¶
Return type:

dict[str, dict[str, Any]]

adaptive_scheduler._mock_scheduler.submit(job_name, fname, url='tcp://127.0.0.1:60547')[source]¶
Return type:

Any