no longer whole object in species but additional fields in the corresponding classes
48 lines
1.3 KiB
C++
Executable File
48 lines
1.3 KiB
C++
Executable File
#ifndef CPU_SYNCHRONIZER_H
|
|
#define CPU_SYNCHRONIZER_H
|
|
|
|
#include <map>
|
|
#include <memory>
|
|
#include <string>
|
|
#include "blitz/array.h"
|
|
|
|
class DynamicDensityField;
|
|
class Timer;
|
|
class CurrentCollector;
|
|
class DeletionLogger;
|
|
|
|
namespace species {
|
|
class TrackedSpecie;
|
|
};
|
|
|
|
class CpuSynchronizer {
|
|
public:
|
|
// CpuSynchronizer();
|
|
|
|
void synchronize(
|
|
std::map<std::string, std::shared_ptr<species::TrackedSpecie>>&
|
|
tracked_species, bool reset);
|
|
|
|
void synchronize(DynamicDensityField* field,
|
|
DynamicDensityField* density_for_drawing,
|
|
bool reset);
|
|
void synchronize(CurrentCollector* collector);
|
|
void synchronize(DeletionLogger* logger);
|
|
void synchronize(Timer* timer, Timer* last_sync_timer);
|
|
|
|
|
|
/*
|
|
sums delta = * - last_sync_* to last_sync_* over all CPUs
|
|
*/
|
|
void sumToAll(blitz::Array<double, 4>& array,
|
|
blitz::Array<double, 4>& last_sync_array);
|
|
void sumToAll(blitz::Array<double, 3>& array,
|
|
blitz::Array<double, 3>& last_sync_array);
|
|
void sumToAll(blitz::Array<long int, 4>& array,
|
|
blitz::Array<long int, 4>& last_sync_array);
|
|
void sumToAll(double& value, double& last_sync_value);
|
|
void sumToAll(long int& value, long int& last_sync_value);
|
|
};
|
|
|
|
#endif /* CPU_SYNCHRONIZER_H */
|