Note
This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the user guide for the big picture.
hopla.utils.InfoWatcher¶
- class hopla.utils.InfoWatcher(delay_s=60)[source]¶
Bases:
ABCAn instance of this class is shared by all jobs, and is in charge of calling scheduler to check status for all jobs at once.
- Parameters:
- delay_s: int, default 60
maximum delay before each non-forced call to the cluster.
- get_info(job_id)[source]¶
Returns a dict containing info about the job.
- Parameters:
- job_id: int
id of the job on the cluster.
- Returns:
- info: dict
information about this jobs.
- get_state(job_id)[source]¶
Returns the state of the job.
- Parameters:
- job_id: str
id of the job on the cluster.
- Returns:
- state: str
the current state of the job.
- is_done(job_id)[source]¶
Returns whether the job is finished.
- Parameters:
- job_id: str
id of the job on the cluster.
- Returns:
- done: bool
True if the job is done, False otherwise.
- abstract read_info(string)[source]¶
Reads the output of the update command and returns a dictionary containing main jobs information.
- abstract property update_command¶
Return the command to list jobs status.
- abstract property valid_status¶
Return the list of valid status.