Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
be cleaner with memory
authorAugustin Degomme <adegomme@users.noreply.github.com>
Thu, 18 Apr 2019 19:47:41 +0000 (21:47 +0200)
committerAugustin Degomme <adegomme@users.noreply.github.com>
Thu, 18 Apr 2019 19:47:41 +0000 (21:47 +0200)
src/smpi/include/smpi_file.hpp
teshsuite/smpi/io-all/io-all.c
teshsuite/smpi/io-ordered/io-ordered.c

index 72efd93..fa3b505 100644 (file)
@@ -151,7 +151,7 @@ class File{
     }\r
     XBT_DEBUG("will have to access %lld from my chunk", totreads);\r
 \r
-    char* sendbuf= static_cast<char *>(smpi_get_tmp_sendbuffer(totreads));\r
+    char* sendbuf= static_cast<char *>(smpi_get_tmp_sendbuffer(total_sent));\r
 \r
     if(totreads>0){\r
       seek(min_offset, MPI_SEEK_SET);\r
index 56d95b3..0f97937 100644 (file)
@@ -20,7 +20,7 @@ int main( int argc, char *argv[] )
     MPI_File_open( comm, (char*)"/scratch/lib/libsimgrid.so.3.6.2", MPI_MODE_RDWR | MPI_MODE_CREATE | MPI_MODE_DELETE_ON_CLOSE, MPI_INFO_NULL, &fh );\r
     MPI_Comm_size( comm, &size );\r
     MPI_Comm_rank( comm, &rank );\r
-    buf = (int *)malloc( 10+ size * sizeof(int) );\r
+    buf = (int *)malloc( 10 * sizeof(int) );\r
     buf[0] = rank;\r
  \r
     /* Write to file */\r
index e5225df..7fae204 100644 (file)
@@ -20,7 +20,7 @@ int main( int argc, char *argv[] )
     MPI_File_open( comm, (char*)"/scratch/lib/libsimgrid.so.3.6.2", MPI_MODE_RDWR | MPI_MODE_CREATE | MPI_MODE_DELETE_ON_CLOSE, MPI_INFO_NULL, &fh );\r
     MPI_Comm_size( comm, &size );\r
     MPI_Comm_rank( comm, &rank );\r
-    buf = (int *)malloc( 10+size * sizeof(int) );\r
+    buf = (int *)malloc( 10* sizeof(int) );\r
     buf[0] = rank;\r
  \r
     /* Write to file */\r