Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Camille Coti
TensorJoseph
Commits
37c16d5b
Commit
37c16d5b
authored
Jan 14, 2020
by
Camille Coti
Browse files
Added some profiling elements with TAU (disabled by default)
parent
a5f4f5e6
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/profiling.cpp
View file @
37c16d5b
...
...
@@ -3,6 +3,31 @@
#ifdef TAUPROF
double
previous
=
0
;
double
getTimeSpent
(
void
*
ptr
){
long
calls
,
childcalls
;
double
incl
[
TAU_MAX_COUNTERS
],
excl
[
TAU_MAX_COUNTERS
];
const
char
**
counters
;
int
numcounters
,
j
;
TAU_PROFILER_GET_CALLS
(
ptr
,
&
calls
);
TAU_PROFILER_GET_CHILD_CALLS
(
ptr
,
&
childcalls
);
TAU_PROFILER_GET_INCLUSIVE_VALUES
(
ptr
,
&
incl
);
TAU_PROFILER_GET_EXCLUSIVE_VALUES
(
ptr
,
&
excl
);
TAU_PROFILER_GET_COUNTER_INFO
(
&
counters
,
&
numcounters
);
printf
(
"Calls = %ld, child = %ld
\n
"
,
calls
,
childcalls
);
printf
(
"numcounters = %d
\n
"
,
numcounters
);
for
(
j
=
0
;
j
<
numcounters
;
j
++
)
{
printf
(
">>>"
);
printf
(
"counter [%d] = %s
\n
"
,
j
,
counters
[
j
]);
printf
(
" excl [%d] = %g, incl [%d] = %g
\n
"
,
j
,
excl
[
j
],
j
,
incl
[
j
]);
}
return
incl
[
0
];
}
double
getTimeSpent
(
const
char
*
cnt
){
const
char
**
inFuncs
;
...
...
src/profiling.h
View file @
37c16d5b
...
...
@@ -8,6 +8,7 @@
#define TAU_STOP( a ) do { ;; } while( 0 );
#endif // TAUPROF
double
getTimeSpent
(
void
*
);
double
getTimeSpent
(
const
char
*
);
uint64_t
rdtsc
(
void
);
...
...
src/sequential.cpp
View file @
37c16d5b
...
...
@@ -106,7 +106,12 @@ gi::ex multiply_1level( tensor3D_t& T, matrix_int_t& J, int size ) { // simpler
j
=
0
;
double
time
;
#ifdef TAUPROF
void
*
ptr
;
TAU_PROFILER_CREATE
(
ptr
,
"b"
,
""
,
TAU_USER
);
#endif
for
(
a1
=
0
;
a1
<
size
;
a1
++
){
i
=
i
+
1
;
// std::cout << "Tens: " << Tens << std::endl;
...
...
@@ -115,17 +120,40 @@ gi::ex multiply_1level( tensor3D_t& T, matrix_int_t& J, int size ) { // simpler
j
=
j
+
1
;
// printf("j = %d\n", j);
for
(
a3
=
0
;
a3
<
size
;
a3
++
){
// TAU_START( "b" );
#ifdef TAUPROF
TAU_START
(
"b"
);
TAU_PROFILER_START
(
ptr
);
#endif
A
=
T
[
a1
][
a2
][
a3
];
/* Beyond this point, a2 and a3 are only used in the simplectic matrix */
for
(
b1
=
0
;
b1
<
size
;
b1
++
){
Tn
=
one_level1_product
(
&
T
,
&
J
,
A
,
size
,
a1
,
a2
,
a3
,
b1
);
Tens
+=
Tn
;
}
// TAU_STOP( "b" );
//#ifdef TAUPROF
#if 0
time = getTimeSpent( "b" );
#ifdef TAUPROF
TAU_STOP
(
"b"
);
// time = getTimeSpent( ptr );
long
calls
,
childcalls
;
double
incl
[
TAU_MAX_COUNTERS
],
excl
[
TAU_MAX_COUNTERS
];
const
char
**
counters
;
int
numcounters
,
i
,
j
;
TAU_PROFILER_GET_CALLS
(
ptr
,
&
calls
);
TAU_PROFILER_GET_CHILD_CALLS
(
ptr
,
&
childcalls
);
TAU_PROFILER_GET_INCLUSIVE_VALUES
(
ptr
,
&
incl
);
TAU_PROFILER_GET_EXCLUSIVE_VALUES
(
ptr
,
&
excl
);
TAU_PROFILER_GET_COUNTER_INFO
(
&
counters
,
&
numcounters
);
printf
(
"Calls = %ld, child = %ld
\n
"
,
calls
,
childcalls
);
printf
(
"numcounters = %d
\n
"
,
numcounters
);
for
(
j
=
0
;
j
<
numcounters
;
j
++
)
{
printf
(
">>>"
);
printf
(
"counter [%d] = %s
\n
"
,
j
,
counters
[
j
]);
printf
(
" excl [%d] = %g, incl [%d] = %g
\n
"
,
j
,
excl
[
j
],
j
,
incl
[
j
]);
}
// time = getTimeSpent( "b" );
#endif // TAUPROF
}
}
...
...
src/tensormatrix_mpi.cpp
View file @
37c16d5b
...
...
@@ -11,6 +11,10 @@
#include "tensormatrix.h"
#include "utils.h"
#ifdef TAUPROF
#include <TAU.h>
#endif
#define DEBUG 0
namespace
gi
=
GiNaC
;
...
...
@@ -59,7 +63,12 @@ int main( int argc, char** argv ){
double
tv_start
,
tv_para
,
tv_seq
;
int
rank
;
#ifdef TAUPROF
TAU_INIT
(
&
argc
,
&
argv
);
TAU_PROFILE_SET_NODE
(
0
);
#endif
MPI_Init
(
&
argc
,
&
argv
);
MPI_Comm_rank
(
MPI_COMM_WORLD
,
&
rank
);
// std::cout << "Process " << rank << " has pid " << getpid() << std::endl;
...
...
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