Bladeren bron

src: small fixes

Nathalie Furmento 4 jaren geleden
bovenliggende
commit
89494ea675

+ 2 - 1
src/core/topology.c

@@ -84,7 +84,6 @@ static int _starpu_get_logical_numa_node_worker(unsigned workerid);
 #define STARPU_NUMA_MAIN_RAM (-1)
 
 #if defined(STARPU_USE_CUDA) || defined(STARPU_USE_OPENCL) || defined(STARPU_SIMGRID) || defined(STARPU_USE_MPI_MASTER_SLAVE)
-
 struct handle_entry
 {
 	UT_hash_handle hh;
@@ -96,7 +95,9 @@ struct handle_entry
 static struct handle_entry *devices_using_cuda;
 #  endif
 
+#if defined(STARPU_USE_CUDA) || defined(STARPU_USE_OPENCL) || defined(STARPU_SIMGRID)
 static unsigned may_bind_automatically[STARPU_NARCH] = { 0 };
+#endif
 
 #endif // defined(STARPU_USE_CUDA) || defined(STARPU_USE_OPENCL)
 

+ 9 - 6
src/core/workers.c

@@ -829,21 +829,20 @@ static void _starpu_launch_drivers(struct _starpu_machine_config *pconfig)
 	for (worker = 0; worker < nworkers; worker++)
 	{
 		struct _starpu_worker *workerarg = &pconfig->workers[worker];
-		unsigned devid = workerarg->devid;
 		workerarg->wait_for_worker_initialization = 0;
 
 		_STARPU_DEBUG("initialising worker %u/%u\n", worker, nworkers);
 
 		_starpu_init_worker_queue(workerarg);
 
-		struct starpu_driver driver;
-		driver.type = workerarg->arch;
 		switch (workerarg->arch)
 		{
 #if defined(STARPU_USE_CPU) || defined(STARPU_SIMGRID)
 			case STARPU_CPU_WORKER:
 			{
-				driver.id.cpu_id = devid;
+				struct starpu_driver driver;
+				driver.type = workerarg->arch;
+				driver.id.cpu_id = workerarg->devid;
 				workerarg->driver_ops = &_starpu_driver_cpu_ops;
 				workerarg->wait_for_worker_initialization = 1;
 
@@ -868,7 +867,9 @@ static void _starpu_launch_drivers(struct _starpu_machine_config *pconfig)
 #if defined(STARPU_USE_CUDA) || defined(STARPU_SIMGRID)
 			case STARPU_CUDA_WORKER:
 			{
-				driver.id.cuda_id = devid;
+				struct starpu_driver driver;
+				driver.type = workerarg->arch;
+				driver.id.cuda_id = workerarg->devid;
 				workerarg->driver_ops = &_starpu_driver_cuda_ops;
 				struct _starpu_worker_set *worker_set = workerarg->set;
 
@@ -903,7 +904,9 @@ static void _starpu_launch_drivers(struct _starpu_machine_config *pconfig)
 			case STARPU_OPENCL_WORKER:
 			{
 #ifndef STARPU_SIMGRID
-				starpu_opencl_get_device(devid, &driver.id.opencl_id);
+				struct starpu_driver driver;
+				driver.type = workerarg->arch;
+				starpu_opencl_get_device(workerarg->devid, &driver.id.opencl_id);
 				workerarg->driver_ops = &_starpu_driver_opencl_ops;
 				workerarg->wait_for_worker_initialization = 1;
 

+ 1 - 1
src/drivers/mp_common/mp_common.h

@@ -255,7 +255,7 @@ struct _starpu_mp_node
         void (*dt_recv_from_device) (const struct _starpu_mp_node *, int, void *, int, void *);
 
         /** Test async transfers */
-        int (*dt_test) (struct _starpu_async_channel *);
+        unsigned int (*dt_test) (struct _starpu_async_channel *);
 
         void (*(*get_kernel_from_job)   (const struct _starpu_mp_node *,struct _starpu_job *))(void);
         void (*(*lookup)                (const struct _starpu_mp_node *, char* ))(void);

+ 1 - 1
src/drivers/mpi/driver_mpi_common.c

@@ -363,7 +363,7 @@ static void _starpu_mpi_common_polling_node(struct _starpu_mp_node * node)
 /* - In device to device communications, the first ack received by host
  * is considered as the sender (but it cannot be, in fact, the sender)
  */
-unsigned _starpu_mpi_common_test_event(struct _starpu_async_channel * event)
+unsigned int _starpu_mpi_common_test_event(struct _starpu_async_channel * event)
 {
         if (event->event.mpi_ms_event.requests != NULL && !_starpu_mpi_ms_event_request_list_empty(event->event.mpi_ms_event.requests))
         {

+ 1 - 1
src/drivers/mpi/driver_mpi_common.h

@@ -47,7 +47,7 @@ void _starpu_mpi_common_mp_recv(const struct _starpu_mp_node *node, void *msg, i
 void _starpu_mpi_common_recv_from_device(const struct _starpu_mp_node *node, int src_devid, void *msg, int len, void * event);
 void _starpu_mpi_common_send_to_device(const struct _starpu_mp_node *node, int dst_devid, void *msg, int len, void * event);
 
-unsigned _starpu_mpi_common_test_event(struct _starpu_async_channel * event);
+unsigned int _starpu_mpi_common_test_event(struct _starpu_async_channel * event);
 void _starpu_mpi_common_wait_request_completion(struct _starpu_async_channel * event);
 
 void _starpu_mpi_common_barrier(void);

+ 5 - 2
src/drivers/mpi/driver_mpi_sink.c

@@ -14,7 +14,6 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
-
 #include <mpi.h>
 #include <dlfcn.h>
 
@@ -85,7 +84,11 @@ void _starpu_mpi_sink_launch_workers(struct _starpu_mp_node *node)
         }
 }
 
-void _starpu_mpi_sink_bind_thread(const struct _starpu_mp_node *mp_node STARPU_ATTRIBUTE_UNUSED, int coreid, int * core_table, int nb_core)
+void _starpu_mpi_sink_bind_thread(const struct _starpu_mp_node *mp_node, int coreid, int *core_table, int nb_core)
 {
         //TODO
+	(void)mp_node;
+	(void)coreid;
+	(void)core_table;
+	(void)nb_core;
 }