Skip to content

Commit

Permalink
[SYSTEMML-2389] Fix paramserv calculation of iterations per worker
Browse files Browse the repository at this point in the history
Closes #785.
  • Loading branch information
EdgarLGB authored and mboehm7 committed Jun 14, 2018
1 parent cc349dc commit ebfe327
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -42,7 +42,7 @@ public LocalPSWorker(int workerID, String updFunc, Statement.PSFrequency freq, i
public Void call() throws Exception {
try {
long dataSize = _features.getNumRows();
int totalIter = (int) Math.ceil(dataSize / _batchSize);
int totalIter = (int) Math.ceil((double) dataSize / _batchSize);

switch (_freq) {
case BATCH:
Expand Down Expand Up @@ -141,9 +141,10 @@ private ListObject computeGradients(long dataSize, int totalIter, int i, int j)
_ec.setVariable(Statement.PS_LABELS, bLabels);

if (LOG.isDebugEnabled()) {
LOG.debug(String.format("Local worker_%d: Got batch data [size:%d kb] of index from %d to %d. "
+ "[Epoch:%d Total epoch:%d Iteration:%d Total iteration:%d]", _workerID, bFeatures.getDataSize()
/ 1024 + bLabels.getDataSize() / 1024, begin, end, i + 1, _epochs, j + 1, totalIter));
LOG.debug(String.format("Local worker_%d: Got batch data [size:%d kb] of index from %d to %d [last index: %d]. "
+ "[Epoch:%d Total epoch:%d Iteration:%d Total iteration:%d]", _workerID,
bFeatures.getDataSize() / 1024 + bLabels.getDataSize() / 1024, begin, end, dataSize, i + 1, _epochs,
j + 1, totalIter));
}

// Invoke the update function
Expand Down

0 comments on commit ebfe327

Please sign in to comment.