16 #include <sys/times.h>
47 const char *MainPATH =
"./";
51 UInt_t error_adf = 0u;
54 {
printf(
"Error in NarvalInterface::process_config %d \n ",error_adf);
return 1; }
63 const UInt_t size_buf_in = 400*
aKByte;
64 const UInt_t size_buf_out =
aMByte;
72 UInt_t error_pro = 0u;
76 printf(
"Error in BasicAFP::process_config %d \n ",error_pro);
80 printf(
"Error in BasicAFP::process_config %d \n ",error_pro);
83 UInt_t error_filter = 0u;
86 if ( error_filter > 0u )
87 printf(
"Error in TestFIO::process_config %d \n ",error_filter);
90 if ( error_filter > 0u )
91 printf(
"Error in TestFIO::process_config %d \n ",error_filter);
94 UInt_t error_cons = 0u;
97 if ( error_cons > 0u )
98 printf(
"Error in BasicAFC::process_config %d \n ",error_cons);
101 if ( error_cons > 0u )
102 printf(
"Error in BasicAFC::process_config %d \n ",error_cons);
105 UInt_t realsize1 = 0u, realsize2= 0u, nb_loop = 0u,
error = 0u;
106 struct tms t0, t; times(&t0);
107 while ( error == 0u ) {
110 pro->
process_block(buf1,size_buf_in,&realsize1,&error);
if ( realsize1 == 0u )
break;
111 std::cout <<
"realsize1 " << realsize1 <<
std::endl;
113 filter->
process_block(buf1,realsize1,buf2,size_buf_out,&realsize2,&error);
115 std::cout <<
"realsize2 " << realsize2 <<
std::endl;
121 printf(
"[[ test0.1 ]] : BENCHMARKS \n[...\n");
122 printf(
"nb_loop %d %d\n",nb_loop,error);
124 std::cout <<
"User " << Float_t(t.tms_utime-t0.tms_utime)/sysconf(_SC_CLK_TCK)
125 <<
" second, System " << Float_t(t.tms_stime-t0.tms_stime)/sysconf(_SC_CLK_TCK)
142 const char *MainPATH =
"./";
143 std::string tmp_path;
146 UInt_t error_adf = 0u;
148 if ( error_adf > 0u )
149 {
printf(
"Error in NarvalInterface::process_config %d \n ",error_adf);
return 1; }
163 UInt_t error_pro = 0u;
166 if ( error_pro > 0u )
167 printf(
"Error in BasicAFP::process_config %d \n ",error_pro);
170 if ( error_pro > 0u )
171 printf(
"Error in BasicAFP::process_config %d \n ",error_pro);
174 UInt_t error_filter = 0u;
177 if ( error_filter > 0u )
178 printf(
"Error in TestFIO::process_config %d \n ",error_filter);
181 if ( error_filter > 0u )
182 printf(
"Error in TestFIO::process_config %d \n ",error_filter);
185 UInt_t error_cons = 0u;
188 if ( error_cons > 0u )
189 printf(
"Error in BasicAFC::process_config %d \n ",error_cons);
192 if ( error_cons > 0u )
193 printf(
"Error in BasicAFC::process_config %d \n ",error_cons);
196 UInt_t nb_loop = 0u,
error = 0u;
struct tms t0, t; times(&t0);
197 while ( error == 0u ) {
199 printf(
"Call producer \n");
215 printf(
"Call consumer \n");
225 printf(
"[[ test0.2 ]] : BENCHMARKS \n[...\n");
226 printf(
"nb_loop %d %d\n",nb_loop,error);
228 std::cout <<
"User " << Float_t(t.tms_utime-t0.tms_utime)/sysconf(_SC_CLK_TCK)
229 <<
" second, System " << Float_t(t.tms_stime-t0.tms_stime)/sysconf(_SC_CLK_TCK)
245 const char *MainPATH =
"./";
246 std::string tmp_path;
249 UInt_t error_adf = 0u;
251 if ( error_adf > 0u )
252 {
printf(
"Error in NarvalInterface::process_config %d \n ",error_adf);
return 1; }
266 UInt_t error_pro = 0u;
269 if ( error_pro > 0u )
270 printf(
"Error in BasicAFP::process_config %d \n ",error_pro);
273 if ( error_pro > 0u )
274 printf(
"Error in BasicAFP::process_config %d \n ",error_pro);
277 UInt_t error_filter = 0u;
280 if ( error_filter > 0u )
281 printf(
"Error in TestFIO::process_config %d \n ",error_filter);
284 if ( error_filter > 0u )
285 printf(
"Error in TestFIO::process_config %d \n ",error_filter);
288 UInt_t nb_loop = 0u,
error = 0u;
struct tms t0, t; times(&t0);
289 while ( error == 0u ) {
309 printf(
"[[ test1.2 ]] : BENCHMARKS \n[...\n");
310 printf(
"nb_loop %d %d\n",nb_loop,error);
312 std::cout <<
"User " << Float_t(t.tms_utime-t0.tms_utime)/sysconf(_SC_CLK_TCK)
313 <<
" second, System " << Float_t(t.tms_stime-t0.tms_stime)/sysconf(_SC_CLK_TCK)
326 #if ADF_STANDALONE == 1
327 int main(
int argc,
char **argv)
329 const int nbtest = 2;
331 std::cout <<
" Usage is : \n\t"
332 << argv[0] <<
" i \n i being a integer from 1 to "<< nbtest <<
std::endl;
334 int nwhat; UInt_t number = 100;
336 std::istringstream what(argv[1]); what >> nwhat;
339 std::istringstream what(argv[2]); what >> number;
352 std::cout <<
" Unknown test number " << nwhat <<
std::endl;
header file for BasicAFC.cpp
printf("******************************************************************** \n")
static void process_config(const Char_t *, UInt_t *, Short_t do_adf_conf=0)
Have to be overwritten and called in your implementation.
TestFIO algorithm embedded in Narval.
int main(int argc, char **argv)
static void process_config(const Char_t *, UInt_t *)
to init globals (static) from a directory
static void Delete(Char_t *p)
LogMessage & error(LogMessage &)
virtual void process_block(void *input_buffer, UInt_t size_of_input_buffer, UInt_t *error_code)
Narval interface, Ask the algorithm to process the input data block.
virtual void process_block(void *input_buffer, UInt_t size_of_input_buffer, void *output_buffer, UInt_t size_of_output_buffer, UInt_t *used_size_of_output_buffer, UInt_t *error_code)
Ask the algorithm to process the data block.
header file for BasicAFP.cpp
virtual void process_initialise(UInt_t *error_code)
Constructor implementation.
virtual UInt_t ProcessBlock(ADF::FrameBlock &)
Produce one block of data.
static void process_config(const Char_t *, UInt_t *)
to init globals (static) from a directory
virtual void process_initialise(UInt_t *error_code)
Constructor implementation.
virtual Long64_t GetSize(UInt_t=0u) const
size of the current block
static Char_t * New(Char_t *p, Int_t nb=32 *aKByte)
virtual UInt_t ProcessBlock(ADF::FrameBlock &)
virtual method to be implemented
ADF::LogMessage & endl(ADF::LogMessage &log)
virtual UInt_t ProcessBlock(ADF::FrameBlock &, ADF::FrameBlock &)
To process just a block of data.
header file for TestFIO.cpp
static void process_config(const Char_t *, UInt_t *)
to init globals (static) from a directory
virtual void process_initialise(UInt_t *error_code)
Constructor implementation.
It implements an in-memory block of Frames.
virtual void process_block(void *output_buffer, UInt_t size_of_output_buffer, UInt_t *used_size_of_output_buffer, UInt_t *error_code)
Ask the algorithm to process the data block.
basic consumer, it counts and dumps Frame in files