Samuel Thibault 11 lat temu
rodzic
commit
ffe426bf48

+ 6 - 1
examples/worker_collections/worker_list_example.c

@@ -21,7 +21,12 @@
 
 int main()
 {
-	starpu_init(NULL);
+	int ret;
+
+	ret = starpu_init(NULL);
+	if (ret == -ENODEV)
+		return 77;
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 	int procs[STARPU_NMAXWORKERS];
 	unsigned ncpus =  starpu_cpu_worker_get_count();

+ 1 - 1
examples/worker_collections/worker_tree_example.c

@@ -63,7 +63,7 @@ int main()
 
 	double timing = (end_time - start_time) / 1000;
 
-	int i;
+	unsigned i;
 	for(i = 0; i < ncpus; i++)
 	{
 		int added = co->add(co, procs[i]);

+ 7 - 0
include/starpu_config.h.in

@@ -15,6 +15,13 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+/*
+ * This is the public config.h file, installed along libstarpu.
+ *
+ * It should only contain the build-time #defines which have an effect on the
+ * API & ABI.
+ */
+
 #ifndef __STARPU_CONFIG_PUBLIC_H__
 #define __STARPU_CONFIG_PUBLIC_H__
 

+ 1 - 1
include/starpu_data_interfaces.h

@@ -113,7 +113,7 @@ struct starpu_data_interface_ops
 	uint32_t 	 (*footprint)			(starpu_data_handle_t handle);
 	int 		 (*compare)			(void *data_interface_a, void *data_interface_b);
 	void 		 (*display)			(starpu_data_handle_t handle, FILE *f);
-	ssize_t		 (*describe)			(void *data_interface, char *buf, size_t size);
+	starpu_ssize_t	 (*describe)			(void *data_interface, char *buf, size_t size);
 	enum starpu_data_interface_id interfaceid;
 	size_t interface_size;
 

+ 2 - 2
mpi/tests/block_interface.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2014  Centre National de la Recherche Scientifique
  *
  * 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
@@ -51,7 +51,7 @@ int main(int argc, char **argv)
 	 * register it directly. Node 0 and 1 will then exchange the content of
 	 * their blocks. */
 
-	float *block;
+	float *block = NULL;
 	starpu_data_handle_t block_handle;
 
 	if (rank == 0)

+ 1 - 1
mpi/tests/insert_task_recv_cache.c

@@ -130,7 +130,7 @@ int main(int argc, char **argv)
 	if (rank == 1)
 	{
 		result = (comm_amount_with_cache[0] == comm_amount_without_cache[0] * 2);
-		FPRINTF_MPI("Communication cache mechanism is %sworking (with cache: %d) (without cache: %d)\n", result?"":"NOT ", comm_amount_with_cache[0], comm_amount_without_cache[0]);
+		FPRINTF_MPI("Communication cache mechanism is %sworking (with cache: %ld) (without cache: %ld)\n", result?"":"NOT ", comm_amount_with_cache[0], comm_amount_without_cache[0]);
 	}
 	else
 		result = 1;

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

@@ -16,7 +16,7 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
-#if !defined(_WIN32) || defined(__MINGW__) || defined(__CYGWIN__)
+#if !defined(_WIN32) || defined(__MINGW32__) || defined(__CYGWIN__)
 #include <dirent.h>
 #include <sys/stat.h>
 #endif
@@ -1047,7 +1047,7 @@ void starpu_perfmodel_directory(FILE *output)
  * the performance model files */
 int starpu_perfmodel_list(FILE *output)
 {
-#if !defined(_WIN32) || defined(__MINGW__) || defined(__CYGWIN__)
+#if !defined(_WIN32) || defined(__MINGW32__) || defined(__CYGWIN__)
         char path[256];
         DIR *dp;
         struct dirent *ep;

+ 31 - 43
src/debug/traces/starpu_fxt.c

@@ -808,7 +808,7 @@ static void handle_end_codelet_body(struct fxt_ev_64 *ev, struct starpu_fxt_opti
 	}
 }
 
-static void handle_start_thread_executing(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
+static void handle_start_executing(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
 {
 	char *prefix = options->file_prefix;
 
@@ -816,7 +816,7 @@ static void handle_start_thread_executing(struct fxt_ev_64 *ev, struct starpu_fx
 		thread_set_state(get_event_time_stamp(ev, options), prefix, ev->param[0], "E");
 }
 
-static void handle_end_thread_executing(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
+static void handle_end_executing(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
 {
 	char *prefix = options->file_prefix;
 
@@ -882,7 +882,7 @@ static void handle_end_callback(struct fxt_ev_64 *ev, struct starpu_fxt_options
 		thread_set_state(get_event_time_stamp(ev, options), options->file_prefix, ev->param[1], "B");
 }
 
-static void handle_hyp_begin(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
+static void handle_hypervisor_begin(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
 {
 	int worker;
 	worker = find_worker_id(ev->param[0]);
@@ -893,7 +893,7 @@ static void handle_hyp_begin(struct fxt_ev_64 *ev, struct starpu_fxt_options *op
 		thread_set_state(get_event_time_stamp(ev, options), options->file_prefix, ev->param[0], "H");
 }
 
-static void handle_hyp_end(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
+static void handle_hypervisor_end(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
 {
 	int worker;
 	worker = find_worker_id(ev->param[0]);
@@ -917,7 +917,7 @@ static void handle_worker_status(struct fxt_ev_64 *ev, struct starpu_fxt_options
 
 static double last_sleep_start[STARPU_NMAXWORKERS];
 
-static void handle_start_scheduling(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
+static void handle_worker_scheduling_start(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
 {
 	int worker;
 	worker = find_worker_id(ev->param[0]);
@@ -927,7 +927,7 @@ static void handle_start_scheduling(struct fxt_ev_64 *ev, struct starpu_fxt_opti
 		thread_set_state(get_event_time_stamp(ev, options), options->file_prefix, ev->param[0], "Sc");
 }
 
-static void handle_end_scheduling(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
+static void handle_worker_scheduling_end(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
 {
 	int worker;
 	worker = find_worker_id(ev->param[0]);
@@ -937,7 +937,7 @@ static void handle_end_scheduling(struct fxt_ev_64 *ev, struct starpu_fxt_option
 		thread_set_state(get_event_time_stamp(ev, options), options->file_prefix, ev->param[0], "B");
 }
 
-static void handle_push_scheduling(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
+static void handle_worker_scheduling_push(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
 {
 	int worker;
 	worker = find_worker_id(ev->param[0]);
@@ -947,7 +947,7 @@ static void handle_push_scheduling(struct fxt_ev_64 *ev, struct starpu_fxt_optio
 		thread_push_state(get_event_time_stamp(ev, options), options->file_prefix, ev->param[0], "Sc");
 }
 
-static void handle_pop_scheduling(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
+static void handle_worker_scheduling_pop(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
 {
 	int worker;
 	worker = find_worker_id(ev->param[0]);
@@ -957,7 +957,7 @@ static void handle_pop_scheduling(struct fxt_ev_64 *ev, struct starpu_fxt_option
 		thread_pop_state(get_event_time_stamp(ev, options), options->file_prefix, ev->param[0]);
 }
 
-static void handle_start_sleep(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
+static void handle_worker_sleep_start(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
 {
 	int worker;
 	worker = find_worker_id(ev->param[0]);
@@ -970,7 +970,7 @@ static void handle_start_sleep(struct fxt_ev_64 *ev, struct starpu_fxt_options *
 		thread_set_state(get_event_time_stamp(ev, options), options->file_prefix, ev->param[0], "Sl");
 }
 
-static void handle_end_sleep(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
+static void handle_worker_sleep_end(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
 {
 	int worker;
 	worker = find_worker_id(ev->param[0]);
@@ -1209,7 +1209,7 @@ void handle_update_task_cnt(struct fxt_ev_64 *ev, struct starpu_fxt_options *opt
 	fprintf(activity_file, "cnt_submitted\t%.9f\t%lu\n", current_timestamp, nsubmitted);
 }
 
-static void handle_codelet_tag(struct fxt_ev_64 *ev)
+static void handle_tag(struct fxt_ev_64 *ev)
 {
 	uint64_t tag;
 	unsigned long job;
@@ -1220,7 +1220,7 @@ static void handle_codelet_tag(struct fxt_ev_64 *ev)
 	_starpu_fxt_dag_add_tag(tag, job);
 }
 
-static void handle_codelet_tag_deps(struct fxt_ev_64 *ev)
+static void handle_tag_deps(struct fxt_ev_64 *ev)
 {
 	uint64_t child;
 	uint64_t father;
@@ -1684,10 +1684,10 @@ void starpu_fxt_parse_new_file(char *filename_in, struct starpu_fxt_options *opt
 				break;
 
 			case _STARPU_FUT_START_EXECUTING:
-				handle_start_thread_executing(&ev, options);
+				handle_start_executing(&ev, options);
 				break;
 			case _STARPU_FUT_END_EXECUTING:
-				handle_end_thread_executing(&ev, options);
+				handle_end_executing(&ev, options);
 				break;
 
 			case _STARPU_FUT_START_CALLBACK:
@@ -1713,19 +1713,15 @@ void starpu_fxt_parse_new_file(char *filename_in, struct starpu_fxt_options *opt
 			case _STARPU_FUT_START_FETCH_INPUT:
 				handle_worker_status(&ev, options, "Fi");
 				break;
-
 			case _STARPU_FUT_START_PUSH_OUTPUT:
 				handle_worker_status(&ev, options, "Po");
 				break;
-
 			case _STARPU_FUT_START_PROGRESS:
 				handle_worker_status(&ev, options, "P");
 				break;
-
 			case _STARPU_FUT_START_UNPARTITION:
 				handle_worker_status(&ev, options, "U");
 				break;
-
 			case _STARPU_FUT_END_FETCH_INPUT:
 			case _STARPU_FUT_END_PROGRESS:
 			case _STARPU_FUT_END_PUSH_OUTPUT:
@@ -1734,35 +1730,35 @@ void starpu_fxt_parse_new_file(char *filename_in, struct starpu_fxt_options *opt
 				break;
 
 			case _STARPU_FUT_WORKER_SCHEDULING_START:
-				handle_start_scheduling(&ev, options);
+				handle_worker_scheduling_start(&ev, options);
 				break;
 
 			case _STARPU_FUT_WORKER_SCHEDULING_END:
-				handle_end_scheduling(&ev, options);
+				handle_worker_scheduling_end(&ev, options);
 				break;
 
 			case _STARPU_FUT_WORKER_SCHEDULING_PUSH:
-				handle_push_scheduling(&ev, options);
+				handle_worker_scheduling_push(&ev, options);
 				break;
 
 			case _STARPU_FUT_WORKER_SCHEDULING_POP:
-				handle_pop_scheduling(&ev, options);
+				handle_worker_scheduling_pop(&ev, options);
 				break;
 
 			case _STARPU_FUT_WORKER_SLEEP_START:
-				handle_start_sleep(&ev, options);
+				handle_worker_sleep_start(&ev, options);
 				break;
 
 			case _STARPU_FUT_WORKER_SLEEP_END:
-				handle_end_sleep(&ev, options);
+				handle_worker_sleep_end(&ev, options);
 				break;
 
 			case _STARPU_FUT_TAG:
-				handle_codelet_tag(&ev);
+				handle_tag(&ev);
 				break;
 
 			case _STARPU_FUT_TAG_DEPS:
-				handle_codelet_tag_deps(&ev);
+				handle_tag_deps(&ev);
 				break;
 
 			case _STARPU_FUT_TASK_DEPS:
@@ -1779,27 +1775,27 @@ void starpu_fxt_parse_new_file(char *filename_in, struct starpu_fxt_options *opt
 
 			case _STARPU_FUT_DATA_COPY:
 				if (!options->no_bus)
-				handle_data_copy();
+				     handle_data_copy();
 				break;
 
 			case _STARPU_FUT_START_DRIVER_COPY:
 				if (!options->no_bus)
-				handle_start_driver_copy(&ev, options);
+					handle_start_driver_copy(&ev, options);
 				break;
 
 			case _STARPU_FUT_END_DRIVER_COPY:
 				if (!options->no_bus)
-				handle_end_driver_copy(&ev, options);
+					handle_end_driver_copy(&ev, options);
 				break;
 
 			case _STARPU_FUT_START_DRIVER_COPY_ASYNC:
 				if (!options->no_bus)
-				handle_start_driver_copy_async(&ev, options);
+					handle_start_driver_copy_async(&ev, options);
 				break;
 
 			case _STARPU_FUT_END_DRIVER_COPY_ASYNC:
 				if (!options->no_bus)
-				handle_end_driver_copy_async(&ev, options);
+					handle_end_driver_copy_async(&ev, options);
 				break;
 
 			case _STARPU_FUT_WORK_STEALING:
@@ -1816,27 +1812,23 @@ void starpu_fxt_parse_new_file(char *filename_in, struct starpu_fxt_options *opt
 
 			case _STARPU_FUT_START_ALLOC:
 				if (!options->no_bus)
-				handle_memnode_event(&ev, options, "A");
+					handle_memnode_event(&ev, options, "A");
 				break;
-
 			case _STARPU_FUT_START_ALLOC_REUSE:
 				if (!options->no_bus)
-				handle_memnode_event(&ev, options, "Ar");
+					handle_memnode_event(&ev, options, "Ar");
 				break;
-
 			case _STARPU_FUT_END_ALLOC:
 			case _STARPU_FUT_END_ALLOC_REUSE:
 				if (!options->no_bus)
 				handle_memnode_event(&ev, options, "No");
 				break;
-
 			case _STARPU_FUT_START_FREE:
 				if (!options->no_bus)
 				{
 					handle_memnode_event(&ev, options, "F");
 				}
 				break;
-
 			case _STARPU_FUT_END_FREE:
 				if (!options->no_bus)
 				{
@@ -1847,14 +1839,12 @@ void starpu_fxt_parse_new_file(char *filename_in, struct starpu_fxt_options *opt
 						handle_memnode_event(&ev, options, "No");
 				}
 				break;
-
 			case _STARPU_FUT_START_WRITEBACK:
 				if (!options->no_bus)
 				{
 					handle_memnode_event(&ev, options, "W");
 				}
 				break;
-
 			case _STARPU_FUT_END_WRITEBACK:
 				if (!options->no_bus)
 				{
@@ -1865,7 +1855,6 @@ void starpu_fxt_parse_new_file(char *filename_in, struct starpu_fxt_options *opt
 						handle_memnode_event(&ev, options, "No");
 				}
 				break;
-
 			case _STARPU_FUT_START_MEMRECLAIM:
 				if (!options->no_bus)
 				{
@@ -1874,7 +1863,6 @@ void starpu_fxt_parse_new_file(char *filename_in, struct starpu_fxt_options *opt
 					handle_memnode_event(&ev, options, "R");
 				}
 				break;
-
 			case _STARPU_FUT_END_MEMRECLAIM:
 				if (!options->no_bus)
 				{
@@ -2050,11 +2038,11 @@ void starpu_fxt_parse_new_file(char *filename_in, struct starpu_fxt_options *opt
 				break;
 
 			case _STARPU_FUT_HYPERVISOR_BEGIN:
-				handle_hyp_begin(&ev, options);
+				handle_hypervisor_begin(&ev, options);
 				break;
 
 			case _STARPU_FUT_HYPERVISOR_END:
-				handle_hyp_end(&ev, options);
+				handle_hypervisor_end(&ev, options);
 				break;
 
 			default:

+ 2 - 3
src/dolib.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010, 2012  Université de Bordeaux 1
+ * Copyright (C) 2010, 2012, 2014  Université de Bordeaux 1
  *
  * 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
@@ -18,8 +18,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <common/config.h>
-#ifdef HAVE_UNISTD_H
+#if defined(_WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__)
 #include <unistd.h>
 #endif
 

+ 7 - 6
src/top/starpu_top_connection.c

@@ -15,15 +15,14 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
-#include <starpu_config.h>
-#include <starpu.h>
-
-#ifdef __MINGW__
-#  define WINVER WindowsXP
-#  include <w32api.h>
+#ifdef __MINGW32__
+#  define WINVER 0x0501 /* WindowsXP, for getaddrinfo */
 #endif
 
+#include <starpu_config.h>
+
 #ifdef STARPU_HAVE_WINDOWS
+#  include <winsock2.h>
 #  include <ws2tcpip.h>
 #  include <io.h>
 #else
@@ -32,6 +31,8 @@
 #  include <netdb.h>
 #endif
 
+#include <starpu.h>
+
 #include <top/starpu_top_core.h>
 #include <top/starpu_top_connection.h>
 #include <top/starpu_top_message_queue.h>

+ 2 - 2
tests/datawizard/interfaces/multiformat/multiformat_interface.c

@@ -83,7 +83,7 @@ void test_multiformat_mic_func(void *buffers[], void *args)
 	printf("MIC\n");
 
 	struct struct_of_arrays *soa;
-	unsigned int n, i;
+	int n, i;
 	int factor;
 
 	soa = (struct struct_of_arrays *) STARPU_MULTIFORMAT_GET_MIC_PTR(buffers[0]);
@@ -92,7 +92,7 @@ void test_multiformat_mic_func(void *buffers[], void *args)
 
 	for (i = 0; i < n; i++)
 	{
-			FPRINTF(stderr, "(%d %d) [%d]", soa->x[i], soa->y[i], factor);
+		FPRINTF(stderr, "(%d %d) [%d]", soa->x[i], soa->y[i], factor);
 		if (soa->x[i] != i * factor || soa->y[i] != i * factor)
 		{
 			multiformat_config.copy_failed = 1;