Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
remove some warnings
authorAugustin Degomme <degomme@idpann.imag.fr>
Wed, 3 Oct 2012 16:52:01 +0000 (18:52 +0200)
committerAugustin Degomme <degomme@idpann.imag.fr>
Wed, 3 Oct 2012 16:52:01 +0000 (18:52 +0200)
examples/smpi/vector_test.c
src/smpi/private.h
src/smpi/smpi_mpi_dt.c

index f539054..8fd729f 100644 (file)
@@ -4,10 +4,9 @@
 
 int main(int argc, char **argv) {
 
-  int rank, tag=1, i, j;
+  int rank, i, j;
   double a[SIZE][SIZE];
 
-  MPI_Status stat;
   MPI_Datatype columntype;
 
   MPI_Init(&argc,&argv);
@@ -38,5 +37,6 @@ int main(int argc, char **argv) {
 
 
   MPI_Finalize();
+  return 0;
 }
 
index 108ace8..ed59446 100644 (file)
@@ -129,6 +129,22 @@ void smpi_datatype_create(MPI_Datatype* new_type, int size, int has_subtype, voi
 void smpi_datatype_free(MPI_Datatype* type);
 void smpi_datatype_commit(MPI_Datatype* datatype);
 
+void unserialize_vector( const void *contiguous_vector,
+                         void *noncontiguous_vector,
+                         size_t count,
+                         void *type);
+
+void serialize_vector( const void *noncontiguous_vector,
+                       void *contiguous_vector,
+                       size_t count,
+                       void *type);
+
+s_smpi_mpi_vector_t* smpi_datatype_vector_create( int block_stride,
+                                                  int block_length,
+                                                  int block_count,
+                                                  MPI_Datatype old_type,
+                                                  int size_oldtype);
+
 
 void smpi_empty_status(MPI_Status * status);
 MPI_Op smpi_op_new(MPI_User_function * function, int commute);
index d75b7fa..5493e5c 100644 (file)
@@ -193,8 +193,11 @@ void serialize_vector( const void *noncontiguous_vector,
   for (i = 0; i < type_c->block_count * count; i++) {
     memcpy(contiguous_vector,
            noncontiguous_vector, type_c->block_length * type_c->size_oldtype);
-    contiguous_vector += type_c->block_length*type_c->size_oldtype;
-    noncontiguous_vector += type_c->block_stride*type_c->size_oldtype;
+
+    char* contiguous_vector_char = (char*)contiguous_vector;
+    char* noncontiguous_vector_char = (char*)noncontiguous_vector;
+    contiguous_vector_char += type_c->block_length*type_c->size_oldtype;
+    noncontiguous_vector_char += type_c->block_stride*type_c->size_oldtype;
   }
 }
 /*
@@ -216,8 +219,12 @@ void unserialize_vector( const void *contiguous_vector,
   for (i = 0; i < type_c->block_count * count; i++) {
     memcpy(noncontiguous_vector,
            contiguous_vector, type_c->block_length * type_c->size_oldtype);
-    contiguous_vector += type_c->block_length*type_c->size_oldtype;
-    noncontiguous_vector += type_c->block_stride*type_c->size_oldtype;
+
+    char* contiguous_vector_char = (char*)contiguous_vector;
+    char* noncontiguous_vector_char = (char*)noncontiguous_vector;
+
+    contiguous_vector_char += type_c->block_length*type_c->size_oldtype;
+    noncontiguous_vector_char += type_c->block_stride*type_c->size_oldtype;
   }
 }