Skip to content

Commit

Permalink
Remove unused stranded GPU code. (#1020)
Browse files Browse the repository at this point in the history
  • Loading branch information
splhack committed Sep 12, 2021
1 parent 053f479 commit 537168f
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 119 deletions.
44 changes: 0 additions & 44 deletions cuebot/src/main/java/com/imageworks/spcue/StrandedGpus.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -526,40 +526,6 @@ void updateProcMemoryUsage(FrameInterface frame, long rss, long maxRss, long vsi
*/
void determineIdleCores(DispatchHost host, int load);

/**
* Pickup any gpus that were stranded on the given host.
*
* @param host
*/
void pickupStrandedGpus(DispatchHost host);

/**
* Return true if the host has stranded gpus.
*
* @param host
* @return
*/
boolean hasStrandedGpus(HostInterface host);

/**
* Add stranded gpus for the given host. Stranded
* gpus will automatically be added to the next frame dispatched
* from the host to make up for gpus stranded with no memory.
*
* @param host
* @param gpus
*/
void strandGpus(DispatchHost host, int gpus);

/**
* Lowers the perceived idle gpus on a machine if
* the load is over certain threshold.
*
* @param host
* @param load
*/
void determineIdleGpus(DispatchHost host, int load);

/**
* Return a set of job IDs that can take the given host.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import com.imageworks.spcue.ResourceUsage;
import com.imageworks.spcue.ShowInterface;
import com.imageworks.spcue.StrandedCores;
import com.imageworks.spcue.StrandedGpus;
import com.imageworks.spcue.VirtualProc;
import com.imageworks.spcue.dao.BookingDao;
import com.imageworks.spcue.dao.DispatcherDao;
Expand Down Expand Up @@ -83,9 +82,6 @@ public class DispatchSupportService implements DispatchSupport {
private ConcurrentHashMap<String, StrandedCores> strandedCores =
new ConcurrentHashMap<String, StrandedCores>();

private ConcurrentHashMap<String, StrandedGpus> strandedGpus =
new ConcurrentHashMap<String, StrandedGpus>();

@Override
public void pickupStrandedCores(DispatchHost host) {
logger.info(host + "picked up stranded cores");
Expand Down Expand Up @@ -117,35 +113,6 @@ public void strandCores(DispatchHost host, int cores) {
strandedCoresCount.getAndIncrement();
}

@Override
public void pickupStrandedGpus(DispatchHost host) {
logger.info(host + "picked up stranded gpu");
pickedUpGpusCount.getAndIncrement();
strandedGpus.remove(host.getHostId());
}

@Override
public boolean hasStrandedGpus(HostInterface host) {
StrandedGpus stranded = strandedGpus.get(host.getHostId());
if (stranded == null) {
return false;
}
if (stranded.isExpired()) {
return false;
}

return true;
}

@Override
public void strandGpus(DispatchHost host, int gpus) {
logger.info(host + " found " + gpus + ", stranded gpu");
host.strandedGpus = gpus;
strandedGpus.putIfAbsent(host.getHostId(), new StrandedGpus(gpus));
strandedGpusCount.getAndIncrement();
}


@Transactional(readOnly = true)
public List<DispatchFrame> findNextDispatchFrames(JobInterface job, VirtualProc proc, int limit) {
return dispatcherDao.findNextDispatchFrames(job, proc, limit);
Expand Down Expand Up @@ -615,14 +582,6 @@ public void determineIdleCores(DispatchHost host, int load) {
}
}

@Override
public void determineIdleGpus(DispatchHost host, int load) {
int idleGpu = host.gpus - load;
if (idleGpu < host.idleGpus) {
host.idleGpus = idleGpu;
}
}

public DispatcherDao getDispatcherDao() {
return dispatcherDao;
}
Expand Down

0 comments on commit 537168f

Please sign in to comment.