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
6b15ec66
Verified
Commit
6b15ec66
authored
3 years ago
by
baptiste.coudray
Browse files
Options
Downloads
Patches
Plain Diff
Updated bench
parent
96d63367
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
elementary/benchmark/main.c
+12
-8
12 additions, 8 deletions
elementary/benchmark/main.c
slurm_gen.py
+1
-1
1 addition, 1 deletion
slurm_gen.py
with
13 additions
and
9 deletions
elementary/benchmark/main.c
+
12
−
8
View file @
6b15ec66
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
#define N_MEASURES 15
#define N_MEASURES 15
#if defined(FUTHARK_BACKEND_cuda) || defined(FUTHARK_BACKEND_opencl)
#if defined(FUTHARK_BACKEND_cuda) || defined(FUTHARK_BACKEND_opencl)
#define N_ITERATIONS
3
00
#define N_ITERATIONS
5
00
#else
#else
#define N_ITERATIONS 100
#define N_ITERATIONS 100
#endif
#endif
...
@@ -29,18 +29,26 @@ void init_chunk_elems(chunk_info_t *ci) {
...
@@ -29,18 +29,26 @@ void init_chunk_elems(chunk_info_t *ci) {
}
}
}
}
void
compute_next_chunk_elems
(
struct
dispatch_context
*
dc
,
struct
futhark_context
*
fc
,
chunk_info_t
*
ci
)
{
double
compute_next_chunk_elems
(
struct
dispatch_context
*
dc
,
struct
futhark_context
*
fc
,
chunk_info_t
*
ci
)
{
struct
futhark_i8_1d
*
fut_chunk_with_envelope
=
get_chunk_with_envelope
(
dc
,
fc
,
1
,
futhark_new_i8_1d
);
struct
futhark_i8_1d
*
fut_chunk_with_envelope
=
get_chunk_with_envelope
(
dc
,
fc
,
1
,
futhark_new_i8_1d
);
// Warmup
struct
futhark_i8_1d
*
fut_next_chunk_elems
;
struct
futhark_i8_1d
*
fut_next_chunk_elems
;
futhark_entry_next_chunk_elems
(
fc
,
&
fut_next_chunk_elems
,
fut_chunk_with_envelope
);
futhark_entry_next_chunk_elems
(
fc
,
&
fut_next_chunk_elems
,
fut_chunk_with_envelope
);
futhark_context_sync
(
fc
);
futhark_context_sync
(
fc
);
double
start
=
MPI_Wtime
();
for
(
int
i
=
0
;
i
<
N_ITERATIONS
;
++
i
)
{
futhark_entry_next_chunk_elems
(
fc
,
&
fut_next_chunk_elems
,
fut_chunk_with_envelope
);
futhark_context_sync
(
fc
);
}
futhark_values_i8_1d
(
fc
,
fut_next_chunk_elems
,
ci
->
data
);
futhark_values_i8_1d
(
fc
,
fut_next_chunk_elems
,
ci
->
data
);
futhark_context_sync
(
fc
);
futhark_context_sync
(
fc
);
double
finish
=
MPI_Wtime
();
futhark_free_i8_1d
(
fc
,
fut_chunk_with_envelope
);
futhark_free_i8_1d
(
fc
,
fut_chunk_with_envelope
);
futhark_free_i8_1d
(
fc
,
fut_next_chunk_elems
);
futhark_free_i8_1d
(
fc
,
fut_next_chunk_elems
);
return
finish
-
start
;
}
}
int
main
(
int
argc
,
char
*
argv
[])
{
int
main
(
int
argc
,
char
*
argv
[])
{
...
@@ -74,13 +82,9 @@ int main(int argc, char *argv[]) {
...
@@ -74,13 +82,9 @@ int main(int argc, char *argv[]) {
init_chunk_elems
(
&
ci
);
init_chunk_elems
(
&
ci
);
for
(
int
i
=
0
;
i
<
N_MEASURES
;
++
i
)
{
for
(
int
i
=
0
;
i
<
N_MEASURES
;
++
i
)
{
double
start
=
MPI_Wtime
();
double
time
=
compute_next_chunk_elems
(
disp_context
,
fut_context
,
&
ci
);
for
(
int
j
=
0
;
j
<
N_ITERATIONS
;
++
j
)
{
compute_next_chunk_elems
(
disp_context
,
fut_context
,
&
ci
);
}
double
finish
=
MPI_Wtime
();
if
(
my_rank
==
ROOT_RANK
)
{
if
(
my_rank
==
ROOT_RANK
)
{
printf
(
"%d;%d;%d;%f
\n
"
,
world_size
,
nb_devices
,
elems_n
,
finish
-
start
);
printf
(
"%d;%d;%d;%f
\n
"
,
world_size
,
nb_devices
,
elems_n
,
time
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
slurm_gen.py
+
1
−
1
View file @
6b15ec66
...
@@ -10,7 +10,7 @@ def slurm_gpu(file, version, ntasks, mem_per_cpu, time):
...
@@ -10,7 +10,7 @@ def slurm_gpu(file, version, ntasks, mem_per_cpu, time):
#SBATCH --ntasks=
{
ntasks
}
#SBATCH --ntasks=
{
ntasks
}
#SBATCH --cpus-per-task=1
#SBATCH --cpus-per-task=1
#SBATCH --partition=shared-gpu
#SBATCH --partition=shared-gpu
#SBATCH --gpus=
ampere
:
{
min
(
ntasks
,
2
)
}
#SBATCH --gpus=
rtx
:
{
min
(
ntasks
,
8
)
}
#SBATCH --mem-per-cpu=
{
mem_per_cpu
}
#SBATCH --mem-per-cpu=
{
mem_per_cpu
}
#SBATCH --time=
{
time
}
#SBATCH --time=
{
time
}
...
...
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