Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Nektar
Nektar
Commits
7a3bd480
Commit
7a3bd480
authored
Jul 07, 2017
by
Douglas Serson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove dependency on boost timer
parent
c4eaf3f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
34 deletions
+15
-34
cmake/ThirdPartyBoost.cmake
cmake/ThirdPartyBoost.cmake
+1
-2
library/Demos/Collections/CollectionTiming.cpp
library/Demos/Collections/CollectionTiming.cpp
+14
-32
No files found.
cmake/ThirdPartyBoost.cmake
View file @
7a3bd480
...
...
@@ -9,8 +9,7 @@
#If the user has not set BOOST_ROOT, look in a couple common places first.
MESSAGE
(
STATUS
"Searching for Boost:"
)
SET
(
MIN_VER
"1.56.0"
)
SET
(
NEEDED_BOOST_LIBS thread iostreams date_time filesystem system
program_options regex timer chrono
)
SET
(
NEEDED_BOOST_LIBS thread iostreams date_time filesystem program_options
)
SET
(
Boost_DEBUG 0
)
SET
(
Boost_NO_BOOST_CMAKE ON
)
IF
(
BOOST_ROOT
)
...
...
library/Demos/Collections/CollectionTiming.cpp
View file @
7a3bd480
...
...
@@ -37,10 +37,9 @@
#include <cstdlib>
#include <iomanip>
#include <boost/timer/timer.hpp>
#include <LibUtilities/Memory/NekMemoryManager.hpp>
#include <LibUtilities/BasicUtils/SessionReader.h>
#include <LibUtilities/BasicUtils/Timer.h>
#include <LibUtilities/Communication/Comm.h>
#include <MultiRegions/ExpList3D.h>
#include <Collections/Collection.h>
...
...
@@ -49,11 +48,6 @@
using
namespace
std
;
using
namespace
Nektar
;
using
boost
::
timer
::
cpu_timer
;
using
boost
::
timer
::
cpu_times
;
using
boost
::
timer
::
nanosecond_type
;
using
boost
::
timer
::
format
;
MultiRegions
::
ExpListSharedPtr
SetupExpList
(
int
N
,
LibUtilities
::
SessionReaderSharedPtr
session
,
...
...
@@ -71,33 +65,21 @@ MultiRegions::ExpListSharedPtr SetupExpList(
return
expList
;
}
void
printOutput
(
int
N
,
int
Ntest
,
cpu_t
imer
&
timer
,
bool
fmt
)
void
printOutput
(
int
N
,
int
Ntest
,
LibUtilities
::
T
imer
&
timer
,
bool
fmt
)
{
cpu_times
times
=
timer
.
elapsed
();
nanosecond_type
total
=
times
.
user
+
times
.
system
;
const
double
sec
=
1000000000.0
L
;
// Normalize timings
double
wall_sec
=
times
.
wall
/
sec
;
double
total_sec
=
total
/
sec
;
wall_sec
/=
Ntest
;
total_sec
/=
Ntest
;
// Get timings
NekDouble
total_sec
=
timer
.
TimePerTest
(
Ntest
);
if
(
fmt
)
{
cout
<<
setw
(
6
)
<<
N
-
1
<<
setw
(
18
)
<<
wall_sec
<<
setw
(
18
)
<<
total_sec
<<
endl
;
}
else
{
cout
<<
"P = "
<<
N
-
1
<<
": "
<<
wall_sec
<<
" (wall) "
<<
total_sec
<<
" (total), "
<<
(
100.0
*
total_sec
/
wall_sec
)
<<
"% CPU"
<<
total_sec
<<
" s, "
<<
endl
;
}
}
...
...
@@ -113,7 +95,7 @@ int main(int argc, char *argv[])
MultiRegions
::
ExpListSharedPtr
expList
;
cpu_t
imer
timer
;
LibUtilities
::
T
imer
timer
;
int
Ntest
,
maxOrder
;
session
->
LoadParameter
(
"Ntest"
,
Ntest
,
1000
);
...
...
@@ -141,12 +123,12 @@ int main(int argc, char *argv[])
Array
<
OneD
,
NekDouble
>
input
(
expList
->
GetNcoeffs
());
Array
<
OneD
,
NekDouble
>
output
(
expList
->
GetNpoints
());
timer
.
s
tart
();
timer
.
S
tart
();
for
(
int
i
=
0
;
i
<
Ntest
;
++
i
)
{
expList
->
BwdTrans
(
input
,
output
);
}
timer
.
s
top
();
timer
.
S
top
();
printOutput
(
N
,
Ntest
,
timer
,
fmt
);
}
...
...
@@ -158,12 +140,12 @@ int main(int argc, char *argv[])
Array
<
OneD
,
NekDouble
>
input
(
expList
->
GetNpoints
());
Array
<
OneD
,
NekDouble
>
output
(
expList
->
GetNcoeffs
());
timer
.
s
tart
();
timer
.
S
tart
();
for
(
int
i
=
0
;
i
<
Ntest
;
++
i
)
{
expList
->
IProductWRTBase
(
input
,
output
);
}
timer
.
s
top
();
timer
.
S
top
();
printOutput
(
N
,
Ntest
,
timer
,
fmt
);
}
...
...
@@ -181,12 +163,12 @@ int main(int argc, char *argv[])
input
[
i
]
=
Array
<
OneD
,
NekDouble
>
(
expList
->
GetNpoints
());
}
timer
.
s
tart
();
timer
.
S
tart
();
for
(
int
i
=
0
;
i
<
Ntest
;
++
i
)
{
expList
->
IProductWRTDerivBase
(
input
,
output
);
}
timer
.
s
top
();
timer
.
S
top
();
printOutput
(
N
,
Ntest
,
timer
,
fmt
);
}
...
...
@@ -200,12 +182,12 @@ int main(int argc, char *argv[])
Array
<
OneD
,
NekDouble
>
output1
(
expList
->
GetNpoints
());
Array
<
OneD
,
NekDouble
>
output2
(
expList
->
GetNpoints
());
timer
.
s
tart
();
timer
.
S
tart
();
for
(
int
i
=
0
;
i
<
Ntest
;
++
i
)
{
expList
->
PhysDeriv
(
input
,
output0
,
output1
,
output2
);
}
timer
.
s
top
();
timer
.
S
top
();
printOutput
(
N
,
Ntest
,
timer
,
fmt
);
}
...
...
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