Commit 898f53ed authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

added power of two warning

parent 7af3cf30
#include "m++.hpp"
#include "Main.hpp"
#ifdef COMPLEX
#error undef COMPLEX in src/Compiler.h
#endif
int main(int argc, char **argv) {
Config::setSearchPath("../mlmc/");
Config::setConfigFileName("m++.conf");
Mpp::initialize(&argc, argv);
Config::setSearchPath("../mlmc/");
Config::setConfigFileName("m++.conf");
Mpp::initialize(&argc, argv);
if(!PowerOfTwo(PPM->Size(0))) {
Warning("Number of process is not a power of 2."
"This might lead to undefined behaviour.")
}
MainProgram mainProgram;
return mainProgram.Run();
MainProgram mainProgram;
return mainProgram.Run();
}
......@@ -4,6 +4,12 @@
#include "montecarlo/MultilevelMonteCarlo.hpp"
bool PowerOfTwo(int n) {
if(n==0) return false;
return (ceil(log2(n)) == floor(log2(n)));
}
class MainProgram {
private:
int verbose = 1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment