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
fcf25c4c
Verified
Commit
fcf25c4c
authored
3 years ago
by
baptiste.coudray
Browse files
Options
Downloads
Patches
Plain Diff
Added dump board
parent
047be592
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
game_of_life/benchmark/main.c
+12
-1
12 additions, 1 deletion
game_of_life/benchmark/main.c
with
12 additions
and
1 deletion
game_of_life/benchmark/main.c
+
12
−
1
View file @
fcf25c4c
...
@@ -79,6 +79,16 @@ void compute_next_chunk_board(struct dispatch_context *dc, struct futhark_contex
...
@@ -79,6 +79,16 @@ void compute_next_chunk_board(struct dispatch_context *dc, struct futhark_contex
envelope_free
(
&
outer_envelope
);
envelope_free
(
&
outer_envelope
);
}
}
void
dump_board
(
struct
dispatch_context
*
dc
,
int
world_size
)
{
int8_t
*
data
=
get_data
(
dc
);
chunk_info_t
ci
=
get_chunk_info
(
dc
);
char
filename
[
25
]
=
{
0
};
snprintf
(
filename
,
sizeof
(
filename
),
"dump-%d.bin"
,
world_size
);
FILE
*
fp
=
fopen
(
filename
,
"w"
);
fwrite
(
data
,
sizeof
(
int8_t
),
(
size_t
)
ci
.
count
,
fp
);
fclose
(
fp
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
int
main
(
int
argc
,
char
*
argv
[])
{
if
(
argc
<
4
)
{
if
(
argc
<
4
)
{
printf
(
"usage: mpirun -n <nb_proc> %s <nb_devices> <height> <width>
\n
"
,
argv
[
0
]);
printf
(
"usage: mpirun -n <nb_proc> %s <nb_devices> <height> <width>
\n
"
,
argv
[
0
]);
...
@@ -109,7 +119,8 @@ int main(int argc, char *argv[]) {
...
@@ -109,7 +119,8 @@ int main(int argc, char *argv[]) {
double
start
=
MPI_Wtime
();
double
start
=
MPI_Wtime
();
compute_next_chunk_board
(
disp_context
,
fut_context
,
&
ci
);
compute_next_chunk_board
(
disp_context
,
fut_context
,
&
ci
);
double
finish
=
MPI_Wtime
();
double
finish
=
MPI_Wtime
();
if
(
my_rank
==
ROOT_RANK
)
{
if
(
my_rank
==
ROOT_RANK
)
{
dump_board
(
disp_context
,
world_size
);
printf
(
"%d;%d;%d;%d;%f
\n
"
,
world_size
,
nb_devices
,
board_n
,
board_m
,
finish
-
start
);
printf
(
"%d;%d;%d;%d;%f
\n
"
,
world_size
,
nb_devices
,
board_n
,
board_m
,
finish
-
start
);
}
}
...
...
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