Skip to content

Commit ec7dea8

Browse files
committed
Generalized use of some slurm batch langevin properties on cluent and server, make them required
1 parent 56df7c9 commit ec7dea8

5 files changed

Lines changed: 19 additions & 10 deletions

File tree

vcell-client/src/main/java/cbit/vcell/solver/ode/gui/SimulationSummaryPanel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ private void displayTask() {
358358
getJLabelAbsTol().setEnabled(true);
359359
getJLabelAbsTolValue().setText(lso.getIntervalImage() + "s");
360360
// default task timeout to 7 days, old default was 86400 s (1 day), but that is too short for some of the larger models
361-
String sTimeoutPerTaskSeconds = PropertyLoader.getProperty(PropertyLoader.slurm_langevin_timeoutPerTaskSeconds, "604800");
361+
String sTimeoutPerTaskSeconds = PropertyLoader.getProperty(PropertyLoader.slurm_langevin_timeoutPerTaskSeconds, "345600");
362362
long value = Long.parseLong(sTimeoutPerTaskSeconds);
363363
String str = DurationFormatUtils.formatDuration(value * 1000, "d'd' H'h' m'm' s's'");
364364
getJLabel10().setText("Timeout per task ");

vcell-server/src/main/java/cbit/vcell/message/server/batch/sim/HtcSimulationWorker.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,10 @@ public static void main(String[] args) throws IOException {
724724
PropertyLoader.htcMinMemoryMB,
725725
PropertyLoader.htcMaxMemoryMB,
726726
PropertyLoader.htcPowerUserMemoryFloorMB,
727-
PropertyLoader.htcPowerUserMemoryMaxMB
727+
PropertyLoader.htcPowerUserMemoryMaxMB,
728+
PropertyLoader.slurm_langevin_timeoutPerTaskSeconds,
729+
PropertyLoader.slurm_langevin_batchMemoryLimitPerTaskMB,
730+
PropertyLoader.slurm_langevin_memoryBlockSizeMB
728731
};
729732

730733

vcell-server/src/main/java/cbit/vcell/message/server/htc/slurm/SlurmProxy.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -489,9 +489,7 @@ public static String computeSlurmTimeLimit(int totalNumberOfJobs,
489489
int perTaskMinutes = (timeoutSeconds + 59) / 60; // ceiling(timeoutSeconds/60)
490490
int batches = (totalNumberOfJobs + numberOfConcurrentTasks - 1) / numberOfConcurrentTasks;
491491
long workMinutes = (long) batches * perTaskMinutes;
492-
long extraMinutes = 3L * perTaskMinutes;
493-
long totalMinutes = workMinutes + extraMinutes;
494-
long cushionedMinutes = (long) Math.ceil(totalMinutes * 1.10);
492+
long cushionedMinutes = (long) Math.ceil(workMinutes * 1.20);
495493

496494
long totalHours = cushionedMinutes / 60;
497495
long minutes = cushionedMinutes % 60;
@@ -500,6 +498,9 @@ public static String computeSlurmTimeLimit(int totalNumberOfJobs,
500498
return String.format("%02d:%02d:00", totalHours, minutes);
501499
} else {
502500
long days = totalHours / 24;
501+
if(days >= 21) {
502+
return("20-23:59:00"); // maxwall for vcell is 21-00:00:00
503+
}
503504
long hours = totalHours % 24;
504505
return String.format("%d-%02d:%02d:00", days, hours, minutes);
505506
}
@@ -665,9 +666,10 @@ String generateLangevinBatchScript(String jobName, ExecutableCommand.Container
665666
SolverDescription solverDescription = std.getSolverDescription();
666667
MemLimitResults memoryMBAllowed = HtcProxy.getMemoryLimit(vcellUserid, simID, solverDescription, memSizeMB, simTask.isPowerUser());
667668

668-
String sTimeoutPerTaskSeconds = PropertyLoader.getProperty(PropertyLoader.slurm_langevin_timeoutPerTaskSeconds, "604800"); // seconds. 7 days
669-
String sHardbBtchMemoryLimitPerTask = PropertyLoader.getProperty(PropertyLoader.slurm_langevin_batchMemoryLimitPerTaskMB, "1024");
670-
String sBlockSizeMB = PropertyLoader.getProperty(PropertyLoader.slurm_langevin_memoryBlockSizeMB, "256");
669+
// next 3 will fire exception if prop not set
670+
String sTimeoutPerTaskSeconds = PropertyLoader.getRequiredProperty(PropertyLoader.slurm_langevin_timeoutPerTaskSeconds); // seconds. 7 days
671+
String sHardbBtchMemoryLimitPerTask = PropertyLoader.getRequiredProperty(PropertyLoader.slurm_langevin_batchMemoryLimitPerTaskMB);
672+
String sBlockSizeMB = PropertyLoader.getRequiredProperty(PropertyLoader.slurm_langevin_memoryBlockSizeMB);
671673
int timeoutPerTaskSeconds = Integer.parseInt(sTimeoutPerTaskSeconds); // seconds. 24 hours
672674
long hardbBtchMemoryLimitPerTask = Long.parseLong(sHardbBtchMemoryLimitPerTask); // MB. we hard limit mem to 2G for langevin batch jobs
673675
int blockSizeMB = Integer.parseInt(sBlockSizeMB); // MB. SLURM memory allocation granularity

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ public void setup()
9090
setProperty(PropertyLoader.htcPowerUserMemoryFloorMB, "51200");
9191
setProperty(PropertyLoader.htcMinMemoryMB, "4096");
9292
setProperty(PropertyLoader.htcMaxMemoryMB, "81920");
93+
94+
setProperty(PropertyLoader.slurm_langevin_timeoutPerTaskSeconds, "345600");
95+
setProperty(PropertyLoader.slurm_langevin_batchMemoryLimitPerTaskMB, "1024");
96+
setProperty(PropertyLoader.slurm_langevin_memoryBlockSizeMB, "256");
9397
}
9498

9599
@AfterEach

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#SBATCH --cpus-per-task=1
1010
#SBATCH --mem-per-cpu=4096M
1111
#SBATCH --nodes=1
12-
#SBATCH --time=6-14:24:00 # timeout for the entire job
12+
#SBATCH --time=14-09:36:00 # timeout for the entire job
1313
#SBATCH --nodelist=mantis-040
1414
#SBATCH --no-kill
1515
#SBATCH --no-requeue
@@ -23,7 +23,7 @@ set +e
2323
USERID=danv
2424
SIM_ID=999999999
2525
TOTAL_JOBS=8 # to be set by generator to lso.getTotalNumberOfJobs()
26-
JOB_TIMEOUT_SECONDS=86400 # per-job timeout (seconds), adjust per generator
26+
JOB_TIMEOUT_SECONDS=345600 # per-job timeout (seconds), adjust per generator
2727
LOG_FILE="/share/apps/vcell3/htclogs/V_TEST2_999999999_0_.submit.log"
2828
MESSAGING_CONFIG_FILE="/share/apps/vcell3/users/danv/SimID_999999999_0_.langevinMessagingConfig"
2929

0 commit comments

Comments
 (0)