-
Notifications
You must be signed in to change notification settings - Fork 2
Description
So this issue documents the proposed breakdown for the design of a SchedulingInterface and MpiInterface. From prior experience it is horrible to couple the MPI generation with the scheduling interface, and it is also horrible to rely on an actual instance of the class because it requires generating a bunch of instances when a class method API would do just fine. There would be commiserate enumerations to standardize returns.
I propose the following:
class SchedulingInterface(ABC):
@abstractclassmethod
def submit_script(cls, script_path, resource_spec):
"""
Submit a script to a scheduler.
"""
@abstractclassmethod
def submit_command(cls, script_body, resource_spec):
"""
Submit a string of commands to a scheduler.
"""
@abstractclassmethod
def resource_header(cls, resources, cluster_spec=None):
"""
Construct the resource header for a scheduler.
"""
@abstractclassmethod
def cancel_job(cls, identifier):
"""
Cancel the specified job through the scheduler API.
"""
@abstractclassmethod
def cancel_jobs(cls, identifier_list):
"""
Cancel a list of jobs through the scheduler API.
"""
A generalized version of the above SchedulingInterface can be created that would take a serialized specification that could be indexed into that would only make it so that specialized cases needed a custom adapter (think something like Flux's Python APIs).
I'll write up a second comment about the MPI interface in a few.