X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e51cc7347665f36a2a71edee93767172ba88f6b2..55ad634bd982190cbb65891936938b68aca89829:/src/smpi/include/smpi_file.hpp diff --git a/src/smpi/include/smpi_file.hpp b/src/smpi/include/smpi_file.hpp index 9ad75374ae..1584a22b32 100644 --- a/src/smpi/include/smpi_file.hpp +++ b/src/smpi/include/smpi_file.hpp @@ -10,6 +10,7 @@ #include "smpi_comm.hpp" #include "smpi_coll.hpp" #include "smpi_datatype.hpp" +#include "smpi_errhandler.hpp" #include "smpi_info.hpp" #include @@ -26,6 +27,8 @@ class File{ s4u::MutexPtr shared_mutex_; MPI_Win win_; char* list_; + MPI_Errhandler errhandler_; + public: File(MPI_Comm comm, const char *filename, int amode, MPI_Info info); File(const File&) = delete; @@ -50,6 +53,8 @@ class File{ template int op_all(void *buf, int count,MPI_Datatype datatype, MPI_Status *status); static int close(MPI_File *fh); static int del(const char *filename, MPI_Info info); + MPI_Errhandler errhandler(); + void set_errhandler( MPI_Errhandler errhandler); }; /* Read_all, Write_all : loosely based on */ @@ -69,8 +74,8 @@ class File{ MPI_Offset max_offset = (min_offset + count * datatype->size());//cheating, as we don't care about exact data location, we can skip extent MPI_Offset* min_offsets = new MPI_Offset[size]; MPI_Offset* max_offsets = new MPI_Offset[size]; - simgrid::smpi::Colls::allgather(&min_offset, 1, MPI_OFFSET, min_offsets, 1, MPI_OFFSET, comm_); - simgrid::smpi::Colls::allgather(&max_offset, 1, MPI_OFFSET, max_offsets, 1, MPI_OFFSET, comm_); + simgrid::smpi::colls::allgather(&min_offset, 1, MPI_OFFSET, min_offsets, 1, MPI_OFFSET, comm_); + simgrid::smpi::colls::allgather(&max_offset, 1, MPI_OFFSET, max_offsets, 1, MPI_OFFSET, comm_); MPI_Offset min=min_offset; MPI_Offset max=max_offset; MPI_Offset tot= 0; @@ -116,7 +121,7 @@ class File{ if((my_chunk_start>=min_offsets[i] && my_chunk_start < max_offsets[i])|| ((my_chunk_end<=max_offsets[i]) && my_chunk_end> min_offsets[i])){ send_sizes[i]=(std::min(max_offsets[i]-1, my_chunk_end-1)-std::max(min_offsets[i], my_chunk_start)); - //store min and max offest to actually read + // store min and max offset to actually read min_offset=std::min(min_offset, min_offsets[i]); total_sent+=send_sizes[i]; XBT_CDEBUG(smpi_pmpi, "will have to send %d bytes to %d", send_sizes[i], i); @@ -160,21 +165,21 @@ class File{ } XBT_CDEBUG(smpi_pmpi, "will have to access %lld from my chunk", totreads); - char* sendbuf= static_cast(smpi_get_tmp_sendbuffer(total_sent)); + unsigned char* sendbuf = smpi_get_tmp_sendbuffer(total_sent); if(totreads>0){ seek(min_offset, MPI_SEEK_SET); T(this,sendbuf,totreads/datatype->size(),datatype, status); } - simgrid::smpi::Colls::alltoall(send_sizes, 1, MPI_INT, recv_sizes, 1, MPI_INT, comm_); + simgrid::smpi::colls::alltoall(send_sizes, 1, MPI_INT, recv_sizes, 1, MPI_INT, comm_); int total_recv=0; for(int i=0;icount=count * datatype->size(); smpi_free_tmp_buffer(sendbuf); delete[] send_sizes;