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

Added dump board

parent 047be592
No related branches found
No related tags found
No related merge requests found
...@@ -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);
} }
......
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