66 const int psum_ext_size[],
67 void **work_buf,
size_t *work_buf_size,
70 if (num_transfer_pos_ext > 0)
73 size_t size_dt_stripes, num_dt_stripes = 0;
76 dt_stripes_init_size = 8,
77 dt_stripes_init_alloc = dt_stripes_init_size *
sizeof (*dt_stripes),
79 if (*work_buf_size < dt_stripes_init_alloc) {
80 dt_stripes =
xrealloc(*work_buf, dt_stripes_init_alloc);
81 size_dt_stripes = dt_stripes_init_size;
83 dt_stripes = *work_buf;
84 size_dt_stripes = *work_buf_size /
sizeof (*dt_stripes);
88 =
pos2disp(transfer_pos_ext[0].start,
89 num_ext, psum_ext_size);
92 struct Xt_pos_ext current_pos_ext = transfer_pos_ext[i];
93 if (num_dt_stripes >= size_dt_stripes) {
97 size_dt_stripes *
sizeof (*dt_stripes));
102 num_ext, psum_ext_size,
106 int pos_remaining = current_pos_ext.
start
107 - psum_ext_size[search_start_ext];
109 = base_ext.start + pos_remaining * base_ext.stride;
110 int isign_mask_current_pos_ext_size =
isign_mask(current_pos_ext.
size);
117 derived_ext.size =
imin(abs(current_pos_ext.
size),
118 (~isign_mask_current_pos_ext_size
119 & (base_ext.size - pos_remaining))
120 | (isign_mask_current_pos_ext_size
121 & (pos_remaining + 1)));
123 = (~XT_EXT_STRIDE_MASK & base_ext.stride)
125 dt_stripes[num_dt_stripes++] = derived_ext;
127 += (~isign_mask_current_pos_ext_size & -derived_ext.size)
128 | (isign_mask_current_pos_ext_size & derived_ext.size);
129 current_pos_ext.
start += derived_ext.size;
130 }
while ((abs(current_pos_ext.
size) > 0)
131 & (num_dt_stripes < size_dt_stripes));
134 if (abs(current_pos_ext.
size) > 0)
137 }
while (++i < num_transfer_pos_ext);
141 *work_buf = dt_stripes;
142 *work_buf_size = size_dt_stripes *
sizeof (*dt_stripes);
146 return MPI_DATATYPE_NULL;
158 int *restrict psum_ext_size
159 =
xmalloc(((
size_t)num_ext + 1) *
sizeof (psum_ext_size[0]));
161 for (
size_t i = 0; i < (size_t)num_ext; ++i) {
162 psum_ext_size[i] = accum;
163 accum += extents[i].size;
165 psum_ext_size[num_ext] = accum;
173 const struct Xt_pos_ext *curr_transfer_pos_ext
175 int curr_num_transfer_pos_ext
180 curr_transfer_pos_ext,
181 num_ext, extents, psum_ext_size,
213 MPI_Datatype datatype,
224 size_t nmsg = (size_t)nrecv + (
size_t)nsend;
226 *send_msgs = msgs, *recv_msgs = msgs + nsend;
244 nsend, nrecv, send_msgs, recv_msgs, comm, &config_);
Xt_redist xt_redist_single_array_base_custom_new(int nsend, int nrecv, const struct Xt_redist_msg send_msgs[], const struct Xt_redist_msg recv_msgs[], MPI_Comm comm, Xt_config config)