浏览代码

disable asynchronous disk to disk when STARPU_DISABLE_ASYNCHRONOUS_COPY is set

Corentin Salingue 8 年之前
父节点
当前提交
cc1d4826d0
共有 2 个文件被更改,包括 12 次插入9 次删除
  1. 10 7
      src/core/disk.c
  2. 2 2
      src/datawizard/copy_driver.c

+ 10 - 7
src/core/disk.c

@@ -245,18 +245,21 @@ int _starpu_disk_copy(unsigned node_src, void *obj_src, off_t offset_src, unsign
 	unsigned pos_src = get_location_with_node(node_src);
 	unsigned pos_dst = get_location_with_node(node_dst);
 	/* both nodes have same copy function */
-        void * event;
-	channel->event.disk_event.memory_node = node_src;
-	event = disk_register_list[pos_src]->functions->copy(disk_register_list[pos_src]->base, obj_src, offset_src,
-											       disk_register_list[pos_dst]->base, obj_dst, offset_dst,
-											       size);
-        add_async_event(channel, event);
+        void * event = NULL;
 
+	if (channel)
+	{
+		channel->event.disk_event.memory_node = node_src;
+		event = disk_register_list[pos_src]->functions->copy(disk_register_list[pos_src]->base, obj_src, offset_src,
+								disk_register_list[pos_dst]->base, obj_dst, offset_dst, size);
+		add_async_event(channel, event);
+	}
 
 	/* Something goes wrong with copy disk to disk... */
 	if (!event)
 	{
-		disk_register_list[pos_src]->functions->copy = NULL;
+		if (channel || (!channel && starpu_asynchronous_copy_disabled()))
+			disk_register_list[pos_src]->functions->copy = NULL;
 
 		/* perform a read, and after a write... */
 		void * ptr;

+ 2 - 2
src/datawizard/copy_driver.c

@@ -598,7 +598,7 @@ static int copy_data_1_to_1_generic(starpu_data_handle_t handle,
                         req->async_channel.type = STARPU_DISK_RAM;
                         req->async_channel.event.disk_event.requests = NULL;
                 }
-		ret = copy_methods->any_to_any(src_interface, src_node, dst_interface, dst_node, req ? &req->async_channel : NULL);
+		ret = copy_methods->any_to_any(src_interface, src_node, dst_interface, dst_node, req && !starpu_asynchronous_copy_disabled() ? &req->async_channel : NULL);
 		break;
 
 	default:
@@ -954,7 +954,7 @@ unsigned _starpu_driver_test_request_completion(struct _starpu_async_channel *as
 		break;
 	case STARPU_CPU_RAM:
 	default:
-		STARPU_ABORT();
+		STARPU_ABORT_MSG("Memory is not recognized (kind %u) \n", kind);
 	}
 
 	return success;