geparser

package
Version: v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2020 License: BSD-2-Clause, BSD-2-Clause Imports: 7 Imported by: 1

Documentation

Overview

Package geparser contains functions for parsing Univa Grid Engine qstat -xml output. Note that those functions are not for using directly by the user of the gestatus library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAR

func GetAR(v *InternalJobStatus) int

GetAR returns the advance reservation the job is running in.

func GetAccount

func GetAccount(v *InternalJobStatus) string

GetAccount returns the string set for acccounting for the job.

func GetAdvanceReservationID

func GetAdvanceReservationID(v *InternalJobStatus) int

GetAdvanceReservationID returns the advance reservation ID the job has requested.

func GetDeadline

func GetDeadline(v *InternalJobStatus) time.Time

GetDeadline returns the deadline time to be scheduled set for the job.

func GetExecFileName

func GetExecFileName(v *InternalJobStatus) string

GetExecFileName returns the command of the job.

func GetExecutionTime

func GetExecutionTime(v *InternalJobStatus) time.Time

GetExecutionTime returns how long the job was running.

func GetGDIL

func GetGDIL(v *InternalJobStatus, task int) *[]GDIL

GetGDIL returns an array of granted destination identifiers

func GetGID

func GetGID(v *InternalJobStatus) int

GetGID returns the job owner's UNIX group ID.

func GetGroup

func GetGroup(v *InternalJobStatus) string

GetGroup returns the UNIX group the owner of the job is member of.

func GetHardRequests

func GetHardRequests(v *InternalJobStatus) (nm []string, val []string)

GetHardRequests pairs of name and value from hard resource requests (-hard -l mem=1G) -> "mem" "1G

func GetJobArgs

func GetJobArgs(v *InternalJobStatus) []string

GetJobArgs returns the arguments of the remote command.

func GetJobClassName

func GetJobClassName(v *InternalJobStatus) string

GetJobClassName returns the name of the requested job class for the job.

func GetJobName

func GetJobName(v *InternalJobStatus) string

GetJobName return the name of the job.

func GetJobNumber

func GetJobNumber(v *InternalJobStatus) int64

GetJobNumber returns the ID of the job.

func GetMailOptions

func GetMailOptions(v *InternalJobStatus) string

GetMailOptions returns the mail settings of the job.

func GetMailingAdresses

func GetMailingAdresses(v *InternalJobStatus) []string

GetMailingAdresses returns all mailing addresses which are informed when the state of the job is changing.

func GetMbind

func GetMbind(v *InternalJobStatus) string

GetMbind returns the memory binding requested by the job.

func GetOwner

func GetOwner(v *InternalJobStatus) string

GetOwner returns the owner of the job.

func GetParallelEnvironmentMax

func GetParallelEnvironmentMax(v *InternalJobStatus) int64

GetParallelEnvironmentMax returns the amount of slots the parallel jobs wants at maximum.

func GetParallelEnvironmentMin

func GetParallelEnvironmentMin(v *InternalJobStatus) int64

GetParallelEnvironmentMin returns the amount of slots the parallel application requires.

func GetParallelEnvironmentRequest

func GetParallelEnvironmentRequest(v *InternalJobStatus) string

GetParallelEnvironmentRequest returns if a parallel environment was requested by the job and hence the job is parallel meaning using multiple cores or even multiple hosts.

func GetParallelEnvironmentStep

func GetParallelEnvironmentStep(v *InternalJobStatus) int64

GetParallelEnvironmentStep returns the step size for searching between the minimum and max. amount of slots a job can use.

func GetPosixPriority

func GetPosixPriority(v *InternalJobStatus) int

GetPosixPriority returns the posix priority requested or set to the job.

func GetScriptFile

func GetScriptFile(v *InternalJobStatus) string

GetScriptFile return the job script executed.

func GetStartTime

func GetStartTime(v *InternalJobStatus) time.Time

GetStartTime returns when the first task of the job was started.

func GetSubmissionTime

func GetSubmissionTime(v *InternalJobStatus) time.Time

GetSubmissionTime returns when the job was submitted.

func GetTaskCount

func GetTaskCount(v *InternalJobStatus) int

GetTaskCount returns the amount of tasks found

func GetTaskStartTime

func GetTaskStartTime(v *InternalJobStatus, taskID int) time.Time

GetTaskStartTime returns the start time of specific task of the job

func GetUID

func GetUID(v *InternalJobStatus) int

GetUID return the job owner's UNIX user ID.

func GetUsageList

func GetUsageList(v *InternalJobStatus, task int) (resource []string, value []string)

GetUsageList returns the usage lists (resource[0] has value value[0])

func IsArray

func IsArray(v *InternalJobStatus) bool

IsArray returns if the job is a job array.

func IsBinary

func IsBinary(v *InternalJobStatus) bool

IsBinary returns if the job is a binary or not.

func IsImmediate

func IsImmediate(v *InternalJobStatus) bool

IsImmediate returns if the job is tried to by scheduled just once.

func IsMergeStderr

func IsMergeStderr(v *InternalJobStatus) bool

IsMergeStderr returns if the stdout and stderr streams are merged by the jobs.

func IsNoShell

func IsNoShell(v *InternalJobStatus) bool

IsNoShell returns if the job should be started without a starter shell.

func IsReservation

func IsReservation(v *InternalJobStatus) bool

IsReservation returns if the job had a reservation requested.

func Unix

func Unix(value, unused int64) time.Time

Unix converts a time from Epoch to Go time. It checks whether the timestamp is milliseconds or seconds since Epoch.

Types

type BNElement

type BNElement struct {
	// BNstrategy is Grid Engine internal data
	BNstrategy string `xml:"BN_strategy"`
	// BNtype is Grid Engine internal data
	BNtype int `xml:"BN_type"`
	// BNparameterN is Grid Engine internal data
	BNparameterN int `xml:"BN_parameter_n"`
	// BNparameterSocket is Grid Engine internal data
	BNparameterSocket int `xml:"BN_parameter_socket"`
	// BNparameterCoreOffset is Grid Engine internal data
	BNparameterCoreOffset int `xml:"BN_parameter_core_offset"`
	// BNparameterStridingStepSize is Grid Engine internal data
	BNparameterStridingStepSize int `xml:"BN_parameter_striding_step_size"`
	// BNparameterExplicit is Grid Engine internal data
	BNparameterExplicit string `xml:"BN_parameter_explicit"`
	// BNparameterNlocal is Grid Engine internal data
	BNparameterNlocal int `xml:"BN_parameter_nlocal"`
}

BNElement is a Grid Engine internal datatype

type DjobInfo

type DjobInfo struct {
	// Element is Grid Engine internal data
	Element Element `xml:"element"`
}

DjobInfo is a Grid Engine internal datatype

type Element

type Element struct {
	// JbJobNumber is Grid Engine internal data
	JbJobNumber int64 `xml:"JB_job_number"`
	// JbAr is Grid Engine internal data
	JbAr int `xml:"JB_ar"`
	// JbExecFile is Grid Engine internal data
	JbExecFile string `xml:"JB_exec_file"`
	// JbSubmissionTime is Grid Engine internal data
	JbSubmissionTime string `xml:"JB_submission_time"`
	// JbOwner is Grid Engine internal data
	JbOwner string `xml:"JB_owner"`
	// JbUID is Grid Engine internal data
	JbUID int `xml:"JB_uid"`
	// JbGroup is Grid Engine internal data
	JbGroup string `xml:"JB_group"`
	// JbGid is Grid Engine internal data
	JbGid int `xml:"JB_gid"`
	// JbAccount is Grid Engine internal data
	JbAccount string `xml:"JB_account"`
	// JbMergeStderr is Grid Engine internal data
	JbMergeStderr bool `xml:"JB_merge_stderr"`
	// JbNotify is Grid Engine internal data
	JbNotify string `xml:"JB_notify"`
	// JbJobName is Grid Engine internal data
	JbJobName string `xml:"JB_job_name"`
	// JbJobShare is Grid Engine internal data
	JbJobShare int `xml:"JB_job_share"`
	// JbEnvList is Grid Engine internal data
	JbEnvList JBEnvList `xml:"JB_env_list"`
	// JbJobArgs is Grid Engine internal data
	JbJobArgs JBJobArgs `xml:"JB_job_args"`
	// JbScriptFile is Grid Engine internal data
	JbScriptFile string `xml:"JB_script_file"`
	// JbJaTasks is Grid Engine internal data
	JbJaTasks JBJaTasks `xml:"JB_ja_tasks"`
	// JbDeadline is Grid Engine internal data
	JbDeadline int64 `xml:"JB_deadline"`
	// JbExecutionTime is Grid Engine internal data
	JbExecutionTime int64 `xml:"JB_execution_time"`
	// JbCheckpointAttr is Grid Engine internal data
	JbCheckpointAttr string `xml:"JB_checkpoint_attr"`
	// JbCheckpointIntvl is Grid Engine internal data
	JbCheckpointIntvl int `xml:"JB_checkpoint_interval"`
	// JbReserve is Grid Engine internal data
	JbReserve bool `xml:"JB_reserve"`
	// JbMailOptions is Grid Engine internal data
	JbMailOptions string `xml:"JB_mail_options"`
	// JbPriority is Grid Engine internal data
	JbPriority int `xml:"JB_priority"`
	// JbRestart is Grid Engine internal data
	JbRestart int `xml:"JB_restart"`
	// JbVerify is Grid Engine internal data
	JbVerify int `xml:"JB_verify"`
	// JbScriptSize is Grid Engine internal data
	JbScriptSize int `xml:"JB_script_size"`
	// JbVerifySuitableQueues is Grid Engine internal data
	JbVerifySuitableQueues int `xml:"JB_verify_suitable_queues"`
	// JbSoftWallclockGmt is Grid Engine internal data
	JbSoftWallclockGmt int `xml:"JB_soft_wallclock_gmt"`
	// JbHardWallclockGmt is Grid Engine internal data
	JbHardWallclockGmt int `xml:"JB_hard_wallclock_gmt"`
	// JbHardResourceRequest is Grid Engine internal data
	JbHardResourceRequest JBHard `xml:"JB_hard_resource_list"`
	// JbOverrideTickets is Grid Engine internal data
	JbOverrideTickets int `xml:"JB_override_tickets"`
	// JbVersion is Grid Engine internal data
	JbVersion int `xml:"JB_version"`
	// JbJaStructure is Grid Engine internal data
	JbJaStructure JBJAStructure `xml:"JB_ja_structure"`
	// JbType is Grid Engine internal data
	JbType int `xml:"JB_type"`
	// JbBinding is Grid Engine internal data
	JbBinding JBBinding `xml:"JB_binding"`
	// JbMbind is Grid Engine internal data
	JbMbind int `xml:"JB_mbind"`
	// JbIsBinary is Grid Engine internal data
	JbIsBinary bool `xml:"JB_is_binary"`
	// JbNoShell is Grid Engine internal data
	JbNoShell bool `xml:"JB_no_shell"`
	// JbIsArray is Grid Engine internal data
	JbIsArray bool `xml:"JB_is_array"`
	// JbIsImmediate is Grid Engine internal data
	JbIsImmediate bool `xml:"JB_is_immediate"`
	// JbJcName is Grid Engine internal data
	JbJcName string `xml:"JB_jc_name"`
	// JbMailList is Grid Engine internal data
	JbMailList JBMailList `xml:"JB_mail_list"`
	// JbPe is Grid Engine internal data
	JbPe string `xml:"JB_pe"`
	// JbPeRange is Grid Engine internal data
	JbPeRange JBPERange `xml:"JB_pe_range"`
}

Element is a Grid Engine internal datatype

type GDIL

type GDIL struct {
	// QueueName is Grid Engine internal data
	QueueName string
	// Slots is Grid Engine internal data
	Slots int
	// Ticket is Grid Engine internal data
	Ticket float64
	// OverrideTicket is Grid Engine internal data
	OverrideTicket float64
	// FunctionalTicket is Grid Engine internal data
	FunctionalTicket float64
	// SharetreeTicket is Grid Engine internal data
	SharetreeTicket float64
}

GDIL is a Grid Engine internal datatype

type GDILElement

type GDILElement struct {
	// JGqname is Grid Engine internal data
	JGqname string `xml:"JG_qname"`
	// JGqversion is Grid Engine internal data
	JGqversion string `xml:"JG_qversion"`
	// JGqhostname is Grid Engine internal data
	JGqhostname string `xml:"JG_qhostname"`
	// JGslots is Grid Engine internal data
	JGslots int `xml:"JG_slots"`
	// JGqueue is Grid Engine internal data
	JGqueue string `xml:"JG_queue"`
	// JGtagslavejob is Grid Engine internal data
	JGtagslavejob int `xml:"JG_tag_slave_job"`
	// JGticket is Grid Engine internal data
	JGticket float64 `xml:"JG_ticket"`
	// JGoticket is Grid Engine internal data
	JGoticket float64 `xml:"JG_oticket"`
	// JGfticket is Grid Engine internal data
	JGfticket float64 `xml:"JG_fticket"`
	// JGsticket is Grid Engine internal data
	JGsticket float64 `xml:"JG_sticket"`
	// JGjcoticket is Grid Engine internal data
	JGjcoticket float64 `xml:"JG_jcoticket"`
	// JGjcfticket is Grid Engine internal data
	JGjcfticket float64 `xml:"JG_jcfticket"`
	// JGbinding is Grid Engine internal data
	JGbinding JGBinding `xml:"JG_binding"`
}

GDILElement is a Grid Engine internal datatype

type HardElement

type HardElement struct {
	// Name is Grid Engine internal data
	Name string `xml:"CE_name"`
	// ValType is Grid Engine internal data
	ValType int `xml:"CE_valtype"`
	// StringVal is Grid Engine internal data
	StringVal string `xml:"CE_stringval"`
	// DoubleVal is Grid Engine internal data
	DoubleVal float64 `xml:"CE_doubleval"`
	// Consumable is Grid Engine internal data
	Consumable int `xml:"CE_consumable"`
}

HardElement is a Grid Engine internal datatype one element of a hard request -hard -l

type InternalJobStatus

type InternalJobStatus struct {
	// XMLName is Grid Engine internal data
	XMLName xml.Name `xml:"detailed_job_info"`
	// Jobinf is Grid Engine internal data
	Jobinf DjobInfo `xml:"djob_info"`
}

InternalJobStatus contains scheduler messages and djob_info

func GetJobStatus

func GetJobStatus(s *drmaa.Session, jobID string) (ijs InternalJobStatus, er error)

GetJobStatus for use within Go DRMAA lib. It first queries the job status cache and if the entry is not found it makes a direct qstat -j -xml call

func GetJobStatusByID

func GetJobStatusByID(jobID string) (ijs InternalJobStatus, err error)

GetJobStatusByID makes a qstat -xml -j jobID call and returns the pared result.

type JATGDIL

type JATGDIL struct {
	// GdilElement is Grid Engine internal data
	GdilElement []GDILElement `xml:"element"`
}

JATGDIL is a Grid Engine internal datatype

type JATScaledElements

type JATScaledElements struct {
	// UAname is Grid Engine internal data
	UAname string `xml:"UA_name"`
	// UAvalue  is Grid Engine internal data
	UAvalue string `xml:"UA_value"`
}

JATScaledElements is a Grid Engine internal datatype

type JATScaledUsageList

type JATScaledUsageList struct {
	// JATscaled82 is Grid Engine internal data
	JATscaled82 []JATScaledElements `xml:"Events"`
	// JATscaled is Grid Engine internal data
	JATscaled []JATScaledElements `xml:"scaled"`
}

JATScaledUsageList is a Grid Engine internal datatype This is 8.1.7 compatible but not 8.2 (use here Events)

type JBBinding

type JBBinding struct {
	// BindingElement is Grid Engine internal data
	BindingElement BNElement `xml:"element"`
}

JBBinding is a Grid Engine internal datatype

type JBEnvElem

type JBEnvElem struct {
	// VAvariable is Grid Engine internal data
	VAvariable string `xml:"VA_variable"`
	// VAvalue is Grid Engine internal data
	VAvalue string `xml:"VA_value"`
	// VAaccessSpecifier is Grid Engine internal data
	VAaccessSpecifier int `xml:"VA_access_specifier"`
}

JBEnvElem is a Grid Engine internal datatype

type JBEnvList

type JBEnvList struct {
	// JBEnvElement is Grid Engine internal data
	JBEnvElement []JBEnvElem `xml:"element"`
}

JBEnvList is a Grid Engine internal datatype

type JBHard

type JBHard struct {
	// HardResourceRequest is Grid Engine internal data
	HardResourceRequest []HardElement `xml:"element"`
}

JBHard is a Grid Engine internal datatype hard resource request list

type JBJAStructure

type JBJAStructure struct {
	// TaskIDrange is Grid Engine internal data
	TaskIDrange TaskidRange `xml:"task_id_range"`
}

JBJAStructure is a Grid Engine internal datatype

type JBJaSublist

type JBJaSublist struct {
	// JATstatus is Grid Engine internal data
	JATstatus int `xml:"JAT_status"`
	// JATtasknumber is Grid Engine internal data
	JATtasknumber int `xml:"JAT_task_number"`
	// JATscaledusagelist is Grid Engine internal data
	JATscaledusagelist JATScaledUsageList `xml:"JAT_scaled_usage_list"`
	// JATstarttime is Grid Engine internal data
	JATstarttime int64 `xml:"JAT_start_time"`
	// JATgranteddestinidentifierlist is Grid Engine internal data
	JATgranteddestinidentifierlist JATGDIL `xml:"JAT_granted_destin_identifier_list"`
}

JBJaSublist is a Grid Engine internal datatype

type JBJaTasks

type JBJaTasks struct {
	// JaTaskSublist82 is Grid Engine internal data
	JaTaskSublist82 []JBJaSublist `xml:"element"`
	// JaTaskSublist is Grid Engine internal data
	JaTaskSublist []JBJaSublist `xml:"ulong_sublist"`
}

JBJaTasks is a Grid Engine internal datatype This is 8.1.7 compatible. In 8.2 it was changed to "element".

type JBJobArgs

type JBJobArgs struct {
	// JBjobArgs is Grid Engine internal data
	JBjobArgs []JBJobArgsElement `xml:"element"`
}

JBJobArgs is a Grid Engine internal datatype

type JBJobArgsElement

type JBJobArgsElement struct {
	// STname is Grid Engine internal data
	STname string `xml:"ST_name"`
	// STpos  is Grid Engine internal data
	STpos int `xml:"ST_pos"`
	// STaccessSpecifier is Grid Engine internal data
	STaccessSpecifier int `xml:"ST_access_specifier"`
}

JBJobArgsElement is a Grid Engine internal datatype

type JBMailList

type JBMailList struct {
	// MailElement is Grid Engine internal data
	MailElement []MRElement `xml:"element"`
}

JBMailList is a Grid Engine internal datatype list of mail addresses

type JBPERange

type JBPERange struct {
	// Range is Grid Engine internal data
	Range RangeElement `xml:"element"`
}

JBPERange is a Grid Engine internal datatype

type JGBinding

type JGBinding struct {
	// JGbindingElement is Grid Engine internal data
	JGbindingElement BNElement `xml:"binding"`
}

JGBinding is a Grid Engine internal datatype

type MRElement

type MRElement struct {
	// User is Grid Engine internal data
	User string `xml:"MR_user"`
	// Host is Grid Engine internal data
	Host string `xml:"MR_host"`
}

MRElement is a Grid Engine internal datatype one element of the mail address list

type QstatJob

type QstatJob struct {
	// JBjobnumber is Grid Engine internal data
	JBjobnumber int64 `xml:"JB_job_number"`
	// JATprio is Grid Engine internal data
	JATprio float64 `xml:"JAT_prio"`
	// JBname is Grid Engine internal data
	JBname string `xml:"JB_name"`
	// JBowner is Grid Engine internal data
	JBowner string `xml:"JB_owner"`
	// State is Grid Engine internal data
	State string `xml:"state"`
	// JATstarttime is Grid Engine internal data
	JATstarttime string `xml:"JAT_start_time"`
	// QueueName is Grid Engine internal data
	QueueName string `xml:"queue_name"`
	// JClassName is Grid Engine internal data
	JClassName string `xml:"jclass_name"`
	// Slots is Grid Engine internal data
	Slots int64 `xml:"slots"`
}

QstatJob is a Grid Engine internal datatype

type QstatJobInfoList

type QstatJobInfoList struct {
	// XMLName is Grid Engine internal data
	XMLName xml.Name `xml:"job_info"`
	// JobList is Grid Engine internal data
	// contains queue_info and job_info
	JobList []QstatJob `xml:"queue_info>job_list"`
}

QstatJobInfoList is a Grid Engine internal datatype

func GetClusterJobsStatus

func GetClusterJobsStatus() (ijs QstatJobInfoList, er error)

GetClusterJobsStatus returns all running jobs of a particular user by executing and parsing the qstat -xml output.

type RangeElement

type RangeElement struct {
	// RnMin is Grid Engine internal data
	RnMin int64 `xml:"RN_min"`
	// RnMax is Grid Engine internal data
	RnMax int64 `xml:"RN_max"`
	// RnStep is Grid Engine internal data
	RnStep int64 `xml:"RN_step"`
}

RangeElement is a Grid Engine internal datatype

type TaskidRange

type TaskidRange struct {
	// RNmin is Grid Engine internal data
	RNmin int `xml:"RN_min"`
	// RNmax is Grid Engine internal data
	RNmax int `xml:"RN_max"`
	// RNstep is Grid Engine internal data
	RNstep int `xml:"RN_step"`
}

TaskidRange is a Grid Engine internal datatype

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL