Browse Source

Completely drop 0-byte transfers, we don't actually produce any in reality

Samuel Thibault 9 years ago
parent
commit
428e4ca6c7
1 changed files with 4 additions and 5 deletions
  1. 4 5
      src/core/simgrid.c

+ 4 - 5
src/core/simgrid.c

@@ -537,6 +537,9 @@ static void transfer_submit(struct transfer *transfer)
 /* Data transfer issued by StarPU */
 int _starpu_simgrid_transfer(size_t size, unsigned src_node, unsigned dst_node, struct _starpu_data_request *req)
 {
+	/* Simgrid does not like 0-bytes transfers */
+	if (!size)
+		return 0;
 	msg_task_t task;
 	msg_host_t *hosts = calloc(2, sizeof(*hosts));
 	double *computation = calloc(2, sizeof(*computation));
@@ -548,11 +551,7 @@ int _starpu_simgrid_transfer(size_t size, unsigned src_node, unsigned dst_node,
 	hosts[0] = _starpu_simgrid_memory_node_get_host(src_node);
 	hosts[1] = _starpu_simgrid_memory_node_get_host(dst_node);
 	STARPU_ASSERT(hosts[0] != hosts[1]);
-	if (size)
-		communication[1] = size;
-	else
-		/* Simgrid does not like 0-bytes transfers, fake one byte */
-		communication[1] = 1;
+	communication[1] = size;
 
 	task = MSG_parallel_task_create("copy", 2, hosts, computation, communication, NULL);