Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Coding style: ! -> 'not'.
[simgrid.git] / src / smpi / include / smpi_file.hpp
index 17969e5..10eaf26 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2020. The SimGrid Team.
+/* Copyright (c) 2010-2021. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -42,6 +42,8 @@ class File : public F2C{
   int get_position_shared(MPI_Offset* offset) const;
   int flags() const;
   MPI_Comm comm() const;
+  std::string name() const override {return file_ ? std::string("MPI_File: ")+ std::string(file_->get_path()): std::string("MPI_File");}
+
   int sync();
   int seek(MPI_Offset offset, int whence);
   int seek_shared(MPI_Offset offset, int whence);
@@ -49,6 +51,7 @@ class File : public F2C{
   int get_view(MPI_Offset* disp, MPI_Datatype* etype, MPI_Datatype* filetype, char* datarep) const;
   MPI_Info info();
   void set_info( MPI_Info info);
+  void set_size(int size);
   static int read(MPI_File fh, void* buf, int count, const Datatype* datatype, MPI_Status* status);
   static int read_shared(MPI_File fh, void* buf, int count, const Datatype* datatype, MPI_Status* status);
   static int read_ordered(MPI_File fh, void* buf, int count, const Datatype* datatype, MPI_Status* status);
@@ -103,7 +106,8 @@ int File::op_all(void* buf, int count, const Datatype* datatype, MPI_Status* sta
   XBT_CDEBUG(smpi_pmpi, "my offsets to read : %lld:%lld, global min and max %lld:%lld", min_offset, max_offset, min,
              max);
   if (empty == 1) {
-    status->count = 0;
+    if (status != MPI_STATUS_IGNORE)
+      status->count = 0;
     return MPI_SUCCESS;
   }
   MPI_Offset total = max - min;