use of cbit.vcell.message.server.htc.HtcProxy.PartitionStatistics in project vcell by virtualcell.
the class SlurmProxyTest method testSLURM.
@Test
public void testSLURM() throws IOException, ExecutableException {
System.setProperty("log4j2.trace", "true");
System.setProperty(PropertyLoader.vcellServerIDProperty, "Test2");
System.setProperty(PropertyLoader.htcLogDirExternal, "/Volumes/vcell/htclogs");
VCMongoMessage.enabled = false;
String[] partitions = new String[] { "vcell", "vcell2" };
System.setProperty(PropertyLoader.slurm_partition, partitions[0]);
CommandServiceSshNative cmd = null;
try {
cmd = new CommandServiceSshNative(new String[] { "vcell-service.cam.uchc.edu" }, "vcell", new File("/Users/schaff/.ssh/schaff_rsa"));
SlurmProxy slurmProxy = new SlurmProxy(cmd, "vcell");
Map<HtcJobInfo, HtcJobStatus> runningJobs = slurmProxy.getRunningJobs();
for (HtcJobInfo jobInfo : runningJobs.keySet()) {
HtcJobStatus jobStatus = runningJobs.get(jobInfo);
System.out.println("job " + jobInfo.getHtcJobID() + " " + jobInfo.getJobName() + ", status=" + jobStatus.toString());
}
for (String partition : partitions) {
System.setProperty(PropertyLoader.slurm_partition, partition);
PartitionStatistics partitionStatistics = slurmProxy.getPartitionStatistics();
System.out.println("partition statistics for partition " + partition + ": " + partitionStatistics);
System.out.println("number of cpus allocated = " + partitionStatistics.numCpusAllocated);
System.out.println("load = " + partitionStatistics.load);
System.out.println("number of cpus total = " + partitionStatistics.numCpusTotal);
}
} catch (Exception e) {
e.printStackTrace();
fail(e.getMessage());
} finally {
if (cmd != null) {
cmd.close();
}
}
}
use of cbit.vcell.message.server.htc.HtcProxy.PartitionStatistics in project vcell by virtualcell.
the class BatchSchedulerTest method test.
@Test
public void test() {
ArrayList<BatchScheduler.ActiveJob> activeJobs = new ArrayList<BatchScheduler.ActiveJob>();
activeJobs.addAll(Arrays.asList(job1, job2, job3, job4, job5, job6, job7, job8, job9, job10));
int numCpusAllocated = 5;
int numCpusTotal = 10;
double load = 0.4;
PartitionStatistics partitionStatistics = new PartitionStatistics(numCpusAllocated, numCpusTotal, load);
int userQuotaOde = 2;
int userQuotaPde = 2;
VCellServerID systemID = relSite;
SchedulerDecisions schedulerDecisions = BatchScheduler.schedule(activeJobs, partitionStatistics, userQuotaOde, userQuotaPde, systemID, null);
schedulerDecisions.show();
//
// enhance BatchScheduler to give reason why not to run each job that is not run.
//
}
Aggregations