Skip to content
Snippets Groups Projects
Verified Commit d0cf3f2a authored by baptiste.coudray's avatar baptiste.coudray
Browse files

Updated bench and created method to create type

parent 5a605979
No related branches found
No related tags found
No related merge requests found
...@@ -58,48 +58,3 @@ ...@@ -58,48 +58,3 @@
8;8;300000000;20.691036 8;8;300000000;20.691036
8;8;300000000;20.691243 8;8;300000000;20.691243
8;8;300000000;20.692818 8;8;300000000;20.692818
16;8;300000000;30.566675
16;8;300000000;30.665124
16;8;300000000;30.685581
16;8;300000000;30.689199
16;8;300000000;30.743035
16;8;300000000;30.748723
16;8;300000000;30.751647
16;8;300000000;30.776734
16;8;300000000;30.786695
16;8;300000000;30.790243
16;8;300000000;30.791904
16;8;300000000;30.793043
16;8;300000000;30.795823
16;8;300000000;30.806600
16;8;300000000;30.846490
32;8;300000000;42.093851
32;8;300000000;42.170424
32;8;300000000;42.217417
32;8;300000000;42.242545
32;8;300000000;42.319022
32;8;300000000;42.322465
32;8;300000000;42.329671
32;8;300000000;42.445236
32;8;300000000;42.445338
32;8;300000000;42.445390
32;8;300000000;42.445987
32;8;300000000;42.448974
32;8;300000000;42.449035
32;8;300000000;42.450328
32;8;300000000;42.459073
64;8;300000000;65.154755
64;8;300000000;65.209561
64;8;300000000;65.211760
64;8;300000000;65.211950
64;8;300000000;65.212586
64;8;300000000;65.212770
64;8;300000000;65.219746
64;8;300000000;65.219890
64;8;300000000;65.221922
64;8;300000000;65.222096
64;8;300000000;65.222844
64;8;300000000;65.223570
64;8;300000000;65.225363
64;8;300000000;65.315617
64;8;300000000;65.335164
...@@ -58,48 +58,3 @@ ...@@ -58,48 +58,3 @@
8;8;300000000;21.472207 8;8;300000000;21.472207
8;8;300000000;21.472531 8;8;300000000;21.472531
8;8;300000000;21.475632 8;8;300000000;21.475632
16;8;300000000;31.501247
16;8;300000000;31.628972
16;8;300000000;31.653815
16;8;300000000;31.657964
16;8;300000000;31.672123
16;8;300000000;31.675078
16;8;300000000;31.680846
16;8;300000000;31.681580
16;8;300000000;31.683500
16;8;300000000;31.684660
16;8;300000000;31.691426
16;8;300000000;31.697524
16;8;300000000;31.716353
16;8;300000000;31.717021
16;8;300000000;31.776415
32;8;300000000;43.400566
32;8;300000000;43.469029
32;8;300000000;43.480339
32;8;300000000;43.658874
32;8;300000000;43.695331
32;8;300000000;43.700740
32;8;300000000;43.702246
32;8;300000000;43.702793
32;8;300000000;43.702851
32;8;300000000;43.703246
32;8;300000000;43.703922
32;8;300000000;43.704707
32;8;300000000;43.704912
32;8;300000000;43.706362
32;8;300000000;43.707016
64;8;300000000;66.768059
64;8;300000000;66.826358
64;8;300000000;67.135115
64;8;300000000;67.139673
64;8;300000000;67.140359
64;8;300000000;67.141521
64;8;300000000;67.141808
64;8;300000000;67.141925
64;8;300000000;67.142367
64;8;300000000;67.142410
64;8;300000000;67.142501
64;8;300000000;67.144063
64;8;300000000;67.144562
64;8;300000000;67.144587
64;8;300000000;67.146298
...@@ -331,6 +331,20 @@ static int cart_rank_to_comm_rank(struct dispatch_context *dc, int y, int x, int ...@@ -331,6 +331,20 @@ static int cart_rank_to_comm_rank(struct dispatch_context *dc, int y, int x, int
return rank; return rank;
} }
extern MPI_Datatype create_type(int count, int *block_lengths, MPI_Aint *displacements, MPI_Datatype *types) {
// https://stackoverflow.com/a/33624425
MPI_Datatype tmp_type, new_type;
MPI_Aint lb, extent;
MPI_Type_create_struct(count, block_lengths, displacements, types, &tmp_type);
MPI_Type_get_extent(tmp_type, &lb, &extent);
MPI_Type_create_resized(tmp_type, lb, extent, &new_type);
MPI_Type_commit(&new_type);
MPI_Type_free(&tmp_type);
return new_type;
}
extern struct dispatch_context *dispatch_context_new(const int *dimensions, MPI_Datatype datatype, int n_dimensions) { extern struct dispatch_context *dispatch_context_new(const int *dimensions, MPI_Datatype datatype, int n_dimensions) {
struct dispatch_context *dc = calloc(1, sizeof(struct dispatch_context)); struct dispatch_context *dc = calloc(1, sizeof(struct dispatch_context));
assert(dc != NULL); assert(dc != NULL);
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
//#include "envelope.h" //#include "envelope.h"
//#include "../elementary/elementary.h" //#include "../elementary/elementary.h"
#include "../game_of_life/gol.h" //#include "../game_of_life/gol.h"
//#include "../lattice_boltzmann/lbm.h" #include "../lattice_boltzmann/lbm.h"
#include "chunk_info.h" #include "chunk_info.h"
#define NB_SIDES 6 #define NB_SIDES 6
...@@ -52,6 +52,8 @@ typedef struct envelope { ...@@ -52,6 +52,8 @@ typedef struct envelope {
side_envelope_t *top; side_envelope_t *top;
} envelope_t; } envelope_t;
extern MPI_Datatype create_type(int count, int *block_lengths, MPI_Aint *displacements, MPI_Datatype *types);
extern struct dispatch_context *dispatch_context_new(const int *dimensions, MPI_Datatype datatype, int n_dimensions); extern struct dispatch_context *dispatch_context_new(const int *dimensions, MPI_Datatype datatype, int n_dimensions);
extern void dispatch_context_print(struct dispatch_context *dc); extern void dispatch_context_print(struct dispatch_context *dc);
...@@ -67,6 +69,7 @@ extern void *get_chunk_with_envelope(struct dispatch_context *dc, struct futhark ...@@ -67,6 +69,7 @@ extern void *get_chunk_with_envelope(struct dispatch_context *dc, struct futhark
extern void *get_data(struct dispatch_context *dc); extern void *get_data(struct dispatch_context *dc);
extern void dispatch_context_free(struct dispatch_context *dc); extern void dispatch_context_free(struct dispatch_context *dc);
extern void envelope_free(envelope_t *envelope); extern void envelope_free(envelope_t *envelope);
......
...@@ -58,48 +58,3 @@ ...@@ -58,48 +58,3 @@
8;8;30000;30000;27.798737 8;8;30000;30000;27.798737
8;8;30000;30000;27.815021 8;8;30000;30000;27.815021
8;8;30000;30000;27.826295 8;8;30000;30000;27.826295
16;8;30000;30000;29.074328
16;8;30000;30000;29.112275
16;8;30000;30000;29.117721
16;8;30000;30000;29.121597
16;8;30000;30000;29.131927
16;8;30000;30000;29.132829
16;8;30000;30000;29.146945
16;8;30000;30000;29.150942
16;8;30000;30000;29.153732
16;8;30000;30000;29.172004
16;8;30000;30000;29.193178
16;8;30000;30000;29.201672
16;8;30000;30000;29.202289
16;8;30000;30000;29.300349
16;8;30000;30000;29.397447
32;8;30000;30000;30.674229
32;8;30000;30000;30.791660
32;8;30000;30000;30.823414
32;8;30000;30000;30.841654
32;8;30000;30000;30.850593
32;8;30000;30000;30.852768
32;8;30000;30000;30.854569
32;8;30000;30000;30.854929
32;8;30000;30000;30.858555
32;8;30000;30000;30.866677
32;8;30000;30000;30.872519
32;8;30000;30000;30.872550
32;8;30000;30000;30.873322
32;8;30000;30000;30.879249
32;8;30000;30000;30.888604
64;8;30000;30000;33.860321
64;8;30000;30000;34.090952
64;8;30000;30000;34.119046
64;8;30000;30000;34.129923
64;8;30000;30000;34.131821
64;8;30000;30000;34.168136
64;8;30000;30000;34.182539
64;8;30000;30000;34.182568
64;8;30000;30000;34.194283
64;8;30000;30000;34.265466
64;8;30000;30000;34.281869
64;8;30000;30000;34.283865
64;8;30000;30000;34.288860
64;8;30000;30000;34.324506
64;8;30000;30000;34.379328
...@@ -58,48 +58,3 @@ ...@@ -58,48 +58,3 @@
8;8;30000;30000;29.231654 8;8;30000;30000;29.231654
8;8;30000;30000;29.233672 8;8;30000;30000;29.233672
8;8;30000;30000;29.241354 8;8;30000;30000;29.241354
16;8;30000;30000;30.364662
16;8;30000;30000;30.514452
16;8;30000;30000;30.519344
16;8;30000;30000;30.529802
16;8;30000;30000;30.541250
16;8;30000;30000;30.545246
16;8;30000;30000;30.548219
16;8;30000;30000;30.557562
16;8;30000;30000;30.604398
16;8;30000;30000;30.619631
16;8;30000;30000;30.623049
16;8;30000;30000;30.658525
16;8;30000;30000;30.666100
16;8;30000;30000;30.670842
16;8;30000;30000;30.727994
32;8;30000;30000;32.178110
32;8;30000;30000;32.265832
32;8;30000;30000;32.295822
32;8;30000;30000;32.325825
32;8;30000;30000;32.326848
32;8;30000;30000;32.330577
32;8;30000;30000;32.334370
32;8;30000;30000;32.338229
32;8;30000;30000;32.338720
32;8;30000;30000;32.345294
32;8;30000;30000;32.346261
32;8;30000;30000;32.351951
32;8;30000;30000;32.355072
32;8;30000;30000;32.356221
32;8;30000;30000;32.356526
64;8;30000;30000;35.175697
64;8;30000;30000;35.383526
64;8;30000;30000;35.447691
64;8;30000;30000;35.471398
64;8;30000;30000;35.567363
64;8;30000;30000;35.578794
64;8;30000;30000;35.579169
64;8;30000;30000;35.581673
64;8;30000;30000;35.585368
64;8;30000;30000;35.605641
64;8;30000;30000;35.610110
64;8;30000;30000;35.622752
64;8;30000;30000;35.637559
64;8;30000;30000;35.648361
64;8;30000;30000;35.764523
...@@ -83,25 +83,18 @@ int main(int argc, char *argv[]) { ...@@ -83,25 +83,18 @@ int main(int argc, char *argv[]) {
#endif #endif
char device[4] = {0}; char device[4] = {0};
snprintf(device, sizeof(device), "#%d", my_rank % nb_devices); snprintf(device, sizeof(device), "#%d", my_rank % nb_devices);
futhark_context_config_set_device(fut_config, device); futhark_context_config_set_device(fut_config, "AMD");
#endif #endif
struct futhark_context *fut_context = futhark_context_new(fut_config); struct futhark_context *fut_context = futhark_context_new(fut_config);
int lbm_dimensions[3] = {atoi(argv[2]), atoi(argv[3]), atoi(argv[4])}; int lbm_dimensions[3] = {atoi(argv[2]), atoi(argv[3]), atoi(argv[4])};
// https://stackoverflow.com/a/33624425
int count = 1; int count = 1;
int block_lengths[] = {NB_VALUES}; int block_lengths[] = {NB_VALUES};
MPI_Aint displacements[] = {offsetof(struct lbm_values, values)}; MPI_Aint displacements[] = {offsetof(struct lbm_values, values)};
MPI_Datatype types[] = {MPI_FLOAT}; MPI_Datatype types[] = {MPI_FLOAT};
MPI_Datatype tmp_type, lbm_type;
MPI_Aint lb, extent;
MPI_Type_create_struct(count, block_lengths, displacements, types, &tmp_type);
MPI_Type_get_extent(tmp_type, &lb, &extent);
MPI_Type_create_resized(tmp_type, lb, extent, &lbm_type);
MPI_Type_commit(&lbm_type);
MPI_Datatype lbm_type = create_type(count, block_lengths, displacements, types);
struct dispatch_context *disp_context = dispatch_context_new(lbm_dimensions, lbm_type, 3); struct dispatch_context *disp_context = dispatch_context_new(lbm_dimensions, lbm_type, 3);
chunk_info_t ci = get_chunk_info(disp_context); chunk_info_t ci = get_chunk_info(disp_context);
init_chunk_lbm(&ci); init_chunk_lbm(&ci);
...@@ -116,7 +109,6 @@ int main(int argc, char *argv[]) { ...@@ -116,7 +109,6 @@ int main(int argc, char *argv[]) {
dispatch_context_free(disp_context); dispatch_context_free(disp_context);
futhark_context_config_free(fut_config); futhark_context_config_free(fut_config);
futhark_context_free(fut_context); futhark_context_free(fut_context);
MPI_Type_free(&tmp_type);
MPI_Type_free(&lbm_type); MPI_Type_free(&lbm_type);
return MPI_Finalize(); return MPI_Finalize();
} }
...@@ -58,48 +58,3 @@ ...@@ -58,48 +58,3 @@
8;8;300;20.488742 8;8;300;20.488742
8;8;300;20.504185 8;8;300;20.504185
8;8;300;20.516133 8;8;300;20.516133
16;8;300;22.777369
16;8;300;22.791165
16;8;300;22.803524
16;8;300;22.813408
16;8;300;22.816956
16;8;300;22.826012
16;8;300;22.828884
16;8;300;22.829457
16;8;300;22.829930
16;8;300;22.836554
16;8;300;22.849634
16;8;300;22.851477
16;8;300;22.893619
16;8;300;22.901473
16;8;300;22.905142
32;8;300;22.314635
32;8;300;22.322662
32;8;300;22.331106
32;8;300;22.345587
32;8;300;22.345630
32;8;300;22.361149
32;8;300;22.365208
32;8;300;22.369361
32;8;300;22.369703
32;8;300;22.374750
32;8;300;22.375080
32;8;300;22.375149
32;8;300;22.375977
32;8;300;22.381544
32;8;300;22.409413
64;8;300;23.577857
64;8;300;23.602226
64;8;300;23.655721
64;8;300;23.657700
64;8;300;23.665956
64;8;300;23.667145
64;8;300;23.689846
64;8;300;23.690878
64;8;300;23.694822
64;8;300;23.706151
64;8;300;23.713216
64;8;300;23.722629
64;8;300;23.740694
64;8;300;23.752026
64;8;300;23.776225
...@@ -58,48 +58,3 @@ ...@@ -58,48 +58,3 @@
8;8;300;20.825832 8;8;300;20.825832
8;8;300;20.842825 8;8;300;20.842825
8;8;300;20.849195 8;8;300;20.849195
16;8;300;22.677872
16;8;300;22.804210
16;8;300;22.833913
16;8;300;22.876965
16;8;300;22.884168
16;8;300;22.885632
16;8;300;22.891433
16;8;300;22.895607
16;8;300;22.905846
16;8;300;22.909601
16;8;300;22.911491
16;8;300;22.915985
16;8;300;22.918687
16;8;300;22.935573
16;8;300;22.946628
32;8;300;22.409582
32;8;300;22.423218
32;8;300;22.430444
32;8;300;22.447238
32;8;300;22.459890
32;8;300;22.462174
32;8;300;22.462496
32;8;300;22.465549
32;8;300;22.465610
32;8;300;22.470822
32;8;300;22.479867
32;8;300;22.490030
32;8;300;22.503559
32;8;300;22.528312
32;8;300;22.546079
64;8;300;23.797840
64;8;300;23.798499
64;8;300;23.805884
64;8;300;23.815996
64;8;300;23.828719
64;8;300;23.835635
64;8;300;23.838288
64;8;300;23.844255
64;8;300;23.852279
64;8;300;23.857556
64;8;300;23.866874
64;8;300;23.873075
64;8;300;23.884159
64;8;300;23.896894
64;8;300;23.920008
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment