Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
I
idg
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
7
Issues
7
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
8
Merge Requests
8
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ResearchAndDevelopment
idg
Commits
9979b170
Commit
9979b170
authored
Jan 11, 2021
by
Bram Veenboer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New threading strategy for reduce_grids
parent
708eea08
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
23 deletions
+29
-23
idg-bin/examples/cxx/distributed/common.h
idg-bin/examples/cxx/distributed/common.h
+29
-23
No files found.
idg-bin/examples/cxx/distributed/common.h
View file @
9979b170
...
...
@@ -242,44 +242,50 @@ void reduce_grids(
unsigned
int
rank
,
unsigned
int
world_size
)
{
unsigned
int
nr_w_layers
=
grid
->
get_w_dim
();
unsigned
int
w
=
0
;
// W-stacking is handled by the workers
unsigned
int
grid_size
=
grid
->
get_y_dim
();
#pragma omp parallel for
for
(
unsigned
int
y
=
0
;
y
<
grid_size
;
y
++
)
{
idg
::
Array1D
<
std
::
complex
<
float
>>
row
(
grid_size
);
idg
::
Array2D
<
std
::
complex
<
float
>>
tmp
(
grid_size
,
grid_size
);
size_t
sizeof_row
=
grid_size
*
sizeof
(
std
::
complex
<
float
>
);
for
(
unsigned
int
w
=
0
;
w
<
nr_w_layers
;
w
++
)
#pragma omp parallel
{
for
(
unsigned
int
pol
=
0
;
pol
<
NR_POLARIZATIONS
;
pol
++
)
{
for
(
unsigned
int
pol
=
0
;
pol
<
NR_POLARIZATIONS
;
pol
++
)
for
(
unsigned
int
i
=
(
world_size
+
1
)
/
2
;
i
>
0
;
i
/=
2
)
{
for
(
unsigned
int
i
=
(
world_size
+
1
)
/
2
;
i
>
0
;
i
/=
2
)
if
((
unsigned
int
)
rank
<
i
)
{
if
(
(
unsigned
int
)
rank
<
i
)
if
(
omp_get_thread_num
()
==
0
)
{
#pragma omp critical
MPIRequestList
requests
;
for
(
unsigned
int
y
=
0
;
y
<
grid_size
;
y
++
)
{
MPIRequest
request
(
true
);
request
.
receive
(
row
.
data
(),
row
.
bytes
(),
i
+
rank
);
requests
.
create
()
->
receive
(
tmp
.
data
(
y
,
0
),
sizeof_row
,
i
+
rank
);
}
requests
.
wait
();
}
auto
&
grid_
=
*
grid
;
#pragma omp barrier
#pragma omp for
for
(
unsigned
int
y
=
0
;
y
<
grid_size
;
y
++
)
for
(
unsigned
int
x
=
0
;
x
<
grid_size
;
x
++
)
{
auto
&
grid_
=
*
grid
;
row
(
x
)
+=
grid_
(
w
,
pol
,
y
,
x
);
}
}
else
if
(
rank
<
(
2
*
i
))
{
#pragma omp critical
{
MPIRequest
request
(
true
);
request
.
send
(
row
.
data
(),
row
.
bytes
(),
rank
-
i
);
grid_
(
w
,
pol
,
y
,
x
)
+=
*
tmp
.
data
(
y
,
x
);
}
}
else
if
(
rank
<
(
2
*
i
)
&&
omp_get_thread_num
()
==
0
)
{
MPIRequestList
requests
;
for
(
unsigned
int
y
=
0
;
y
<
grid_size
;
y
++
)
{
requests
.
create
()
->
send
(
tmp
.
data
(
y
,
0
),
sizeof_row
,
rank
-
i
);
}
}
}
}
}
}
// end for i
}
// end for pol
}
// end pragma parallel
}
void
broadcast_grid
(
...
...
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