|
| | AskForROBs (const EventContext &context, const ServiceHandle< IROBDataProviderSvc > &svc, uint32_t lvl1ID, const std::vector< eformat::read::ROBFragment > &robs, size_t frac=8) |
| size_t | nrobs () const |
| virtual void | firstCall () override |
| | a method that will be called to obtain first results from the service It should set the reference quantities
|
| virtual bool | callAndCompare () const override |
| | a function that performs request, and compares the results obtained with the result of the first execution When result differ this function is supposed to return false, otherwise true
|
| bool | run (size_t nrepeats) |
| | runs the stress test by invoking it the firstCall and then repetitively the callAndCompare
|
|
| static bool | launchTests (size_t nrepeats, const std::vector< ParallelCallTest * > &tests) |
| | Method to run launch number of tests in parallel (increasing the stress of the calle) It has a potential that also the "first" calls can be launched in parallel and thus be the worse case compared to a situation when the first calls are invoked sequentially while further calls in parallel.
|
Definition at line 29 of file ROBDataProviderMTTest.cxx.
◆ AskForROBs()
| AskForROBs::AskForROBs |
( |
const EventContext & | context, |
|
|
const ServiceHandle< IROBDataProviderSvc > & | svc, |
|
|
uint32_t | lvl1ID, |
|
|
const std::vector< eformat::read::ROBFragment > & | robs, |
|
|
size_t | frac = 8 ) |
|
inline |
Definition at line 31 of file ROBDataProviderMTTest.cxx.
35
36 for (
size_t el = 0;
el <
robs.size()/frac; ++
el ) {
37 m_ROBIDs.push_back( robs[el].rob_source_id() );
38 }
39 }
const ServiceHandle< IROBDataProviderSvc > & m_svc
std::vector< uint32_t > m_ROBIDs
◆ callAndCompare()
| virtual bool AskForROBs::callAndCompare |
( |
| ) |
const |
|
inlineoverridevirtual |
a function that performs request, and compares the results obtained with the result of the first execution When result differ this function is supposed to return false, otherwise true
Implements ParallelCallTest.
Definition at line 42 of file ROBDataProviderMTTest.cxx.
42 {
45 for ( auto& rob: robs ) {
46 if ( rob->rod_lvl1_id() !=
m_lvl1ID )
47 return false;
48 }
49 return true;
50 }
std::vector< const ROBF * > VROBFRAG
◆ firstCall()
| virtual void AskForROBs::firstCall |
( |
| ) |
|
|
inlineoverridevirtual |
◆ launchTests()
| bool ParallelCallTest::launchTests |
( |
size_t | nrepeats, |
|
|
const std::vector< ParallelCallTest * > & | tests ) |
|
staticinherited |
Method to run launch number of tests in parallel (increasing the stress of the calle) It has a potential that also the "first" calls can be launched in parallel and thus be the worse case compared to a situation when the first calls are invoked sequentially while further calls in parallel.
Definition at line 83 of file ParallelCallTest.cxx.
83 {
84
85
86
87
88
89 RedirStderr redir;
90
91
92 return tbb::parallel_reduce( tbb::blocked_range< std::vector<ParallelCallTest*>::const_iterator >(
tests.begin(),
tests.end() ),
93 true,
94 [&]( tbb::blocked_range< std::vector<ParallelCallTest*>::const_iterator > groupOfTests, bool statusSoFar ) -> bool {
95 bool success = true;
96 for ( auto test : groupOfTests ) {
97 success = test->run( nrepeats ) and success;
98 }
99 return statusSoFar and success;
100 },
101 []( bool allCallsStatus, bool thisCallStatus ) -> bool {
102 return allCallsStatus and thisCallStatus;
103 } );
104}
◆ nrobs()
| size_t AskForROBs::nrobs |
( |
| ) |
const |
|
inline |
◆ run()
| bool ParallelCallTest::run |
( |
size_t | nrepeats | ) |
|
|
inherited |
runs the stress test by invoking it the firstCall and then repetitively the callAndCompare
- nrepeats times (>=1) A single failure of the callAndCompare would result in the whole execution failed
Definition at line 69 of file ParallelCallTest.cxx.
69 {
71
72 return tbb::parallel_reduce( tbb::blocked_range<int>( 0, nrepeats, 1 ),
73 true,
74 [&]( tbb::blocked_range<int>, bool statusSoFar ) -> bool {
76 },
77 []( bool allCallsStatus, bool thisCallStatus ) -> bool {
78 return allCallsStatus and thisCallStatus;
79 } );
80}
virtual bool callAndCompare() const =0
a function that performs request, and compares the results obtained with the result of the first exec...
virtual void firstCall()=0
a method that will be called to obtain first results from the service It should set the reference qua...
◆ m_context
| EventContext AskForROBs::m_context |
|
private |
◆ m_lvl1ID
| uint32_t AskForROBs::m_lvl1ID |
|
private |
◆ m_ROBIDs
| std::vector<uint32_t> AskForROBs::m_ROBIDs |
|
private |
◆ m_svc
The documentation for this class was generated from the following file: