瀏覽代碼

Replace STARPU_ASSERT(0) by STARPU_ABORT().

Cyril Roelandt 13 年之前
父節點
當前提交
88bf76e6b2

+ 1 - 1
examples/interface/complex_interface.c

@@ -134,7 +134,7 @@ static starpu_ssize_t complex_allocate_data_on_node(void *data_interface, uint32
 		}
 #endif
 		default:
-			STARPU_ASSERT(0);
+			STARPU_ABORT();
 	}
 
 	if (fail)

+ 4 - 4
examples/stencil/stencil-tasks.c

@@ -66,7 +66,7 @@ static void create_task_save_local(unsigned iter, unsigned z, int dir, unsigned
 	if (ret)
 	{
 		fprintf(stderr, "Could not submit task save: %d\n", ret);
-		STARPU_ASSERT(0);
+		STARPU_ABORT();
 	}
 }
 
@@ -155,7 +155,7 @@ void create_task_save(unsigned iter, unsigned z, int dir, unsigned local_rank)
 		{ /* R(z) != local & R(z+d) != local We don't have
 			      the saved data and don't need it, we shouldn't
 			      even have been called! */
-			STARPU_ASSERT(0);
+			STARPU_ABORT();
 		}
 	}
 #else /* !STARPU_USE_MPI */
@@ -208,7 +208,7 @@ void create_task_update(unsigned iter, unsigned z, unsigned local_rank)
 	if (ret)
 	{
 		fprintf(stderr, "Could not submit task update block: %d\n", ret);
-		STARPU_ASSERT(0);
+		STARPU_ABORT();
 	}
 }
 
@@ -243,7 +243,7 @@ void create_start_task(int z, int dir)
 	if (ret)
 	{
 		fprintf(stderr, "Could not submit task initial wait: %d\n", ret);
-		STARPU_ASSERT(0);
+		STARPU_ABORT();
 	}
 }
 

+ 4 - 4
include/starpu_util.h

@@ -57,18 +57,18 @@ extern "C"
 #  define STARPU_CHECK_RETURN_VALUE(err, message) {if (err != 0) { \
 			char xmessage[256]; strerror_r(-err, xmessage, 256); \
 			fprintf(stderr, "StarPU function <%s> returned unexpected value: <%d:%s>\n", message, err, xmessage); \
-			STARPU_ASSERT(0); }}
+			STARPU_ABORT(); }}
 #  define STARPU_CHECK_RETURN_VALUE_IS(err, value, message) {if (err != value) { \
 			char xmessage[256]; strerror_r(-err, xmessage, 256); \
 			fprintf(stderr, "StarPU function <%s> returned unexpected value: <%d:%s>\n", message, err, xmessage); \
-			STARPU_ASSERT(0); }}
+			STARPU_ABORT(); }}
 #else
 #  define STARPU_CHECK_RETURN_VALUE(err, message) {if (err != 0) {		\
 			fprintf(stderr, "StarPU function <%s> returned unexpected value: <%d>\n", message, err); \
-			STARPU_ASSERT(0); }}
+			STARPU_ABORT(); }}
 #  define STARPU_CHECK_RETURN_VALUE_IS(err, value, message) {if (err != value) { \
 			fprintf(stderr, "StarPU function <%s> returned unexpected value: <%d>\n", message, err); \
-			STARPU_ASSERT(0); }}
+			STARPU_ABORT(); }}
 #endif /* STARPU_HAVE_STRERROR_R */
 
 /* Return true (non-zero) if GCC version MAJ.MIN or later is being used

+ 2 - 2
src/common/utils.c

@@ -87,7 +87,7 @@ void _starpu_mkpath_and_check(const char *path, mode_t mode)
 		{
 			fprintf(stderr,"Error making StarPU directory %s:\n", path);
 			perror("mkdir");
-			STARPU_ASSERT(0);
+			STARPU_ABORT();
 		}
 
 		/* make sure that it is actually a directory */
@@ -96,7 +96,7 @@ void _starpu_mkpath_and_check(const char *path, mode_t mode)
 		if (!S_ISDIR(sb.st_mode))
 		{
 			fprintf(stderr,"Error: %s is not a directory:\n", path);
-			STARPU_ASSERT(0);
+			STARPU_ABORT();
 		}
 	}
 }

+ 1 - 1
src/core/perfmodel/perfmodel.c

@@ -281,7 +281,7 @@ double starpu_task_expected_conversion_time(struct starpu_task *task,
 			node = opencl_node;
 #endif
 		if (node == -EINVAL)
-			STARPU_ASSERT(0);
+			STARPU_ABORT();
 
 		if (!_starpu_handle_needs_conversion_task(handle, node))
 			continue;

+ 1 - 1
src/core/perfmodel/perfmodel_history.c

@@ -1149,7 +1149,7 @@ void _starpu_update_perfmodel_history(struct _starpu_job *j, struct starpu_perfm
 		if (f == NULL)
 		{
 			_STARPU_DISP("Error <%s> when opening file <%s>\n", strerror(errno), per_arch_model->debug_path);
-			STARPU_ASSERT(0);
+			STARPU_ABORT();
 		}
 
 		if (!j->footprint_is_computed)

+ 3 - 3
src/core/sched_policy.c

@@ -336,7 +336,7 @@ struct starpu_task *_starpu_create_conversion_task(starpu_data_handle_t handle,
 		switch (starpu_node_get_kind(handle->mf_node))
 		{
 		case STARPU_CPU_RAM:
-			STARPU_ASSERT(0);
+			STARPU_ABORT();
 #ifdef STARPU_USE_CUDA
 		case STARPU_CUDA_RAM:
 		{
@@ -357,7 +357,7 @@ struct starpu_task *_starpu_create_conversion_task(starpu_data_handle_t handle,
 #endif
 		default:
 			fprintf(stderr, "Oops : %u\n", handle->mf_node);
-			STARPU_ASSERT(0);
+			STARPU_ABORT();
 		}
 		break;
 #ifdef STARPU_USE_CUDA
@@ -380,7 +380,7 @@ struct starpu_task *_starpu_create_conversion_task(starpu_data_handle_t handle,
 #endif
 	case STARPU_SPU_LS: /* Not supported */
 	default:
-		STARPU_ASSERT(0);
+		STARPU_ABORT();
 	}
 
 	conversion_task->cl->modes[0] = STARPU_RW;

+ 3 - 3
src/core/task.c

@@ -730,7 +730,7 @@ _starpu_handle_needs_conversion_task(starpu_data_handle_t handle,
 					return 1;
 				case STARPU_SPU_LS: /* Not supported */
 				default:
-					STARPU_ASSERT(0);
+					STARPU_ABORT();
 			}
 			break;
 		case STARPU_CUDA_RAM:    /* Fall through */
@@ -744,12 +744,12 @@ _starpu_handle_needs_conversion_task(starpu_data_handle_t handle,
 					return 0;
 				case STARPU_SPU_LS: /* Not supported */
 				default:
-					STARPU_ASSERT(0);
+					STARPU_ABORT();
 			}
 			break;
 		case STARPU_SPU_LS:            /* Not supported */
 		default:
-			STARPU_ASSERT(0);
+			STARPU_ABORT();
 	}
 	/* that instruction should never be reached */
 	return -EINVAL;

+ 1 - 1
src/datawizard/interfaces/data_interface.c

@@ -556,7 +556,7 @@ static void _starpu_data_unregister(starpu_data_handle_t handle, unsigned cohere
 				case STARPU_CPU_RAM:      /* Impossible ! */
 				case STARPU_SPU_LS:       /* Not supported */
 				default:
-					STARPU_ASSERT(0);
+					STARPU_ABORT();
 			}
 			buffers[0] = format_interface;
 

+ 5 - 5
src/datawizard/interfaces/multiformat_interface.c

@@ -127,7 +127,7 @@ static void *multiformat_handle_to_pointer(starpu_data_handle_t handle, uint32_t
 			return multiformat_interface->opencl_ptr;
 #endif
 		default:
-			STARPU_ASSERT(0);
+			STARPU_ABORT();
 	}
 	return NULL;
 }
@@ -448,7 +448,7 @@ static int copy_cuda_common(void *src_interface, unsigned src_node __attribute__
 			break;
 		}
 		default:
-			STARPU_ASSERT(0);
+			STARPU_ABORT();
 	}
 
 	return 0;
@@ -514,7 +514,7 @@ static int copy_cuda_common_async(void *src_interface, unsigned src_node __attri
 			break;
 		}
 		default:
-			STARPU_ASSERT(0);
+			STARPU_ABORT();
 	}
 
 	return 0;
@@ -589,7 +589,7 @@ static int copy_cuda_to_cuda(void *src_interface, unsigned src_node STARPU_ATTRI
 					     dst_interface, dst_node,
 					     NULL);
 #else
-		STARPU_ASSERT(0);
+		STARPU_ABORT();
 #endif
 	}
 }
@@ -611,7 +611,7 @@ static int copy_cuda_to_cuda_async(void *src_interface, unsigned src_node,
 					     dst_interface, dst_node,
 					     stream);
 #else
-		STARPU_ASSERT(0);
+		STARPU_ABORT();
 #endif
 	}
 }

+ 3 - 3
src/drivers/cuda/driver_cuda.c

@@ -187,7 +187,7 @@ static void init_context(int devid)
 #ifdef HAVE_CUDA_MEMCPY_PEER
 	if (props[devid].computeMode == cudaComputeModeExclusive) {
 		fprintf(stderr, "CUDA is in EXCLUSIVE-THREAD mode, but StarPU was built with multithread GPU control support, please either ask your administrator to use EXCLUSIVE-PROCESS mode (which should really be fine), or reconfigure with --disable-cuda-memcpy-peer but that will disable the memcpy-peer optimizations\n");
-		STARPU_ASSERT(0);
+		STARPU_ABORT();
 	}
 #endif
 
@@ -503,14 +503,14 @@ void starpu_cublas_report_error(const char *func, const char *file, int line, cu
 			break;
 	}
 	fprintf(stderr, "oops in %s (%s:%u)... %d: %s \n", func, file, line, status, errormsg);
-	STARPU_ASSERT(0);
+	STARPU_ABORT();
 }
 
 void starpu_cuda_report_error(const char *func, const char *file, int line, cudaError_t status)
 {
 	const char *errormsg = cudaGetErrorString(status);
 	printf("oops in %s (%s:%u)... %d: %s \n", func, file, line, status, errormsg);
-	STARPU_ASSERT(0);
+	STARPU_ABORT();
 }
 
 int starpu_cuda_copy_async_sync(void *src_ptr, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_ptr, unsigned dst_node STARPU_ATTRIBUTE_UNUSED, size_t ssize, cudaStream_t stream, enum cudaMemcpyKind kind)

+ 1 - 1
src/drivers/opencl/driver_opencl.c

@@ -524,7 +524,7 @@ int _starpu_opencl_driver_run_once(struct starpu_driver *d)
 				STARPU_ABORT();
 				return 0;
 			default:
-				STARPU_ASSERT(0);
+				STARPU_ABORT();
 		}
 	}
 

+ 3 - 3
tests/datawizard/interfaces/test_interfaces.c

@@ -191,8 +191,8 @@ get_field(struct data_interface_test_summary *s, int async, enum operation op)
 	case OPENCL_TO_CPU:
 		return async?&s->opencl_to_cpu_async:&s->opencl_to_cpu;
 #endif /* !STARPU_USE_OPENCL */
-		default:
-			STARPU_ASSERT(0);
+	default:
+		STARPU_ABORT();
 	}
 	/* that instruction should never be reached */
 	return NULL;
@@ -222,7 +222,7 @@ set_field(struct data_interface_test_summary *s, int async,
 			*field = TASK_SUBMISSION_FAILURE;
 			break;
 		default:
-			STARPU_ASSERT(0);
+			STARPU_ABORT();
 	}
 }