sge_urg = options.showJobUrgency();
sge_pri = options.showJobPriorities();
sge_time = !sge_ext;
sge_time = sge_time | tsk_ext | sge_urg | sge_pri;
OutputTable table = new OutputTable(JobSummary.class);
table.addCol("id", "job-ID ", 7, OutputTable.Column.RIGHT);
table.addCol("priority", "prior", 7);
if (sge_pri || sge_urg) {
table.addCol("normalizedUrgency", "nurg", 9);
}
if (sge_pri) {
table.addCol("normalizedRequestedPriority", "npprior", 10);
}
if (sge_pri || sge_ext) {
table.addCol("normalizedTickets", "ntckts", 6);
}
if (sge_urg) {
table.addCol("urgency", "urg", 8);
table.addCol("rrcontr", "rrcontr", 8);
table.addCol("wtcontr", "wtcontr", 8);
table.addCol("wtcontr", "dlcontr", 8);
}
if (sge_pri) {
table.addCol("priority", "ppri", 7);
}
table.addCol("name", "name", 10);
table.addCol("user", "user", 12);
if (sge_ext) {
table.addCol("project", "project", 15);
table.addCol("department", "department", 15);
}
table.addCol("state", "state", 5);
if (sge_time) {
Calc timeCalc = new Calc() {
public Object getValue(Object obj) {
JobSummary js = (JobSummary) obj;
if (js.isRunning()) {
return js.getStartTime();
} else {
return js.getSubmitTime();
}
}
};
table.addCol("submitTime", "submit/start at ", 19, DEFAULT_DATE_FORMAT, timeCalc);
}
if (sge_urg) {
table.addCol("deadline", "deadline", 15);
}
if (sge_ext) {
table.addCol("cpuUsage", "cpu", 8, new CpuUsageCalc());
table.addCol("memUsage", "mem", 7, OutputTable.Column.RIGHT, new MemUsageCalc());
table.addCol("ioUsage", "io", 7, OutputTable.Column.RIGHT, new IOUsageCalc());
table.addCol("tickets", "tckts", 8, new TicketCalc(sge_ext) {
public long getValue(JobSummary js) {
return js.getTickets();
}
});
table.addCol("overrideTickets", "ovrts", 8, new TicketCalc(sge_ext) {
public long getValue(JobSummary js) {
return js.getOverrideTickets();
}
});
table.addCol("otickets", "otckt", 8, new TicketCalc(sge_ext) {
public long getValue(JobSummary js) {
return js.getOtickets();
}
});
table.addCol("ftickets", "ftckt", 8, new TicketCalc(sge_ext) {
public long getValue(JobSummary js) {
return js.getFtickets();
}
});
table.addCol("stickets", "stckt", 8, new TicketCalc(sge_ext) {
public long getValue(JobSummary js) {
return js.getStickets();
}
});
table.addCol("share", "share", 8, new ShareCalc(sge_ext));
}
//table.addCol("queueAssigned", "qs", 5);
if (!options.showFullOutput()) {
table.addCol("queue", "queue", 30);
}
// if (options.showPEJobs()) {
if (options.showExtendedSubTaskInfo()) {
table.addCol("masterQueue", "master", 8, OutputTable.Column.LEFT);
} else {
table.addCol("slots", "slots", 8, OutputTable.Column.RIGHT);
}
table.addCol("ja-taskId", "ja-task-ID", 10, new JaTaskIdCalc());
if (tsk_ext) {
Calc fixedValue = new Calc() {
public Object getValue(Object obj) {
return " NA ";
}
};
table.addCol("taskId", "task-ID ", 7, fixedValue);
table.addCol("state", "state", 6, new StatCalc());
// TODO retrieve values from first task
table.addCol("cpuUsage", "cpu", 8, fixedValue);
table.addCol("memUsage", "mem", 7, OutputTable.Column.RIGHT, fixedValue);
table.addCol("ioUsage", "io", 7, OutputTable.Column.RIGHT, fixedValue);
table.addCol("stat", "stat", 5, fixedValue);
table.addCol("failed", "failed", 7, fixedValue);
}
return table;
}