@@ -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
0 commit comments