Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

Fixing MemoryEstimatorOracle #34

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -426,11 +426,14 @@ public void ioCommandCompleted(IOCommand command) {
* threads.
*
* @param fraction the fraction of processing threads to remain active. This
* number is in range [0, 1]
* number is in range (0, 1]
*/
public void updateActiveThreadsFraction(double fraction) {
checkState(fraction >= 0 && fraction <= 1);
int numActiveThreads = (int) (numProcessingThreads * fraction);
// Making sure the number of active threads is not set to 0 to ensure
// progress in computation
int numActiveThreads = Math.max(
(int) (Math.ceil(numProcessingThreads * fraction)), 1);
if (LOG.isInfoEnabled()) {
LOG.info("updateActiveThreadsFraction: updating the number of active " +
"threads to " + numActiveThreads);
Expand Down Expand Up @@ -489,7 +492,7 @@ public void processingThreadFinish() {
*/
public void updateRequestsCreditFraction(double fraction) {
checkState(fraction >= 0 && fraction <= 1);
short newCredit = (short) (maxRequestsCredit * fraction);
short newCredit = (short) (Math.ceil(maxRequestsCredit * fraction));
if (LOG.isInfoEnabled()) {
LOG.info("updateRequestsCreditFraction: updating the credit to " +
newCredit);
Expand Down
Loading