... | ... |
@@ -50,7 +50,8 @@ mStatistics(D.nrow(), D.ncol(), nFactor) |
50 | 50 |
Rcpp::List GapsRunner::run() |
51 | 51 |
{ |
52 | 52 |
// reset the checkpoint timer |
53 |
- mLastCheckpoint = bpt_now(); |
|
53 |
+ mStartTime = bpt_now(); |
|
54 |
+ mLastCheckpoint = mStartTime; |
|
54 | 55 |
|
55 | 56 |
// cascade down the various phases of the algorithm |
56 | 57 |
// this allows for starting in the middle of the algorithm |
... | ... |
@@ -162,6 +163,27 @@ void GapsRunner::displayStatus(const std::string &type, unsigned nIterTotal) |
162 | 163 |
Rprintf("%s %d of %d, Atoms:%lu(%lu) Chi2 = %.2f\n", type.c_str(), |
163 | 164 |
mCurrentIter + 1, nIterTotal, mASampler.nAtoms(), |
164 | 165 |
mPSampler.nAtoms(), mASampler.chi2()); |
166 |
+ bpt::time_duration diff = bpt_now() - mStartTime; |
|
167 |
+ double elapsed = diff.total_milliseconds() / 1000.0; |
|
168 |
+ Rprintf("Elapsed Time: %.3f seconds\n", elapsed); |
|
169 |
+ |
|
170 |
+ double prop = 0.0; |
|
171 |
+ switch (mPhase) |
|
172 |
+ { |
|
173 |
+ case GAPS_BURN: |
|
174 |
+ prop = mCurrentIter; |
|
175 |
+ break; |
|
176 |
+ case GAPS_COOL: |
|
177 |
+ prop = mEquilIter + mCurrentIter; |
|
178 |
+ break; |
|
179 |
+ case GAPS_SAMP: |
|
180 |
+ prop = mEquilIter + mCoolIter + mCurrentIter; |
|
181 |
+ break; |
|
182 |
+ } |
|
183 |
+ prop = (double)(mEquilIter + mCoolIter + mSampleIter) / prop; |
|
184 |
+ double est = diff.total_milliseconds() * prop / 1000.0; |
|
185 |
+ Rprintf("Estimated Total Time: %.3f seconds\n", est); |
|
186 |
+ Rprintf("Estimated Remaining Time: %.3f seconds\n", est - elapsed); |
|
165 | 187 |
} |
166 | 188 |
} |
167 | 189 |
|
... | ... |
@@ -2,7 +2,7 @@ |
2 | 2 |
#define __COGAPS_GAPS_RUNNER_H__ |
3 | 3 |
|
4 | 4 |
#include "Archive.h" |
5 |
-#include "math/Matrix.h" |
|
5 |
+#include "data_structures/Matrix.h" |
|
6 | 6 |
#include "GibbsSampler.h" |
7 | 7 |
#include "GapsStatistics.h" |
8 | 8 |
|
... | ... |
@@ -65,6 +65,8 @@ public: |
65 | 65 |
|
66 | 66 |
unsigned mNumCores; |
67 | 67 |
|
68 |
+ bpt::ptime mStartTime; |
|
69 |
+ |
|
68 | 70 |
void createCheckpoint(); |
69 | 71 |
void makeCheckpointIfNeeded(); |
70 | 72 |
void displayStatus(const std::string &type, unsigned nIterTotal); |
6 | 6 |
similarity index 83% |
7 | 7 |
rename from src/data_structures/FixedHashSet.h |
8 | 8 |
rename to src/data_structures/EfficientSets.h |
... | ... |
@@ -1,5 +1,5 @@ |
1 |
-#ifndef __COGAPS_FIXED_HASH_SET__ |
|
2 |
-#define __COGAPS_FIXED_HASH_SET__ |
|
1 |
+#ifndef __COGAPS_EFFICIENT_SETS_H__ |
|
2 |
+#define __COGAPS_EFFICIENT_SETS_H__ |
|
3 | 3 |
|
4 | 4 |
#include <stdint.h> |
5 | 5 |
|
... | ... |
@@ -20,7 +20,7 @@ public: |
20 | 20 |
void insert(uint64_t n) {mSet[n] = mCurrentKey;} |
21 | 21 |
}; |
22 | 22 |
|
23 |
-// have vector with at least some % of holes |
|
23 |
+// have sorted vector with at least some % of holes |
|
24 | 24 |
// even distribute entries along it |
25 | 25 |
// when shift happens, should be minimal |
26 | 26 |
|