Skip to content

Commit

Permalink
Fix Group GPU APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
splhack committed Nov 23, 2021
1 parent fc0b509 commit 67605cc
Showing 1 changed file with 0 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,6 @@ public boolean isOverMinCores(JobInterface job) {
@Override
public void updateDefaultJobMaxGpus(GroupInterface group, int value) {
if (value <= 0) { value = CueUtil.FEATURE_DISABLED; }
if (value < CueUtil.ONE_CORE && value != CueUtil.FEATURE_DISABLED) {
String msg = "The default max cores for a job must " +
"be greater than a single core";
throw new IllegalArgumentException(msg);
}
getJdbcTemplate().update(
"UPDATE folder SET int_job_max_gpus=? WHERE pk_folder=?",
value, group.getId());
Expand All @@ -248,11 +243,6 @@ public void updateDefaultJobMaxGpus(GroupInterface group, int value) {
@Override
public void updateDefaultJobMinGpus(GroupInterface group, int value) {
if (value <= 0) { value = CueUtil.FEATURE_DISABLED; }
if (value < CueUtil.ONE_CORE && value != CueUtil.FEATURE_DISABLED) {
String msg = "The default min cores for a job must " +
"be greater than a single core";
throw new IllegalArgumentException(msg);
}
getJdbcTemplate().update(
"UPDATE folder SET int_job_min_gpus=? WHERE pk_folder=?",
value, group.getId());
Expand All @@ -261,11 +251,6 @@ public void updateDefaultJobMinGpus(GroupInterface group, int value) {
@Override
public void updateMaxGpus(GroupInterface group, int value) {
if (value < 0) { value = CueUtil.FEATURE_DISABLED; }
if (value < CueUtil.ONE_CORE && value != CueUtil.FEATURE_DISABLED) {
String msg = "The group max cores feature must " +
"be a whole core or greater, pass in: " + value;
throw new IllegalArgumentException(msg);
}

getJdbcTemplate().update(
"UPDATE folder_resource SET int_max_gpus=? WHERE pk_folder=?",
Expand Down

0 comments on commit 67605cc

Please sign in to comment.