Skip to content

Commit

Permalink
Grab Min Memory Property When Required
Browse files Browse the repository at this point in the history
  • Loading branch information
AvocadoMoon committed Oct 9, 2024
1 parent f17b6ae commit 9e863fe
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,6 @@ public static String toUnixStyleText(String javaString) throws IOException {

public abstract String getSubmissionFileExtension();
public static class MemLimitResults {
private static final long FALLBACK_MEM_LIMIT_MB= Integer.parseInt(PropertyLoader.getRequiredProperty(PropertyLoader.htcMinMemoryMB)); // MAX memory allowed if not set in limitFile, currently 4g
private static final long POWER_USER_MEMORY_FLOOR=Integer.parseInt(PropertyLoader.getRequiredProperty(PropertyLoader.htcPowerUserMemoryFloorMB)); // MIN memory allowed if declared to be a power user, currently 50g
private long memLimit;
private String memLimitSource;
public MemLimitResults(long memLimit, String memLimitSource) {
Expand All @@ -258,15 +256,16 @@ public String getMemLimitSource() {
return memLimitSource;
}
private static MemLimitResults getJobRequestedMemoryLimit(SolverDescription solverDescription, double estimatedMemSizeMB, boolean isPowerUser) {
long batchJobMemoryLimit = FALLBACK_MEM_LIMIT_MB;
long batchJobMemoryLimit = Integer.parseInt(PropertyLoader.getRequiredProperty(PropertyLoader.htcMinMemoryMB)); // MAX memory allowed if not set in limitFile, currently 4g
String detailedMessage = "default memory limit";

if(estimatedMemSizeMB > batchJobMemoryLimit) {//Use estimated if bigger
batchJobMemoryLimit = (long)estimatedMemSizeMB;
detailedMessage = "used Estimated";
}
if (isPowerUser && batchJobMemoryLimit < POWER_USER_MEMORY_FLOOR){
batchJobMemoryLimit = POWER_USER_MEMORY_FLOOR;
long powerUserMemory = Integer.parseInt(PropertyLoader.getRequiredProperty(PropertyLoader.htcPowerUserMemoryFloorMB)); // MIN memory allowed if declared to be a power user, currently 50g
if (isPowerUser && batchJobMemoryLimit < powerUserMemory){
batchJobMemoryLimit = powerUserMemory;
detailedMessage = "poweruser's memory override";
}

Expand Down

0 comments on commit 9e863fe

Please sign in to comment.