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;
}
Aggregations