Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NP_TMcode
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Giacomo Mulas
NP_TMcode
Commits
b8184b93
There was an error fetching the commit references. Please try again later.
Commit
b8184b93
authored
1 month ago
by
Giovanni La Mura
Browse files
Options
Downloads
Patches
Plain Diff
Add a logger to np_trapping and use it to write the execution time
parent
b9f6783f
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/trapping/np_trapping.cpp
+12
-0
12 additions, 0 deletions
src/trapping/np_trapping.cpp
with
12 additions
and
0 deletions
src/trapping/np_trapping.cpp
+
12
−
0
View file @
b8184b93
...
@@ -2,9 +2,14 @@
...
@@ -2,9 +2,14 @@
*
*
* \brief Trapping problem handler.
* \brief Trapping problem handler.
*/
*/
#include
<chrono>
#include
<cstdio>
#include
<cstdio>
#include
<string>
#include
<string>
#ifndef INCLUDE_LOGGING_H_
#include
"../include/logging.h"
#endif
using
namespace
std
;
using
namespace
std
;
extern
void
frfme
(
string
data_file
,
string
output_path
);
extern
void
frfme
(
string
data_file
,
string
output_path
);
...
@@ -17,9 +22,13 @@ extern void lffft(string data_file, string output_path);
...
@@ -17,9 +22,13 @@ extern void lffft(string data_file, string output_path);
* \return result: `int`
* \return result: `int`
*/
*/
int
main
(
int
argc
,
char
**
argv
)
{
int
main
(
int
argc
,
char
**
argv
)
{
chrono
::
time_point
<
chrono
::
high_resolution_clock
>
t_start
=
chrono
::
high_resolution_clock
::
now
();
chrono
::
duration
<
double
>
elapsed
;
string
frfme_data_file
=
"../../test_data/trapping/DFRFME"
;
string
frfme_data_file
=
"../../test_data/trapping/DFRFME"
;
string
lffft_data_file
=
"../../test_data/trapping/DLFFFT"
;
string
lffft_data_file
=
"../../test_data/trapping/DLFFFT"
;
string
output_path
=
"."
;
string
output_path
=
"."
;
string
message
;
Logger
logger
(
LOG_DEBG
);
if
(
argc
==
4
)
{
if
(
argc
==
4
)
{
frfme_data_file
=
string
(
argv
[
1
]);
frfme_data_file
=
string
(
argv
[
1
]);
lffft_data_file
=
string
(
argv
[
2
]);
lffft_data_file
=
string
(
argv
[
2
]);
...
@@ -27,5 +36,8 @@ int main(int argc, char **argv) {
...
@@ -27,5 +36,8 @@ int main(int argc, char **argv) {
}
}
frfme
(
frfme_data_file
,
output_path
);
frfme
(
frfme_data_file
,
output_path
);
lffft
(
lffft_data_file
,
output_path
);
lffft
(
lffft_data_file
,
output_path
);
elapsed
=
chrono
::
high_resolution_clock
::
now
()
-
t_start
;
message
=
"INFO: calculation lasted "
+
to_string
(
elapsed
.
count
())
+
"s.
\n
"
;
logger
.
log
(
message
);
return
0
;
return
0
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment