Skip to content

Commit

Permalink
adding a small header to benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
Iximiel committed Jul 12, 2024
1 parent 639e810 commit cb2fb77
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/cltools/Benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ int Benchmark::main(FILE* in, FILE*out,Communicator& pc) {
log.link(log_dev_null.get());
}
log.setLinePrefix("BENCH: ");

log <<"Welcome to PLUMED benchmark\n";
std::vector<Kernel> kernels;

// perform comparative analysis
Expand Down Expand Up @@ -589,13 +589,15 @@ int Benchmark::main(FILE* in, FILE*out,Communicator& pc) {
{
std::string paths;
parse("--kernel",paths);
log <<"Using --kernel=" << paths << "\n";
allpaths=Tools::getWords(paths,":");
}

std::vector<std::string> allplumed;
{
std::string paths;
parse("--plumed",paths);
log <<"Using --plumed=" << paths << "\n";
allplumed=Tools::getWords(paths,":");
}

Expand Down Expand Up @@ -628,27 +630,36 @@ int Benchmark::main(FILE* in, FILE*out,Communicator& pc) {
// read other flags:
bool shuffled=false;
parseFlag("--shuffled",shuffled);
if (shuffled)
log << "Using --shuffled\n";
int nf; parse("--nsteps",nf);
log << "Using --nsteps=" << nf << "\n";
unsigned natoms; parse("--natoms",natoms);

log << "Using --natoms=" << natoms << "\n";
double maxtime; parse("--maxtime",maxtime);
log << "Using --maxtime=" << maxtime << "\n";

bool domain_decomposition=false;
parseFlag("--domain-decomposition",domain_decomposition);
if (domain_decomposition)
log << "Using --domain-decomposition\n";

if(pc.Get_size()>1) domain_decomposition=true;
if(domain_decomposition) shuffled=true;

double timeToSleep;
parse("--sleep",timeToSleep);
log << "Using --sleep=" << timeToSleep << "\n";

std::vector<int> shuffled_indexes;

{
std::string atomicDistr;
parse("--atom-distribution",atomicDistr);
distribution = getAtomDistribution(atomicDistr);
log << "Using --atom-distribution=" << atomicDistr << "\n";
}

log <<"Initializing the setup of the kernel(s)\n";
const auto initial_time=std::chrono::high_resolution_clock::now();

for(auto & k : kernels) {
Expand Down Expand Up @@ -690,7 +701,6 @@ int Benchmark::main(FILE* in, FILE*out,Communicator& pc) {
// trap signals:
SignalHandlerGuard sigIntGuard(SIGINT, signalHandler);


for(int step=0; nf<0 || step<nf; ++step) {
std::shuffle(kernels_ptr.begin(),kernels_ptr.end(),rng);
distribution->positions(pos,step,atomicGenerator);
Expand Down

0 comments on commit cb2fb77

Please sign in to comment.