1 package org.apache.commons.rng.examples.jmh.simple.jmh_generated;
2
3 import java.util.List;
4 import java.util.concurrent.atomic.AtomicInteger;
5 import java.util.Collection;
6 import java.util.ArrayList;
7 import java.util.concurrent.TimeUnit;
8 import org.openjdk.jmh.annotations.CompilerControl;
9 import org.openjdk.jmh.runner.InfraControl;
10 import org.openjdk.jmh.infra.ThreadParams;
11 import org.openjdk.jmh.results.BenchmarkTaskResult;
12 import org.openjdk.jmh.results.Result;
13 import org.openjdk.jmh.results.ThroughputResult;
14 import org.openjdk.jmh.results.AverageTimeResult;
15 import org.openjdk.jmh.results.SampleTimeResult;
16 import org.openjdk.jmh.results.SingleShotResult;
17 import org.openjdk.jmh.util.SampleBuffer;
18 import org.openjdk.jmh.annotations.Mode;
19 import org.openjdk.jmh.annotations.Fork;
20 import org.openjdk.jmh.annotations.Measurement;
21 import org.openjdk.jmh.annotations.Threads;
22 import org.openjdk.jmh.annotations.Warmup;
23 import org.openjdk.jmh.annotations.BenchmarkMode;
24 import org.openjdk.jmh.results.RawResults;
25 import org.openjdk.jmh.results.ResultRole;
26 import java.lang.reflect.Field;
27 import org.openjdk.jmh.infra.BenchmarkParams;
28 import org.openjdk.jmh.infra.IterationParams;
29 import org.openjdk.jmh.infra.Blackhole;
30 import org.openjdk.jmh.infra.Control;
31 import org.openjdk.jmh.results.ScalarResult;
32 import org.openjdk.jmh.results.AggregationPolicy;
33 import org.openjdk.jmh.runner.FailureAssistException;
34
35 import org.apache.commons.rng.examples.jmh.simple.jmh_generated.SeedArrayGenerationPerformance_jmhType;
36 import org.apache.commons.rng.examples.jmh.simple.jmh_generated.SeedArrayGenerationPerformance_SeedRandomSources_jmhType;
37 import org.apache.commons.rng.examples.jmh.simple.jmh_generated.SeedArrayGenerationPerformance_SeedSizes_jmhType;
38 public final class SeedArrayGenerationPerformance_Threads4_createIntArraySeed_UnfairLock_jmhTest {
39
40 byte p000, p001, p002, p003, p004, p005, p006, p007, p008, p009, p010, p011, p012, p013, p014, p015;
41 byte p016, p017, p018, p019, p020, p021, p022, p023, p024, p025, p026, p027, p028, p029, p030, p031;
42 byte p032, p033, p034, p035, p036, p037, p038, p039, p040, p041, p042, p043, p044, p045, p046, p047;
43 byte p048, p049, p050, p051, p052, p053, p054, p055, p056, p057, p058, p059, p060, p061, p062, p063;
44 byte p064, p065, p066, p067, p068, p069, p070, p071, p072, p073, p074, p075, p076, p077, p078, p079;
45 byte p080, p081, p082, p083, p084, p085, p086, p087, p088, p089, p090, p091, p092, p093, p094, p095;
46 byte p096, p097, p098, p099, p100, p101, p102, p103, p104, p105, p106, p107, p108, p109, p110, p111;
47 byte p112, p113, p114, p115, p116, p117, p118, p119, p120, p121, p122, p123, p124, p125, p126, p127;
48 byte p128, p129, p130, p131, p132, p133, p134, p135, p136, p137, p138, p139, p140, p141, p142, p143;
49 byte p144, p145, p146, p147, p148, p149, p150, p151, p152, p153, p154, p155, p156, p157, p158, p159;
50 byte p160, p161, p162, p163, p164, p165, p166, p167, p168, p169, p170, p171, p172, p173, p174, p175;
51 byte p176, p177, p178, p179, p180, p181, p182, p183, p184, p185, p186, p187, p188, p189, p190, p191;
52 byte p192, p193, p194, p195, p196, p197, p198, p199, p200, p201, p202, p203, p204, p205, p206, p207;
53 byte p208, p209, p210, p211, p212, p213, p214, p215, p216, p217, p218, p219, p220, p221, p222, p223;
54 byte p224, p225, p226, p227, p228, p229, p230, p231, p232, p233, p234, p235, p236, p237, p238, p239;
55 byte p240, p241, p242, p243, p244, p245, p246, p247, p248, p249, p250, p251, p252, p253, p254, p255;
56 int startRndMask;
57 BenchmarkParams benchmarkParams;
58 IterationParams iterationParams;
59 ThreadParams threadParams;
60 Blackhole blackhole;
61 Control notifyControl;
62
63 public BenchmarkTaskResult Threads4_createIntArraySeed_UnfairLock_Throughput(InfraControl control, ThreadParams threadParams) throws Throwable {
64 this.benchmarkParams = control.benchmarkParams;
65 this.iterationParams = control.iterationParams;
66 this.threadParams = threadParams;
67 this.notifyControl = control.notifyControl;
68 if (this.blackhole == null) {
69 this.blackhole = new Blackhole("Today's password is swordfish. I understand instantiating Blackholes directly is dangerous.");
70 }
71 if (threadParams.getSubgroupIndex() == 0) {
72 RawResults res = new RawResults();
73 SeedArrayGenerationPerformance_jmhType l_seedarraygenerationperformance0_G = _jmh_tryInit_f_seedarraygenerationperformance0_G(control);
74 SeedArrayGenerationPerformance_SeedSizes_jmhType l_seedsizes2_G = _jmh_tryInit_f_seedsizes2_G(control);
75 SeedArrayGenerationPerformance_SeedRandomSources_jmhType l_seedrandomsources1_G = _jmh_tryInit_f_seedrandomsources1_G(control);
76
77 control.preSetup();
78
79
80 control.announceWarmupReady();
81 while (control.warmupShouldWait) {
82 blackhole.consume(l_seedarraygenerationperformance0_G.Threads4_createIntArraySeed_UnfairLock(l_seedrandomsources1_G, l_seedsizes2_G));
83 res.allOps++;
84 }
85
86 notifyControl.startMeasurement = true;
87 Threads4_createIntArraySeed_UnfairLock_thrpt_jmhStub(control, res, benchmarkParams, iterationParams, threadParams, blackhole, notifyControl, startRndMask, l_seedrandomsources1_G, l_seedsizes2_G, l_seedarraygenerationperformance0_G);
88 notifyControl.stopMeasurement = true;
89 control.announceWarmdownReady();
90 try {
91 while (control.warmdownShouldWait) {
92 blackhole.consume(l_seedarraygenerationperformance0_G.Threads4_createIntArraySeed_UnfairLock(l_seedrandomsources1_G, l_seedsizes2_G));
93 res.allOps++;
94 }
95 } catch (Throwable e) {
96 if (!(e instanceof InterruptedException)) throw e;
97 }
98 control.preTearDown();
99
100 if (control.isLastIteration()) {
101 if (SeedArrayGenerationPerformance_SeedRandomSources_jmhType.tearTrialMutexUpdater.compareAndSet(l_seedrandomsources1_G, 0, 1)) {
102 try {
103 if (control.isFailing) throw new FailureAssistException();
104 if (l_seedrandomsources1_G.readyTrial) {
105 l_seedrandomsources1_G.readyTrial = false;
106 }
107 } catch (Throwable t) {
108 control.isFailing = true;
109 throw t;
110 } finally {
111 SeedArrayGenerationPerformance_SeedRandomSources_jmhType.tearTrialMutexUpdater.set(l_seedrandomsources1_G, 0);
112 }
113 } else {
114 long l_seedrandomsources1_G_backoff = 1;
115 while (SeedArrayGenerationPerformance_SeedRandomSources_jmhType.tearTrialMutexUpdater.get(l_seedrandomsources1_G) == 1) {
116 TimeUnit.MILLISECONDS.sleep(l_seedrandomsources1_G_backoff);
117 l_seedrandomsources1_G_backoff = Math.max(1024, l_seedrandomsources1_G_backoff * 2);
118 if (control.isFailing) throw new FailureAssistException();
119 if (Thread.interrupted()) throw new InterruptedException();
120 }
121 }
122 synchronized(this.getClass()) {
123 f_seedrandomsources1_G = null;
124 }
125 synchronized(this.getClass()) {
126 f_seedsizes2_G = null;
127 }
128 synchronized(this.getClass()) {
129 f_seedarraygenerationperformance0_G = null;
130 }
131 }
132 res.allOps += res.measuredOps;
133 int batchSize = iterationParams.getBatchSize();
134 int opsPerInv = benchmarkParams.getOpsPerInvocation();
135 res.allOps *= opsPerInv;
136 res.allOps /= batchSize;
137 res.measuredOps *= opsPerInv;
138 res.measuredOps /= batchSize;
139 BenchmarkTaskResult results = new BenchmarkTaskResult((long)res.allOps, (long)res.measuredOps);
140 results.add(new ThroughputResult(ResultRole.PRIMARY, "Threads4_createIntArraySeed_UnfairLock", res.measuredOps, res.getTime(), benchmarkParams.getTimeUnit()));
141 this.blackhole.evaporate("Yes, I am Stephen Hawking, and know a thing or two about black holes.");
142 return results;
143 } else
144 throw new IllegalStateException("Harness failed to distribute threads among groups properly");
145 }
146
147 public static void Threads4_createIntArraySeed_UnfairLock_thrpt_jmhStub(InfraControl control, RawResults result, BenchmarkParams benchmarkParams, IterationParams iterationParams, ThreadParams threadParams, Blackhole blackhole, Control notifyControl, int startRndMask, SeedArrayGenerationPerformance_SeedRandomSources_jmhType l_seedrandomsources1_G, SeedArrayGenerationPerformance_SeedSizes_jmhType l_seedsizes2_G, SeedArrayGenerationPerformance_jmhType l_seedarraygenerationperformance0_G) throws Throwable {
148 long operations = 0;
149 long realTime = 0;
150 result.startTime = System.nanoTime();
151 do {
152 blackhole.consume(l_seedarraygenerationperformance0_G.Threads4_createIntArraySeed_UnfairLock(l_seedrandomsources1_G, l_seedsizes2_G));
153 operations++;
154 } while(!control.isDone);
155 result.stopTime = System.nanoTime();
156 result.realTime = realTime;
157 result.measuredOps = operations;
158 }
159
160
161 public BenchmarkTaskResult Threads4_createIntArraySeed_UnfairLock_AverageTime(InfraControl control, ThreadParams threadParams) throws Throwable {
162 this.benchmarkParams = control.benchmarkParams;
163 this.iterationParams = control.iterationParams;
164 this.threadParams = threadParams;
165 this.notifyControl = control.notifyControl;
166 if (this.blackhole == null) {
167 this.blackhole = new Blackhole("Today's password is swordfish. I understand instantiating Blackholes directly is dangerous.");
168 }
169 if (threadParams.getSubgroupIndex() == 0) {
170 RawResults res = new RawResults();
171 SeedArrayGenerationPerformance_jmhType l_seedarraygenerationperformance0_G = _jmh_tryInit_f_seedarraygenerationperformance0_G(control);
172 SeedArrayGenerationPerformance_SeedSizes_jmhType l_seedsizes2_G = _jmh_tryInit_f_seedsizes2_G(control);
173 SeedArrayGenerationPerformance_SeedRandomSources_jmhType l_seedrandomsources1_G = _jmh_tryInit_f_seedrandomsources1_G(control);
174
175 control.preSetup();
176
177
178 control.announceWarmupReady();
179 while (control.warmupShouldWait) {
180 blackhole.consume(l_seedarraygenerationperformance0_G.Threads4_createIntArraySeed_UnfairLock(l_seedrandomsources1_G, l_seedsizes2_G));
181 res.allOps++;
182 }
183
184 notifyControl.startMeasurement = true;
185 Threads4_createIntArraySeed_UnfairLock_avgt_jmhStub(control, res, benchmarkParams, iterationParams, threadParams, blackhole, notifyControl, startRndMask, l_seedrandomsources1_G, l_seedsizes2_G, l_seedarraygenerationperformance0_G);
186 notifyControl.stopMeasurement = true;
187 control.announceWarmdownReady();
188 try {
189 while (control.warmdownShouldWait) {
190 blackhole.consume(l_seedarraygenerationperformance0_G.Threads4_createIntArraySeed_UnfairLock(l_seedrandomsources1_G, l_seedsizes2_G));
191 res.allOps++;
192 }
193 } catch (Throwable e) {
194 if (!(e instanceof InterruptedException)) throw e;
195 }
196 control.preTearDown();
197
198 if (control.isLastIteration()) {
199 if (SeedArrayGenerationPerformance_SeedRandomSources_jmhType.tearTrialMutexUpdater.compareAndSet(l_seedrandomsources1_G, 0, 1)) {
200 try {
201 if (control.isFailing) throw new FailureAssistException();
202 if (l_seedrandomsources1_G.readyTrial) {
203 l_seedrandomsources1_G.readyTrial = false;
204 }
205 } catch (Throwable t) {
206 control.isFailing = true;
207 throw t;
208 } finally {
209 SeedArrayGenerationPerformance_SeedRandomSources_jmhType.tearTrialMutexUpdater.set(l_seedrandomsources1_G, 0);
210 }
211 } else {
212 long l_seedrandomsources1_G_backoff = 1;
213 while (SeedArrayGenerationPerformance_SeedRandomSources_jmhType.tearTrialMutexUpdater.get(l_seedrandomsources1_G) == 1) {
214 TimeUnit.MILLISECONDS.sleep(l_seedrandomsources1_G_backoff);
215 l_seedrandomsources1_G_backoff = Math.max(1024, l_seedrandomsources1_G_backoff * 2);
216 if (control.isFailing) throw new FailureAssistException();
217 if (Thread.interrupted()) throw new InterruptedException();
218 }
219 }
220 synchronized(this.getClass()) {
221 f_seedrandomsources1_G = null;
222 }
223 synchronized(this.getClass()) {
224 f_seedsizes2_G = null;
225 }
226 synchronized(this.getClass()) {
227 f_seedarraygenerationperformance0_G = null;
228 }
229 }
230 res.allOps += res.measuredOps;
231 int batchSize = iterationParams.getBatchSize();
232 int opsPerInv = benchmarkParams.getOpsPerInvocation();
233 res.allOps *= opsPerInv;
234 res.allOps /= batchSize;
235 res.measuredOps *= opsPerInv;
236 res.measuredOps /= batchSize;
237 BenchmarkTaskResult results = new BenchmarkTaskResult((long)res.allOps, (long)res.measuredOps);
238 results.add(new AverageTimeResult(ResultRole.PRIMARY, "Threads4_createIntArraySeed_UnfairLock", res.measuredOps, res.getTime(), benchmarkParams.getTimeUnit()));
239 this.blackhole.evaporate("Yes, I am Stephen Hawking, and know a thing or two about black holes.");
240 return results;
241 } else
242 throw new IllegalStateException("Harness failed to distribute threads among groups properly");
243 }
244
245 public static void Threads4_createIntArraySeed_UnfairLock_avgt_jmhStub(InfraControl control, RawResults result, BenchmarkParams benchmarkParams, IterationParams iterationParams, ThreadParams threadParams, Blackhole blackhole, Control notifyControl, int startRndMask, SeedArrayGenerationPerformance_SeedRandomSources_jmhType l_seedrandomsources1_G, SeedArrayGenerationPerformance_SeedSizes_jmhType l_seedsizes2_G, SeedArrayGenerationPerformance_jmhType l_seedarraygenerationperformance0_G) throws Throwable {
246 long operations = 0;
247 long realTime = 0;
248 result.startTime = System.nanoTime();
249 do {
250 blackhole.consume(l_seedarraygenerationperformance0_G.Threads4_createIntArraySeed_UnfairLock(l_seedrandomsources1_G, l_seedsizes2_G));
251 operations++;
252 } while(!control.isDone);
253 result.stopTime = System.nanoTime();
254 result.realTime = realTime;
255 result.measuredOps = operations;
256 }
257
258
259 public BenchmarkTaskResult Threads4_createIntArraySeed_UnfairLock_SampleTime(InfraControl control, ThreadParams threadParams) throws Throwable {
260 this.benchmarkParams = control.benchmarkParams;
261 this.iterationParams = control.iterationParams;
262 this.threadParams = threadParams;
263 this.notifyControl = control.notifyControl;
264 if (this.blackhole == null) {
265 this.blackhole = new Blackhole("Today's password is swordfish. I understand instantiating Blackholes directly is dangerous.");
266 }
267 if (threadParams.getSubgroupIndex() == 0) {
268 RawResults res = new RawResults();
269 SeedArrayGenerationPerformance_jmhType l_seedarraygenerationperformance0_G = _jmh_tryInit_f_seedarraygenerationperformance0_G(control);
270 SeedArrayGenerationPerformance_SeedSizes_jmhType l_seedsizes2_G = _jmh_tryInit_f_seedsizes2_G(control);
271 SeedArrayGenerationPerformance_SeedRandomSources_jmhType l_seedrandomsources1_G = _jmh_tryInit_f_seedrandomsources1_G(control);
272
273 control.preSetup();
274
275
276 control.announceWarmupReady();
277 while (control.warmupShouldWait) {
278 blackhole.consume(l_seedarraygenerationperformance0_G.Threads4_createIntArraySeed_UnfairLock(l_seedrandomsources1_G, l_seedsizes2_G));
279 res.allOps++;
280 }
281
282 notifyControl.startMeasurement = true;
283 int targetSamples = (int) (control.getDuration(TimeUnit.MILLISECONDS) * 20);
284 int batchSize = iterationParams.getBatchSize();
285 int opsPerInv = benchmarkParams.getOpsPerInvocation();
286 SampleBuffer buffer = new SampleBuffer();
287 Threads4_createIntArraySeed_UnfairLock_sample_jmhStub(control, res, benchmarkParams, iterationParams, threadParams, blackhole, notifyControl, startRndMask, buffer, targetSamples, opsPerInv, batchSize, l_seedrandomsources1_G, l_seedsizes2_G, l_seedarraygenerationperformance0_G);
288 notifyControl.stopMeasurement = true;
289 control.announceWarmdownReady();
290 try {
291 while (control.warmdownShouldWait) {
292 blackhole.consume(l_seedarraygenerationperformance0_G.Threads4_createIntArraySeed_UnfairLock(l_seedrandomsources1_G, l_seedsizes2_G));
293 res.allOps++;
294 }
295 } catch (Throwable e) {
296 if (!(e instanceof InterruptedException)) throw e;
297 }
298 control.preTearDown();
299
300 if (control.isLastIteration()) {
301 if (SeedArrayGenerationPerformance_SeedRandomSources_jmhType.tearTrialMutexUpdater.compareAndSet(l_seedrandomsources1_G, 0, 1)) {
302 try {
303 if (control.isFailing) throw new FailureAssistException();
304 if (l_seedrandomsources1_G.readyTrial) {
305 l_seedrandomsources1_G.readyTrial = false;
306 }
307 } catch (Throwable t) {
308 control.isFailing = true;
309 throw t;
310 } finally {
311 SeedArrayGenerationPerformance_SeedRandomSources_jmhType.tearTrialMutexUpdater.set(l_seedrandomsources1_G, 0);
312 }
313 } else {
314 long l_seedrandomsources1_G_backoff = 1;
315 while (SeedArrayGenerationPerformance_SeedRandomSources_jmhType.tearTrialMutexUpdater.get(l_seedrandomsources1_G) == 1) {
316 TimeUnit.MILLISECONDS.sleep(l_seedrandomsources1_G_backoff);
317 l_seedrandomsources1_G_backoff = Math.max(1024, l_seedrandomsources1_G_backoff * 2);
318 if (control.isFailing) throw new FailureAssistException();
319 if (Thread.interrupted()) throw new InterruptedException();
320 }
321 }
322 synchronized(this.getClass()) {
323 f_seedrandomsources1_G = null;
324 }
325 synchronized(this.getClass()) {
326 f_seedsizes2_G = null;
327 }
328 synchronized(this.getClass()) {
329 f_seedarraygenerationperformance0_G = null;
330 }
331 }
332 res.allOps += res.measuredOps * batchSize;
333 res.allOps *= opsPerInv;
334 res.allOps /= batchSize;
335 res.measuredOps *= opsPerInv;
336 BenchmarkTaskResult results = new BenchmarkTaskResult((long)res.allOps, (long)res.measuredOps);
337 results.add(new SampleTimeResult(ResultRole.PRIMARY, "Threads4_createIntArraySeed_UnfairLock", buffer, benchmarkParams.getTimeUnit()));
338 this.blackhole.evaporate("Yes, I am Stephen Hawking, and know a thing or two about black holes.");
339 return results;
340 } else
341 throw new IllegalStateException("Harness failed to distribute threads among groups properly");
342 }
343
344 public static void Threads4_createIntArraySeed_UnfairLock_sample_jmhStub(InfraControl control, RawResults result, BenchmarkParams benchmarkParams, IterationParams iterationParams, ThreadParams threadParams, Blackhole blackhole, Control notifyControl, int startRndMask, SampleBuffer buffer, int targetSamples, long opsPerInv, int batchSize, SeedArrayGenerationPerformance_SeedRandomSources_jmhType l_seedrandomsources1_G, SeedArrayGenerationPerformance_SeedSizes_jmhType l_seedsizes2_G, SeedArrayGenerationPerformance_jmhType l_seedarraygenerationperformance0_G) throws Throwable {
345 long realTime = 0;
346 long operations = 0;
347 int rnd = (int)System.nanoTime();
348 int rndMask = startRndMask;
349 long time = 0;
350 int currentStride = 0;
351 do {
352 rnd = (rnd * 1664525 + 1013904223);
353 boolean sample = (rnd & rndMask) == 0;
354 if (sample) {
355 time = System.nanoTime();
356 }
357 for (int b = 0; b < batchSize; b++) {
358 if (control.volatileSpoiler) return;
359 blackhole.consume(l_seedarraygenerationperformance0_G.Threads4_createIntArraySeed_UnfairLock(l_seedrandomsources1_G, l_seedsizes2_G));
360 }
361 if (sample) {
362 buffer.add((System.nanoTime() - time) / opsPerInv);
363 if (currentStride++ > targetSamples) {
364 buffer.half();
365 currentStride = 0;
366 rndMask = (rndMask << 1) + 1;
367 }
368 }
369 operations++;
370 } while(!control.isDone);
371 startRndMask = Math.max(startRndMask, rndMask);
372 result.realTime = realTime;
373 result.measuredOps = operations;
374 }
375
376
377 public BenchmarkTaskResult Threads4_createIntArraySeed_UnfairLock_SingleShotTime(InfraControl control, ThreadParams threadParams) throws Throwable {
378 this.benchmarkParams = control.benchmarkParams;
379 this.iterationParams = control.iterationParams;
380 this.threadParams = threadParams;
381 this.notifyControl = control.notifyControl;
382 if (this.blackhole == null) {
383 this.blackhole = new Blackhole("Today's password is swordfish. I understand instantiating Blackholes directly is dangerous.");
384 }
385 if (threadParams.getSubgroupIndex() == 0) {
386 SeedArrayGenerationPerformance_jmhType l_seedarraygenerationperformance0_G = _jmh_tryInit_f_seedarraygenerationperformance0_G(control);
387 SeedArrayGenerationPerformance_SeedSizes_jmhType l_seedsizes2_G = _jmh_tryInit_f_seedsizes2_G(control);
388 SeedArrayGenerationPerformance_SeedRandomSources_jmhType l_seedrandomsources1_G = _jmh_tryInit_f_seedrandomsources1_G(control);
389
390 control.preSetup();
391
392
393 notifyControl.startMeasurement = true;
394 RawResults res = new RawResults();
395 int batchSize = iterationParams.getBatchSize();
396 Threads4_createIntArraySeed_UnfairLock_ss_jmhStub(control, res, benchmarkParams, iterationParams, threadParams, blackhole, notifyControl, startRndMask, batchSize, l_seedrandomsources1_G, l_seedsizes2_G, l_seedarraygenerationperformance0_G);
397 control.preTearDown();
398
399 if (control.isLastIteration()) {
400 if (SeedArrayGenerationPerformance_SeedRandomSources_jmhType.tearTrialMutexUpdater.compareAndSet(l_seedrandomsources1_G, 0, 1)) {
401 try {
402 if (control.isFailing) throw new FailureAssistException();
403 if (l_seedrandomsources1_G.readyTrial) {
404 l_seedrandomsources1_G.readyTrial = false;
405 }
406 } catch (Throwable t) {
407 control.isFailing = true;
408 throw t;
409 } finally {
410 SeedArrayGenerationPerformance_SeedRandomSources_jmhType.tearTrialMutexUpdater.set(l_seedrandomsources1_G, 0);
411 }
412 } else {
413 long l_seedrandomsources1_G_backoff = 1;
414 while (SeedArrayGenerationPerformance_SeedRandomSources_jmhType.tearTrialMutexUpdater.get(l_seedrandomsources1_G) == 1) {
415 TimeUnit.MILLISECONDS.sleep(l_seedrandomsources1_G_backoff);
416 l_seedrandomsources1_G_backoff = Math.max(1024, l_seedrandomsources1_G_backoff * 2);
417 if (control.isFailing) throw new FailureAssistException();
418 if (Thread.interrupted()) throw new InterruptedException();
419 }
420 }
421 synchronized(this.getClass()) {
422 f_seedrandomsources1_G = null;
423 }
424 synchronized(this.getClass()) {
425 f_seedsizes2_G = null;
426 }
427 synchronized(this.getClass()) {
428 f_seedarraygenerationperformance0_G = null;
429 }
430 }
431 int opsPerInv = control.benchmarkParams.getOpsPerInvocation();
432 long totalOps = opsPerInv;
433 BenchmarkTaskResult results = new BenchmarkTaskResult(totalOps, totalOps);
434 results.add(new SingleShotResult(ResultRole.PRIMARY, "Threads4_createIntArraySeed_UnfairLock", res.getTime(), totalOps, benchmarkParams.getTimeUnit()));
435 this.blackhole.evaporate("Yes, I am Stephen Hawking, and know a thing or two about black holes.");
436 return results;
437 } else
438 throw new IllegalStateException("Harness failed to distribute threads among groups properly");
439 }
440
441 public static void Threads4_createIntArraySeed_UnfairLock_ss_jmhStub(InfraControl control, RawResults result, BenchmarkParams benchmarkParams, IterationParams iterationParams, ThreadParams threadParams, Blackhole blackhole, Control notifyControl, int startRndMask, int batchSize, SeedArrayGenerationPerformance_SeedRandomSources_jmhType l_seedrandomsources1_G, SeedArrayGenerationPerformance_SeedSizes_jmhType l_seedsizes2_G, SeedArrayGenerationPerformance_jmhType l_seedarraygenerationperformance0_G) throws Throwable {
442 long realTime = 0;
443 result.startTime = System.nanoTime();
444 for (int b = 0; b < batchSize; b++) {
445 if (control.volatileSpoiler) return;
446 blackhole.consume(l_seedarraygenerationperformance0_G.Threads4_createIntArraySeed_UnfairLock(l_seedrandomsources1_G, l_seedsizes2_G));
447 }
448 result.stopTime = System.nanoTime();
449 result.realTime = realTime;
450 }
451
452
453 static volatile SeedArrayGenerationPerformance_jmhType f_seedarraygenerationperformance0_G;
454
455 SeedArrayGenerationPerformance_jmhType _jmh_tryInit_f_seedarraygenerationperformance0_G(InfraControl control) throws Throwable {
456 SeedArrayGenerationPerformance_jmhType val = f_seedarraygenerationperformance0_G;
457 if (val != null) {
458 return val;
459 }
460 synchronized(this.getClass()) {
461 try {
462 if (control.isFailing) throw new FailureAssistException();
463 val = f_seedarraygenerationperformance0_G;
464 if (val != null) {
465 return val;
466 }
467 val = new SeedArrayGenerationPerformance_jmhType();
468 val.readyTrial = true;
469 f_seedarraygenerationperformance0_G = val;
470 } catch (Throwable t) {
471 control.isFailing = true;
472 throw t;
473 }
474 }
475 return val;
476 }
477
478 static volatile SeedArrayGenerationPerformance_SeedRandomSources_jmhType f_seedrandomsources1_G;
479
480 SeedArrayGenerationPerformance_SeedRandomSources_jmhType _jmh_tryInit_f_seedrandomsources1_G(InfraControl control) throws Throwable {
481 SeedArrayGenerationPerformance_SeedRandomSources_jmhType val = f_seedrandomsources1_G;
482 if (val != null) {
483 return val;
484 }
485 synchronized(this.getClass()) {
486 try {
487 if (control.isFailing) throw new FailureAssistException();
488 val = f_seedrandomsources1_G;
489 if (val != null) {
490 return val;
491 }
492 val = new SeedArrayGenerationPerformance_SeedRandomSources_jmhType();
493 Field f;
494 f = org.apache.commons.rng.examples.jmh.simple.SeedArrayGenerationPerformance.SeedRandomSources.class.getDeclaredField("randomSourceName");
495 f.setAccessible(true);
496 f.set(val, control.getParam("randomSourceName"));
497 val.setup();
498 val.readyTrial = true;
499 f_seedrandomsources1_G = val;
500 } catch (Throwable t) {
501 control.isFailing = true;
502 throw t;
503 }
504 }
505 return val;
506 }
507
508 static volatile SeedArrayGenerationPerformance_SeedSizes_jmhType f_seedsizes2_G;
509
510 SeedArrayGenerationPerformance_SeedSizes_jmhType _jmh_tryInit_f_seedsizes2_G(InfraControl control) throws Throwable {
511 SeedArrayGenerationPerformance_SeedSizes_jmhType val = f_seedsizes2_G;
512 if (val != null) {
513 return val;
514 }
515 synchronized(this.getClass()) {
516 try {
517 if (control.isFailing) throw new FailureAssistException();
518 val = f_seedsizes2_G;
519 if (val != null) {
520 return val;
521 }
522 val = new SeedArrayGenerationPerformance_SeedSizes_jmhType();
523 Field f;
524 f = org.apache.commons.rng.examples.jmh.simple.SeedArrayGenerationPerformance.SeedSizes.class.getDeclaredField("size");
525 f.setAccessible(true);
526 f.set(val, Integer.valueOf(control.getParam("size")));
527 val.readyTrial = true;
528 f_seedsizes2_G = val;
529 } catch (Throwable t) {
530 control.isFailing = true;
531 throw t;
532 }
533 }
534 return val;
535 }
536
537
538 }
539