drmaa2

package module
v0.0.0-...-22641b0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2020 License: Apache-2.0 Imports: 5 Imported by: 1

README

drmaa2

GoDoc Apache V2 License

NOTE THAT THIS A COMPLETELY BROKEN IMPLEMENTATION AND COMPLETELY OUT OF DATE JUST HERE FOR KEEPING HISTORY ALIVE :-D

PLEASE CONSIDER TO USE WHICH SUPPORTS A BROADER RANGE OF MODERN WORKLOAD MANAGERS: https://github.com/dgruber/drmaa2os

A Go (#golang) API for job submission, job workflow management, and HPC cluster monitoring based on the open OGF DRMAA2 standard (http://www.drmaa.org / http://www.ogf.org).

This Go API is a wrapper around the DRMAA2 C APIs. It is not yet finished. Improvements, bug reports, and pull requests are welcome. DRMAA2 Go API is not yet standardized but a draft (based on this implementation) is available here: http://redmine.ogf.org/projects/drmaav2-go-binding/repository

Note: The master branch contains now methods (like job.Reap()) which are specified in DRMAA2 2015 Errata. Those methods might not be (yet) in the underlying DRMAA2 C library. Hence I created a branch which is compatible with older DRMAA2 C implementations (UGE_82_Compatible) which can be used instead.

Installation

NOTE THAT THIS A COMPLETELY BROKEN IMPLEMENTATION AND COMPLETELY OUT OF DATE JUST HERE FOR KEEPING HISTORY ALIVE :-D

PLEASE CONSIDER TO USE WHICH SUPPORTS A BROADER RANGE OF MODERN WORKLOAD MANAGERS: https://github.com/dgruber/drmaa2os

  1. Download / Install Univa Grid Engine (see http://www.univa.com) Univa Grid Engine is currently the only cluster scheduler which supports the DRMAA2 standard. A quick guide to get it installed you can find in my blog article: http://www.gridengine.eu/index.php/grid-engine-internals/209-installing-a-univa-grid-engine-demo-cluster-with-one-command-2014-07-13

    Note that Univa Grid Engine is commercial.

  2. Be sure that you have Grid Engine in your path (i.e. $SGE_ROOT is set)

    You can test this by calling qhost / qstat / ..... Usually this is done by calling source /path/where/grid/engine/is/installed/default/common/settings.sh

    Note that "default" is the CELL directory which can be different to "default".

  3. Clone the project with git tools in your go source path (github.com/dgruber/drmaa2).

  4. Call build.sh

Usage

NOTE THAT THIS A COMPLETELY BROKEN IMPLEMENTATION AND COMPLETELY OUT OF DATE JUST HERE FOR KEEPING HISTORY ALIVE :-D

Please check out a detailed example which exploits the monitoring session and creates a webserver hosting the cluster status information.

https://github.com/dgruber/drmaa2_web_app

For a simple multi-clustering (access multiple compute clusters with the same tools) application based on this DRMAA2 API, please check out:

https://github.com/dgruber/ubercluster

It implements a simple webservice API for DRMAA2.

Documentation

NOTE THAT THIS A COMPLETELY BROKEN IMPLEMENTATION AND COMPLETELY OUT OF DATE JUST HERE FOR KEEPING HISTORY ALIVE :-D

Better not read the documentation. Move to something more advanced...

https://godoc.org/github.com/dgruber/drmaa2

Documentation

Index

Constants

View Source
const (
	AdvanceReservation = iota
	ReserveSlots
	Callback
	BulkJobsMaxParallel
	JtEmail
	JtStaging
	JtDeadline
	JtMaxSlots
	JtAccountingId
	RtStartNow
	RtDuration
	RtMachineOS
	RtMachineArch
)
View Source
const (
	Success errorID = iota
	DeniedByDrms
	DrmCommunication
	TryLater
	SessionManagement
	Timeout
	Internal
	InvalidArgument
	InvalidSession
	InvalidState
	OutOfResource
	UnsupportedAttribute
	UnsupportedOperation
	ImplementationSpecific
	LastError
)
View Source
const (
	NewState = iota
	Migrated
	AttributeChange
)
View Source
const InfiniteTime = int64(C.DRMAA2_INFINITE_TIME)

InfiniteTime is a special timeout value: Wait probably infinitly

View Source
const UnsetTime = int64(C.DRMAA2_UNSET_TIME)

UnsetTime is a special time value: Time or date not set

View Source
const ZeroTime = int64(C.DRMAA2_ZERO_TIME)

ZeroTime is a special timeout value: Don't wait

Variables

This section is empty.

Functions

This section is empty.

Types

type ArrayJob

type ArrayJob struct {
	// contains filtered or unexported fields
}

ArrayJob represents a DRMAA2 job array. Basically a super-job which contains lots of jobs called tasks. All tasks share the same property (process name / arguments etc). The tasks can differentiate between themselfs by reading out a specific environment variable.

func (*ArrayJob) GetID

func (aj *ArrayJob) GetID() string

GetID returns the job identifier of the ArrayJob.

func (*ArrayJob) GetJobTemplate

func (aj *ArrayJob) GetJobTemplate() *JobTemplate

GetJobTemplate returns a pointer to a job template of the ArrayJob.

func (*ArrayJob) GetJobs

func (aj *ArrayJob) GetJobs() []Job

GetJobs returns a list of individual jobs the ArrayJob consists of.

func (*ArrayJob) GetSessionName

func (aj *ArrayJob) GetSessionName() string

GetSessionName returns the name of the job session the array job belongs to.

func (*ArrayJob) Hold

func (aj *ArrayJob) Hold() error

Hold puts all tasks of an ArrayJob into hold state.

func (*ArrayJob) Release

func (aj *ArrayJob) Release() error

Release releases all tasks of an ArrayJob from hold, if they are on hold.

func (*ArrayJob) Resume

func (aj *ArrayJob) Resume() error

Resume continues all suspended tasks of an ArrayJob.

func (*ArrayJob) Suspend

func (aj *ArrayJob) Suspend() error

Suspend stops all running tasks of an ArrayJob without destroying them (usually a SIGSTP signal is send to the processes the job consists of).

func (*ArrayJob) Terminate

func (aj *ArrayJob) Terminate() error

Terminate terminates (usually sends a SIGKILL) all tasks of an ArrayJob.

type CPU

type CPU int

CPU architecture types

const (
	// OtherCPU is an unknown CPU type
	OtherCPU CPU = iota
	// Alpha is Alpha CPU
	Alpha
	// ARM is a 32bit ARM (ARM6, ARM7) type
	ARM
	// ARM64 is a 64bit ARM (ARM8) type
	ARM64
	// Cell is the Cell architecture (PS3)
	Cell
	// PA_RISC is the HP RISC architecture
	PA_RISC
	// PA_RISC64 is the HP RISC architecture 64bit version
	PA_RISC64

	// IA_64 is the Intel 64bit architecture
	IA_64
	// MIPS is 32bit MIPS
	MIPS
	// MIPS64 is 64bit MIPS
	MIPS64
	// PowerPC is the 32bit PowerPC architecture
	PowerPC
	// PowerPC64 is the 64bit PowerPC architecture
	PowerPC64
	// SPARC is the 32bit SPARC architecture
	SPARC
	// SPARC64 is the 64bit SPARC architecture
	SPARC64
)

func (CPU) String

func (cpu CPU) String() string

String is the string representation of the CPU type

type CallbackFunction

type CallbackFunction func(notification Notification)

CallbackFunction is function which works on the notification struct as callback.

type Capability

type Capability int

Capability is a type which represents the availability of optional functionality of the DRMAA2 implementation. Option functionality is defined by the DRMAA2 standard but not mandatory to implement.

type Error

type Error struct {
	Message string
	ID      errorID
}

Error is a DRMAA2 error (implements Go Error interface).

func (Error) Error

func (ce Error) Error() string

Error implements the Error interface for a DRMAA2 error.

func (Error) String

func (ce Error) String() string

String implement the Stringer interface for an drmaa2.Error

type Event

type Event int

Event is job status change event used by the Notification struct.

type EventChannel

type EventChannel chan Notification

type Extensible

type Extensible interface {
	// ListExtensions Lists all implementation specific key names for
	// a particular DRMAA2 extensible data type
	ListExtensions() []string
	// DescribeExtension describes the semantic of an extension
	DescribeExtension(string) string
	// SetExtension sets value in a extension
	SetExtension(string) error
	// GetExtension returns the value of an extension
	GetExtension() string
}

Extensible is an interface which defines functions used to interact with extensible data structures (JobTemplate, JobInfo etc.).

type Extension

type Extension struct {
	// SType stores the type of the structure to extent
	SType structType
	// Internal is a pointer to the enhacement of the C struct (void *)
	Internal unsafe.Pointer
	// ExtensionList caches the extension requests in a map
	ExtensionList map[string]string
}

Extension is a struct which is embedded in DRMAA2 objects which are extensible.

func (*Extension) GetExtension

func (e *Extension) GetExtension(extension string) (string, error)

GetExtension returns an extension of a extensible struct by name.

type Job

type Job struct {
	// contains filtered or unexported fields
}

Job is a struct which represents a job in the DRM system (part of a JobSession or a Monitoring session).

func (*Job) GetId

func (job *Job) GetId() string

func (*Job) GetJobInfo

func (job *Job) GetJobInfo() (*JobInfo, error)

GetJobInfo creates a new JobInfo object out of the job.

func (*Job) GetJobTemplate

func (job *Job) GetJobTemplate() (*JobTemplate, error)

Returns the JobTemplate used to submit the job.

func (*Job) GetSessionName

func (job *Job) GetSessionName() string

A job session name is a (per user) unique identifier of the job session. It is stored in the cluster scheduler or in the underlying DRMAA2 C implementation. It is persistent until it gets reaped by DestroyJobSession() method.

func (*Job) GetState

func (job *Job) GetState() JobState

GetState returns the current state of the job.

func (*Job) Hold

func (job *Job) Hold() error

Hold set the job into an hold state so that it is not scheduled. If the job is already running it continues to run and the hold state becomes only effectice when the job is rescheduled.

func (*Job) Reap

func (job *Job) Reap() error

Reap removes a finished job from internal storage. Without calling Reap() the job will be listed in the jobs session and monitoring session as finished job until the sessions are closed. Reaping jobs makes sense to avoid out of memory conditions. (Remark Reap() came in DRMAA2 2015 Errata)

func (*Job) Release

func (job *Job) Release() error

Release removes the hold state from the job so that it will be considered as a schedulable job.

func (*Job) Resume

func (job *Job) Resume() error

Resume continues to run a job / process (typically a SIGCONT signal is sent to the job / process).

func (*Job) Suspend

func (job *Job) Suspend() error

Stops a job / process from beeing executed (typically a SIGSTOP or SIGTSTP signal is sent to the job / process).

func (*Job) Terminate

func (job *Job) Terminate() error

Terminate tells the resource manager to kill the job.

func (*Job) TerminateForced

func (job *Job) TerminateForced() error

Terminate tells the resource manager to kill the job.

func (*Job) WaitStarted

func (job *Job) WaitStarted(timeout int64) error

Blocking wait until the job is started. The timeout prefents that the call is blocking endlessly. Special timeouts are available by the constants InfiniteTime and ZeroTime.

func (*Job) WaitTerminated

func (job *Job) WaitTerminated(timeout int64) error

WaitTerminated wait until the job goes into one of the finished states. The timeout specifies the maximum time to wait. If no timeout is required use the constant drmaa2.InfiniteTime.

type JobInfo

type JobInfo struct {
	// reference to the void* pointer which
	// is used for extensions
	Extension         `xml:"-" json:"-"`
	Id                string        `json:"id"`
	JobName           string        `json:"jobName"`
	ExitStatus        int           `json:"exitStatus"`
	TerminatingSignal string        `json:"terminationSignal"`
	Annotation        string        `json:"annotation"`
	State             JobState      `json:"state"`
	SubState          string        `json:"subState"`
	AllocatedMachines []SlotInfo    `json:"allocatedMachines"`
	SubmissionMachine string        `json:"submissionMachine"`
	JobOwner          string        `json:"jobOwner"`
	Slots             int64         `json:"slots"`
	QueueName         string        `json:"queueName"`
	WallclockTime     time.Duration `json:"wallockTime"`
	CPUTime           int64         `json:"cpuTime"`
	SubmissionTime    time.Time     `json:"submissionTime"`
	DispatchTime      time.Time     `json:"dispatchTime"`
	FinishTime        time.Time     `json:"finishTime"`
}

JobInfo is a struct which represents the current state of a job.

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).

func (*JobInfo) ListExtensions

func (ji *JobInfo) ListExtensions() []string

ListExtensions returns a string list containing all implementation specific extensions of the JobInfo object.

func (*JobInfo) SetExtension

func (ji *JobInfo) SetExtension(extension, value string) error

SetExtension adds an vendor specific attribute to the extensible structure.

type JobSession

type JobSession struct {
	Name string `json:"name"` // public name of job session
	// contains filtered or unexported fields
}

JobSession is a struct which represents a DRMAA2 job session for job submission and job management.

func (*JobSession) Close

func (js *JobSession) Close() error

Close closes the connection to an open JobSession.

func (*JobSession) GetContact

func (js *JobSession) GetContact() (string, error)

GetContact returns the contact string of the DRM session.

func (*JobSession) GetJobArray

func (js *JobSession) GetJobArray(id string) (*ArrayJob, error)

GetJobArray returns a reference to an existing ArrayJob based on the given job id. In case of an error the error return value is set to != nil.

func (*JobSession) GetJobCategories

func (js *JobSession) GetJobCategories() ([]string, error)

GetJobCategories returns all job categories specified in the job session or globally.

func (*JobSession) GetJobs

func (js *JobSession) GetJobs(ji *JobInfo) ([]Job, error)

GetJobs returns a list of all jobs currently attached to the given JobSession. If a JobInfo argument unequal nil is given then this JobInfo element is used for filtering the result. For more details about filtering consider the details of the DRMAA2 specificaton.

func (*JobSession) GetSessionName

func (js *JobSession) GetSessionName() (string, error)

GetSessionName returns the session name of the JobSession struct which also can be used directly.

func (*JobSession) RunBulkJobs

func (js *JobSession) RunBulkJobs(jt JobTemplate, begin int, end int, step int, maxParallel int) (*ArrayJob, error)

RunBulkJobs submits a JobTemplate to the cluster as an array job (multiple instances of the same job, not neccessarly running a the same point in time). It requires a JobTemplate filled out at least with a RemoteCommand. The begin, end and step parameters specifying how many array job instances are submitted and how the instances are numbered (1,10,1 denotes 10 array job instances numbered from 1 to 10). The maxParallel parameter specifies how many of the array job instances should run at parallel as maximum (when resources are contrainted then less instances could run).

func (*JobSession) RunJob

func (js *JobSession) RunJob(jt JobTemplate) (*Job, error)

RunJob submits a job based on the parameters specified in the JobTemplate in the cluster. In case of success it returns a pointer to a Job element, which can be used for further processing. In case of an error the error return value is set.

func (*JobSession) WaitAnyStarted

func (js *JobSession) WaitAnyStarted(jobs []Job, timeout int64) (*Job, error)

WaitAnyStarted waits until any of the given jobs is started (usually in running state). The timeout determines after how many seconds the method should abort, even when none of the given jobs was started. Special timeout values are InfiniteTime and ZeroTime.

func (*JobSession) WaitAnyTerminated

func (js *JobSession) WaitAnyTerminated(jobs []Job, timeout int64) (*Job, error)

WaitAnyTerminated waits until any of the given jobs is finished. The timeout determines after how many seconds the method should abort, even when none of the given jobs is finished. Sepecial timeout values are InfiniteTime and ZeroTime.

type JobState

type JobState int

JobState represents a DRMAA2 job state

const (
	// Unset is no job state (used as JobInfo filter for matching all states
	// for example)
	Unset JobState = iota
	// Undetermined is an unknown state of the job
	Undetermined
	// Queued means the job is waiting
	Queued
	// QueuedHeld means the job is waiting and not eligible to run
	QueuedHeld
	// Running means the job is actually running
	Running
	// Suspended means the job was running but now in a suspended state
	Suspended
	// Requeued means the job was running and then stopped and now waiting
	// again for being scheduled.
	Requeued
	// ReuquedHeld means the job was requeued but has a hold flag set
	RequeuedHeld
	// Done means the job finished without an error (exit code 0)
	Done
	// Failed means that the job finished with an error
	Failed
)

func (JobState) String

func (js JobState) String() string

String returns the string representation of a JobState

type JobTemplate

type JobTemplate struct {
	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 is the template for creating a job out of it.

func (*JobTemplate) DescribeExtension

func (jt *JobTemplate) DescribeExtension(extensionName string) (string, error)

DescribeExtension returns the description of an implementation specific JobTemplate extension as a string.

func (*JobTemplate) ListExtensions

func (jt *JobTemplate) ListExtensions() []string

ListExtensions returns a string list containing all implementation specific extensions of the JobTemplate object.

func (*JobTemplate) SetExtension

func (jt *JobTemplate) SetExtension(extension, value string) error

SetExtension adds an vendor specific attribute to the extensible structure.

type Machine

type Machine struct {
	// Extension is embedded in a machine since it is extensible.
	Extension `xml:"-" json:"-"`
	// Name is the name of the compute node.
	Name string `json:"name"`
	// Available determines if the machine can accept jobs.
	Available bool `json:"available"`
	// Sockets is the amount of CPU packages installed on the compute node.
	Sockets int64 `json:"sockets"`
	// CoresPerSocket represents the amount of cores per socket.
	CoresPerSocket int64 `json:"coresPerSocket"`
	// ThreadsPerCore specifies how SMT threads are supported per core.
	ThreadsPerCore int64 `json:"threadsPerCore"`
	// Load is the 5 min. load average of the compute node.
	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 is a host where jobs can be executed.

func (*Machine) ListExtensions

func (m *Machine) ListExtensions() []string

ListExtensions returns a string list containing all implementation specific extensions of the Machine object.

func (*Machine) SetExtension

func (m *Machine) SetExtension(extension, value string) error

SetExtension adds an vendor specific attribute to the extensible structure.

type MonitoringSession

type MonitoringSession struct {
	// contains filtered or unexported fields
}

MonitoringSession is a struct which represents a DRMAA2 monitoring session (for cluster monitoring).

func (*MonitoringSession) CloseMonitoringSession

func (ms *MonitoringSession) CloseMonitoringSession() error

CloseMonitoringSession closes the MonitoringSession.

func (*MonitoringSession) GetAllJobs

func (ms *MonitoringSession) GetAllJobs(ji *JobInfo) (jobs []Job, err error)

GetAllJobs returns a slice of jobs currently visible in the monitoring session. The JobInfo parameter specifies a filter for the job. For instance when a certain job number is set in the JobInfo object, then

func (*MonitoringSession) GetAllMachines

func (ms *MonitoringSession) GetAllMachines(names []string) (machines []Machine, err error)

GetAllMachines returns a list of all machines configured in cluster if the argument is nil. Otherwise a list of available machines which matches the given names is returned.

func (*MonitoringSession) GetAllQueues

func (ms *MonitoringSession) GetAllQueues(names []string) (queues []Queue, err error)

GetlAllQueues returns all queues configured in the cluster in case the argument is nil. Otherwise as subset of the queues which matches the given names is returned.

func (*MonitoringSession) GetAllReservations

func (ms *MonitoringSession) GetAllReservations() (reservations []Reservation, err error)

GetAllReservations returns all known advance reservations.

type Notification

type Notification struct {
	Evt         Event    `json:"event"`
	JobId       string   `json:"jobId"`
	SessionName string   `json:"sessionName"`
	State       JobState `json:"jobState"`
}

Notification represents a JobStatus change event.

type OS

type OS int

OS is the operating system type.

const (
	OtherOS OS = iota
	AIX
	BSD
	Linux
	HPUX
	IRIX
	MacOS
	SunOS
	TRU64
	UnixWare
	Win
	WinNT
)

func (OS) String

func (os OS) String() string

String returns the string represnentation of the OS struct

type Queue

type Queue struct {
	// Extension is embedded in a queue since it is extensible.
	Extension `xml:"-" json:"-"`
	// Name is the name of the queue.
	Name string `xml:"name"`
}

Queue represents a queue of the Distribute Resource Manager. In Grid Engine a queue defines the execution context of a job, it is not a waiting queue.

func (*Queue) ListExtensions

func (q *Queue) ListExtensions() []string

ListExtensions returns a string list containing all implementation specific extensions of the Queue object.

func (*Queue) SetExtension

func (q *Queue) SetExtension(extension, value string) error

SetExtension adds an vendor specific attribute to the extensible structure.

type Reservation

type Reservation struct {
	SessionName   string              `json:"sessionName"`
	Contact       string              `json:"contact"`
	Template      ReservationTemplate `json:"template"`
	ReservationId string              `json:"reservationId"`
}

Reservation represents a advance reservation in the Distributed Resource Management system.

func (*Reservation) GetID

func (r *Reservation) GetID() (string, error)

GetID Returns the advance reservation id. TODO(dg)

func (*Reservation) GetInfo

func (r *Reservation) GetInfo() (*ReservationInfo, error)

GetInfo returns the reservation info object of the reservation. TODO(dg)

func (*Reservation) GetSessionName

func (r *Reservation) GetSessionName() (string, error)

GetSessionName returns the name of the reservation. TODO(dg)

func (*Reservation) GetTemplate

func (r *Reservation) GetTemplate() (*ReservationTemplate, error)

GetTemplate returns the reservation template of the reservation. TODO(dg)

func (*Reservation) Terminate

func (r *Reservation) Terminate() error

Terminate cancels an advance reservation. TODO(dg)

type ReservationInfo

type ReservationInfo struct {
	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 is a struct which represents a reservation.

type ReservationSession

type ReservationSession struct {
	Name string `json:"name"`
	// contains filtered or unexported fields
}

ReservationSession is a struct which represents a DRMAA reservation session for handling advance reservations. The support for reservation sessions is optional in the DRMAA2 standard.

func (*ReservationSession) Close

func (rs *ReservationSession) Close() error

Close closes an open ReservationSession.

func (*ReservationSession) GetContact

func (rs *ReservationSession) GetContact() (string, error)

GetContact returns the contact string of the reservation session.

func (*ReservationSession) GetReservation

func (rs *ReservationSession) GetReservation(rid string) (*Reservation, error)

GetReservation returns a reservation object based on the advance reservation ID. TODO(dg)

func (*ReservationSession) GetReservations

func (rs *ReservationSession) GetReservations() ([]Reservation, error)

GetReservations returns a list of available advance reservations. TODO(dg)

func (*ReservationSession) GetSessionName

func (rs *ReservationSession) GetSessionName() (string, error)

GetSessionName returns the name of the reservation session. TODO(dg)

func (*ReservationSession) RequestReservation

func (rs *ReservationSession) RequestReservation(rtemplate ReservationTemplate) (*Reservation, error)

RequestReservation allocates an advance reservation based on the reservation template. TODO(dg)

type ReservationTemplate

type ReservationTemplate struct {
	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 is a template from which a reservation can be generated.

type SessionManager

type SessionManager struct {
}

SessionManager is a utility function for creating monitoring sessions and Job Sessions A Create Method which initializes the values and also does initialization about capabilities, versions etc. ?!? TODO(dg)

func (*SessionManager) CreateJobSession

func (sm *SessionManager) CreateJobSession(sessionName, contact string) (*JobSession, error)

CreateJobSession creates a new persistent job session and opens it. The returned JobSession object contains a reference to a DRMAA2 C jobsession object and hence needs to be freed manually.

func (*SessionManager) CreateReservationSession

func (sm *SessionManager) CreateReservationSession(sessionName, contact string) (rs *ReservationSession, err error)

CreateReservationSessiono creates a reservation session by name and contact string.

func (*SessionManager) DestroyJobSession

func (sm *SessionManager) DestroyJobSession(sessionName string) error

DestroyJobSession destroys a job session by name.

func (*SessionManager) DestroyReservationSession

func (sm *SessionManager) DestroyReservationSession(sessionName string) error

DestroyReservationSession destroys a reservation by name.

func (*SessionManager) GetDrmsName

func (sm *SessionManager) GetDrmsName() (string, error)

GetDrmsName returns the name of the Distributed Resource Management System.

func (*SessionManager) GetDrmsVersion

func (sm *SessionManager) GetDrmsVersion() (*Version, error)

GetDrmsVersion returns the version of the Distributed Resource Management System.

func (*SessionManager) GetJobSessionNames

func (sm *SessionManager) GetJobSessionNames() ([]string, error)

GetJobSessionNames returns all job sessions accessable to the user.

func (*SessionManager) GetReservationSessionNames

func (sm *SessionManager) GetReservationSessionNames() ([]string, error)

GetReservationSessionNames returns all reservation sessions accessable to the user.

func (*SessionManager) OpenJobSession

func (sm *SessionManager) OpenJobSession(sessionName string) (*JobSession, error)

OpenJobSession opens an existing DRMAA2 job sesssion. In Univa Grid Engine this job session is persistently stored in the Grid Engine master process. The sessionName needs to be != "".

func (*SessionManager) OpenMonitoringSession

func (sm *SessionManager) OpenMonitoringSession(sessionName string) (*MonitoringSession, error)

OpenMonitoringSession opens a MonitoringSession by name. Usually the name is ignored.

func (*SessionManager) OpenReservationSession

func (sm *SessionManager) OpenReservationSession(name string) (rs ReservationSession, err error)

OpenReservationSession opens an existing ReservationSession by name.

func (*SessionManager) RegisterEventNotification

func (sm *SessionManager) RegisterEventNotification() (EventChannel, error)

RegisterEventNotification needs to install a C callback in the C interface. TODO(dg)

func (*SessionManager) Supports

func (sm *SessionManager) Supports(c Capability) bool

Supports checks whether the DRMAA2 implementation supports an optional functionality or not.

func (*SessionManager) UnregisterEventNotification

func (sm *SessionManager) UnregisterEventNotification() error

UnregisterEventNotification turns off sending events through the EventChannel. Internally a NULL callback is registered so that no new events are created. TODO(dg)

type SlotInfo

type SlotInfo struct {
	MachineName string
	Slots       int64
}

SlotInfo represents the amount of slots used on a particular host.

type Version

type Version struct {
	// Major is the major version of the DRM or DRMAA2 implementation
	Major string
	// Minor is the minor version of the DRM or DRMAA2 implementation
	Minor string
}

Version is a DRMAA2 version type which consists of a major version and a minor version.

func (*Version) String

func (v *Version) String() string

String returns a "Major.Minor" formated representation of the version.

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL