public:
File(MPI_Comm comm, const char *filename, int amode, MPI_Info info);
public:
File(MPI_Comm comm, const char *filename, int amode, MPI_Info info);
int sync();
int seek(MPI_Offset offset, int whence);
int seek_shared(MPI_Offset offset, int whence);
int sync();
int seek(MPI_Offset offset, int whence);
int seek_shared(MPI_Offset offset, int whence);
+ int set_view(MPI_Offset disp, MPI_Datatype etype, MPI_Datatype filetype, const char* datarep, const Info* info);
+ int get_view(MPI_Offset *disp, MPI_Datatype *etype, MPI_Datatype *filetype, char *datarep);
MPI_Info info();
void set_info( MPI_Info info);
static int read(MPI_File fh, void *buf, int count,MPI_Datatype datatype, MPI_Status *status);
MPI_Info info();
void set_info( MPI_Info info);
static int read(MPI_File fh, void *buf, int count,MPI_Datatype datatype, MPI_Status *status);
static int write_ordered(MPI_File fh, const void *buf, int count,MPI_Datatype datatype, MPI_Status *status);
template <int (*T)(MPI_File, void *, int, MPI_Datatype, MPI_Status *)> int op_all(void *buf, int count,MPI_Datatype datatype, MPI_Status *status);
static int close(MPI_File *fh);
static int write_ordered(MPI_File fh, const void *buf, int count,MPI_Datatype datatype, MPI_Status *status);
template <int (*T)(MPI_File, void *, int, MPI_Datatype, MPI_Status *)> int op_all(void *buf, int count,MPI_Datatype datatype, MPI_Status *status);
static int close(MPI_File *fh);
int size = comm_->size();
int rank = comm_-> rank();
MPI_Offset min_offset = file_->tell();
int size = comm_->size();
int rank = comm_-> rank();
MPI_Offset min_offset = file_->tell();
- 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 max_offset = min_offset + count * datatype->get_extent();//cheating, as we don't care about exact data location, we can skip extent
- 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_);
return T(this,buf,count,datatype, status);
}
return T(this,buf,count,datatype, status);
}
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));
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));
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);
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);
seek(min_offset, MPI_SEEK_SET);
T(this,sendbuf,totreads/datatype->size(),datatype, status);
}
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;i<size;i++){
recv_disps[i]=total_recv;
total_recv+=recv_sizes[i];
}
//Set buf value to avoid copying dumb data
int total_recv=0;
for(int i=0;i<size;i++){
recv_disps[i]=total_recv;
total_recv+=recv_sizes[i];
}
//Set buf value to avoid copying dumb data
- simgrid::smpi::Colls::alltoallv(sendbuf, send_sizes, send_disps, MPI_BYTE,
- buf, recv_sizes, recv_disps, MPI_BYTE, comm_);
- status->count=count * datatype->size();
+ simgrid::smpi::colls::alltoallv(sendbuf, send_sizes, send_disps, MPI_BYTE, buf, recv_sizes, recv_disps, MPI_BYTE,
+ comm_);
+ if(status!=MPI_STATUS_IGNORE)
+ status->count=count * datatype->size();