func (js *JobStatus) ParallelEnvironment() string {
	return geparser.GetParallelEnvironmentRequest(&js.js)
}
ParallelEnvironment returns the name of the parallel environment
requested by a job.
package gestatus
import (
	"github.com/dgruber/drmaa"
	"github.com/dgruber/drmaa/gestatus/private_gestatus"
	"strconv"
	"strings"
	"time"
)
type ClusterJobs struct {
	jobs []geparser.QstatJob
}
type Job struct {
	Number    int64
	Priority  float64
	Name      string
	Owner     string
	State     string
	StartTime string
	QueueName string
	JobClass  string
	Slots     int64
}
func convertQstatJobToJob(qsj geparser.QstatJob) (job Job) {
	job.Number = qsj.JBjobnumber
	job.Priority = qsj.JATprio
	job.Name = qsj.JBname
	job.Owner = qsj.JBowner
	job.State = qsj.State
	qsj.JATstarttime = strings.Replace(qsj.JATstarttime, "T", "-", 1)
	job.StartTime = qsj.JATstarttime
	job.QueueName = qsj.QueueName
	job.JobClass = qsj.JClassName
	job.Slots = qsj.Slots
	return job
}
func GetClusterJobs() (clusterjobs ClusterJobs, err error) {
	if cjs, err := geparser.GetClusterJobsStatus(); err == nil {
		if cjs.JobList != nil {
			clusterjobs.jobs = cjs.JobList
		}
		return clusterjobs, nil
	}
	return clusterjobs, err
}
func (cjs *ClusterJobs) AllJobs() []Job {
	if cjs.jobs == nil {
		return nil
	}
	jobs := make([]Job, 0, len(cjs.jobs))
	for _, j := range cjs.jobs {
		jobs = append(jobs, convertQstatJobToJob(j))
	}
	return jobs
}
type JobStatus struct {
	js geparser.InternalJobStatus
}
func GetJob(jobid string) (jobstat JobStatus, err error) {
	js, err := geparser.GetJobStatusByID(jobid)
	if err != nil {
		return jobstat, err
	}
	jobstat.js = js
	return jobstat, nil
}
func GetJobStatus(session *drmaa.Session, jobID string) (jobstat JobStatus, err error) {
	js, err := geparser.GetJobStatus(session, jobID)
	if err != nil {
		return jobstat, err
	}
	jobstat.js = js
	return jobstat, nil
}
func (js *JobStatus) JobName() string {
	return geparser.GetJobName(&js.js)
}
func (js *JobStatus) JobID() int64 {
	return geparser.GetJobNumber(&js.js)
}
func (js *JobStatus) execFileName() string {
	return geparser.GetExecFileName(&js.js)
}
func (js *JobStatus) JobScript() string {
	return geparser.GetScriptFile(&js.js)
}
func (js *JobStatus) JobArgs() []string {
	return geparser.GetJobArgs(&js.js)
}
func (js *JobStatus) JobOwner() string {
	return geparser.GetOwner(&js.js)
}
func (js *JobStatus) JobUID() int {
	return geparser.GetUID(&js.js)
}
func (js *JobStatus) JobGroup() string {
	return geparser.GetGroup(&js.js)
}
func (js *JobStatus) JobGID() int {
	return geparser.GetGID(&js.js)
}
func (js *JobStatus) JobAccountName() string {
	return geparser.GetAccount(&js.js)
}
func (js *JobStatus) IsImmediateJob() bool {
	return geparser.IsImmediate(&js.js)
}
func (js *JobStatus) HasReservation() bool {
	return geparser.IsReservation(&js.js)
}
func (js *JobStatus) IsBinaryJob() bool {
	return geparser.IsBinary(&js.js)
}
func (js *JobStatus) HasNoShell() bool {
	return geparser.IsNoShell(&js.js)
}
func (js *JobStatus) IsArrayJob() bool {
	return geparser.IsArray(&js.js)
}
func (js *JobStatus) JobMergesStderr() bool {
	return geparser.IsMergeStderr(&js.js)
}
func (js *JobStatus) HasMemoryBinding() bool {
	if geparser.GetMbind(&js.js) == "no_bind" {
		return false
	}
	return true
}
func (js *JobStatus) MemoryBinding() string {
	return geparser.GetMbind(&js.js)
}
func (js *JobStatus) StartTime() time.Time {
	return geparser.GetStartTime(&js.js)
}
func (js *JobStatus) RunTime() time.Duration {
	if js.StartTime().Unix() != 0 {
		return time.Since(js.StartTime())
	}
	d, _ := time.ParseDuration("0s")
	return d
}
func (js *JobStatus) TaskStartTime(taskID int) time.Time {
	return geparser.GetTaskStartTime(&js.js, taskID)
}
func (js *JobStatus) executionTime() time.Time {
	return geparser.GetExecutionTime(&js.js)
}
func (js *JobStatus) SubmissionTime() time.Time {
	return geparser.GetSubmissionTime(&js.js)
}
func (js *JobStatus) JobDeadline() time.Time {
	return geparser.GetDeadline(&js.js)
}
func (js *JobStatus) PosixPriority() int {
	return geparser.GetPosixPriority(&js.js) - 1024
}
func (js *JobStatus) MailOptions() string {
	return geparser.GetMailOptions(&js.js)
}
func (js *JobStatus) AdvanceReservationID() int {
	return geparser.GetAR(&js.js)
}
func (js *JobStatus) JobClassName() string {
	return geparser.GetJobClassName(&js.js)
}
func (js *JobStatus) MailAdresses() []string {
	return geparser.GetMailingAdresses(&js.js)
}
func (js *JobStatus) HardRequests() ([]string, []string) {
	return geparser.GetHardRequests(&js.js)
}
func (js *JobStatus) gdilQueueNames(what string, task int) []string {
	qil := make([]string, 16)
	gdil := geparser.GetGDIL(&js.js, task)
	if gdil == nil {
		return nil
	}
	for i := range *gdil {
		if what == "QueueName" {
			qil = append(qil, (*gdil)[i].QueueName)
		} else if what == "HostName" {
			qi := strings.Split((*gdil)[i].QueueName, "@")
			if len(qi) == 2 {
				qil = append(qil, qi[1])
			}
		} else if what == "Slots" {
			qil = append(qil, strconv.Itoa((*gdil)[i].Slots))
		}
	}
	return qil
}
func (js *JobStatus) DestinationQueueInstanceList() []string {
	return js.gdilQueueNames("QueueName", 0)
}
func (js *JobStatus) DestinationQueueInstanceListOfTask(task int) []string {
	return js.gdilQueueNames("QueueName", task)
}
func (js *JobStatus) DestinationSlotsList() []string {
	return js.gdilQueueNames("Slots", 0)
}
func (js *JobStatus) DestinationHostList() []string {
	return js.gdilQueueNames("HostName", 0)
}
func (js *JobStatus) DestinationHostListOfTask(task int) []string {
	return js.gdilQueueNames("HostName", task)
}
func (js *JobStatus) TasksCount() int {
	return geparser.GetTaskCount(&js.js)
}