MPI_Type_contiguous(0, oldtype, newtype) is valid in MPI but SMPI does
not accept it as the resulting datatype is considered invalid: SMPI
does not accept datatypes with size of 0. Fix the datatype validation
function in order to accept this.
This type of datatype is used in bcastzerotype.
bcast-NTSL is fixed as well (division by zero).
int from = (rank + size - 1) % size;
/* segment is segment size in number of elements (not bytes) */
- int segment = bcast_NTSL_segment_size_in_byte / extent;
+ int segment = extent == 0 ? 1 : (bcast_NTSL_segment_size_in_byte / extent);
segment = segment == 0 ? 1 :segment;
/* pipeline length */
int pipe_length = count / segment;
int is_datatype_valid(MPI_Datatype datatype) {
return datatype != MPI_DATATYPE_NULL
&& (datatype->flags & DT_FLAG_COMMITED)
- && (smpi_datatype_size(datatype)>0);
+ && (smpi_datatype_size(datatype)>=0);
}
size_t smpi_datatype_size(MPI_Datatype datatype)