- if (is_homogeneous && curr_size != nbytes) {
- xbt_die("we didn't receive enough !");
- }
-
- if (!is_contig || !is_homogeneous)
- {
- if (rank != root)
- {
- position = 0;
- mpi_errno = MPI_Unpack(tmp_buf, nbytes, &position, buffer,
- count, datatype, comm);
- if (mpi_errno) xbt_die("error when unpacking %d", mpi_errno);
- }
+ xbt_assert(not is_homogeneous || curr_size == nbytes, "we didn't receive enough !");
+
+ if (not is_contig || not is_homogeneous) {
+ if (rank != root) {
+ position = 0;
+ mpi_errno = MPI_Unpack(tmp_buf, nbytes, &position, buffer, count, datatype, comm);
+ xbt_assert(mpi_errno == 0, "error when unpacking %d", mpi_errno);
+ }