Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Unused parameters.
[simgrid.git] / src / smpi / mpi / smpi_file.cpp
index c743cf9..7f1d69b 100644 (file)
@@ -41,6 +41,7 @@ namespace smpi{
       else
         mount = disk->extension<simgrid::s4u::FileSystemDiskExt>()->get_mount_point();
       XBT_DEBUG("No absolute path given for file opening, use '%s'", mount.c_str());
+      mount.append("/");
       fullname.insert(0, mount);
     }
 
@@ -143,7 +144,8 @@ namespace smpi{
       fh->file_->seek(position+movesize, SEEK_SET);
     }
     XBT_VERB("Position after read in MPI_File %s : %llu",fh->file_->get_path(), fh->file_->tell());
-    status->count=count*datatype->size();
+    if(status != MPI_STATUS_IGNORE)
+      status->count=count*datatype->size();
     return MPI_SUCCESS;
   }
 
@@ -202,7 +204,8 @@ namespace smpi{
       fh->file_->seek(position+movesize, SEEK_SET);
     }
     XBT_VERB("Position after write in MPI_File %s : %llu",fh->file_->get_path(), fh->file_->tell());
-    status->count=count*datatype->size();
+    if(status != MPI_STATUS_IGNORE)
+      status->count=count*datatype->size();
     return MPI_SUCCESS;
   }
 
@@ -237,6 +240,23 @@ namespace smpi{
     return ret;
   }
 
+  int File::set_view(MPI_Offset /*disp*/, MPI_Datatype etype, MPI_Datatype filetype, const char* datarep, MPI_Info)
+  {
+    etype_=etype;
+    filetype_=filetype;
+    datarep_=std::string(datarep);
+    seek_shared(0,MPI_SEEK_SET);
+    return MPI_SUCCESS;
+  }
+
+  int File::get_view(MPI_Offset* /*disp*/, MPI_Datatype* etype, MPI_Datatype* filetype, char* datarep)
+  {
+    *etype=etype_;
+    *filetype=filetype_;
+    snprintf(datarep, MPI_MAX_NAME_STRING+1, "%s", datarep_.c_str());
+    return MPI_SUCCESS;
+  }
+
   int File::size(){
     return file_->size();
   }