Documentation ¶
Overview ¶
Package drmaa2interface implements the DRMAA2 Go interface. Actual Go DRMAA2 compatible implementations should use that interface to guarantee compatibility.
Index ¶
- Constants
- Variables
- type ArrayJob
- type CPU
- type Capability
- type Error
- type ErrorID
- type Event
- type EventChannel
- type Extensible
- type Extension
- type Job
- type JobInfo
- type JobSession
- type JobState
- type JobTemplate
- type Machine
- type MonitoringSession
- type Notification
- type OS
- type Queue
- type Reservation
- type ReservationInfo
- type ReservationSession
- type ReservationTemplate
- type SessionManager
- type Version
Constants ¶
const InfiniteTime = time.Duration(1<<63 - 1)
InfiniteTime is a special timeout value: Wait probably infinitly
const PlaceholderHomeDir = "$DRMAA2_HOME_DIR$"
PlaceholderHomeDir is a specified string which can be used to request the home directory of the user (e.g. as the output directory of the job).
const PlaceholderIndex = "$DRMAA2_INDEX$"
PlaceholderIndex is a specified string which can be used to put the output of a job in a file which has the array job task ID within the directory structure or filename.
const PlaceholderWorkingDir = "$DRMAA2_WORKING_DIR$"
PlaceholderWorkingDir is a specified string which can be used to point to the current working directory of the job.
const UnsetEnum = -1
UnsetEnum defines an unset enum (required?)
const UnsetNum = -1
UnsetNum defines an unset number (which is different than 0)
const UnsetTime = -3
UnsetTime is a special time value: Time or date not set
const ZeroTime = time.Duration(0)
ZeroTime is a special timeout value: Don't wait
Variables ¶
var UnsetDict map[string]string
UnsetDict is means no dictionary is set (nil)
var UnsetList []interface{}
UnsetList is used to differentiate between an empty and an unspecified (unset) list. Probably not needed in Go.
Functions ¶
This section is empty.
Types ¶
type ArrayJob ¶
type ArrayJob interface { GetID() string GetJobs() []Job GetSessionName() string GetJobTemplate() JobTemplate Suspend() error Resume() error Hold() error Release() error Terminate() error }
ArrayJob defines all methods which can be executed on a DRMAA2 job array. A job array contains a set of jobs with the same properties (same job template).
type Capability ¶
type Capability int
Capability is a type which represents the availability of optional functionality of the DRMAA2 implementation. Optional functionality is defined by the DRMAA2 standard but not mandatory to implement.
const ( AdvanceReservation Capability = iota ReserveSlots Callback BulkJobsMaxParallel JtEmail JtStaging JtDeadline JtMaxSlots JtAccountingID RtStartNow RtDuration RtMachineOS RtMachineArch )
func (Capability) String ¶
func (i Capability) String() string
type Error ¶
type Error struct { // Messages is a dynamically created human readable error description. // There is no fixed message catalog defined. Message string // ID is used for identifying the error type ID ErrorID }
Error is a DRMAA2 error type (implements Go Error interface). All errors returned by any DRMAA2 method is (and can be casted to) this Error type.
type ErrorID ¶
type ErrorID int
ErrorID type represents a DRMAA2 standardized error ID which is part of the DRMAA2 Error type.
type EventChannel ¶
type EventChannel <-chan Notification
EventChannel sends Notifications about job events. When subscribed they need to be consumed in the rate created by the system.
type Extensible ¶
type Extensible interface { // ListExtensions lists all implementation specific key names for // a particular DRMAA2 extensible data type ListExtensions() []string DescribeExtension(string) string }
Extensible is an interface which defines functions used to interact with extensible data structures (JobTemplate, JobInfo etc.).
type Extension ¶
type Extension struct {
ExtensionList map[string]string // stores the extension requests as string
}
Extension is a struct which is embedded in DRMAA2 objects which are extensible. The extension is named in the DRMAA2 spec as SetIntanceValue / GetInstanceValue.
type Job ¶
type Job interface { GetID() string GetSessionName() string GetJobTemplate() (JobTemplate, error) GetState() JobState GetJobInfo() (JobInfo, error) Suspend() error Resume() error Hold() error Release() error Terminate() error WaitStarted(time.Duration) error WaitTerminated(time.Duration) error Reap() error }
Job defines all methods which needs to be implemented for a DRMAA job type.
type JobInfo ¶
type JobInfo struct { Extensible Extension `xml:"-" json:"-"` ID string `json:"id"` ExitStatus int `json:"exitStatus"` TerminatingSignal string `json:"terminationSignal"` Annotation string `json:"annotation"` State JobState `json:"state"` SubState string `json:"subState"` AllocatedMachines []string `json:"allocatedMachines"` SubmissionMachine string `json:"submissionMachine"` JobOwner string `json:"jobOwner"` Slots int64 `json:"slots"` QueueName string `json:"queueName"` WallclockTime time.Duration `json:"wallclockTime"` CPUTime int64 `json:"cpuTime"` SubmissionTime time.Time `json:"submissionTime"` DispatchTime time.Time `json:"dispatchTime"` FinishTime time.Time `json:"finishTime"` }
JobInfo represents the state of a job.
var UnsetJobInfo *JobInfo
UnsetJobInfo means no job info is set (nil)
func CreateJobInfo ¶
func CreateJobInfo() (ji JobInfo)
CreateJobInfo creates a JobInfo object where all values are initialized with UNSET (needed in order to differentiate if a value is not set or 0).
type JobSession ¶
type JobSession interface { Close() error GetContact() (string, error) GetSessionName() (string, error) GetJobCategories() ([]string, error) GetJobs(ji JobInfo) ([]Job, error) GetJobArray(id string) (ArrayJob, error) RunJob(jt JobTemplate) (Job, error) RunBulkJobs(jt JobTemplate, begin int, end int, step int, maxParallel int) (ArrayJob, error) WaitAnyStarted(jobs []Job, timeout time.Duration) (Job, error) WaitAnyTerminated(jobs []Job, timeout time.Duration) (Job, error) }
JobSession contains all functions for managing jobs within one names job session. Multiple concurrent job sessions can be used at one point in time. A job session is a logical concept for separating workflows.
type JobTemplate ¶
type JobTemplate struct { Extensible Extension `xml:"-" json:"-"` RemoteCommand string `json:"remoteCommand"` Args []string `json:"args"` SubmitAsHold bool `json:"submitAsHold"` ReRunnable bool `json:"reRunnable"` JobEnvironment map[string]string `json:"jobEnvironment"` WorkingDirectory string `json:"workingDirectory"` JobCategory string `json:"jobCategory"` Email []string `json:"email"` EmailOnStarted bool `json:"emailOnStarted"` EmailOnTerminated bool `json:"emailOnTerminated"` JobName string `json:"jobName"` InputPath string `json:"inputPath"` OutputPath string `json:"outputPath"` ErrorPath string `json:"errorPath"` JoinFiles bool `json:"joinFiles"` ReservationID string `json:"reservationID"` QueueName string `json:"queueName"` MinSlots int64 `json:"minSlots"` MaxSlots int64 `json:"maxSlots"` Priority int64 `json:"priority"` CandidateMachines []string `json:"candidateMachines"` MinPhysMemory int64 `json:"minPhysMemory"` MachineOs string `json:"machineOs"` MachineArch string `json:"machineArch"` StartTime time.Time `json:"startTime"` DeadlineTime time.Time `json:"deadlineTime"` StageInFiles map[string]string `json:"stageInFiles"` StageOutFiles map[string]string `json:"stageOutFiles"` ResourceLimits map[string]string `json:"resourceLimits"` AccountingID string `json:"accountingString"` }
JobTemplate defines all fields for a job request defined by the DRMAA2 standard.
type Machine ¶
type Machine struct { Extensible Extension `xml:"-" json:"-"` Name string `json:"name"` Available bool `json:"available"` Sockets int64 `json:"sockets"` CoresPerSocket int64 `json:"coresPerSocket"` ThreadsPerCore int64 `json:"threadsPerCore"` Load float64 `json:"load"` PhysicalMemory int64 `json:"physicalMemory"` VirtualMemory int64 `json:"virtualMemory"` Architecture CPU `json:"architecture"` OSVersion Version `json:"osVersion"` OS OS `json:"os"` }
Machine represents a compute instance implementing the extension interface.
type MonitoringSession ¶
type MonitoringSession interface { CloseMonitoringSession() error GetAllJobs(filter JobInfo) ([]Job, error) GetAllQueues(names []string) ([]Queue, error) GetAllMachines(names []string) ([]Machine, error) GetAllReservations() ([]Reservation, error) }
MonitoringSession interface defines all methods required for implementing a DRMAA2 compatible monitoring session.
type Notification ¶
type Notification struct { Evt Event `json:"event"` JobID string `json:"jobID"` SessionName string `json:"sessionName"` State JobState `json:"jobState"` }
Notification is the argument of the callback function automatically called for an event.
type Queue ¶
type Queue struct { Extensible Extension `xml:"-" json:"-"` Name string `xml:"name"` }
Queue implements all required elements of a queue.
type Reservation ¶
type Reservation interface { GetID() (string, error) GetSessionName() (string, error) GetTemplate() (ReservationTemplate, error) GetInfo() (ReservationInfo, error) Terminate() error }
Reservation implements all methods required to be a valid DRMAA2 compatible reservation, created by a ReservationSession.
type ReservationInfo ¶
type ReservationInfo struct { Extensible Extension `xml:"-" json:"-"` ReservationID string `json:"reservationID"` ReservationName string `json:"reservationName"` ReservationStartTime time.Time `json:"reservationStartTime"` ReservationEndTime time.Time `json:"reservationEndTime"` ACL []string `json:"acl"` ReservedSlots int64 `json:"reservedSlots"` ReservedMachines []string `json:"reservedMachines"` }
ReservationInfo contains all details of the current state of a resource reservation.
type ReservationSession ¶
type ReservationSession interface { Close() error GetContact() (string, error) GetSessionName() (string, error) GetReservation(string) (Reservation, error) RequestReservation(ReservationTemplate) (Reservation, error) GetReservations() ([]Reservation, error) }
ReservationSession provides all methods required for a DRMAA2 compatible reservation session.
type ReservationTemplate ¶
type ReservationTemplate struct { Extensible Extension `xml:"-" json:"-"` Name string `json:"name"` StartTime time.Time `json:"startTime"` EndTime time.Time `json:"endTime"` Duration time.Duration `json:"duration"` MinSlots int64 `json:"minSlots"` MaxSlots int64 `json:"maxSlots"` JobCategory string `json:"jobCategory"` UsersACL []string `json:"userACL"` CandidateMachines []string `json:"candidateMachines"` MinPhysMemory int64 `json:"minPhysMemory"` MachineOs string `json:"machineOs"` MachineArch string `json:"machineArch"` }
ReservationTemplate contains ressource requests for a resource reservation.
type SessionManager ¶
type SessionManager interface { CreateJobSession(name, contact string) (JobSession, error) CreateReservationSession(sessionName, contact string) (ReservationSession, error) OpenMonitoringSession(sessionName string) (MonitoringSession, error) OpenJobSession(sessionName string) (JobSession, error) OpenReservationSession(name string) (ReservationSession, error) DestroyJobSession(sessionName string) error DestroyReservationSession(sessionName string) error GetJobSessionNames() ([]string, error) GetReservationSessionNames() ([]string, error) GetDrmsName() (string, error) GetDrmsVersion() (Version, error) Supports(Capability) bool RegisterEventNotification() (EventChannel, error) }
SessionManager defines all methods available from a DRMAA2 compatible SessionManager implementation. A SessionManager handles creation, opening, closing, destruction of DRMAA2 sessions. Sessions can be job sessions, monitoring sessions, or optionally reservation sessions. It provides generic methods for querying supported optional functionality and versioning.
Source Files ¶
- arrayjob.go
- callback.go
- capability.go
- capability_string.go
- constants.go
- cpu.go
- cpu_string.go
- error.go
- errorid_string.go
- extension.go
- job.go
- jobinfo.go
- jobsession.go
- jobstate_string.go
- jobtemplate.go
- machine.go
- monitoringsession.go
- os_string.go
- queue.go
- reservationsession.go
- sessionmanager.go
- version.go