Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
fmpi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
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
raphael.bach
fmpi
Commits
54619dc3
Verified
Commit
54619dc3
authored
2 years ago
by
raphael.bach
Browse files
Options
Downloads
Patches
Plain Diff
Fix halo exchange in `fmpi_task_run_sync()`
parent
7c7dc684
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
src/fmpi_task.c
+11
-11
11 additions, 11 deletions
src/fmpi_task.c
with
11 additions
and
11 deletions
src/fmpi_task.c
+
11
−
11
View file @
54619dc3
...
...
@@ -138,34 +138,34 @@ int fmpi_task_run_sync(
memcpy
(
dest
,
src
,
size
);
const
size_t
idx_1
=
type_size
;
const
size_t
idx_n
=
task
->
domains
[
0
].
halo
.
cnt
*
type_size
;
const
size_t
idx_n
p
1
=
idx_n
+
idx_1
;
const
size_t
idx_n
m2
=
(
task
->
domains
[
0
].
halo
.
cnt
-
2
)
*
type_size
;
const
size_t
idx_n
m
1
=
idx_n
m2
+
idx_1
;
void
*
const
buf_0
=
task
->
domains
[
0
].
halo
.
raw
;
const
void
*
const
buf_1
=
(
char
*
)
buf_0
+
idx_1
;
const
void
*
const
buf_n
=
(
char
*
)
buf_0
+
idx_n
;
void
*
const
buf_n
p
1
=
(
char
*
)
buf_0
+
idx_n
p
1
;
const
void
*
const
buf_n
m2
=
(
char
*
)
buf_0
+
idx_n
m2
;
void
*
const
buf_n
m
1
=
(
char
*
)
buf_0
+
idx_n
m
1
;
MPI_Datatype
type
=
fmpi_mpi_type
(
task
->
domains
[
0
].
halo
.
type
.
base
);
if
((
rank
%
2
)
==
0
)
{
int
left
=
(
rank
!=
0
)
?
(
rank
-
1
)
:
MPI_PROC_NULL
;
int
right
=
rank
+
1
;
MPI_Send
(
buf_n
,
1
,
type
,
right
,
0
,
ctx
->
mpi
->
world
);
MPI_Send
(
buf_n
m2
,
1
,
type
,
right
,
0
,
ctx
->
mpi
->
world
);
MPI_Recv
(
buf_0
,
1
,
type
,
left
,
1
,
ctx
->
mpi
->
world
,
MPI_STATUS_IGNORE
);
MPI_Send
(
buf_1
,
1
,
type
,
left
,
0
,
ctx
->
mpi
->
world
);
MPI_Recv
(
buf_n
p
1
,
1
,
type
,
right
,
1
,
ctx
->
mpi
->
world
,
MPI_STATUS_IGNORE
);
MPI_Send
(
buf_1
,
1
,
type
,
left
,
2
,
ctx
->
mpi
->
world
);
MPI_Recv
(
buf_n
m
1
,
1
,
type
,
right
,
3
,
ctx
->
mpi
->
world
,
MPI_STATUS_IGNORE
);
}
else
{
int
left
=
rank
-
1
;
int
right
=
(
rank
!=
(
ctx
->
mpi
->
size
-
1
))
?
(
rank
+
1
)
:
MPI_PROC_NULL
;
MPI_Recv
(
buf_0
,
1
,
type
,
left
,
0
,
ctx
->
mpi
->
world
,
MPI_STATUS_IGNORE
);
MPI_Send
(
buf_n
,
1
,
type
,
right
,
1
,
ctx
->
mpi
->
world
);
MPI_Recv
(
buf_n
p
1
,
1
,
type
,
right
,
0
,
ctx
->
mpi
->
world
,
MPI_STATUS_IGNORE
);
MPI_Send
(
buf_1
,
1
,
type
,
left
,
1
,
ctx
->
mpi
->
world
);
MPI_Send
(
buf_n
m2
,
1
,
type
,
right
,
1
,
ctx
->
mpi
->
world
);
MPI_Recv
(
buf_n
m
1
,
1
,
type
,
right
,
2
,
ctx
->
mpi
->
world
,
MPI_STATUS_IGNORE
);
MPI_Send
(
buf_1
,
1
,
type
,
left
,
3
,
ctx
->
mpi
->
world
);
}
const
int
err
=
fmpi_futhark_free_data_sync
(
ctx
->
fut
,
task
->
args
.
in
[
0
].
gpu
,
task
->
domains
[
0
].
halo
.
type
.
base
,
task
->
domains
[
0
].
halo
.
cnt
task
->
domains
[
0
].
halo
.
dim_
cnt
);
if
(
err
!=
FMPI_SUCCESS
)
{
FMPI_RAISE_ERROR
(
ctx
->
err_handler
,
"FMPI"
,
...
...
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