Skip to content

Commit

Permalink
[cuebot] Fix GPU calculation in FrameCompleteHandler. (#1053)
Browse files Browse the repository at this point in the history
  • Loading branch information
splhack committed Oct 20, 2021
1 parent 66c0ee1 commit 393a774
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 66 deletions.
8 changes: 0 additions & 8 deletions cuebot/src/main/java/com/imageworks/spcue/dao/GroupDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,6 @@ public interface GroupDao {
*/
boolean isOverMinCores(JobInterface job);

/**
* Returns true if the group of the specified job is at or over its min gpus
*
* @param job
* @return
*/
boolean isOverMinGpus(JobInterface job);

/**
* Returns true if the group is managed.
*
Expand Down
8 changes: 0 additions & 8 deletions cuebot/src/main/java/com/imageworks/spcue/dao/JobDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -273,14 +273,6 @@ public interface JobDao {
*/
boolean isOverMaxCores(JobInterface job, int coreUnits);

/**
* reteurns true if job is over its minimum gpus
*
* @param job
* @return boolean
*/
boolean isOverMinGpus(JobInterface job);

/**
* returns true if job is over max gpus
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,25 +280,6 @@ public void updateMinGpus(GroupInterface group, int value) {
value, group.getId());
}

private static final String IS_OVER_MIN_GPUS =
"SELECT " +
"COUNT(1) " +
"FROM " +
"job,"+
"folder_resource fr "+
"WHERE " +
"job.pk_folder = fr.pk_folder " +
"AND " +
"fr.int_gpus > fr.int_min_gpus " +
"AND "+
"job.pk_job = ?";

@Override
public boolean isOverMinGpus(JobInterface job) {
return getJdbcTemplate().queryForObject(IS_OVER_MIN_GPUS,
Integer.class, job.getJobId()) > 0;
}

@Override
public void updateDefaultJobPriority(GroupInterface group, int value) {
if (value < 0) { value = CueUtil.FEATURE_DISABLED; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -662,22 +662,6 @@ public boolean isAtMaxCores(JobInterface job) {
Integer.class, job.getJobId()) > 0;
}

private static final String IS_JOB_OVER_MIN_GPUS =
"SELECT " +
"COUNT(1) " +
"FROM " +
"job_resource " +
"WHERE " +
"job_resource.pk_job = ? " +
"AND " +
"job_resource.int_gpus > job_resource.int_min_gpus";

@Override
public boolean isOverMinGpus(JobInterface job) {
return getJdbcTemplate().queryForObject(IS_JOB_OVER_MIN_GPUS,
Integer.class, job.getJobId()) > 0;
}

private static final String IS_JOB_OVER_MAX_GPUS =
"SELECT " +
"COUNT(1) " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ else if (report.getHost().getNimbyLocked()) {
// Then check for higher priority jobs
// If not, rebook this job
if (job.autoUnbook && proc.coresReserved >= 100) {
if (jobManager.isOverMinCores(job) && jobManager.isOverMinGpus(job)) {
if (jobManager.isOverMinCores(job)) {
try {

boolean unbook =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,14 +292,6 @@ public interface JobManager {
*/
boolean isOverMinCores(JobInterface job);

/**
* Return true if the given job is booked greater than min gpus.
*
* @param job
* @return
*/
boolean isOverMinGpus(JobInterface job);

/**
* Increase the layer memory requirement to given KB value.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,6 @@ public boolean isOverMinCores(JobInterface job) {
return jobDao.isOverMinCores(job);
}

@Override
@Transactional(propagation = Propagation.REQUIRED, readOnly=true)
public boolean isOverMinGpus(JobInterface job) {
return jobDao.isOverMinGpus(job);
}

@Transactional(propagation = Propagation.REQUIRED, readOnly=true)
public DispatchJob getDispatchJob(String id) {
return jobDao.getDispatchJob(id);
Expand Down

0 comments on commit 393a774

Please sign in to comment.