14 #include "boost/tokenizer.hpp"
17 #include <sys/types.h>
25 : actionId_(
pset.getUntrackedParameter<
int>(
"defaultAction", -1)),
26 intqualifier_(
pset.getUntrackedParameter<
int>(
"defaultQualifier", 0)),
27 qualifier2_(
pset.getUntrackedParameter<double>(
"secondQualifier", 1)),
28 actionRequired_(actionId_ != -1) {
34 timingHisto_ =
new TH1D(
"timingHisto_",
"Total time for all modules per event", 100, 0, 1000);
144 unsigned int iterations = 0;
145 if (actionRequired_) {
151 ::usleep(intqualifier_ * 1000);
157 throw cms::Exception(qualifier_) <<
"This exception was generated by the ExceptionGenerator";
184 for (
unsigned int j = 0;
j < intqualifier_ * 1000 * 100;
j++) {
189 iterations = 100 * static_cast<unsigned int>(timingHisto_->GetRandom() * intqualifier_ * 17. + 0.5);
190 for (
unsigned int j = 0;
j < iterations;
j++) {
195 iterations = static_cast<unsigned int>(timingHisto_->GetRandom() * intqualifier_ * 12. + 0.5);
196 TRandom3 random(iterations);
197 const size_t dataSize = 32 * 500;
198 std::vector<double>
data(dataSize);
199 random.RndmArray(dataSize, &
data[0]);
201 for (
unsigned int j = 0;
j < iterations;
j++) {
202 const size_t index = static_cast<size_t>(random.Rndm() * dataSize + 0.5);
205 if (random.Rndm() < 0.1)
211 gettimeofday(&tv_now,
nullptr);
212 if ((
unsigned)(tv_now.tv_sec - tv_start_.tv_sec) > intqualifier_)
216 void *vp = malloc(1024);
217 memset((
char *)vp - 32, 0, 1024);
223 float off = intqualifier_ * (1. - qualifier2_);
225 iterations = static_cast<unsigned int>(
max(1., off + timingHisto_->GetRandom() *
scale));
227 ::usleep(iterations * 1000);
232 float off = intqualifier_ * (1. - qualifier2_);
234 iterations = static_cast<unsigned int>(
max(1., off + timingHisto_->GetRandom() *
scale));
235 iterations *= 100000;
236 for (
unsigned int j = 0;
j < iterations;
j++) {