Skip to content
Snippets Groups Projects
Commit 23e60a06 authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

adds timing tags

parent 7b4d4274
No related branches found
No related tags found
No related merge requests found
......@@ -45,6 +45,7 @@
* - updating particle information and redistributing data among MPI processes
* accordingly.
* - approximating fields at particle locations ("sampling").
* - applying a generic particle-to-particle interaction object (P2PKernel)
*
*/
......@@ -80,6 +81,7 @@ class abstract_particle_set
template <class func_type>
int LOOP(func_type expression)
{
TIMEZONE("abstract_particle_set::LOOP");
for (partsize_t idx = 0; idx < this->getLocalNumberOfParticles()*this->getStateSize(); idx++)
expression(idx);
return EXIT_SUCCESS;
......@@ -87,6 +89,7 @@ class abstract_particle_set
template <class func_type>
int LOOP_state(func_type expression)
{
TIMEZONE("abstract_particle_set::LOOP_state");
for (partsize_t idx_part = 0; idx_part < this->getLocalNumberOfParticles(); idx_part++)
for (unsigned int cc = 0; cc < this->getStateSize(); cc++)
expression(idx_part, cc);
......@@ -141,6 +144,7 @@ class abstract_particle_set
p2p_kernel_class p2p_kernel,
std::vector<std::unique_ptr<particle_rnumber[]>> &additional_data)
{
TIMEZONE("abstract_particle_set::applyP2PKernel");
// there must be at least one array with additional data,
// since the p2p kernel expects an array where to store the result of the computation
assert(int(additional_data.size()) > int(0));
......@@ -166,6 +170,7 @@ class abstract_particle_set
const std::string field_name,
const int iteration)
{
TIMEZONE("abstract_particle_set::writeSample");
// set file layout
particle_sample_writer->setParticleFileLayout(this->getParticleFileLayout());
// allocate position array
......@@ -197,6 +202,7 @@ class abstract_particle_set
const std::string field_name,
const int iteration)
{
TIMEZONE("abstract_particle_set::writeStateTriplet");
assert(i0 >= 0);
assert(i0 <= this->getStateSize()-3);
// set file layout
......
......@@ -151,6 +151,7 @@ class particle_set: public abstract_particle_set
p2p_cutoff)
{
TIMEZONE("particle_set::particle_set");
// if these assertions fail,
// it means the constructor prototype is broken
// because the arrays above are wrong.
......@@ -224,6 +225,7 @@ class particle_set: public abstract_particle_set
const int firstState,
const int lastState) const
{
TIMEZONE("particle_set::extractFromParticleState");
const int numberOfStates = std::max(0,(std::min(lastState, state_size)-firstState));
std::unique_ptr<particle_rnumber[]> stateExtract(new particle_rnumber[local_number_of_particles*numberOfStates]);
......@@ -243,6 +245,7 @@ class particle_set: public abstract_particle_set
int template_sample(const field<field_rnumber, be, fc> &field_to_sample,
particle_rnumber *result)
{
TIMEZONE("particle_set::template_sample");
// attention: compute_distr adds result on top of existing values.
// please clean up result as appropriate before call.
this->pDistributor.template compute_distr<interpolator_class,
......@@ -291,6 +294,7 @@ class particle_set: public abstract_particle_set
int redistribute(std::vector<std::unique_ptr<particle_rnumber[]>> &additional_data)
{
TIMEZONE("particle_set::redistribute");
this->pDistributor.template redistribute<interpolator_class,
state_size,
state_size,
......@@ -307,7 +311,7 @@ class particle_set: public abstract_particle_set
int init(abstract_particles_input<partsize_t, particle_rnumber>& particles_input)
{
TIMEZONE("particles_system::init");
TIMEZONE("particle_set::init");
this->local_state = particles_input.getMyParticles();
this->local_index = particles_input.getMyParticlesIndexes();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment