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
cbbed01b
Commit
cbbed01b
authored
Sep 23, 2013
by
BRAMAS Berenger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update timer for ftic to omp timer of gettimeofday
parent
464daaf8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
+12
-9
CMakeLists.txt
CMakeLists.txt
+1
-1
Src/Utils/FTic.hpp
Src/Utils/FTic.hpp
+11
-8
No files found.
CMakeLists.txt
View file @
cbbed01b
...
...
@@ -50,7 +50,7 @@ OPTION( ScalFMM_USE_ADDONS "Set to ON to compile add ons"
OPTION
(
ScalFMM_USE_SSE
"Set to ON to compile with sse support"
ON
)
# Set scalfmm to default libraries
SET
(
SCALFMM_LIBRARIES
"
-lrt
"
)
SET
(
SCALFMM_LIBRARIES
""
)
# Test if openmp is here
find_package
(
OpenMP
)
...
...
Src/Utils/FTic.hpp
View file @
cbbed01b
...
...
@@ -17,15 +17,17 @@
#define FTIC_HPP
#include "FGlobal.hpp"
#include <time.h>
// We need an os specific function
#if defined(WINDOWS)
#ifdef _OPENMP
#include <omp.h>
#elif defined(WINDOWS) // We need an os specific function
#include <time.h>
#include <windows.h>
#else
#ifndef POSIX
#warning Posix used withoug being explicitly defined
#endif
#include <time.h>
#include <sys/time.h>
#include <unistd.h>
#include <stdint.h>
...
...
@@ -94,13 +96,14 @@ public:
* gettimeofday on linux or a direct ASM method
*/
static
double
GetTime
(){
#ifdef WINDOWS
#ifdef _OPENMP
return
omp_get_wtime
();
#elif defined(WINDOWS)
return
static_cast
<
double
>
(
GetTickCount
())
/
1000.0
;
#else // We are in linux/posix
// better than gettimeofday but need -lrt
struct
timespec
tp
;
clock_gettime
(
CLOCK_MONOTONIC_RAW
,
&
tp
);
return
double
(
tp
.
tv_sec
)
+
(
double
(
tp
.
tv_nsec
)
/
1000000000.0
);
timeval
t
;
gettimeofday
(
&
t
,
NULL
);
return
double
(
t
.
tv_sec
)
+
(
double
(
t
.
tv_usec
)
/
1000000.0
);
#endif
}
};
...
...
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