Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ScalFMM
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
solverstack
ScalFMM
Commits
7741b9b5
Commit
7741b9b5
authored
May 19, 2016
by
Quentin Khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FAdaptiveTask: use FAlgorithmTimers to time algorithm steps
parent
1176253b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
25 deletions
+40
-25
Src/Adaptive/new/FAdaptiveTask.hpp
Src/Adaptive/new/FAdaptiveTask.hpp
+40
-25
No files found.
Src/Adaptive/new/FAdaptiveTask.hpp
View file @
7741b9b5
...
...
@@ -6,6 +6,7 @@
#include <cmath> // Used to round box differences
#include <functional>
#include <map>
#include <vector>
#include <list>
#include <array>
#include <type_traits>
...
...
@@ -18,11 +19,10 @@
#include "Core/FCoreCommon.hpp"
#include "Containers/FTreeCoordinate.hpp"
#include "FTimer.hpp"
#include "Utils/FAlgorithmTimers.hpp"
template
<
class
_Tree
,
class
_Kernel
>
class
FAdaptiveTask
:
public
FAlgorithmInterface
{
class
FAdaptiveTask
:
public
FAlgorithmInterface
,
public
FAlgorithmTimers
{
public:
using
tree_t
=
_Tree
;
using
kernel_t
=
_Kernel
;
...
...
@@ -36,9 +36,6 @@ protected:
/// Vector of kernels, one per thread
std
::
vector
<
std
::
unique_ptr
<
kernel_t
>>
_kernels
;
/// Timing object
FTimer
timer
;
/** \brief SFINAE shortcut to check `K.setup(Args...)` existence */
template
<
typename
K
,
typename
Ret
,
typename
...
Args
>
...
...
@@ -206,56 +203,74 @@ public:
{
if
(
operations
&
FFmmP2M
)
{
// 1. source to up, P2M
timer
.
time
([
this
](){
this
->
source_to_up
();});
std
::
cout
<<
" P2M: "
<<
timer
.
last
().
count
()
<<
'\n'
;
Timers
[
"P2M"
].
tic
();
this
->
source_to_up
();;
Timers
[
"P2M"
].
tac
();
std
::
cout
<<
" P2M: "
<<
Timers
[
"P2M"
].
elapsed
()
<<
std
::
endl
;
}
if
(
operations
&
FFmmP2L
)
{
// 3b X-list, P2L
timer
.
time
([
this
](){
this
->
x_list_step
();});
std
::
cout
<<
" P2L: "
<<
timer
.
last
().
count
()
<<
'\n'
;
Timers
[
"P2L"
].
tic
();
this
->
x_list_step
();
Timers
[
"P2L"
].
tac
();
std
::
cout
<<
" P2L: "
<<
Timers
[
"P2L"
].
elapsed
()
<<
std
::
endl
;
}
if
(
operations
&
FFmmP2P
)
{
// A. U-list, P2P
timer
.
time
([
this
](){
this
->
u_list_step
();});
std
::
cout
<<
" P2P: "
<<
timer
.
last
().
count
()
<<
'\n'
;
Timers
[
"P2P"
].
tic
();
this
->
u_list_step
();
Timers
[
"P2P"
].
tac
();
std
::
cout
<<
" P2P: "
<<
Timers
[
"P2P"
].
elapsed
()
<<
std
::
endl
;
}
if
(
operations
&
FFmmM2M
)
{
// 2. up to up, M2M
timer
.
time
([
this
](){
this
->
up_to_up
();});
std
::
cout
<<
" M2M: "
<<
timer
.
last
().
count
()
<<
'\n'
;
Timers
[
"M2M"
].
tic
();
this
->
up_to_up
();
Timers
[
"M2M"
].
tac
();
std
::
cout
<<
" M2M: "
<<
Timers
[
"M2M"
].
elapsed
()
<<
std
::
endl
;
}
if
(
operations
&
FFmmM2P
)
{
// 5a W-list, M2P
timer
.
time
([
this
](){
this
->
w_list_step
();});
std
::
cout
<<
" M2P: "
<<
timer
.
last
().
count
()
<<
'\n'
;
Timers
[
"M2P"
].
tic
();
this
->
w_list_step
();
Timers
[
"M2P"
].
tac
();
std
::
cout
<<
" M2P: "
<<
Timers
[
"M2P"
].
elapsed
()
<<
std
::
endl
;
}
if
(
operations
&
FFmmM2L
)
{
// 3a V-list, M2L
timer
.
time
([
this
](){
this
->
v_list_step
();});
std
::
cout
<<
" M2L: "
<<
timer
.
last
().
count
()
<<
'\n'
;
Timers
[
"M2L"
].
tic
();
this
->
v_list_step
();
Timers
[
"M2L"
].
tac
();
std
::
cout
<<
" M2L: "
<<
Timers
[
"M2L"
].
elapsed
()
<<
std
::
endl
;
}
if
(
operations
&
FFmmL2L
)
{
// 4. down to down, L2L
timer
.
time
([
this
](){
this
->
down_to_down
();});
std
::
cout
<<
" L2L: "
<<
timer
.
last
().
count
()
<<
'\n'
;
Timers
[
"L2L"
].
tic
();
this
->
down_to_down
();
Timers
[
"L2L"
].
tac
();
std
::
cout
<<
" L2L: "
<<
Timers
[
"L2L"
].
elapsed
()
<<
std
::
endl
;
}
if
(
operations
&
FFmmL2P
)
{
// 5b down to target, L2P
timer
.
time
([
this
](){
this
->
down_to_target
();});
std
::
cout
<<
" L2P: "
<<
timer
.
last
().
count
()
<<
'\n'
;
Timers
[
"L2P"
].
tic
();
this
->
down_to_target
();
Timers
[
"L2P"
].
tac
();
std
::
cout
<<
" L2P: "
<<
Timers
[
"L2P"
].
elapsed
()
<<
std
::
endl
;
}
std
::
cout
<<
" task created: "
<<
std
::
accumulate
(
this
->
timer
.
measures
().
begin
()
,
this
->
timer
.
measures
().
end
(),
std
::
chrono
::
duration
<
double
>
(
0
)).
count
(
)
<<
std
::
accumulate
(
Timers
.
begin
(),
Timers
.
end
(),
0.
,
[](
double
&
res
,
const
typename
decltype
(
Timers
)
::
value_type
&
t
)
{
return
res
+
t
.
second
.
cumulated
();}
)
<<
'\n'
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment