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
e7fc95b5
Commit
e7fc95b5
authored
12 years ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
Task #4315: Removed templates from MPI classes
parent
6b43d713
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
RTCP/Cobalt/InputProc/test/tMPITransfer.cc
+18
-10
18 additions, 10 deletions
RTCP/Cobalt/InputProc/test/tMPITransfer.cc
with
18 additions
and
10 deletions
RTCP/Cobalt/InputProc/test/tMPITransfer.cc
+
18
−
10
View file @
e7fc95b5
...
...
@@ -120,13 +120,13 @@ void sender()
LOG_INFO_STR
(
"Detected "
<<
s
);
LOG_INFO_STR
(
"Connecting to receivers to send "
<<
from
<<
" to "
<<
to
);
SampleBufferReader
<
SampleT
>
reader
(
s
,
keys
(
beamletDistribution
),
0.1
);
MPISendStation
<
SampleT
>
sender
(
s
,
rank
,
beamletDistribution
);
MPISendStation
sender
(
s
,
rank
,
beamletDistribution
);
LOG_INFO_STR
(
"Sending to receivers"
);
for
(
TimeStamp
current
=
from
;
current
+
blockSize
<
to
;
current
+=
blockSize
)
{
SmartPtr
<
struct
SampleBufferReader
<
SampleT
>::
Block
>
block
(
reader
.
block
(
current
,
current
+
blockSize
));
sender
.
sendBlock
(
*
block
);
sender
.
sendBlock
<
SampleT
>
(
*
block
);
}
generator
.
stop
();
...
...
@@ -148,31 +148,39 @@ void receiver()
stationRanks
[
i
]
=
i
;
{
MPIReceiveStations
<
SampleT
>
receiver
(
stationRanks
,
beamlets
[
receiverNr
],
blockSize
);
MPIReceiveStations
receiver
(
stationRanks
,
beamlets
[
receiverNr
],
blockSize
);
const
size_t
nrStations
=
stationRanks
.
size
();
const
size_t
nrBeamlets
=
beamlets
[
receiverNr
].
size
();
size_t
block
=
0
;
MultiDimArray
<
struct
MPIReceiveStations
::
Beamlet
<
SampleT
>
,
2
>
block
(
boost
::
extents
[
nrStations
][
nrBeamlets
]);
for
(
size_t
s
=
0
;
s
<
nrStations
;
++
s
)
{
for
(
size_t
b
=
0
;
b
<
nrBeamlets
;
++
b
)
{
block
[
s
][
b
].
samples
.
resize
(
blockSize
);
}
}
size_t
blockIdx
=
0
;
for
(
TimeStamp
current
=
from
;
current
+
blockSize
<
to
;
current
+=
blockSize
)
{
receiver
.
receiveBlock
(
);
receiver
.
receiveBlock
<
SampleT
>
(
block
);
// data is now in receiver.lastBlock
// calculate flagging average
const
size_t
nrStations
=
stationRanks
.
size
();
const
size_t
nrBeamlets
=
beamlets
[
receiverNr
].
size
();
const
size_t
nrSamples
=
nrStations
*
nrBeamlets
*
blockSize
;
size_t
nrFlaggedSamples
=
0
;
for
(
size_t
s
=
0
;
s
<
nrStations
;
++
s
)
{
for
(
size_t
b
=
0
;
b
<
nrBeamlets
;
++
b
)
{
nrFlaggedSamples
=
receiver
.
lastB
lock
[
s
].
flags
[
b
]
.
count
();
nrFlaggedSamples
=
b
lock
[
s
]
[
b
]
.
flags
.
count
();
}
}
float
flagPerc
=
100.0
f
*
nrFlaggedSamples
/
nrSamples
;
LOG_INFO_STR
(
"Receiver "
<<
rank
<<
" received block "
<<
block
<<
" flags: "
<<
flagPerc
<<
"%"
);
++
block
;
LOG_INFO_STR
(
"Receiver "
<<
rank
<<
" received block "
<<
block
Idx
<<
" flags: "
<<
flagPerc
<<
"%"
);
++
block
Idx
;
}
}
...
...
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