Skip to content
This repository has been archived by the owner on Sep 23, 2020. It is now read-only.

Commit

Permalink
Default to one core when none are requested
Browse files Browse the repository at this point in the history
  • Loading branch information
oldpatricka committed Mar 2, 2011
1 parent 7201554 commit 077537a
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ public Reservation reserveCoscheduledSpace(NodeRequest[] requests,
* than one VM is mapped to the same node, the returned node
* assignment array will include duplicates.
* @param memory megabytes needed
* @param cores needed
* @param requestedCores needed
* @param duration seconds needed
* @param uuid group ID, can not be null if vmids is length > 1
* @param creatorDN the DN of the user who requested creation of the VM
Expand All @@ -622,7 +622,7 @@ public Reservation reserveCoscheduledSpace(NodeRequest[] requests,
*/
private void reserveSpace(final int[] vmids,
final int memory,
final int cores,
final int requestedCores,
final int duration,
final String uuid,
final String creatorDN)
Expand All @@ -640,6 +640,16 @@ private void reserveSpace(final int[] vmids,
throw new ResourceRequestDeniedException(msg);
}

// When there is no core request, the default is -1,
// we would actually like one core.
int cores;
if (requestedCores <= 0) {
cores = 1;
}
else {
cores = requestedCores;
}

if (vmids.length > 1 && uuid == null) {
logger.error("cannot make group space request without group ID");
throw new ResourceRequestDeniedException("internal " +
Expand Down

0 comments on commit 077537a

Please sign in to comment.