Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
d2fe22e8
Commit
d2fe22e8
authored
18 years ago
by
John Romein
Browse files
Options
Downloads
Patches
Plain Diff
BugID: 225
Debug times now not dependent on MPI.
parent
b24d5e25
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CEP/CEPFrame/src/SynchronisityManager.cc
+39
-13
39 additions, 13 deletions
CEP/CEPFrame/src/SynchronisityManager.cc
with
39 additions
and
13 deletions
CEP/CEPFrame/src/SynchronisityManager.cc
+
39
−
13
View file @
d2fe22e8
...
@@ -35,14 +35,10 @@
...
@@ -35,14 +35,10 @@
#include
<CEPFrame/DataManager.h>
#include
<CEPFrame/DataManager.h>
#undef OLAP_CS1_TIMINGS
#ifdef OLAP_CS1_TIMINGS
#ifdef OLAP_CS1_TIMINGS
// This is used to plot the times that each thread starts writing/reading
#include
<sys/time.h>
#ifdef HAVE_MPI
#include
<mpi.h>
#define MPITIMEROUTPUT MPI_Wtime() << ": "
#else
#define MPITIMEROUTPUT ""
#endif
#endif
#endif
namespace
LOFAR
namespace
LOFAR
...
@@ -205,6 +201,28 @@ static bool stopThread(thread_data *data)
...
@@ -205,6 +201,28 @@ static bool stopThread(thread_data *data)
return
stopThread
;
return
stopThread
;
}
}
#if defined OLAP_CS1_TIMINGS
static
double
getTime
()
{
struct
timeval
tv
;
static
double
first_time
=
0.0
;
if
(
gettimeofday
(
&
tv
,
0
)
!=
0
)
{
perror
(
"gettimeofday"
);
tv
.
tv_sec
=
tv
.
tv_usec
=
0
;
}
double
time
=
tv
.
tv_sec
+
tv
.
tv_usec
/
1.0e6
;
if
(
first_time
==
0
)
first_time
=
time
;
return
time
-
first_time
;
}
#endif
void
*
SynchronisityManager
::
startReaderThread
(
void
*
thread_arg
)
void
*
SynchronisityManager
::
startReaderThread
(
void
*
thread_arg
)
{
{
thread_data
*
data
=
(
thread_data
*
)
thread_arg
;
thread_data
*
data
=
(
thread_data
*
)
thread_arg
;
...
@@ -221,18 +239,21 @@ void* SynchronisityManager::startReaderThread(void* thread_arg)
...
@@ -221,18 +239,21 @@ void* SynchronisityManager::startReaderThread(void* thread_arg)
pConn
->
getTransportHolder
()
->
reset
();
// Reset TransportHolder
pConn
->
getTransportHolder
()
->
reset
();
// Reset TransportHolder
#ifdef OLAP_CS1_TIMINGS
#ifdef OLAP_CS1_TIMINGS
cerr
<<
MPITIMEROUTPUT
<<
"thread "
<<
data
->
threadnumber
<<
" waits for read right
\n
"
;
cerr
<<
getTime
()
<<
"
:
thread "
<<
data
->
threadnumber
<<
" waits for read right
\n
"
;
#endif
#endif
data
->
commAllowed
.
down
();
data
->
commAllowed
.
down
();
#ifdef OLAP_CS1_TIMINGS
#ifdef OLAP_CS1_TIMINGS
cerr
<<
MPITIMEROUTPUT
<<
"thread "
<<
data
->
threadnumber
<<
" received read right
\n
"
;
cerr
<<
getTime
()
<<
"
:
thread "
<<
data
->
threadnumber
<<
" received read right
\n
"
;
#endif
#endif
Connection
::
State
result
=
pConn
->
read
();
Connection
::
State
result
=
pConn
->
read
();
#ifdef OLAP_CS1_TIMINGS
#ifdef OLAP_CS1_TIMINGS
cerr
<<
MPITIMEROUTPUT
<<
"thread "
<<
data
->
threadnumber
<<
" releases read right
\n
"
;
cerr
<<
getTime
()
<<
"
:
thread "
<<
data
->
threadnumber
<<
" releases read right
\n
"
;
#endif
#endif
data
->
nextThread
->
commAllowed
.
up
();
data
->
nextThread
->
commAllowed
.
up
();
ASSERTSTR
(
result
!=
Connection
::
Error
,
ASSERTSTR
(
result
!=
Connection
::
Error
,
...
@@ -260,18 +281,23 @@ void* SynchronisityManager::startWriterThread(void* thread_arg)
...
@@ -260,18 +281,23 @@ void* SynchronisityManager::startWriterThread(void* thread_arg)
pConn
->
getTransportHolder
()
->
reset
();
// Reset TransportHolder
pConn
->
getTransportHolder
()
->
reset
();
// Reset TransportHolder
#ifdef OLAP_CS1_TIMINGS
#ifdef OLAP_CS1_TIMINGS
cerr
<<
MPITIMEROUTPUT
<<
"thread "
<<
data
->
threadnumber
<<
" waits for write right
\n
"
;
cerr
<<
getTime
()
<<
"
:
thread "
<<
data
->
threadnumber
<<
" waits for write right
\n
"
;
#endif
#endif
data
->
commAllowed
.
down
();
data
->
commAllowed
.
down
();
#ifdef OLAP_CS1_TIMINGS
#ifdef OLAP_CS1_TIMINGS
cerr
<<
MPITIMEROUTPUT
<<
"thread "
<<
data
->
threadnumber
<<
" received write right
\n
"
;
cerr
<<
getTime
()
<<
"
:
thread "
<<
data
->
threadnumber
<<
" received write right
\n
"
;
#endif
#endif
Connection
::
State
result
=
pConn
->
write
();
Connection
::
State
result
=
pConn
->
write
();
ASSERTSTR
(
result
!=
Connection
::
Error
,
ASSERTSTR
(
result
!=
Connection
::
Error
,
"Writer thread encountered error in writing"
);
"Writer thread encountered error in writing"
);
#ifdef OLAP_CS1_TIMINGS
#ifdef OLAP_CS1_TIMINGS
cerr
<<
MPITIMEROUTPUT
<<
"thread "
<<
data
->
threadnumber
<<
" releases write right
\n
"
;
cerr
<<
getTime
()
<<
"
:
thread "
<<
data
->
threadnumber
<<
" releases write right
\n
"
;
#endif
#endif
data
->
nextThread
->
commAllowed
.
up
();
data
->
nextThread
->
commAllowed
.
up
();
manager
->
readUnlock
(
id
);
manager
->
readUnlock
(
id
);
}
}
...
...
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