瀏覽代碼

minor fixes

Nathalie Furmento 7 年之前
父節點
當前提交
f20d9c8959
共有 4 個文件被更改,包括 34 次插入33 次删除
  1. 1 1
      mpi/tests/ring.c
  2. 29 29
      src/core/disk_ops/disk_hdf5.c
  3. 3 3
      src/core/disk_ops/unistd/disk_unistd_global.c
  4. 1 0
      tools/starpu_lp2paje.c

+ 1 - 1
mpi/tests/ring.c

@@ -77,7 +77,7 @@ int main(int argc, char **argv)
 	int token = 42;
 	starpu_data_handle_t token_handle;
 
-	MPI_INIT_THREAD(&argc, &argv, MPI_THREAD_SERIALIZED, &mpi_init);
+	MPI_INIT_THREAD(&argc, &argv, MPI_THREAD_MULTIPLE, &mpi_init);
 
 	ret = starpu_init(NULL);
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");

+ 29 - 29
src/core/disk_ops/disk_hdf5.c

@@ -46,7 +46,7 @@ static starpu_pthread_cond_t global_cond;
 static struct _starpu_hdf5_work_list global_work_list;        /* This list contains the work for the hdf5 thread */
 #endif
 
-#ifdef H5_HAVE_THREADSAFE						
+#ifdef H5_HAVE_THREADSAFE
 
 #define HDF5_VAR_THREAD fileBase->thread
 #define HDF5_VAR_RUN fileBase->run
@@ -54,7 +54,7 @@ static struct _starpu_hdf5_work_list global_work_list;        /* This list conta
 #define HDF5_VAR_COND fileBase->cond
 #define HDF5_VAR_WORK_LIST fileBase->work_list
 
-#else									
+#else
 
 #define HDF5_VAR_THREAD global_thread
 #define HDF5_VAR_RUN global_run
@@ -62,7 +62,7 @@ static struct _starpu_hdf5_work_list global_work_list;        /* This list conta
 #define HDF5_VAR_COND global_cond
 #define HDF5_VAR_WORK_LIST global_work_list
 
-#endif									
+#endif
 
 enum hdf5_work_type { READ, WRITE, FULL_READ, FULL_WRITE, COPY };
 
@@ -140,7 +140,7 @@ static void starpu_hdf5_full_write_internal(struct _starpu_hdf5_work * work)
 		/* Get official datatype */
 		hid_t datatype = H5Dget_type(work->obj_dst->dataset);
 		hsize_t sizeDatatype = H5Tget_size(datatype);
-		
+
 		/* Count in number of elements */
 		hsize_t extendsdim[1] = {work->size/sizeDatatype};
 		status = H5Dset_extent (work->obj_dst->dataset, extendsdim);
@@ -263,10 +263,10 @@ static void starpu_hdf5_copy_internal(struct _starpu_hdf5_work * work)
 		/* Dirty : Delete dataspace because H5Ocopy only works if destination does not exist */
 		H5Ldelete(work->base_dst->fileID, work->obj_dst->path, H5P_DEFAULT);
 
-		status = H5Ocopy(work->base_src->fileID, work->obj_src->path, work->base_dst->fileID, work->obj_dst->path, H5P_DEFAULT, H5P_DEFAULT); 
+		status = H5Ocopy(work->base_src->fileID, work->obj_src->path, work->base_dst->fileID, work->obj_dst->path, H5P_DEFAULT, H5P_DEFAULT);
 		STARPU_ASSERT_MSG(status >= 0, "Can not copy data (%s) associed to this disk (%s) to the data (%s) on this disk (%s)\n", work->obj_src->path, work->base_src->path, work->obj_dst->path, work->base_dst->path);
 
-		work->obj_dst->dataset = H5Dopen2(work->base_dst->fileID, work->obj_dst->path, H5P_DEFAULT);				
+		work->obj_dst->dataset = H5Dopen2(work->base_dst->fileID, work->obj_dst->path, H5P_DEFAULT);
 	}
 	else
 	{
@@ -278,11 +278,11 @@ static void starpu_hdf5_copy_internal(struct _starpu_hdf5_work * work)
 
 		void * ptr;
 		int ret = _starpu_malloc_flags_on_node(STARPU_MAIN_RAM, &ptr, work->size, 0);
-		STARPU_ASSERT_MSG(ret == 0, "Cannot allocate %lu bytes to perform disk to disk operation", work->size);
+		STARPU_ASSERT_MSG(ret == 0, "Cannot allocate %lu bytes to perform disk to disk operation", (unsigned long)work->size);
 
 		/* buffer is only used internally to store intermediate data */
 		work->ptr = ptr;
-		
+
 		starpu_hdf5_read_internal(work);
 		starpu_hdf5_write_internal(work);
 
@@ -342,7 +342,7 @@ static void * _starpu_hdf5_internal_thread(void * arg)
                                 case FULL_WRITE:
                                         starpu_hdf5_full_write_internal(work);
                                         break;
-				
+
 				case COPY:
 					starpu_hdf5_copy_internal(work);
 					break;
@@ -383,7 +383,7 @@ static void _starpu_hdf5_create_thread(struct starpu_hdf5_base * fileBase)
         HDF5_VAR_RUN = 1;
 
         STARPU_PTHREAD_COND_INIT(&HDF5_VAR_COND, NULL);
-        STARPU_PTHREAD_CREATE(&HDF5_VAR_THREAD, NULL, _starpu_hdf5_internal_thread, (void *) fileBase); 
+        STARPU_PTHREAD_CREATE(&HDF5_VAR_THREAD, NULL, _starpu_hdf5_internal_thread, (void *) fileBase);
 }
 
 /* returns the size in BYTES */
@@ -438,7 +438,7 @@ static void starpu_hdf5_send_work(void *base_src, void *obj_src, off_t offset_sr
         struct starpu_hdf5_base * fileBase;
 	if (fileBase_src != NULL)
 		fileBase = fileBase_src;
-	else	
+	else
 		fileBase = fileBase_dst;
 #endif
 
@@ -466,14 +466,14 @@ static struct starpu_hdf5_obj * _starpu_hdf5_data_alloc(struct starpu_hdf5_base
                 free(obj);
                 return NULL;
         }
-	
+
 	hsize_t chunkdim[1] = {STARPU_CHUNK_DIM};
 	hid_t prop = H5Pcreate (H5P_DATASET_CREATE);
 	herr_t status = H5Pset_chunk (prop, 1, chunkdim);
         STARPU_ASSERT_MSG(status >= 0, "Error when setting HDF5 property \n");
 
         /* create a dataset at location name, with data described by the dataspace.
-         * Each element are like char in C (expected one byte) 
+         * Each element are like char in C (expected one byte)
          */
         obj->dataset = H5Dcreate2(fileBase->fileID, name, H5T_NATIVE_CHAR, dataspace, H5P_DEFAULT, prop, H5P_DEFAULT);
 
@@ -490,7 +490,7 @@ static struct starpu_hdf5_obj * _starpu_hdf5_data_alloc(struct starpu_hdf5_base
 	obj->size = size;
 
         _starpu_hdf5_protect_stop((void *) fileBase);
-        
+
         return obj;
 }
 
@@ -502,7 +502,7 @@ static struct starpu_hdf5_obj * _starpu_hdf5_data_open(struct starpu_hdf5_base *
         _starpu_hdf5_protect_start((void *) fileBase);
 
         /* create a dataset at location name, with data described by the dataspace.
-         * Each element are like char in C (expected one byte) 
+         * Each element are like char in C (expected one byte)
          */
         obj->dataset = H5Dopen2(fileBase->fileID, name, H5P_DEFAULT);
 
@@ -516,7 +516,7 @@ static struct starpu_hdf5_obj * _starpu_hdf5_data_open(struct starpu_hdf5_base *
 
         obj->path = name;
 	obj->size = size;
-        
+
         return obj;
 }
 
@@ -528,7 +528,7 @@ static void *starpu_hdf5_plug(void *parameter, starpu_ssize_t size STARPU_ATTRIB
 #ifndef H5_HAVE_THREADSAFE
 	int actual_nb_disk = STARPU_ATOMIC_ADD(&nb_disk_open, 1);
 	if (actual_nb_disk == 1)
-	{	
+	{
 #endif
 		STARPU_PTHREAD_MUTEX_INIT(&HDF5_VAR_MUTEX, NULL);
 #ifndef H5_HAVE_THREADSAFE
@@ -561,14 +561,14 @@ static void *starpu_hdf5_plug(void *parameter, starpu_ssize_t size STARPU_ATTRIB
 
                 /* Truncate it */
                 fileBase->fileID = H5Fcreate((char *)fileBase->path, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
-                if (fileBase->fileID < 0) 
+                if (fileBase->fileID < 0)
                 {
-                        free(fileBase); 
+                        free(fileBase);
                         _STARPU_ERROR("Can not create the HDF5 file (%s)", (char *) parameter);
 			return NULL;
                 }
                 fileBase->created = 1;
-        } 
+        }
         else
         {
                 /* Well, open it ! */
@@ -576,7 +576,7 @@ static void *starpu_hdf5_plug(void *parameter, starpu_ssize_t size STARPU_ATTRIB
 		STARPU_ASSERT(path);
 
                 fileBase->fileID = H5Fopen((char *)parameter, H5F_ACC_RDWR, H5P_DEFAULT);
-                if (fileBase->fileID < 0) 
+                if (fileBase->fileID < 0)
                 {
                         free(fileBase);
 			free(path);
@@ -597,7 +597,7 @@ static void *starpu_hdf5_plug(void *parameter, starpu_ssize_t size STARPU_ATTRIB
 	}
 #endif
 
-#if H5_VERS_MAJOR > 1 || (H5_VERS_MAJOR == 1 && H5_VERS_MINOR > 10) || (H5_VERS_MAJOR == 1 && H5_VERS_MINOR == 10 && H5_VERS_RELEASE > 0) 
+#if H5_VERS_MAJOR > 1 || (H5_VERS_MAJOR == 1 && H5_VERS_MINOR > 10) || (H5_VERS_MAJOR == 1 && H5_VERS_MINOR == 10 && H5_VERS_RELEASE > 0)
 	H5Pset_file_space_strategy(fileBase->fileID, H5F_FSPACE_STRATEGY_FSM_AGGR, 0, 0);
 #endif
 
@@ -653,7 +653,7 @@ static void starpu_hdf5_unplug(void *base)
         STARPU_ASSERT_MSG(status >= 0, "Can not unplug this HDF5 disk (%s)\n", fileBase->path);
         if (fileBase->created)
         {
-                unlink(fileBase->path);        
+                unlink(fileBase->path);
         }
         else
         {
@@ -703,7 +703,7 @@ static void starpu_hdf5_free(void *base, void *obj, size_t size STARPU_ATTRIBUTE
         status = H5Dclose(dataObj->dataset);
         STARPU_ASSERT_MSG(status >= 0, "Can not free this HDF5 dataset (%s)\n", dataObj->path);
 
-        /* remove the dataset link in the HDF5 
+        /* remove the dataset link in the HDF5
          * But it doesn't delete the space in the file */
         status = H5Ldelete(fileBase->fileID, dataObj->path, H5P_DEFAULT);
         STARPU_ASSERT_MSG(status >= 0, "Can not delete the link associed to this dataset (%s)\n", dataObj->path);
@@ -774,14 +774,14 @@ static int starpu_hdf5_full_read(void *base, void *obj, void **ptr, size_t *size
         *size = _starpu_get_size_obj(dataObj);
         _starpu_hdf5_protect_stop(base);
 
-        _starpu_malloc_flags_on_node(dst_node, ptr, *size, 0); 
+        _starpu_malloc_flags_on_node(dst_node, ptr, *size, 0);
 
         starpu_hdf5_send_work(base, obj, 0, NULL, NULL, 0, *ptr, *size, (void*) &finished, FULL_READ);
-        
+
         starpu_hdf5_wait(&finished);
 
         starpu_sem_destroy(&finished);
-        
+
         return 0;
 }
 
@@ -861,10 +861,10 @@ void * starpu_hdf5_async_full_read (void * base, void * obj, void ** ptr, size_t
         *size = _starpu_get_size_obj(dataObj);
         _starpu_hdf5_protect_stop(base);
 
-        _starpu_malloc_flags_on_node(dst_node, ptr, *size, 0); 
+        _starpu_malloc_flags_on_node(dst_node, ptr, *size, 0);
 
         starpu_hdf5_send_work(base, obj, 0, NULL, NULL, 0, *ptr, *size, (void*) finished, FULL_READ);
-        
+
         return finished;
 }
 

+ 3 - 3
src/core/disk_ops/unistd/disk_unistd_global.c

@@ -608,12 +608,12 @@ static void * starpu_unistd_internal_thread(void * arg)
 			if (starpu_unistd_copy_failed == INIT && ret == -1 && errno == ENOSYS)
 			{
 				starpu_unistd_copy_failed = FAILED;
-			} 
+			}
 			else
 			{
 #endif
 				STARPU_ASSERT_MSG(ret >= 0, "Copy_file_range failed (errno %d)", errno);
-				STARPU_ASSERT_MSG((size_t) ret == work->len, "Copy_file_range failed (value %zd instead of %zd)", ret, work->len);
+				STARPU_ASSERT_MSG((size_t) ret == work->len, "Copy_file_range failed (value %ld instead of %ld)", (long)ret, (long)work->len);
 #if !defined(HAVE_COPY_FILE_RANGE) && defined( __NR_copy_file_range)
 				starpu_unistd_copy_failed = CHECKED;
 			}
@@ -1064,7 +1064,7 @@ void *  starpu_unistd_global_copy(void *base_src, void* obj_src, off_t offset_sr
 		starpu_unistd_global_wait_request((void *) event);
 		/* add token when StarPU will test/wait the request */
 		starpu_sem_post(&work->finished);
-	
+
 		STARPU_PTHREAD_MUTEX_LOCK(&thread->mutex);
 		/* here copy_file_range does not work */
 		if (starpu_unistd_copy_failed == FAILED)

+ 1 - 0
tools/starpu_lp2paje.c

@@ -20,6 +20,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <common/config.h>
 
 #define PROGNAME "starpu_lp2paje"