Bladeren bron

src: fix parameter printf type

Nathalie Furmento 8 jaren geleden
bovenliggende
commit
17d445233c

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

@@ -1383,7 +1383,7 @@ void starpu_perfmodel_get_arch_name(struct starpu_perfmodel_arch* arch, char *ar
 	strcpy(devices, "");
 	for(i=0 ; i<arch->ndevices ; i++)
 	{
-		written += snprintf(devices + written, sizeof(devices)-written, "%s%u%s", starpu_perfmodel_get_archtype_name(arch->devices[i].type), arch->devices[i].devid, i != arch->ndevices-1 ? "_":"");
+		written += snprintf(devices + written, sizeof(devices)-written, "%s%d%s", starpu_perfmodel_get_archtype_name(arch->devices[i].type), arch->devices[i].devid, i != arch->ndevices-1 ? "_":"");
 	}
 	snprintf(archname, maxlen, "%s_impl%u (Comb%d)", devices, impl, comb);
 }
@@ -1822,7 +1822,7 @@ void _starpu_update_perfmodel_history(struct _starpu_job *j, struct starpu_perfm
 
 		STARPU_ASSERT(j->footprint_is_computed);
 
-		fprintf(f, "0x%x\t%lu\t%f\t%f\t%f\t%d\t\t", j->footprint, (unsigned long) _starpu_job_get_data_size(model, arch, impl, j), measured, task->predicted, task->predicted_transfer, cpuid);
+		fprintf(f, "0x%x\t%lu\t%f\t%f\t%f\t%u\t\t", j->footprint, (unsigned long) _starpu_job_get_data_size(model, arch, impl, j), measured, task->predicted, task->predicted_transfer, cpuid);
 		unsigned i;
 		unsigned nbuffers = STARPU_TASK_GET_NBUFFERS(task);
 

+ 2 - 2
src/core/sched_ctx.c

@@ -575,7 +575,7 @@ struct _starpu_sched_ctx* _starpu_create_sched_ctx(struct starpu_sched_policy *p
 		sched_ctx->sms_start_idx = occupied_sms;
 		sched_ctx->sms_end_idx = occupied_sms+nsms;
 		occupied_sms += nsms;
-		_STARPU_DEBUG("ctx %d: stream worker %d nsms %d ocupied sms %d\n", sched_ctx->id, workerids[0], nsms, occupied_sms);
+		_STARPU_DEBUG("ctx %u: stream worker %d nsms %d ocupied sms %d\n", sched_ctx->id, workerids[0], nsms, occupied_sms);
 		STARPU_ASSERT_MSG(occupied_sms <= STARPU_NMAXSMS , "STARPU:requested more sms than available");
 		_starpu_worker_set_stream_ctx(workerids[0], sched_ctx);
 		sched_ctx->stream_worker = workerids[0];
@@ -1092,7 +1092,7 @@ unsigned _starpu_can_push_task(struct _starpu_sched_ctx *sched_ctx, struct starp
 			expected_len = expected_end - hyp_actual_start_sample[sched_ctx->id] ;
 		else
 		{
-			_STARPU_MSG("%d: sc start is 0.0\n", sched_ctx->id);
+			_STARPU_MSG("%u: sc start is 0.0\n", sched_ctx->id);
 			expected_len = expected_end - starpu_timing_now();
 		}
 		if(expected_len < 0.0)

+ 2 - 2
src/core/simgrid.c

@@ -110,7 +110,7 @@ int _starpu_simgrid_get_nbhosts(const char *prefix)
 	{
 		char name[32];
 		STARPU_ASSERT(starpu_mpi_world_rank);
-		snprintf(name, sizeof(name), STARPU_MPI_AS_PREFIX"%u", starpu_mpi_world_rank());
+		snprintf(name, sizeof(name), STARPU_MPI_AS_PREFIX"%d", starpu_mpi_world_rank());
 		hosts = MSG_environment_as_get_hosts(_starpu_simgrid_get_as_by_name(name));
 		snprintf(new_prefix, sizeof(new_prefix), "%s-%s", name, prefix);
 		prefix = new_prefix;
@@ -187,7 +187,7 @@ msg_host_t _starpu_simgrid_get_host_by_worker(struct _starpu_worker *worker)
 		default:
 			STARPU_ASSERT(0);
 	}
-	snprintf(name, sizeof(name), "%s%d", prefix, worker->devid);
+	snprintf(name, sizeof(name), "%s%u", prefix, worker->devid);
 	host =  _starpu_simgrid_get_host_by_name(name);
 	STARPU_ASSERT_MSG(host, "Could not find host %s!", name);
 	return host;

+ 1 - 1
src/core/topology.c

@@ -2077,7 +2077,7 @@ _starpu_init_workers_binding (struct _starpu_machine_config *config, int no_mp_c
 
 		workerarg->memory_node = memory_node;
 
-		_STARPU_DEBUG("worker %d type %d devid %d bound to cpu %d, STARPU memory node %d\n", worker, workerarg->arch, devid, workerarg->bindid, memory_node);
+		_STARPU_DEBUG("worker %d type %d devid %u bound to cpu %d, STARPU memory node %u\n", worker, workerarg->arch, devid, workerarg->bindid, memory_node);
 
 #ifdef __GLIBC__
 		if (workerarg->bindid != -1)

+ 1 - 1
src/datawizard/malloc.c

@@ -125,7 +125,7 @@ int starpu_malloc_flags(void **A, size_t dim, int flags)
 			{
 				size_t freed;
 				size_t reclaim = 2 * dim;
-				_STARPU_DEBUG("There is not enough memory left, we are going to reclaim %ld\n", reclaim);
+				_STARPU_DEBUG("There is not enough memory left, we are going to reclaim %ld\n", (long)reclaim);
 				_STARPU_TRACE_START_MEMRECLAIM(STARPU_MAIN_RAM,0);
 				freed = _starpu_memory_reclaim_generic(STARPU_MAIN_RAM, 0, reclaim);
 				_STARPU_TRACE_END_MEMRECLAIM(STARPU_MAIN_RAM,0);

+ 2 - 2
src/datawizard/memory_manager.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2012-2013, 2015, 2016  CNRS
+ * Copyright (C) 2012-2013, 2015, 2016, 2017  CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -57,7 +57,7 @@ void _starpu_memory_manager_set_global_memory_size(unsigned node, size_t size)
 	if (!global_size[node])
 	{
 		global_size[node] = size;
-		_STARPU_DEBUG("Global size for node %d is %ld\n", node, (long)global_size[node]);
+		_STARPU_DEBUG("Global size for node %u is %ld\n", node, (long)global_size[node]);
 	}
 	else
 	{

+ 2 - 2
src/datawizard/memory_nodes.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009-2017  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015  CNRS
+ * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2017  CNRS
  * Copyright (C) 2017  Inria
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -105,7 +105,7 @@ void _starpu_memory_node_get_name(unsigned node, char *name, int size)
 		prefix = "unknown";
 		STARPU_ASSERT(0);
 	}
-	snprintf(name, size, "%s %u", prefix, _starpu_descr.devid[node]);
+	snprintf(name, size, "%s %d", prefix, _starpu_descr.devid[node]);
 }
 
 unsigned _starpu_memory_node_register(enum starpu_node_kind kind, int devid)

+ 5 - 5
src/datawizard/memstats.c

@@ -65,13 +65,13 @@ void _starpu_memory_display_handle_stats(FILE *stream, starpu_data_handle_t hand
 		    +handle->memory_stats->invalidated[node]+handle->memory_stats->loaded_owner[node])
 		{
 			fprintf(stream, "Node #%u\n", node);
-			fprintf(stream, "\tDirect access : %d\n", handle->memory_stats->direct_access[node]);
+			fprintf(stream, "\tDirect access : %u\n", handle->memory_stats->direct_access[node]);
 			/* XXX Not Working yet. */
 			if (handle->memory_stats->shared_to_owner[node])
-				fprintf(stream, "\t\tShared to Owner : %d\n", handle->memory_stats->shared_to_owner[node]);
-			fprintf(stream, "\tLoaded (Owner) : %d\n", handle->memory_stats->loaded_owner[node]);
-			fprintf(stream, "\tLoaded (Shared) : %d\n", handle->memory_stats->loaded_shared[node]);
-			fprintf(stream, "\tInvalidated (was Owner) : %d\n\n", handle->memory_stats->invalidated[node]);
+				fprintf(stream, "\t\tShared to Owner : %u\n", handle->memory_stats->shared_to_owner[node]);
+			fprintf(stream, "\tLoaded (Owner) : %u\n", handle->memory_stats->loaded_owner[node]);
+			fprintf(stream, "\tLoaded (Shared) : %u\n", handle->memory_stats->loaded_shared[node]);
+			fprintf(stream, "\tInvalidated (was Owner) : %u\n\n", handle->memory_stats->invalidated[node]);
 		}
 	}
 }

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

@@ -111,7 +111,7 @@ static void _starpu_opencl_limit_gpu_mem_if_needed(unsigned devid)
 	to_waste = totalGlobalMem - global_mem[devid];
 #endif
 
-	_STARPU_DEBUG("OpenCL device %d: Wasting %ld MB / Limit %ld MB / Total %ld MB / Remains %ld MB\n",
+	_STARPU_DEBUG("OpenCL device %u: Wasting %ld MB / Limit %ld MB / Total %ld MB / Remains %ld MB\n",
 			devid, (long)to_waste/(1024*1024), (long) limit, (long)totalGlobalMem/(1024*1024),
 			(long)(totalGlobalMem - to_waste)/(1024*1024));
 

+ 1 - 1
src/sched_policies/heteroprio.c

@@ -128,7 +128,7 @@ inline void starpu_heteroprio_set_mapping(unsigned sched_ctx_id, enum starpu_het
 	hp->prio_mapping_per_arch_index[arch][source_prio] = dest_bucket_id;
 
 	hp->buckets[dest_bucket_id].valid_archs |= starpu_heteroprio_types_to_arch[arch];
-	_STARPU_DEBUG("Adding arch %d to bucket %d\n", arch, dest_bucket_id);
+	_STARPU_DEBUG("Adding arch %d to bucket %u\n", arch, dest_bucket_id);
 }
 
 /** Tell which arch is the faster for the tasks of a bucket (optional) */

+ 1 - 1
src/util/starpu_clusters_create.c

@@ -277,7 +277,7 @@ int starpu_cluster_print(struct starpu_cluster_machine *clusters)
 	struct _starpu_cluster_group *group;
 	struct _starpu_cluster *cluster;
 
-	printf("Number of clusters created: %d\n", clusters->nclusters);
+	printf("Number of clusters created: %u\n", clusters->nclusters);
 	cnt=0;
 	for (group = _starpu_cluster_group_list_begin(clusters->groups);
 	     group != _starpu_cluster_group_list_end(clusters->groups);