Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
canvas
canvas
test
tbb
tbb_init_t.cc
Go to the documentation of this file.
1
// Sketch of one way to do a scaling study
2
#include "tbb/task_scheduler_init.h"
3
#include "tbb/tick_count.h"
4
#include <iostream>
5
6
extern
"C"
{
7
#include <unistd.h>
8
}
9
10
int
11
main
()
12
{
13
int
n
= tbb::task_scheduler_init::default_num_threads();
14
for
(
int
p = 1; p <=
n
; ++p) {
15
// Construct task scheduler with p threads
16
tbb::task_scheduler_init init(p);
17
auto
t0
=
tbb::tick_count::now
();
18
// Execute parallel algorithm using task or template algorithm here.
19
usleep(4005 / n);
20
auto
t1
=
tbb::tick_count::now
();
21
double
t
= (
t1
-
t0
).seconds();
22
std::cout <<
"time = "
<< t <<
" with "
<< p <<
" threads."
<< std::endl;
23
// Implicitly destroy task scheduler.
24
}
25
return
0;
26
}
t0
code to link reconstructed objects back to the MC truth information
Definition:
DirectHitParticleAssns_tool.cc:18
generate_CCQE_events.t
t
Definition:
generate_CCQE_events.py:68
test_gpu_visible.t1
t1
Definition:
test_gpu_visible.py:16
main
int main()
Definition:
tbb_init_t.cc:11
submit_mcc.now
now
Definition:
submit_mcc.py:14
test_gpu_visible.t0
t0
Definition:
test_gpu_visible.py:13
plotSensitivity.n
n
Definition:
plotSensitivity.py:109
Generated by
1.8.11