|
@@ -1840,71 +1840,79 @@ double _starpu_predict_transfer_time(unsigned src_node, unsigned dst_node, size_
|
|
|
|
|
|
|
|
|
/* calculate save bandwidth and latency */
|
|
|
-
|
|
|
-void _starpu_save_bandwith_and_latency_disk(double bandwidth_write, double bandwidth_read, double latency_write, double latency_read, unsigned node)
|
|
|
+/* bandwidth in MB/s - latency in µs */
|
|
|
+void _starpu_save_bandwidth_and_latency_disk(double bandwidth_write, double bandwidth_read, double latency_write, double latency_read, unsigned node)
|
|
|
{
|
|
|
unsigned int i, j;
|
|
|
double slowness_disk_between_main_ram, slowness_main_ram_between_node;
|
|
|
|
|
|
- /* for(i = 0; i < STARPU_MAXNODES; ++i) */
|
|
|
- /* { */
|
|
|
- /* for(j = 0; j < STARPU_MAXNODES; ++j) */
|
|
|
- /* { */
|
|
|
- /* if (i == j && j == node) /\* source == destination *\/ */
|
|
|
- /* { */
|
|
|
- /* bandwidth_matrix[i][j] = 0; */
|
|
|
- /* printf("A"); */
|
|
|
- /* } */
|
|
|
- /* else if (i == node) /\* source == disk *\/ */
|
|
|
- /* { */
|
|
|
- /* /\* convert in slowness *\/ */
|
|
|
- /* if(bandwidth_read != 0) */
|
|
|
- /* slowness_disk_between_main_ram = 1/bandwidth_read; */
|
|
|
- /* else */
|
|
|
- /* slowness_disk_between_main_ram = 0; */
|
|
|
-
|
|
|
- /* if(bandwidth_matrix[STARPU_MAIN_RAM][j] != 0) */
|
|
|
- /* slowness_main_ram_between_node = 1/bandwidth_matrix[STARPU_MAIN_RAM][j]; */
|
|
|
- /* else */
|
|
|
- /* slowness_main_ram_between_node = 0; */
|
|
|
+ /* save bandwith */
|
|
|
+ for(i = 0; i < STARPU_MAXNODES; ++i)
|
|
|
+ {
|
|
|
+ for(j = 0; j < STARPU_MAXNODES; ++j)
|
|
|
+ {
|
|
|
+ if (i == j && j == node) /* source == destination == node */
|
|
|
+ {
|
|
|
+ bandwidth_matrix[i][j] = 0;
|
|
|
+ }
|
|
|
+ else if (i == node) /* source == disk */
|
|
|
+ {
|
|
|
+ /* convert in slowness */
|
|
|
+ if(bandwidth_read != 0)
|
|
|
+ slowness_disk_between_main_ram = 1/bandwidth_read;
|
|
|
+ else
|
|
|
+ slowness_disk_between_main_ram = 0;
|
|
|
+
|
|
|
+ if(bandwidth_matrix[STARPU_MAIN_RAM][j] != 0)
|
|
|
+ slowness_main_ram_between_node = 1/bandwidth_matrix[STARPU_MAIN_RAM][j];
|
|
|
+ else
|
|
|
+ slowness_main_ram_between_node = 0;
|
|
|
|
|
|
- /* bandwidth_matrix[i][j] = 1/(slowness_disk_between_main_ram+slowness_main_ram_between_node); */
|
|
|
- /* printf("B"); */
|
|
|
- /* } */
|
|
|
- /* else if (j == node) /\* destination == disk *\/ */
|
|
|
- /* { */
|
|
|
- /* /\* convert in slowness *\/ */
|
|
|
- /* if(bandwidth_write != 0) */
|
|
|
- /* slowness_disk_between_main_ram = 1/bandwidth_write; */
|
|
|
- /* else */
|
|
|
- /* slowness_disk_between_main_ram = 0; */
|
|
|
-
|
|
|
- /* if(bandwidth_matrix[i][STARPU_MAIN_RAM] != 0) */
|
|
|
- /* slowness_main_ram_between_node = 1/bandwidth_matrix[i][STARPU_MAIN_RAM]; */
|
|
|
- /* else */
|
|
|
- /* slowness_main_ram_between_node = 0; */
|
|
|
-
|
|
|
- /* bandwidth_matrix[i][j] = 1/(slowness_disk_between_main_ram+slowness_main_ram_between_node); */
|
|
|
- /* printf("C"); */
|
|
|
- /* } */
|
|
|
- /* else if (j > node || i > node) */
|
|
|
- /* { */
|
|
|
- /* bandwidth_matrix[i][j] = NAN; */
|
|
|
- /* printf("D"); */
|
|
|
- /* } */
|
|
|
-
|
|
|
- /* printf("%f ", bandwidth_matrix[i][j]); */
|
|
|
- /* } */
|
|
|
- /* printf("\n"); */
|
|
|
- /* } */
|
|
|
- printf("\n\n");
|
|
|
+ bandwidth_matrix[i][j] = 1/(slowness_disk_between_main_ram+slowness_main_ram_between_node);
|
|
|
+ }
|
|
|
+ else if (j == node) /* destination == disk */
|
|
|
+ {
|
|
|
+ /* convert in slowness */
|
|
|
+ if(bandwidth_write != 0)
|
|
|
+ slowness_disk_between_main_ram = 1/bandwidth_write;
|
|
|
+ else
|
|
|
+ slowness_disk_between_main_ram = 0;
|
|
|
+
|
|
|
+ if(bandwidth_matrix[i][STARPU_MAIN_RAM] != 0)
|
|
|
+ slowness_main_ram_between_node = 1/bandwidth_matrix[i][STARPU_MAIN_RAM];
|
|
|
+ else
|
|
|
+ slowness_main_ram_between_node = 0;
|
|
|
+
|
|
|
+ bandwidth_matrix[i][j] = 1/(slowness_disk_between_main_ram+slowness_main_ram_between_node);
|
|
|
+ }
|
|
|
+ else if (j > node || i > node) /* not affected by the node */
|
|
|
+ {
|
|
|
+ bandwidth_matrix[i][j] = NAN;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /* save latency */
|
|
|
for(i = 0; i < STARPU_MAXNODES; ++i)
|
|
|
{
|
|
|
for(j = 0; j < STARPU_MAXNODES; ++j)
|
|
|
{
|
|
|
- printf("%f ", bandwidth_matrix[i][j]);
|
|
|
+ if (i == j && j == node) /* source == destination == node */
|
|
|
+ {
|
|
|
+ latency_matrix[i][j] = 0;
|
|
|
+ }
|
|
|
+ else if (i == node) /* source == disk */
|
|
|
+ {
|
|
|
+ latency_matrix[i][j] = (latency_write+latency_matrix[STARPU_MAIN_RAM][j]);
|
|
|
+ }
|
|
|
+ else if (j == node) /* destination == disk */
|
|
|
+ {
|
|
|
+ latency_matrix[i][j] = (latency_read+latency_matrix[i][STARPU_MAIN_RAM]);
|
|
|
+ }
|
|
|
+ else if (j > node || i > node) /* not affected by the node */
|
|
|
+ {
|
|
|
+ latency_matrix[i][j] = NAN;
|
|
|
+ }
|
|
|
}
|
|
|
- printf("\n");
|
|
|
}
|
|
|
- printf("\n\n");
|
|
|
}
|