Skip to content

Commit ddf58ed

Browse files
committed
WIP sample slurm script for batch execution
1 parent 0406ca5 commit ddf58ed

2 files changed

Lines changed: 38 additions & 4 deletions

File tree

vcell-server/src/test/java/cbit/vcell/message/server/htc/slurm/SlurmProxyTest.java

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,35 @@ public String createScriptForNativeSolvers(String simTaskResourcePath, String[]
139139

140140
public String createScriptForNativeSolversBatch(String simTaskResourcePath, String[] command, String JOB_NAME) throws IOException, XmlParseException, ExpressionException {
141141

142-
return null;
142+
SimulationTask simTask = XmlHelper.XMLToSimTask(readTextFileFromResource(simTaskResourcePath));
143+
KeyValue simKey = simTask.getSimKey();
144+
145+
SlurmProxy slurmProxy = new SlurmProxy(null, "vcell");
146+
File subFileExternal = new File("/share/apps/vcell3/htclogs/V_REL_"+simKey+"_0_0.slurm.sub");
147+
148+
User simOwner = simTask.getSimulation().getVersion().getOwner();
149+
final int jobId = simTask.getSimulationJob().getJobIndex();
150+
151+
152+
// TODO: fill here with stuff
153+
154+
155+
String args = null; // dummy code, replace once we know
156+
ExecutableCommand preprocessorCmd = new ExecutableCommand(null, false, false, args);
157+
ExecutableCommand solverCmd = new ExecutableCommand(null, false, false, args);
158+
ExecutableCommand postprocessorCmd = new ExecutableCommand(null, false, false, args);
159+
160+
// TODO: more stuff
161+
162+
ExecutableCommand.Container commandSet = new ExecutableCommand.Container();
163+
commandSet.add(preprocessorCmd);
164+
commandSet.add(solverCmd);
165+
commandSet.add(postprocessorCmd);
166+
167+
int NUM_CPUs = 1;
168+
int MEM_SIZE_MB = 1000;
169+
ArrayList<PortableCommand> postProcessingCommands = new ArrayList<>();
170+
return slurmProxy.createJobScriptText(JOB_NAME, commandSet, NUM_CPUs, MEM_SIZE_MB, postProcessingCommands, simTask);
143171
}
144172

145173
public String createScriptForJavaSolvers(String simTaskResourcePath, String JOB_NAME) throws IOException, XmlParseException, ExpressionException {
@@ -261,11 +289,17 @@ public void testSimJobScriptLangevin() throws IOException, XmlParseException, Ex
261289

262290
@Test
263291
public void testSimJobScriptLangevinBatch() throws IOException, XmlParseException, ExpressionException {
264-
265292
String simTaskResourcePath = "slurm_fixtures/langevin/SimID_999999999_0__0.simtask.xml";
266293
String JOB_NAME = "V_REL_999999999_0_0";
267294

268295

296+
// TODO: fill here with stuff
297+
298+
299+
String[] command = null; // dummy to avoid compiler error for "command" variable below
300+
String slurmScript = createScriptForNativeSolversBatch(simTaskResourcePath, command, JOB_NAME);
301+
String expectedSlurmScript = readTextFileFromResource("slurm_fixtures/langevin/V_REL_999999999_0_0.slurm.sub");
302+
Assertions.assertEquals(expectedSlurmScript.trim(), slurmScript.trim());
269303
}
270304

271305

vcell-server/src/test/resources/slurm_fixtures/langevin/V_REL_274672135_0_0.slurm.sub

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ container_env+="--env secondary_datadir_external=/share/apps/vcell7/users "
4444
container_env+="--env htclogdir_external=/share/apps/vcell3/htclogs "
4545
container_env+="--env softwareVersion=Rel_Version_7.6.0_build_28 "
4646
container_env+="--env serverid=REL "
47-
solver_docker_name=ghcr.io/virtualcell/vcell-batch:7.6.0.43
47+
solver_docker_name=ghcr.io/virtualcell/vcell-batch:7.6.0.43 # should be latest, like 7.7.0.27
4848
solver_container_prefix="singularity run --containall ${container_bindings} ${container_env} docker://${solver_docker_name}"
49-
batch_docker_name=ghcr.io/virtualcell/vcell-batch:7.6.0.43
49+
batch_docker_name=ghcr.io/virtualcell/vcell-batch:7.6.0.43 # 7.7.0.27 or latest
5050
batch_container_prefix="singularity run --containall ${container_bindings} ${container_env} docker://${batch_docker_name}"
5151

5252

0 commit comments

Comments
 (0)