Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up strand(ed) GPU units #1020

Merged
merged 1 commit into from
Sep 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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