Просмотр исходного кода

More prefixing ...

find . -type f -not -name "*svn*"|xargs sed -i s/"\bUSE_CPUS\b"/STARPU_USE_CPUS/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bUSE_ALLOCATION_CACHE\b"/STARPU_USE_ALLOCATION_CACHE/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bUSE_FXT\b"/STARPU_USE_FXT/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bVERBOSE\b"/STARPU_VERBOSE/g
Nathalie Furmento лет назад: 15
Родитель
Сommit
da24e5ab1b

+ 6 - 6
configure.ac

@@ -131,7 +131,7 @@ AC_SUBST(STARPU_USE_CPU, $enable_cpu)
 AM_CONDITIONAL(STARPU_USE_CPU, test x$enable_cpu = xyes)
 
 if test x$enable_cpu = xyes; then
-	AC_DEFINE(USE_CPUS, [1], [CPU driver is activated])
+	AC_DEFINE(STARPU_USE_CPUS, [1], [CPU driver is activated])
 
 	# This value is set quite randomly, but StarPU should not take more
 	# core than there are in the system
@@ -314,7 +314,7 @@ AC_ARG_ENABLE(verbose, [AS_HELP_STRING([--enable-verbose],
 			enable_verbose=$enableval, enable_verbose=no)
 AC_MSG_RESULT($enable_verbose)
 if test x$enable_verbose = xyes; then
-	AC_DEFINE(VERBOSE, [1], [display verbose debug messages])
+	AC_DEFINE(STARPU_VERBOSE, [1], [display verbose debug messages])
 fi
 
 
@@ -356,11 +356,11 @@ AC_ARG_WITH(fxt, [AS_HELP_STRING([--with-fxt[=<dir>]], [generate fxt traces])],
 		use_fxt=no
 		AC_MSG_RESULT(no)
 	])
-AC_SUBST(USE_FXT, $use_fxt)
-AM_CONDITIONAL(USE_FXT, test x$use_fxt = xyes)
+AC_SUBST(STARPU_USE_FXT, $use_fxt)
+AM_CONDITIONAL(STARPU_USE_FXT, test x$use_fxt = xyes)
 
 if test x$use_fxt = xyes; then
-	AC_DEFINE(USE_FXT, [1], [enable FxT traces])
+	AC_DEFINE(STARPU_USE_FXT, [1], [enable FxT traces])
 	AC_DEFINE(STARPU_CONFIG_FUT, [1], [enable FUT traces])
 
 	AC_SUBST(USE_FXTDIR_FROM_USER,$use_fxt_from_system)
@@ -455,7 +455,7 @@ AC_ARG_ENABLE(allocation-cache, [AS_HELP_STRING([--enable-allocation-cache],
 			enable_allocation_cache=$enableval, enable_allocation_cache=no)
 AC_MSG_RESULT($enable_allocation_cache)
 if test x$enable_allocation_cache = xyes; then
-	AC_DEFINE(USE_ALLOCATION_CACHE, [1], [enable data allocation cache])
+	AC_DEFINE(STARPU_USE_ALLOCATION_CACHE, [1], [enable data allocation cache])
 fi
 
 AC_ARG_WITH(perf-model-dir, [AS_HELP_STRING([--with-perf-model-dir=<dir>], [specify where performance models shoulds be stored])],

+ 1 - 1
examples/mult/dw_mult.c

@@ -198,7 +198,7 @@ static starpu_codelet cl = {
 
 static void launch_codelets(void)
 {
-#ifdef USE_FXT
+#ifdef STARPU_USE_FXT
 	fxt_register_thread(0);
 #endif
 	/* partition the work into slices */

+ 1 - 1
examples/mult/dw_mult_no_stride.c

@@ -347,7 +347,7 @@ static void submit_new_iter(unsigned x, unsigned y, unsigned iter)
 
 static void launch_codelets(void)
 {
-#ifdef USE_FXT
+#ifdef STARPU_USE_FXT
 	fxt_register_thread(0);
 #endif
 	/* partition the work into slices */

+ 1 - 1
examples/mult/dw_mult_no_stride_no_tag.c

@@ -375,7 +375,7 @@ static void callback_func_3(void *arg)
 
 static void launch_codelets(void)
 {
-#ifdef USE_FXT
+#ifdef STARPU_USE_FXT
 	fxt_register_thread(0);
 #endif
 	/* partition the work into slices */

+ 1 - 1
examples/strassen/test_strassen.c

@@ -113,7 +113,7 @@ void init_problem(void)
 {
 	unsigned i,j;
 
-#ifdef USE_FXT
+#ifdef STARPU_USE_FXT
 	fxt_register_thread(0);
 #endif
 

+ 2 - 2
mpi/starpu_mpi.c

@@ -610,7 +610,7 @@ static int hookid = - 1;
 
 static void _starpu_mpi_add_sync_point_in_fxt(void)
 {
-#ifdef USE_FXT
+#ifdef STARPU_USE_FXT
 	int rank;
 	int worldsize;
 	MPI_Comm_rank(MPI_COMM_WORLD, &rank);
@@ -635,7 +635,7 @@ static void _starpu_mpi_add_sync_point_in_fxt(void)
 
 	TRACE_MPI_BARRIER(rank, worldsize, random_number);
 
-#ifdef VERBOSE
+#ifdef STARPU_VERBOSE
 	fprintf(stderr, "StarPU MPI (rank %d): unique key %x\n", rank, random_number);
 #endif
 

+ 1 - 1
mpi/starpu_mpi_fxt.h

@@ -25,7 +25,7 @@
 #define FUT_MPI_ISEND		0x5202
 #define FUT_MPI_IRECV_END	0x5203
 
-#ifdef USE_FXT
+#ifdef STARPU_USE_FXT
 #define TRACE_MPI_BARRIER(rank, worldsize, key)	\
 	FUT_DO_PROBE4(FUT_MPI_BARRIER, (rank), (worldsize), (key), syscall(SYS_gettid));
 #define TRACE_MPI_ISEND(dest, mpi_tag, size)	\

+ 3 - 3
src/common/fxt.c

@@ -16,7 +16,7 @@
 
 #include <starpu.h>
 #include <common/config.h>
-#ifdef USE_FXT
+#ifdef STARPU_USE_FXT
 
 #include <common/fxt.h>
 
@@ -80,7 +80,7 @@ void stop_fxt_profiling(void)
 {
 	if (!written)
 	{
-#ifdef VERBOSE
+#ifdef STARPU_VERBOSE
 	        char hostname[128];
 		gethostname(hostname, 128);
 		fprintf(stderr, "Writing FxT traces into file %s:%s\n", hostname, PROF_FILE_USER);
@@ -99,7 +99,7 @@ void fxt_register_thread(unsigned cpuid)
 
 void starpu_trace_user_event(unsigned code __attribute__((unused)))
 {
-#ifdef USE_FXT
+#ifdef STARPU_USE_FXT
 	TRACE_USER_EVENT(code);
 #endif
 }

+ 3 - 3
src/common/fxt.h

@@ -85,7 +85,7 @@
 
 #define FUT_USER_EVENT		0x5132
 
-#ifdef USE_FXT
+#ifdef STARPU_USE_FXT
 #include <sys/syscall.h> /* pour les définitions de SYS_xxx */
 #include <fxt/fxt.h>
 #include <fxt/fut.h>
@@ -234,7 +234,7 @@ do {										\
 #define TRACE_USER_EVENT(code)			\
 	FUT_DO_PROBE2(FUT_USER_EVENT, code, syscall(SYS_gettid));
 
-#else // !USE_FXT
+#else // !STARPU_USE_FXT
 
 #define TRACE_NEW_MEM_NODE(nodeid)	do {} while(0);
 #define TRACE_NEW_WORKER(a,b)		do {} while(0);
@@ -271,6 +271,6 @@ do {										\
 #define TRACE_END_PROGRESS(memnode)	do {} while(0);
 #define TRACE_USER_EVENT(code)		do {} while(0);
 
-#endif // USE_FXT
+#endif // STARPU_USE_FXT
 
 #endif // __FXT_H__

+ 4 - 4
src/core/debug.c

@@ -17,7 +17,7 @@
 #include <common/config.h>
 #include <core/debug.h>
 
-#ifdef VERBOSE
+#ifdef STARPU_VERBOSE
 /* we want a single writer at the same time to have a log that is readable */
 static pthread_mutex_t logfile_mutex = PTHREAD_MUTEX_INITIALIZER;
 static FILE *logfile;
@@ -25,7 +25,7 @@ static FILE *logfile;
 
 void _starpu_open_debug_logfile(void)
 {
-#ifdef VERBOSE
+#ifdef STARPU_VERBOSE
 	/* what is  the name of the file ? default = "starpu.log" */
 	char *logfile_name;
 	
@@ -42,14 +42,14 @@ void _starpu_open_debug_logfile(void)
 
 void _starpu_close_debug_logfile(void)
 {
-#ifdef VERBOSE
+#ifdef STARPU_VERBOSE
 	fclose(logfile);
 #endif
 }
 
 void _starpu_print_to_logfile(const char *format __attribute__((unused)), ...)
 {
-#ifdef VERBOSE
+#ifdef STARPU_VERBOSE
 	va_list args;
 	va_start(args, format);
 	pthread_mutex_lock(&logfile_mutex);

+ 3 - 3
src/core/perfmodel/perfmodel_bus.c

@@ -169,7 +169,7 @@ static void measure_bandwith_between_host_and_dev(int dev, unsigned ncpus)
 			sizeof(struct cudadev_timing),
 			compar_cudadev_timing);
 	
-#ifdef VERBOSE
+#ifdef STARPU_VERBOSE
 	for (cpu = 0; cpu < ncpus; cpu++)
 	{
 		unsigned current_cpu = cudadev_timing_per_cpu[dev+1][cpu].cpu_id;
@@ -198,7 +198,7 @@ static void benchmark_all_cuda_devices(void)
 #ifdef STARPU_USE_CUDA
 	int ret;
 
-#ifdef VERBOSE
+#ifdef STARPU_VERBOSE
 	fprintf(stderr, "Benchmarking the speed of the bus\n");
 #endif
 
@@ -232,7 +232,7 @@ static void benchmark_all_cuda_devices(void)
 		STARPU_ABORT();
 	}
 
-#ifdef VERBOSE
+#ifdef STARPU_VERBOSE
 	fprintf(stderr, "Benchmarking the speed of the bus is done.\n");
 #endif
 #endif

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

@@ -258,7 +258,7 @@ static void save_history_based_model(struct starpu_perfmodel_t *model)
 	char path[256];
 	get_model_path(model, path, 256);
 
-#ifdef VERBOSE
+#ifdef STARPU_VERBOSE
 	fprintf(stderr, "Opening performance model file %s for model %s\n", path, model->symbol);
 #endif
 
@@ -283,7 +283,7 @@ void dump_registered_models(void)
 	struct starpu_model_list_t *node;
 	node = registered_models;
 
-#ifdef VERBOSE
+#ifdef STARPU_VERBOSE
 	fprintf(stderr, "DUMP MODELS !\n");
 #endif
 
@@ -342,14 +342,14 @@ static void load_history_based_model(struct starpu_perfmodel_t *model, unsigned
 	char path[256];
 	get_model_path(model, path, 256);
 
-#ifdef VERBOSE
+#ifdef STARPU_VERBOSE
 	fprintf(stderr, "Opening performance model file %s for model %s ... ", path, model->symbol);
 #endif
 	
 	/* try to open an existing file and load it */
 	res = access(path, F_OK); 
 	if (res == 0) {
-#ifdef VERBOSE
+#ifdef STARPU_VERBOSE
 		fprintf(stderr, "File exists !\n");
 #endif
 
@@ -362,7 +362,7 @@ static void load_history_based_model(struct starpu_perfmodel_t *model, unsigned
 		fclose(f);
 	}
 	else {
-#ifdef VERBOSE
+#ifdef STARPU_VERBOSE
 		fprintf(stderr, "File does not exists !\n");
 #endif
 		initialize_model(model);

+ 1 - 1
src/core/policies/deque-modeling-policy.c

@@ -178,7 +178,7 @@ static void initialize_dm_policy(struct machine_config_s *config,
 	if (use_prefetch == -1)
 		use_prefetch = 0;
 
-#ifdef VERBOSE
+#ifdef STARPU_VERBOSE
 	fprintf(stderr, "Using prefetch ? %s\n", use_prefetch?"yes":"no");
 #endif
 

+ 1 - 1
src/core/policies/sched_policy.c

@@ -61,7 +61,7 @@ static void load_sched_policy(struct sched_policy_s *sched_policy)
 {
 	STARPU_ASSERT(sched_policy);
 
-#ifdef VERBOSE
+#ifdef STARPU_VERBOSE
 	if (sched_policy->policy_name)
 	{
 		fprintf(stderr, "Use %s scheduler", sched_policy->policy_name);

+ 2 - 2
src/core/topology.c

@@ -258,7 +258,7 @@ static int _starpu_init_machine_config(struct machine_config_s *config,
 
 /* we put the CPU section after the accelerator : in case there was an
  * accelerator found, we devote one cpu */
-#ifdef USE_CPUS
+#ifdef STARPU_USE_CPUS
 	if (user_conf && (user_conf->ncpus != -1)) {
 		explicitval = user_conf->ncpus;
 	}
@@ -292,7 +292,7 @@ static int _starpu_init_machine_config(struct machine_config_s *config,
 
 	if (config->nworkers == 0)
 	{
-#ifdef VERBOSE
+#ifdef STARPU_VERBOSE
 		fprintf(stderr, "No worker found, aborting ...\n");
 #endif
 		return -ENODEV;

+ 6 - 6
src/core/workers.c

@@ -126,7 +126,7 @@ static void _starpu_init_workers(struct machine_config_s *config)
 		_starpu_init_worker_queue(workerarg);
 
 		switch (workerarg->arch) {
-#ifdef USE_CPUS
+#ifdef STARPU_USE_CPUS
 			case STARPU_CPU_WORKER:
 				workerarg->set = NULL;
 				workerarg->worker_is_initialized = 0;
@@ -223,7 +223,7 @@ int starpu_init(struct starpu_conf *user_conf)
 
 	srand(2008);
 	
-#ifdef USE_FXT
+#ifdef STARPU_USE_FXT
 	start_fxt_profiling();
 #endif
 	
@@ -264,7 +264,7 @@ static void _starpu_terminate_workers(struct machine_config_s *config)
 	{
 		starpu_wake_all_blocked_workers();
 		
-#ifdef VERBOSE
+#ifdef STARPU_VERBOSE
 		fprintf(stderr, "wait for worker %d\n", workerid);
 #endif
 
@@ -278,7 +278,7 @@ static void _starpu_terminate_workers(struct machine_config_s *config)
 				if (!pthread_equal(pthread_self(), set->worker_thread))
 				{
 					status = pthread_join(set->worker_thread, NULL);
-#ifdef VERBOSE
+#ifdef STARPU_VERBOSE
 					if (status)
 						fprintf(stderr, "pthread_join -> %d\n", status);
 #endif
@@ -291,7 +291,7 @@ static void _starpu_terminate_workers(struct machine_config_s *config)
 			if (!pthread_equal(pthread_self(), worker->worker_thread))
 			{
 				status = pthread_join(worker->worker_thread, NULL);
-#ifdef VERBOSE
+#ifdef STARPU_VERBOSE
 				if (status)
 					fprintf(stderr, "pthread_join -> %d\n", status);
 #endif
@@ -449,7 +449,7 @@ void starpu_shutdown(void)
 
 	starpu_destroy_topology(&config);
 
-#ifdef USE_FXT
+#ifdef STARPU_USE_FXT
 	stop_fxt_profiling();
 #endif
 

+ 3 - 3
src/datawizard/copy-driver.c

@@ -66,7 +66,7 @@ void starpu_wake_all_blocked_workers(void)
 	}
 }
 
-#ifdef USE_FXT
+#ifdef STARPU_USE_FXT
 /* we need to identify each communication so that we can match the beginning
  * and the end of a communication in the trace, so we use a unique identifier
  * per communication */
@@ -222,7 +222,7 @@ int __attribute__((warn_unused_result)) driver_copy_data_1_to_1(starpu_data_hand
 		update_comm_ammount(src_node, dst_node, size);
 #endif
 		
-#ifdef USE_FXT
+#ifdef STARPU_USE_FXT
 		com_id = STARPU_ATOMIC_ADD(&communication_cnt, 1);
 
 		if (req)
@@ -233,7 +233,7 @@ int __attribute__((warn_unused_result)) driver_copy_data_1_to_1(starpu_data_hand
 		TRACE_START_DRIVER_COPY(src_node, dst_node, 0, com_id);
 		ret_copy = copy_data_1_to_1_generic(handle, src_node, dst_node, req);
 
-#ifdef USE_FXT
+#ifdef STARPU_USE_FXT
 		if (ret_copy != EAGAIN)
 		{
 			size_t size = handle->ops->get_size(handle);

+ 1 - 1
src/datawizard/data_request.c

@@ -211,7 +211,7 @@ static void handle_data_request_completion(data_request_t r)
 
 	update_data_state(handle, dst_node, r->write);
 
-#ifdef USE_FXT
+#ifdef STARPU_USE_FXT
 	size_t size = handle->ops->get_size(handle);
 	TRACE_END_DRIVER_COPY(src_node, dst_node, size, r->com_id);
 #endif

+ 1 - 1
src/datawizard/data_request.h

@@ -57,7 +57,7 @@ LIST_TYPE(data_request,
 	unsigned strictness;
 	unsigned is_a_prefetch_request;
 
-#ifdef USE_FXT
+#ifdef STARPU_USE_FXT
 	unsigned com_id;
 #endif
 );

+ 2 - 2
src/datawizard/memalloc.c

@@ -230,7 +230,7 @@ static size_t try_to_free_mem_chunk(mem_chunk_t mc, unsigned node, unsigned atte
 	return liberated;
 }
 
-#ifdef USE_ALLOCATION_CACHE
+#ifdef STARPU_USE_ALLOCATION_CACHE
 /* we assume that mc_rwlock[node] is taken */
 static void reuse_mem_chunk(unsigned node, starpu_data_handle new_data, mem_chunk_t mc, unsigned is_already_in_mc_list)
 {
@@ -550,7 +550,7 @@ int _starpu_allocate_memory_on_node(starpu_data_handle handle, uint32_t dst_node
 
 	data_allocation_inc_stats(dst_node);
 
-#ifdef USE_ALLOCATION_CACHE
+#ifdef STARPU_USE_ALLOCATION_CACHE
 	/* perhaps we can directly reuse a buffer in the free-list */
 	uint32_t footprint = compute_data_footprint(handle);
 

+ 3 - 3
src/drivers/cpu/driver_cpu.c

@@ -98,14 +98,14 @@ void *_starpu_cpu_worker(void *arg)
 {
 	struct worker_s *cpu_arg = arg;
 
-#ifdef USE_FXT
+#ifdef STARPU_USE_FXT
 	fxt_register_thread(cpu_arg->bindid);
 #endif
 	TRACE_WORKER_INIT_START(FUT_CPU_KEY, cpu_arg->memory_node);
 
 	_starpu_bind_thread_on_cpu(cpu_arg->config, cpu_arg->bindid);
 
-#ifdef VERBOSE
+#ifdef STARPU_VERBOSE
         fprintf(stderr, "cpu worker %d is ready on logical cpu %d\n", cpu_arg->id, cpu_arg->bindid);
 #endif
 
@@ -197,7 +197,7 @@ void *_starpu_cpu_worker(void *arg)
 	fprintf(stderr, "CPU #%d computation %le comm %le (%lf \%%)\n", cpu_arg->id, cpu_arg->jobq->total_computation_time, cpu_arg->jobq->total_communication_time,  cpu_arg->jobq->total_communication_time*100.0/cpu_arg->jobq->total_computation_time);
 #endif
 
-#ifdef VERBOSE
+#ifdef STARPU_VERBOSE
 	double ratio = 0;
 	if (cpu_arg->jobq->total_job_performed != 0)
 	{

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

@@ -170,7 +170,7 @@ void *_starpu_cuda_worker(void *arg)
 	int devid = args->id;
 	unsigned memory_node = args->memory_node;
 
-#ifdef USE_FXT
+#ifdef STARPU_USE_FXT
 	fxt_register_thread(args->bindid);
 #endif
 	TRACE_WORKER_INIT_START(FUT_CUDA_KEY, memory_node);
@@ -206,7 +206,7 @@ void *_starpu_cuda_worker(void *arg)
 	strncpy(devname, prop.name, 128);
 	snprintf(args->name, 32, "CUDA %d (%s)", args->id, devname);
 
-#ifdef VERBOSE
+#ifdef STARPU_VERBOSE
 	fprintf(stderr, "cuda (%s) dev id %d thread is ready to run on CPU %d !\n", devname, devid, args->bindid);
 #endif
 
@@ -284,7 +284,7 @@ void *_starpu_cuda_worker(void *arg)
 	fprintf(stderr, "CUDA #%d computation %le comm %le (%lf \%%)\n", args->id, args->jobq->total_computation_time, args->jobq->total_communication_time, args->jobq->total_communication_time*100.0/args->jobq->total_computation_time);
 #endif
 
-#ifdef VERBOSE
+#ifdef STARPU_VERBOSE
 	double ratio = 0;
 	if (args->jobq->total_job_performed != 0)
 	{

+ 1 - 1
tools/Makefile.am

@@ -27,7 +27,7 @@ bin_PROGRAMS += calibrate_bus
 
 calibrate_bus_SOURCES = calibrate_bus.c
 
-if USE_FXT
+if STARPU_USE_FXT
 bin_PROGRAMS += fxt-tool fxt-stats
 
 fxt_tool_SOURCES = fxt-tool.c fxt-tool-common.c fxt-tool-mpi.c dag-dot.c histo-paje.c