Search in sources :

Example 16 with CommandOutput

use of cbit.vcell.message.server.cmd.CommandService.CommandOutput in project vcell by virtualcell.

the class SlurmProxy method getPartitionStatistics.

public PartitionStatistics getPartitionStatistics() throws HtcException, ExecutableException, IOException {
    final String JOB_CMD_SCONTROL = PropertyLoader.getProperty(PropertyLoader.slurm_cmd_scontrol, "scontrol");
    // 
    // scontrol show node $(sinfo -N -p vcell2 --Format='nodelist' | xargs | tr ' ' ',') | grep CPUAlloc
    // 
    String partitionNodeList = getPartitionNodeListCSV();
    // String[] cmds = {JOB_CMD_SCONTROL,"show","node","$(",JOB_CMD_SINFO,"-N","-h","-p",partition,"--Format='nodelist'","|","xargs","|","tr","' '","','",")","|","grep","CPUAlloc"};
    String[] cmds = { JOB_CMD_SCONTROL, "-a", "show", "node", partitionNodeList, "|", "grep", "CPUAlloc" };
    CommandOutput commandOutput = commandService.command(cmds);
    String output = commandOutput.getStandardOutput();
    PartitionStatistics clusterStatistics = extractPartitionStatistics(output);
    return clusterStatistics;
}
Also used : CommandOutput(cbit.vcell.message.server.cmd.CommandService.CommandOutput)

Aggregations

CommandOutput (cbit.vcell.message.server.cmd.CommandService.CommandOutput)16 ExecutableException (org.vcell.util.exe.ExecutableException)11 IOException (java.io.IOException)7 File (java.io.File)6 HtcJobNotFoundException (cbit.vcell.message.server.htc.HtcJobNotFoundException)4 Test (org.junit.Test)4 HtcJobID (cbit.vcell.server.HtcJobID)3 ArrayList (java.util.ArrayList)3 HtcJobStatus (cbit.vcell.message.server.htc.HtcJobStatus)2 StringTokenizer (java.util.StringTokenizer)2 RollbackException (cbit.vcell.message.RollbackException)1 VCMessagingException (cbit.vcell.message.VCMessagingException)1 CommandService (cbit.vcell.message.server.cmd.CommandService)1 CommandServiceLocal (cbit.vcell.message.server.cmd.CommandServiceLocal)1 CommandServiceSshNative (cbit.vcell.message.server.cmd.CommandServiceSshNative)1 HtcException (cbit.vcell.message.server.htc.HtcException)1 HtcProxy (cbit.vcell.message.server.htc.HtcProxy)1 BatchSystemType (cbit.vcell.server.HtcJobID.BatchSystemType)1 SolverException (cbit.vcell.solver.SolverException)1 XmlParseException (cbit.vcell.xml.XmlParseException)1