Browse code

status message about number of cores

Tom Sherman authored on 14/05/2018 19:27:35
Showing1 changed files

... ...
@@ -2,6 +2,7 @@
2 2
 #include "GapsRunner.h"
3 3
 
4 4
 #include <Rcpp.h>
5
+#include <omp.h>
5 6
 
6 7
 // [[Rcpp::export]]
7 8
 Rcpp::List cogaps_cpp(const Rcpp::NumericMatrix &D,
... ...
@@ -13,6 +14,9 @@ const Rcpp::NumericMatrix &FP, unsigned checkpointInterval,
13 14
 const std::string &cptFile, unsigned pumpThreshold, unsigned nPumpSamples,
14 15
 unsigned nCores)
15 16
 {
17
+    unsigned availableCores = omp_get_max_threads();
18
+    Rprintf("Running on %d out of %d available cores\n", nCores, availableCores);
19
+
16 20
     // create internal state from parameters and run from there
17 21
     GapsRunner runner(D, S, nFactor, nEquil, nEquilCool, nSample,
18 22
         nOutputs, nSnapshots, alphaA, alphaP, maxGibbmassA, maxGibbmassP, seed,