Commit 88d43af4 authored by Burlen Loring's avatar Burlen Loring Committed by Mario Melara

autocreelation use 1 thread by default

fixes a bug where each rank had used the maximum number of threads
on the system, leading us to hit resource limits when running fully
packed.
parent 31a1063f
......@@ -188,7 +188,7 @@ int main(int argc, char** argv)
size_t k_max = 3;
int threads = 1;
int ghostLevels = 0;
int numberOfParticles = 1024;
int numberOfParticles = 64;
int seed = -1;
std::string config_file;
std::string out_prefix = "";
......@@ -242,10 +242,8 @@ int main(int argc, char** argv)
if (seed == -1)
{
if (world.rank() == 0)
{
seed = static_cast<int>(std::time(nullptr));
fmt::print("using seed {}\n", seed);
}
diy::mpi::broadcast(world, seed, 0);
}
......@@ -419,12 +417,13 @@ int main(int argc, char** argv)
if (sync)
world.barrier();
timer::MarkEndTimeStep();
t += dt;
t_count++;
}
world.barrier();
timer::MarkStartEvent("oscillators::finalize");
#ifdef ENABLE_SENSEI
......@@ -436,9 +435,10 @@ int main(int argc, char** argv)
timer::Finalize();
auto duration = std::chrono::duration_cast<ms>(Time::now() - start);
world.barrier();
if (world.rank() == 0)
{
auto duration = std::chrono::duration_cast<ms>(Time::now() - start);
fmt::print("Total run time: {}.{} s\n", duration.count() / 1000, duration.count() % 1000);
}
}
This diff is collapsed.
......@@ -29,9 +29,11 @@ public:
/// compute autocorrelation for.
/// @param arrayname together with \c association, identifies the array to
/// compute autocorrelation for.
/// @param k_max number of strongest autocorrelations to report
/// @param kMax number of strongest autocorrelations to report
/// @param numThreads number of threads in diy's thread pool
void Initialize(size_t window, const std::string &meshName,
int association, const std::string &arrayname, size_t k_max);
int association, const std::string &arrayname, size_t kMax,
int numThreads = 1);
bool Execute(DataAdaptor* data) override;
......
......@@ -710,6 +710,7 @@ int ConfigurableAnalysis::InternalsType::AddAutoCorrelation(pugi::xml_node node)
int window = node.attribute("window").as_int(10);
int kMax = node.attribute("k-max").as_int(3);
int numThreads = node.attribute("n-threads").as_int(1);
auto adaptor = vtkSmartPointer<Autocorrelation>::New();
......@@ -720,11 +721,13 @@ int ConfigurableAnalysis::InternalsType::AddAutoCorrelation(pugi::xml_node node)
adaptor->Initialize(window, meshName, assoc, arrayName, kMax);
return 0;
});
this->Analyses.push_back(adaptor.GetPointer());
SENSEI_STATUS("Configured Autocorrelation " << assocStr
<< " data array " << arrayName << " on mesh " << meshName
<< " window " << window << " k-max " << kMax)
<< " data array \"" << arrayName << "\" on mesh \"" << meshName
<< "\" window " << window << " k-max " << kMax
<< " n-threads " << numThreads)
return 0;
}
......
......@@ -9,6 +9,7 @@
#include <functional>
#include <numeric>
#include <memory>
#include <climits>
#include "link.hpp"
#include "collection.hpp"
......
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