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
2f1c1e5f
Verified
Commit
2f1c1e5f
authored
3 years ago
by
baptiste.coudray
Browse files
Options
Downloads
Patches
Plain Diff
Used context sync
parent
b2501663
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
futhark_mpi/dispatch.c
+26
-11
26 additions, 11 deletions
futhark_mpi/dispatch.c
with
26 additions
and
11 deletions
futhark_mpi/dispatch.c
+
26
−
11
View file @
2f1c1e5f
...
@@ -187,7 +187,10 @@ static envelope_t get_inner_envelope_1d(struct dispatch_context *dc, struct futh
...
@@ -187,7 +187,10 @@ static envelope_t get_inner_envelope_1d(struct dispatch_context *dc, struct futh
int
thickness_x
=
min
(
thickness
,
dc
->
chunk_info
->
dimensions
[
1
]);
int
thickness_x
=
min
(
thickness
,
dc
->
chunk_info
->
dimensions
[
1
]);
int
dimensions
[
2
]
=
{
1
,
thickness_x
};
int
dimensions
[
2
]
=
{
1
,
thickness_x
};
futhark_context_sync
(
fc
);
futhark_entry_get_envelope_1d
(
fc
,
&
fut_west
,
&
fut_east
,
fut_chunk_data
,
dimensions
[
1
]
*
dc
->
type
);
futhark_entry_get_envelope_1d
(
fc
,
&
fut_west
,
&
fut_east
,
fut_chunk_data
,
dimensions
[
1
]
*
dc
->
type
);
futhark_context_sync
(
fc
);
futhark_free_u8_1d
(
fc
,
fut_chunk_data
);
envelope_t
inner_envelope
=
(
envelope_t
)
{
0
};
envelope_t
inner_envelope
=
(
envelope_t
)
{
0
};
// West
// West
...
@@ -195,17 +198,17 @@ static envelope_t get_inner_envelope_1d(struct dispatch_context *dc, struct futh
...
@@ -195,17 +198,17 @@ static envelope_t get_inner_envelope_1d(struct dispatch_context *dc, struct futh
int
start_x
=
dc
->
chunk_info
->
x
;
int
start_x
=
dc
->
chunk_info
->
x
;
chunk_info_init
(
&
inner_envelope
.
west
,
dc
->
type
,
dimensions
,
0
,
start_x
,
true
);
chunk_info_init
(
&
inner_envelope
.
west
,
dc
->
type
,
dimensions
,
0
,
start_x
,
true
);
futhark_values_u8_1d
(
fc
,
fut_west
,
inner_envelope
.
west
.
data
);
futhark_values_u8_1d
(
fc
,
fut_west
,
inner_envelope
.
west
.
data
);
futhark_free_u8_1d
(
fc
,
fut_west
);
}
}
// East
// East
{
{
int
start_x
=
dc
->
chunk_info
->
x
+
dc
->
chunk_info
->
dimensions
[
1
]
-
thickness_x
;
int
start_x
=
dc
->
chunk_info
->
x
+
dc
->
chunk_info
->
dimensions
[
1
]
-
thickness_x
;
chunk_info_init
(
&
inner_envelope
.
east
,
dc
->
type
,
dimensions
,
0
,
start_x
,
true
);
chunk_info_init
(
&
inner_envelope
.
east
,
dc
->
type
,
dimensions
,
0
,
start_x
,
true
);
futhark_values_u8_1d
(
fc
,
fut_east
,
inner_envelope
.
east
.
data
);
futhark_values_u8_1d
(
fc
,
fut_east
,
inner_envelope
.
east
.
data
);
futhark_free_u8_1d
(
fc
,
fut_east
);
}
}
futhark_free_u8_1d
(
fc
,
fut_chunk_data
);
futhark_context_sync
(
fc
);
futhark_free_u8_1d
(
fc
,
fut_west
);
futhark_free_u8_1d
(
fc
,
fut_east
);
return
inner_envelope
;
return
inner_envelope
;
}
}
...
@@ -226,9 +229,12 @@ static envelope_t get_inner_envelope_2d(struct dispatch_context *dc, struct futh
...
@@ -226,9 +229,12 @@ static envelope_t get_inner_envelope_2d(struct dispatch_context *dc, struct futh
int
thickness_y
=
min
(
thickness
,
dc
->
chunk_info
->
dimensions
[
0
]);
int
thickness_y
=
min
(
thickness
,
dc
->
chunk_info
->
dimensions
[
0
]);
int
thickness_x
=
min
(
thickness
,
dc
->
chunk_info
->
dimensions
[
1
]);
int
thickness_x
=
min
(
thickness
,
dc
->
chunk_info
->
dimensions
[
1
]);
futhark_context_sync
(
fc
);
futhark_entry_get_envelope_2d
(
fc
,
&
fut_north
,
&
fut_north_east
,
&
fut_east
,
&
fut_south_east
,
&
fut_south
,
futhark_entry_get_envelope_2d
(
fc
,
&
fut_north
,
&
fut_north_east
,
&
fut_east
,
&
fut_south_east
,
&
fut_south
,
&
fut_south_west
,
&
fut_west
,
&
fut_north_west
,
fut_chunk_data
,
thickness_y
,
&
fut_south_west
,
&
fut_west
,
&
fut_north_west
,
fut_chunk_data
,
thickness_y
,
thickness_x
*
dc
->
type
);
thickness_x
*
dc
->
type
);
futhark_context_sync
(
fc
);
futhark_free_u8_2d
(
fc
,
fut_chunk_data
);
envelope_t
inner_envelope
=
(
envelope_t
)
{
0
};
envelope_t
inner_envelope
=
(
envelope_t
)
{
0
};
...
@@ -239,8 +245,8 @@ static envelope_t get_inner_envelope_2d(struct dispatch_context *dc, struct futh
...
@@ -239,8 +245,8 @@ static envelope_t get_inner_envelope_2d(struct dispatch_context *dc, struct futh
int
start_x
=
dc
->
chunk_info
->
x
;
int
start_x
=
dc
->
chunk_info
->
x
;
chunk_info_init
(
&
inner_envelope
.
north_west
,
dc
->
type
,
dimensions
,
start_y
,
start_x
,
true
);
chunk_info_init
(
&
inner_envelope
.
north_west
,
dc
->
type
,
dimensions
,
start_y
,
start_x
,
true
);
futhark_values_u8_2d
(
fc
,
fut_north_west
,
inner_envelope
.
north_west
.
data
);
futhark_values_u8_2d
(
fc
,
fut_north_west
,
inner_envelope
.
north_west
.
data
);
futhark_free_u8_2d
(
fc
,
fut_north_west
);
}
}
// North
// North
{
{
int
dimensions
[
2
]
=
{
thickness_y
,
dc
->
chunk_info
->
dimensions
[
1
]};
int
dimensions
[
2
]
=
{
thickness_y
,
dc
->
chunk_info
->
dimensions
[
1
]};
...
@@ -248,8 +254,8 @@ static envelope_t get_inner_envelope_2d(struct dispatch_context *dc, struct futh
...
@@ -248,8 +254,8 @@ static envelope_t get_inner_envelope_2d(struct dispatch_context *dc, struct futh
int
start_x
=
dc
->
chunk_info
->
x
;
int
start_x
=
dc
->
chunk_info
->
x
;
chunk_info_init
(
&
inner_envelope
.
north
,
dc
->
type
,
dimensions
,
start_y
,
start_x
,
true
);
chunk_info_init
(
&
inner_envelope
.
north
,
dc
->
type
,
dimensions
,
start_y
,
start_x
,
true
);
futhark_values_u8_2d
(
fc
,
fut_north
,
inner_envelope
.
north
.
data
);
futhark_values_u8_2d
(
fc
,
fut_north
,
inner_envelope
.
north
.
data
);
futhark_free_u8_2d
(
fc
,
fut_north
);
}
}
// North-East
// North-East
{
{
int
dimensions
[
2
]
=
{
thickness_y
,
thickness_x
};
int
dimensions
[
2
]
=
{
thickness_y
,
thickness_x
};
...
@@ -257,8 +263,8 @@ static envelope_t get_inner_envelope_2d(struct dispatch_context *dc, struct futh
...
@@ -257,8 +263,8 @@ static envelope_t get_inner_envelope_2d(struct dispatch_context *dc, struct futh
int
start_x
=
dc
->
chunk_info
->
x
+
dc
->
chunk_info
->
dimensions
[
1
]
-
thickness_x
;
int
start_x
=
dc
->
chunk_info
->
x
+
dc
->
chunk_info
->
dimensions
[
1
]
-
thickness_x
;
chunk_info_init
(
&
inner_envelope
.
north_east
,
dc
->
type
,
dimensions
,
start_y
,
start_x
,
true
);
chunk_info_init
(
&
inner_envelope
.
north_east
,
dc
->
type
,
dimensions
,
start_y
,
start_x
,
true
);
futhark_values_u8_2d
(
fc
,
fut_north_east
,
inner_envelope
.
north_east
.
data
);
futhark_values_u8_2d
(
fc
,
fut_north_east
,
inner_envelope
.
north_east
.
data
);
futhark_free_u8_2d
(
fc
,
fut_north_east
);
}
}
// West
// West
{
{
int
dimensions
[
2
]
=
{
dc
->
chunk_info
->
dimensions
[
0
],
thickness_x
};
int
dimensions
[
2
]
=
{
dc
->
chunk_info
->
dimensions
[
0
],
thickness_x
};
...
@@ -266,8 +272,8 @@ static envelope_t get_inner_envelope_2d(struct dispatch_context *dc, struct futh
...
@@ -266,8 +272,8 @@ static envelope_t get_inner_envelope_2d(struct dispatch_context *dc, struct futh
int
start_x
=
dc
->
chunk_info
->
x
;
int
start_x
=
dc
->
chunk_info
->
x
;
chunk_info_init
(
&
inner_envelope
.
west
,
dc
->
type
,
dimensions
,
start_y
,
start_x
,
true
);
chunk_info_init
(
&
inner_envelope
.
west
,
dc
->
type
,
dimensions
,
start_y
,
start_x
,
true
);
futhark_values_u8_2d
(
fc
,
fut_west
,
inner_envelope
.
west
.
data
);
futhark_values_u8_2d
(
fc
,
fut_west
,
inner_envelope
.
west
.
data
);
futhark_free_u8_2d
(
fc
,
fut_west
);
}
}
// East
// East
{
{
int
dimensions
[
2
]
=
{
dc
->
chunk_info
->
dimensions
[
0
],
thickness_x
};
int
dimensions
[
2
]
=
{
dc
->
chunk_info
->
dimensions
[
0
],
thickness_x
};
...
@@ -275,8 +281,8 @@ static envelope_t get_inner_envelope_2d(struct dispatch_context *dc, struct futh
...
@@ -275,8 +281,8 @@ static envelope_t get_inner_envelope_2d(struct dispatch_context *dc, struct futh
int
start_x
=
dc
->
chunk_info
->
x
+
dc
->
chunk_info
->
dimensions
[
1
]
-
thickness_x
;
int
start_x
=
dc
->
chunk_info
->
x
+
dc
->
chunk_info
->
dimensions
[
1
]
-
thickness_x
;
chunk_info_init
(
&
inner_envelope
.
east
,
dc
->
type
,
dimensions
,
start_y
,
start_x
,
true
);
chunk_info_init
(
&
inner_envelope
.
east
,
dc
->
type
,
dimensions
,
start_y
,
start_x
,
true
);
futhark_values_u8_2d
(
fc
,
fut_east
,
inner_envelope
.
east
.
data
);
futhark_values_u8_2d
(
fc
,
fut_east
,
inner_envelope
.
east
.
data
);
futhark_free_u8_2d
(
fc
,
fut_east
);
}
}
// South-West
// South-West
{
{
int
dimensions
[
2
]
=
{
thickness_y
,
thickness_x
};
int
dimensions
[
2
]
=
{
thickness_y
,
thickness_x
};
...
@@ -284,8 +290,8 @@ static envelope_t get_inner_envelope_2d(struct dispatch_context *dc, struct futh
...
@@ -284,8 +290,8 @@ static envelope_t get_inner_envelope_2d(struct dispatch_context *dc, struct futh
int
start_x
=
dc
->
chunk_info
->
x
;
int
start_x
=
dc
->
chunk_info
->
x
;
chunk_info_init
(
&
inner_envelope
.
south_west
,
dc
->
type
,
dimensions
,
start_y
,
start_x
,
true
);
chunk_info_init
(
&
inner_envelope
.
south_west
,
dc
->
type
,
dimensions
,
start_y
,
start_x
,
true
);
futhark_values_u8_2d
(
fc
,
fut_south_west
,
inner_envelope
.
south_west
.
data
);
futhark_values_u8_2d
(
fc
,
fut_south_west
,
inner_envelope
.
south_west
.
data
);
futhark_free_u8_2d
(
fc
,
fut_south_west
);
}
}
// South
// South
{
{
int
dimensions
[
2
]
=
{
thickness_y
,
dc
->
chunk_info
->
dimensions
[
1
]};
int
dimensions
[
2
]
=
{
thickness_y
,
dc
->
chunk_info
->
dimensions
[
1
]};
...
@@ -293,8 +299,8 @@ static envelope_t get_inner_envelope_2d(struct dispatch_context *dc, struct futh
...
@@ -293,8 +299,8 @@ static envelope_t get_inner_envelope_2d(struct dispatch_context *dc, struct futh
int
start_x
=
dc
->
chunk_info
->
x
;
int
start_x
=
dc
->
chunk_info
->
x
;
chunk_info_init
(
&
inner_envelope
.
south
,
dc
->
type
,
dimensions
,
start_y
,
start_x
,
true
);
chunk_info_init
(
&
inner_envelope
.
south
,
dc
->
type
,
dimensions
,
start_y
,
start_x
,
true
);
futhark_values_u8_2d
(
fc
,
fut_south
,
inner_envelope
.
south
.
data
);
futhark_values_u8_2d
(
fc
,
fut_south
,
inner_envelope
.
south
.
data
);
futhark_free_u8_2d
(
fc
,
fut_south
);
}
}
// South-East
// South-East
{
{
int
dimensions
[
2
]
=
{
thickness_y
,
thickness_x
};
int
dimensions
[
2
]
=
{
thickness_y
,
thickness_x
};
...
@@ -302,8 +308,17 @@ static envelope_t get_inner_envelope_2d(struct dispatch_context *dc, struct futh
...
@@ -302,8 +308,17 @@ static envelope_t get_inner_envelope_2d(struct dispatch_context *dc, struct futh
int
start_x
=
dc
->
chunk_info
->
x
+
dc
->
chunk_info
->
dimensions
[
1
]
-
thickness_x
;
int
start_x
=
dc
->
chunk_info
->
x
+
dc
->
chunk_info
->
dimensions
[
1
]
-
thickness_x
;
chunk_info_init
(
&
inner_envelope
.
south_east
,
dc
->
type
,
dimensions
,
start_y
,
start_x
,
true
);
chunk_info_init
(
&
inner_envelope
.
south_east
,
dc
->
type
,
dimensions
,
start_y
,
start_x
,
true
);
futhark_values_u8_2d
(
fc
,
fut_south_east
,
inner_envelope
.
south_east
.
data
);
futhark_values_u8_2d
(
fc
,
fut_south_east
,
inner_envelope
.
south_east
.
data
);
futhark_free_u8_2d
(
fc
,
fut_south_east
);
}
}
futhark_context_sync
(
fc
);
futhark_free_u8_2d
(
fc
,
fut_north_west
);
futhark_free_u8_2d
(
fc
,
fut_north
);
futhark_free_u8_2d
(
fc
,
fut_north_east
);
futhark_free_u8_2d
(
fc
,
fut_west
);
futhark_free_u8_2d
(
fc
,
fut_east
);
futhark_free_u8_2d
(
fc
,
fut_south_west
);
futhark_free_u8_2d
(
fc
,
fut_south
);
futhark_free_u8_2d
(
fc
,
fut_south_east
);
return
inner_envelope
;
return
inner_envelope
;
}
}
...
...
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