Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
La programmation parallèle pour les gens
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
baptiste.coudray
La programmation parallèle pour les gens
Commits
c8558fd6
Verified
Commit
c8558fd6
authored
3 years ago
by
baptiste.coudray
Browse files
Options
Downloads
Patches
Plain Diff
Fixed bugs
parent
7573d74e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
futhark_mpi/dispatch.c
+2
-3
2 additions, 3 deletions
futhark_mpi/dispatch.c
futhark_mpi/tests/main.c
+29
-9
29 additions, 9 deletions
futhark_mpi/tests/main.c
with
31 additions
and
12 deletions
futhark_mpi/dispatch.c
+
2
−
3
View file @
c8558fd6
...
...
@@ -1419,7 +1419,7 @@ static envelope_t get_outer_envelope_3d(struct dispatch_context *dc, int thickne
{
// Surface
{
int
dest_source_y
=
(
coordinate_y
+
1
)
%
dc
->
network_dimensions
[
1
];
int
dest_source_y
=
(
coordinate_y
+
1
)
%
dc
->
network_dimensions
[
0
];
int
dest_source
=
INDEX_3D_TO_1D
(
dest_source_y
,
coordinate_x
,
coordinate_z
,
dc
->
network_dimensions
[
1
],
dc
->
network_dimensions
[
2
]);
...
...
@@ -1804,7 +1804,7 @@ static envelope_t get_outer_envelope_3d(struct dispatch_context *dc, int thickne
{
// Surface
{
int
dest_source_y
=
(
coordinate_y
-
1
)
>=
0
?
(
coordinate_y
-
1
)
:
dc
->
network_dimensions
[
1
]
-
1
;
int
dest_source_y
=
(
coordinate_y
-
1
)
>=
0
?
(
coordinate_y
-
1
)
:
dc
->
network_dimensions
[
0
]
-
1
;
int
dest_source
=
INDEX_3D_TO_1D
(
dest_source_y
,
coordinate_x
,
coordinate_z
,
dc
->
network_dimensions
[
1
],
dc
->
network_dimensions
[
2
]);
...
...
@@ -2051,7 +2051,6 @@ static envelope_t get_outer_envelope_3d(struct dispatch_context *dc, int thickne
}
MPI_Waitall
(
i_request
,
requests
,
MPI_STATUSES_IGNORE
);
chunk_info_print
(
outer_envelope
.
front
->
north
);
return
outer_envelope
;
}
...
...
This diff is collapsed.
Click to expand it.
futhark_mpi/tests/main.c
+
29
−
9
View file @
c8558fd6
...
...
@@ -167,13 +167,13 @@ void tests_1_process(struct futhark_context *fc) {
envelope_t
inner_envelope
=
get_inner_envelope
(
dc
,
fc
,
1
);
envelope_init_accessors
(
&
inner_envelope
);
int
expected_north
[]
=
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
};
int
expected_east
[]
=
{
14
,
15
,
16
,
17
,
18
,
19
,
20
,
21
,
22
,
23
};
int
expected_east
[]
=
{
14
,
15
,
16
,
17
,
18
,
19
,
20
,
21
,
22
,
23
};
int
expected_south
[]
=
{
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
19
,
20
,
21
,
22
,
23
};
int
expected_west
[]
=
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
};
int
expected_nw
[]
=
{
0
};
int
expected_ne
[]
=
{
14
};
int
expected_se
[]
=
{
23
};
int
expected_sw
[]
=
{
9
};
int
expected_west
[]
=
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
};
int
expected_nw
[]
=
{
0
};
int
expected_ne
[]
=
{
14
};
int
expected_se
[]
=
{
23
};
int
expected_sw
[]
=
{
9
};
assert
(
memcmp
(
expected_north
,
inner_envelope
.
front
->
north
->
data
,
sizeof
(
expected_north
))
==
0
);
assert
(
memcmp
(
expected_east
,
inner_envelope
.
front
->
east
->
data
,
sizeof
(
expected_east
))
==
0
);
...
...
@@ -306,7 +306,7 @@ void tests_2_processes(int my_rank, struct futhark_context *fc) {
printf
(
"
\t
Testing get_outer_envelope. Thickness = 9...
\n
"
);
{
envelope_t
outer_envelope
=
get_outer_envelope
(
dc
,
fc
,
9
);
if
(
my_rank
==
0
)
{
if
(
my_rank
==
0
)
{
int
expected_west
[]
=
{
0
,
1
,
2
,
3
,
4
,
5
,
6
};
int
expected_east
[]
=
{
0
,
1
,
2
,
3
,
4
,
5
,
6
};
...
...
@@ -410,7 +410,6 @@ void tests_2_processes(int my_rank, struct futhark_context *fc) {
envelope_t
outer_envelope
=
get_outer_envelope
(
dc
,
fc
,
4
);
envelope_free
(
&
outer_envelope
);
}
...
...
@@ -609,7 +608,8 @@ void tests_6_processes(int my_rank, struct futhark_context *fc) {
envelope_free
(
&
outer_envelope
);
dispatch_context_free
(
dc
);
}
printf
(
"Testing dispatch_context_new with 4 processes. Dimensions = 21x42...
\n
"
);
printf
(
"Testing dispatch_context_new with 6 processes. Dimensions = 21x42...
\n
"
);
{
int
dimensions
[
2
]
=
{
21
,
42
};
struct
dispatch_context
*
dc
=
dispatch_context_new
(
dimensions
,
MPI_INT
,
2
);
...
...
@@ -660,6 +660,23 @@ void tests_6_processes(int my_rank, struct futhark_context *fc) {
}
}
void
tests_12_processes
(
int
my_rank
,
struct
futhark_context
*
fc
)
{
printf
(
"Testing dispatch_context_new with 12 processes. Dimensions = 2x2x2...
\n
"
);
{
int
dimensions
[
3
]
=
{
10
,
10
,
3
};
struct
dispatch_context
*
dc
=
dispatch_context_new
(
dimensions
,
MPI_INT
,
3
);
chunk_info_t
ci
=
get_chunk_info
(
dc
);
dispatch_context_print
(
dc
);
chunk_info_print
(
&
ci
);
envelope_t
inner_envelope
=
get_inner_envelope
(
dc
,
fc
,
1
);
envelope_free
(
&
inner_envelope
);
envelope_t
outer_envelope
=
get_outer_envelope
(
dc
,
fc
,
1
);
envelope_free
(
&
outer_envelope
);
dispatch_context_free
(
dc
);
}
}
int
main
(
int
argc
,
char
*
argv
[])
{
MPI_Init
(
&
argc
,
&
argv
);
struct
futhark_context_config
*
fcc
=
futhark_context_config_new
();
...
...
@@ -687,6 +704,9 @@ int main(int argc, char *argv[]) {
case
6
:
tests_6_processes
(
my_rank
,
fc
);
break
;
case
12
:
tests_12_processes
(
my_rank
,
fc
);
break
;
default:
break
;
}
...
...
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