27 #include "../common.hpp"
29 #include "../types/config.hpp"
30 #include "../plugin.hpp"
36 namespace swarm {
namespace log {
41 debug = cfg.
optional<
int>(
"debug_host_array_writer",0);
43 int event_type = cfg.
require<
int>(
"host_array_event_type");
46 if(cfg.
valid(
"host_array_event_type2"))
48 if(cfg.
valid(
"host_array_event_type3"))
50 if(cfg.
valid(
"host_array_event_type4"))
59 event_codes_to_log.push_back(et);
60 event_log.resize(event_codes_to_log.size());
67 gpulog::ilogstream ils(log_data,length);
69 while(lr = ils.next())
71 bool need_to_log =
false;
72 int event_code = lr.msgid();
73 for(
int i=0;i<event_codes_to_log.size();++i)
75 if(event_codes_to_log[i]!=event_code)
continue;
81 if(sysid>=event_log[i].size()) event_log[i].resize(sysid+1);
93 std::vector<int> intdata(num_ints,-1);
94 std::vector<double> doubledata(num_doubles,-1.);
95 for(
int j=0;j<num_ints;++j)
97 for(
int j=0;j<num_doubles;++j)
103 else if (num_ints==2)
110 int oldprec = std::cout.precision();
111 std::cout.precision(10);
112 std::cout <<
"EventCode= " << event_code <<
" t= " << time <<
" sys= " << sysid <<
" bod= " << intdata[0];
115 for(
int j=1;j<num_ints;++j)
116 std::cout <<
", " << intdata[j];
118 std::cout.precision(6);
119 for(
int j=0;j<num_doubles;++j)
120 std::cout <<
" " << doubledata[j];
121 std::cout.precision(oldprec);
132 host_array_writer_plugin(
"host_array",
"This stores selected events in simple arrays on the host");