41 time_interval = cfg.
require(
"log_interval", 0.0);
63 ensemble::SystemRef& _sys;
64 double _next_log_time;
69 static GENERIC int thread_per_system(T compile_time_param){
74 static GENERIC int shmem_per_system(T compile_time_param) {
77 GPUAPI
bool is_deactivate_on() {
return false; };
79 GPUAPI
bool is_log_on() {
return _params.time_interval!=0.; };
80 GPUAPI
bool is_verbose_on() {
return false; };
81 GPUAPI
bool is_any_on() {
return is_deactivate_on() || is_log_on() || is_verbose_on() ; }
82 GPUAPI
bool is_condition_met () {
return ( condition_met ); }
83 GPUAPI
bool need_to_log_system ()
84 {
return (is_log_on() && is_condition_met() ); }
85 GPUAPI
bool need_to_deactivate ()
86 {
return ( is_deactivate_on() && is_condition_met() ); }
88 GPUAPI
void log_system() {
log::system(_log, _sys); }
92 pass_one(thread_in_system);
93 pass_two(thread_in_system);
94 if(need_to_log_system() && (thread_in_system==0) )
98 GPUAPI
bool pass_one (
int thread_in_system)
100 condition_met =
false;
103 if(thread_in_system == 0 && _sys.time() >= _next_log_time )
105 condition_met =
true;
106 _next_log_time += _params.time_interval;
110 return condition_met;
114 GPUAPI
int pass_two (
int thread_in_system)
115 {
return _sys.state(); }
119 :_params(p),_sys(s),_log(l),_next_log_time(s.time()){}