Quellcode durchsuchen

Make pack allocate aligned buffers for o_direct to be able to work

Samuel Thibault vor 10 Jahren
Ursprung
Commit
ab0ded4ebf

+ 2 - 2
doc/doxygen/chapters/16mpi_support.doxy

@@ -179,7 +179,7 @@ DefiningANewDataInterface can also be used within StarPU-MPI and
 exchanged between nodes. Two functions needs to be defined through the
 type starpu_data_interface_ops. The function
 starpu_data_interface_ops::pack_data takes a handle and returns a
-contiguous memory buffer along with its size where data to be conveyed
+contiguous memory buffer allocated with starpu_malloc_flags(ptr, size, 0) along with its size where data to be conveyed
 to another node should be copied. The reversed operation is
 implemented in the function starpu_data_interface_ops::unpack_data which
 takes a contiguous memory buffer and recreates the data handle.
@@ -193,7 +193,7 @@ static int complex_pack_data(starpu_data_handle_t handle, unsigned node, void **
     (struct starpu_complex_interface *) starpu_data_get_interface_on_node(handle, node);
 
   *count = complex_get_size(handle);
-  *ptr = malloc(*count);
+  starpu_malloc_flags(ptr, *count, 0);
   memcpy(*ptr, complex_interface->real, complex_interface->nx*sizeof(double));
   memcpy(*ptr+complex_interface->nx*sizeof(double), complex_interface->imaginary,
          complex_interface->nx*sizeof(double));

+ 2 - 1
doc/doxygen/chapters/api/data_interfaces.doxy

@@ -40,7 +40,8 @@ todo
 \var struct starpu_multiformat_data_interface_ops* (*starpu_data_interface_ops::get_mf_ops)(void *data_interface)
 todo
 \var int (*starpu_data_interface_ops::pack_data)(starpu_data_handle_t handle, unsigned node, void **ptr, starpu_ssize_t *count)
-Pack the data handle into a contiguous buffer at the address ptr and
+Pack the data handle into a contiguous buffer at the address allocated with
+starpu_malloc_flags(ptr, size, 0) (and thus returned in ptr) and
 set the size of the newly created buffer in count. If ptr is NULL, the
 function should not copy the data in the buffer but just set count to
 the size of the buffer which would have been allocated. The special