126 static inline Xt_xmap_intersection_ext
xmie(
void *xmap)
128 return (Xt_xmap_intersection_ext)xmap;
133 Xt_xmap_intersection_ext xmap_intersection_ext =
xmie(xmap);
134 return xmap_intersection_ext->
comm;
139 Xt_xmap_intersection_ext xmap_intersection_ext =
xmie(xmap);
141 return xmap_intersection_ext->
n_out;
146 Xt_xmap_intersection_ext xmap_intersection_ext =
xmie(xmap);
148 return xmap_intersection_ext->
n_in;
154 Xt_xmap_intersection_ext xmap_intersection_ext =
xmie(xmap);
155 size_t n_out = (size_t)xmap_intersection_ext->
n_out;
157 for (
size_t i = 0; i <
n_out; ++i)
164 Xt_xmap_intersection_ext xmap_intersection_ext =
xmie(xmap);
165 size_t n_in = (size_t)xmap_intersection_ext->
n_in;
167 for (
size_t i = 0; i <
n_in; ++i)
183 *nmsg_copy = (int)nmsg;
185 = *msg_copy =
xmalloc(
sizeof (*msg_copy_) * nmsg);
186 for (
size_t i = 0; i < nmsg; ++i) {
188 = (size_t)(msg_copy_[i].num_transfer_pos_ext
189 = msg[i].num_transfer_pos_ext);
190 msg_copy_[i].num_transfer_pos = msg[i].num_transfer_pos;
191 msg_copy_[i].rank = msg[i].rank;
192 msg_copy_[i].transfer_pos = NULL;
193 size_t size_transfer_pos_ext
194 = num_transfer_pos_ext *
sizeof (*(msg[i].transfer_pos_ext));
195 msg_copy_[i].transfer_pos_ext =
xmalloc(size_transfer_pos_ext);
197 size_transfer_pos_ext);
204 Xt_xmap_intersection_ext xmap_intersection_ext =
xmie(xmap),
205 xmap_intersection_ext_new =
xmalloc(
sizeof (*xmap_intersection_ext_new));
206 xmap_intersection_ext_new->vtable = xmap_intersection_ext->
vtable;
207 size_t n_in = (size_t)(xmap_intersection_ext_new->n_in = xmap_intersection_ext->
n_in),
208 n_out = (size_t)(xmap_intersection_ext_new->n_out = xmap_intersection_ext->
n_out);
209 xmap_intersection_ext_new->max_src_pos = xmap_intersection_ext->
max_src_pos;
210 xmap_intersection_ext_new->max_dst_pos = xmap_intersection_ext->
max_dst_pos;
212 &xmap_intersection_ext_new->n_in,
213 &xmap_intersection_ext_new->in_msg);
215 &xmap_intersection_ext_new->n_out,
216 &xmap_intersection_ext_new->out_msg);
217 xmap_intersection_ext_new->comm
219 &xmap_intersection_ext_new->tag_offset);
220 return (
Xt_xmap)xmap_intersection_ext_new;
227 for (
size_t i = 0; i < num_msg; ++i) {
236 Xt_xmap_intersection_ext xmap_intersection_ext =
xmie(xmap);
239 xmap_intersection_ext->
in_msg);
242 xmap_intersection_ext->
out_msg);
246 free(xmap_intersection_ext);
251 int num_src_intersections,
252 const struct Xt_com_list src_com[num_src_intersections],
253 int num_dst_intersections,
254 const struct Xt_com_list dst_com[num_dst_intersections],
262 src_com[num_src_intersections],
263 int num_dst_intersections,
265 dst_com[num_dst_intersections],
269 Xt_xmap_intersection_ext xmap =
xmalloc(
sizeof (*xmap));
277 num_src_intersections, src_com,
278 num_dst_intersections, dst_com,
279 src_idxlist, dst_idxlist, comm);
290 generate_dir_transfer_ext_dst(
291 int num_intersections,
292 const struct Xt_com_list intersections[num_intersections],
293 Xt_idxlist mypart_idxlist,
296 int (*restrict dst_removals_per_intersection)[2]);
301 int num_src_intersections,
302 const struct Xt_com_list src_com[num_src_intersections],
303 int num_dst_intersections,
304 const struct Xt_com_list dst_com[num_dst_intersections],
306 int (*restrict src_removals_per_intersection)[2],
307 int (*restrict dst_removals_per_intersection)[2],
313 const struct Xt_com_list dst_com[num_dst_intersections],
314 Xt_idxlist mypart_idxlist,
317 int (*removals_per_intersection)[2]);
321 int num_intersections,
322 const struct Xt_com_list intersections[num_intersections],
323 Xt_idxlist mypart_idxlist,
326 int (*restrict removals_per_intersection)[2],
331 int num_src_intersections,
332 const struct Xt_com_list src_com[num_src_intersections],
333 int num_dst_intersections,
334 const struct Xt_com_list dst_com[num_dst_intersections],
335 Xt_idxlist src_idxlist_local,
336 Xt_idxlist dst_idxlist_local,
345 int (*src_removals_per_intersection)[2] =
346 xmalloc(((
size_t)num_dst_intersections + (
size_t)num_src_intersections)
347 *
sizeof(*src_removals_per_intersection)),
348 (*dst_removals_per_intersection)[2]
349 = src_removals_per_intersection + num_src_intersections;
354 num_dst_intersections, dst_com, dst_idxlist_local,
355 &(xmap->
n_in), &(xmap->
in_msg), dst_removals_per_intersection);
359 Xt_abort(comm,
"ERROR: ups...this should not have happend...", __FILE__,
361 int first_missing_pos = 0;
367 char error_message[1024];
368 sprintf(error_message,
"ERROR: destination intersections do not match " 369 "with destination index list (first missing index %lld " 370 "at position %d)", (
long long)missing_index, first_missing_pos);
371 Xt_abort(comm, error_message, __FILE__, __LINE__);
379 num_src_intersections, src_com, num_dst_intersections, dst_com,
381 src_removals_per_intersection,
382 dst_removals_per_intersection, xmap->
tag_offset, comm);
386 dst_removals_per_intersection);
388 src_removals_per_intersection =
389 xrealloc(src_removals_per_intersection, (
size_t)num_src_intersections
390 *
sizeof(*src_removals_per_intersection));
393 num_src_intersections, src_com, src_idxlist_local,
395 src_removals_per_intersection, pos_updates);
397 free(src_removals_per_intersection);
411 a_s = a.start + (aSizeMaskNeg & (a.size + 1)),
412 a_e = a.start + (~aSizeMaskNeg & (a.size - 1)),
414 b_s = b.start + (bSizeMaskNeg & (b.size + 1)),
415 b_e = b.start + (~bSizeMaskNeg & (b.size - 1));
417 if ((b_s > a_e) | (a_s > b_e))
421 int lowSkipA = b_s - a_s;
422 int lowSkipB = -lowSkipA;
423 lowSkipA = (int)((
unsigned)(lowSkipA + abs(lowSkipA))/2U);
424 lowSkipB = (int)((
unsigned)(lowSkipB + abs(lowSkipB))/2U);
425 int overlapLen =
imin(b_e - b_s - lowSkipB + 1,
426 abs(a.size) - lowSkipA);
427 int highSkipA = abs(a.size) - lowSkipA - overlapLen;
430 int aSkipLen = (~aSizeMaskNeg & lowSkipA)
431 | (aSizeMaskNeg & -highSkipA),
432 aTailLen = (aSizeMaskNeg & -lowSkipA)
433 | (~aSizeMaskNeg & highSkipA);
442 size_t *num_pos_exts,
443 size_t *size_pos_exts,
447 generate_dir_transfer_ext_dst(
448 int num_intersections,
449 const struct Xt_com_list intersections[num_intersections],
450 Xt_idxlist mypart_idxlist,
452 int (*restrict dst_removals_per_intersection)[2])
455 = *resSets =
xmalloc((
size_t)num_intersections *
sizeof(**resSets));
457 int new_num_intersections = 0;
466 struct Xt_pos_ext *restrict isect_transfer_pos_ext = NULL;
468 for (
int i = 0; i < num_intersections; ++i) {
470 int num_stripes, num_indices_to_remove = 0;
471 struct Xt_stripe *restrict intersection_idxstripes;
473 (
struct Xt_stripe **)&intersection_idxstripes,
475 struct Xt_pos_ext *restrict isect_pos_exts = NULL;
476 int num_isect_pos_exts;
478 mypart_idxlist, num_stripes, intersection_idxstripes,
479 &num_isect_pos_exts, (
struct Xt_pos_ext **)&isect_pos_exts, 1);
481 int isect_pos_exts_size_psum = 0;
485 size_t num_isect_transfer_pos_ext = 1, size_isect_transfer_pos_ext = 8;
486 isect_transfer_pos_ext
487 =
xrealloc(intersection_idxstripes,
sizeof (*isect_transfer_pos_ext)
488 * size_isect_transfer_pos_ext);
489 intersection_idxstripes = NULL;
490 isect_transfer_pos_ext[0]
494 for (
size_t j = 0; j < (size_t)num_isect_pos_exts; ++j) {
495 struct Xt_pos_ext isect_pos_ext = isect_pos_exts[j];
497 int isign_mask_isect_pos_ext_size =
isign_mask(isect_pos_ext.
size);
499 += isign_mask_isect_pos_ext_size & (isect_pos_ext.
size + 1);
500 int isect_pos_ext_orig_size = isect_pos_ext.
size;
501 isect_pos_ext.
size = abs(isect_pos_ext.
size);
502 isect_pos_exts_size_psum += isect_pos_ext.
size;
505 int progress = -isect_pos_ext.
size;
506 size_t search_start_pos = 0, insert_pos;
510 .end = isect_pos_ext.
start + isect_pos_ext.
size - 1 };
513 if (insert_pos == SIZE_MAX)
514 goto next_isect_pos_ext;
535 memmove(cover.
pos_ext + insert_pos, cover.
pos_ext + insert_pos + 1,
540 progress = (~isign_mask_isect_pos_ext_size
541 & (progress + overlap_desc.
skip))
542 | (isign_mask_isect_pos_ext_size
543 & (isect_pos_ext_orig_size + overlap_desc.
tail));
545 num_indices_to_remove += overlap_desc.
overlap;
547 .start = isect_pos_exts_size_psum + progress,
548 .size = overlap_desc.
overlap },
549 &num_isect_transfer_pos_ext, &size_isect_transfer_pos_ext,
550 (
struct Xt_pos_ext **)&isect_transfer_pos_ext);
551 progress += overlap_desc.
overlap;
555 isect_pos_ext.
size = overlap_desc.
tail;
556 search_start_pos = ++insert_pos;
557 }
while ((isect_pos_ext.
size != 0)
559 if (isect_pos_ext.
size)
567 if (intersection_size > num_indices_to_remove) {
568 resSets_[new_num_intersections].transfer_pos_ext
569 =
xrealloc(isect_transfer_pos_ext,
sizeof (*isect_transfer_pos_ext)
570 * num_isect_transfer_pos_ext);
572 resSets_[new_num_intersections].transfer_pos = NULL;
573 resSets_[new_num_intersections].num_transfer_pos
574 = intersection_size - num_indices_to_remove;
575 resSets_[new_num_intersections].num_transfer_pos_ext
576 = (int)num_isect_transfer_pos_ext;
577 resSets_[new_num_intersections].rank = intersections[i].rank;
578 ++new_num_intersections;
579 isect_transfer_pos_ext = NULL;
581 dst_removals_per_intersection[i][0] = num_indices_to_remove;
582 dst_removals_per_intersection[i][1]
583 = ((num_indices_to_remove == intersection_size)
584 | (num_indices_to_remove == 0))?0:(
int)num_isect_transfer_pos_ext;
585 free(isect_transfer_pos_ext);
586 free(isect_pos_exts);
588 *resCount = new_num_intersections;
589 if (num_intersections != new_num_intersections)
591 (
size_t)new_num_intersections *
sizeof(**resSets));
597 size_t *num_pos_exts,
598 size_t *size_pos_exts,
601 struct Xt_pos_ext *restrict pos_exts_ = *pos_exts;
602 size_t num_pos_exts_ = *num_pos_exts;
603 size_t i = num_pos_exts_;
606 int db_skip = pos_ext.
start - pos_exts_[i].start;
607 if ((!db_skip) & (pos_ext.
size == pos_exts_[i].size))
610 memmove(pos_exts_ + i, pos_exts_ + i + 1,
611 sizeof (*pos_exts_) * (num_pos_exts_ - i - 1));
612 *num_pos_exts = --num_pos_exts_;
614 else if (db_skip + pos_ext.
size == pos_exts_[i].size)
617 pos_exts_[i].size -= pos_ext.
size;
619 else if (db_skip == 0)
622 pos_exts_[i].start = pos_ext.
start + pos_ext.
size;
623 pos_exts_[i].size -= pos_ext.
size;
629 pos_exts_ = *pos_exts;
630 memmove(pos_exts_ + i + 1, pos_exts_ + i,
631 (num_pos_exts_ - i) *
sizeof (*pos_exts_));
636 .size = orig.
size - db_skip - pos_ext.
size };
637 *num_pos_exts = ++num_pos_exts_;
643 int num_src_intersections,
644 const struct Xt_com_list src_com[num_src_intersections],
645 int num_dst_intersections,
646 const struct Xt_com_list dst_com[num_dst_intersections],
648 int (*restrict src_removals_per_intersection)[2],
649 int (*restrict dst_removals_per_intersection)[2],
653 MPI_Request * requests
654 =
xmalloc((
size_t)(num_src_intersections + 2 * num_dst_intersections) *
656 MPI_Request *restrict recv_requests = requests,
657 *restrict send_header_requests = requests + num_src_intersections,
658 *restrict send_data_requests = send_header_requests + num_dst_intersections;
661 for (
int i = 0; i < num_src_intersections; ++i)
663 src_removals_per_intersection[i], 2, MPI_INT, src_com[i].
rank,
665 comm, recv_requests + i), comm);
670 unsigned num_active_dst = 0, num_dst_changes = 0;
671 for (
int i = 0; i < num_dst_intersections; ++i) {
673 dst_removals_per_intersection[i], 2, MPI_INT, dst_com[i].rank,
675 comm, send_header_requests + i), comm);
677 if (dst_removals_per_intersection[i][1] > 0) {
679 assert(dst_removals_per_intersection[i][1]
681 assert(dst_com[i].rank
682 == dst_ext[num_active_dst].rank);
685 dst_removals_per_intersection[i][1],
686 MPI_2INT, dst_com[i].rank,
688 comm, send_data_requests + num_dst_changes),
692 num_active_dst += (unsigned)((dst_removals_per_intersection[i][0] == 0)
693 | (dst_removals_per_intersection[i][1] != 0));
697 xt_mpi_call(MPI_Waitall(num_src_intersections + num_dst_intersections,
698 recv_requests, MPI_STATUSES_IGNORE), comm);
700 size_t total_num_pos_ext_to_recv = 0;
702 for (
size_t i = 0; i < (size_t)num_src_intersections; ++i)
703 total_num_pos_ext_to_recv += (
size_t)src_removals_per_intersection[i][1];
706 unsigned num_src_changes = 0;
707 if (total_num_pos_ext_to_recv > 0) {
710 =
xmalloc(total_num_pos_ext_to_recv *
sizeof(*src_updated_pos_ext));
715 for (
int i = 0; i < num_src_intersections; ++i)
716 if (src_removals_per_intersection[i][1] > 0) {
718 src_updated_pos_ext + offset,
719 src_removals_per_intersection[i][1], MPI_2INT,
722 comm, recv_requests + num_src_changes), comm);
724 offset += (size_t)src_removals_per_intersection[i][1];
728 src_updated_pos_ext = NULL;
731 memcpy(recv_requests + num_src_changes, send_data_requests,
732 num_dst_changes *
sizeof (recv_requests[0]));
735 xt_mpi_call(MPI_Waitall((
int)num_src_changes + (
int)num_dst_changes,
736 recv_requests, MPI_STATUSES_IGNORE), comm);
739 return src_updated_pos_ext;
744 Xt_idxlist intersection,
745 size_t num_pos_updates,
746 struct Xt_pos_ext pos_updates[num_pos_updates],
748 int single_match_only);
752 int num_dst_intersections,
753 const struct Xt_com_list intersections[num_dst_intersections],
754 Xt_idxlist mypart_idxlist,
757 int (*removals_per_intersection)[2])
760 for (
size_t i = 0; i < (size_t)num_dst_intersections; ++i)
762 int intersection_size
765 int num_indices_to_remove = removals_per_intersection[i][0];
767 if (num_indices_to_remove != intersection_size) {}
else 773 (
size_t)removals_per_intersection[i][1],
774 pos_updates, resSets + resIdx, 1);
778 assert(resIdx == (
size_t)resCount);
785 int num_intersections,
786 const struct Xt_com_list intersections[num_intersections],
787 Xt_idxlist mypart_idxlist,
790 int (*restrict removals_per_intersection)[2],
794 =
xmalloc((
size_t)num_intersections *
sizeof(**resSets));
797 int new_num_intersections = 0;
799 size_t intersection_pos_ext = 0;
801 for (
int i = 0; i < num_intersections; ++i) {
803 int intersection_size
806 int num_indices_to_remove = removals_per_intersection[i][0];
808 if (num_indices_to_remove != intersection_size) {}
else 813 (
size_t)removals_per_intersection[i][1],
814 pos_updates + intersection_pos_ext,
815 resSets_ + new_num_intersections, 0);
818 resSets_[new_num_intersections].transfer_pos = NULL;
819 resSets_[new_num_intersections].num_transfer_pos
820 = intersection_size - num_indices_to_remove;
821 resSets_[new_num_intersections].rank = intersections[i].rank;
822 new_num_intersections++;
823 intersection_pos_ext += (size_t)removals_per_intersection[i][1];
826 *resCount = new_num_intersections;
827 if (num_intersections != new_num_intersections)
829 (
size_t)new_num_intersections *
sizeof(**resSets));
834 struct Xt_stripe *restrict intersection_idxstripes,
835 size_t num_pos_updates,
839 size_t num_refined_intersection_idxstripes = 0,
840 size_refined_intersection_idxstripes = num_pos_updates;
841 struct Xt_stripe *restrict refined_intersection_idxstripes
842 =
xmalloc(size_refined_intersection_idxstripes
843 *
sizeof (*refined_intersection_idxstripes));
845 int nstrides_psum = 0;
846 for (
size_t i_pos_ext = 0; i_pos_ext < num_pos_updates; ++i_pos_ext)
848 int pos = pos_updates[i_pos_ext].start;
849 int size = pos_updates[i_pos_ext].size;
850 while (nstrides_psum + intersection_idxstripes[i_stripe].
nstrides <= pos)
852 nstrides_psum += intersection_idxstripes[i_stripe].nstrides;
856 int instripe_pos = pos - nstrides_psum;
858 size_refined_intersection_idxstripes,
859 num_refined_intersection_idxstripes + 1);
860 struct Xt_stripe cur_stripe = intersection_idxstripes[i_stripe];
861 int cur_stripe_nstrides = cur_stripe.
nstrides;
862 int overlap =
imin(cur_stripe_nstrides - instripe_pos, size);
867 refined_intersection_idxstripes[num_refined_intersection_idxstripes]
869 ++num_refined_intersection_idxstripes;
870 i_stripe += (instripe_pos + overlap == cur_stripe_nstrides);
871 nstrides_psum += (instripe_pos + overlap == cur_stripe_nstrides)
872 ? cur_stripe_nstrides : 0;
877 free(intersection_idxstripes);
878 *num_stripes_ = (int)num_refined_intersection_idxstripes;
879 return refined_intersection_idxstripes;
891 Xt_idxlist intersection,
892 size_t num_pos_updates,
893 struct Xt_pos_ext pos_updates[num_pos_updates],
895 int single_match_only)
897 struct Xt_stripe *intersection_idxstripes;
900 &intersection_idxstripes,
903 intersection_idxstripes
905 num_pos_updates, pos_updates);
910 mypart_idxlist, num_stripes, intersection_idxstripes,
914 free(intersection_idxstripes);
939 .get_num_transfer_pos_ext
941 .delete = xmap_intersection_ext_iterator_delete};
955 Xt_xmap_intersection_ext xmap_intersection_ext =
xmie(xmap);
957 if (xmap_intersection_ext->
n_in == 0)
960 Xt_xmap_iter_intersection_ext iter =
xmalloc(
sizeof (*iter));
963 iter->
msg = xmap_intersection_ext->
in_msg;
971 Xt_xmap_intersection_ext xmap_intersection_ext =
xmie(xmap);
973 if (xmap_intersection_ext->
n_out == 0)
976 Xt_xmap_iter_intersection_ext iter =
xmalloc(
sizeof (*iter));
985 static inline Xt_xmap_iter_intersection_ext
988 return (Xt_xmap_iter_intersection_ext)iter;
993 Xt_xmap_iter_intersection_ext iter_intersection =
xmiei(iter);
995 if (iter_intersection == NULL || iter_intersection->
msgs_left == 0)
998 iter_intersection->
msg++;
1006 assert(iter != NULL);
1013 assert(iter != NULL);
1015 if ((!msg->num_transfer_pos) | (msg->transfer_pos != NULL)) { }
else {
1018 =
xmalloc(num_transfer_pos *
sizeof (*msg->transfer_pos));
1025 for (
int j = 0; j < abssize; ++j)
1027 ofs += (size_t)abssize;
1029 assert(ofs == num_transfer_pos);
1031 return msg->transfer_pos;
1036 assert(iter != NULL);
1042 assert(iter != NULL);
1048 assert(iter != NULL);
const struct Xt_xmap_vtable * vtable
static const struct Xt_xmap_iter_vtable xmap_iterator_intersection_ext_vtable
int xt_idxlist_get_num_indices(Xt_idxlist idxlist)
static int xmap_intersection_ext_iterator_get_num_transfer_pos_ext(Xt_xmap_iter iter)
static int xmap_intersection_ext_iterator_get_rank(Xt_xmap_iter iter)
static struct Xt_pos_ext * exchange_pos_ext_modifications(int num_src_intersections, const struct Xt_com_list src_com[num_src_intersections], int num_dst_intersections, const struct Xt_com_list dst_com[num_dst_intersections], struct exchange_ext dst_ext[num_dst_intersections], int(*restrict src_removals_per_intersection)[2], int(*restrict dst_removals_per_intersection)[2], int tag_offset, MPI_Comm comm)
static void generate_transfer_ext(struct Xt_xmap_intersection_ext_ *xmap, int num_src_intersections, const struct Xt_com_list src_com[num_src_intersections], int num_dst_intersections, const struct Xt_com_list dst_com[num_dst_intersections], Xt_idxlist src_idxlist_local, Xt_idxlist dst_idxlist_local, MPI_Comm comm)
static void remap_intersection(Xt_idxlist mypart_idxlist, Xt_idxlist intersection, size_t num_pos_updates, struct Xt_pos_ext pos_updates[num_pos_updates], struct exchange_ext *resSet, int single_match_only)
void xt_cover_range_append(struct Xt_pos_ext_vec *restrict cover, struct Xt_pos_ext range)
struct exchange_ext * out_msg
static int xmap_intersection_ext_get_max_src_pos(Xt_xmap xmap)
int(* next)(Xt_xmap_iter iter)
static int imin(int a, int b)
add versions of standard API functions not returning on error
static int xmap_intersection_ext_iterator_get_num_transfer_pos(Xt_xmap_iter iter)
static Xt_xmap_iter xmap_intersection_ext_get_in_iterator(Xt_xmap xmap)
contains declaration for the exchange map data structure
static void cut_pos_ext_from_pos_exts(struct Xt_pos_ext pos_ext, size_t *num_pos_exts, size_t *size_pos_exts, struct Xt_pos_ext **pos_exts)
struct Xt_pos_ext * transfer_pos_ext
struct Xt_pos_ext * pos_ext
void xt_idxlist_get_index_stripes(Xt_idxlist idxlist, struct Xt_stripe **stripes, int *num_stripes)
static Xt_xmap_intersection_ext xmie(void *xmap)
#define xrealloc(ptr, size)
static int xmap_intersection_ext_get_max_dst_pos(Xt_xmap xmap)
static struct Xt_pos_ext_overlap Xt_get_pos_ext_overlap(struct Xt_pos_ext a, struct Xt_pos_ext b)
static struct Xt_pos_ext_vec generate_dir_transfer_ext_dst(int num_intersections, const struct Xt_com_list intersections[num_intersections], Xt_idxlist mypart_idxlist, int *resCount, struct exchange_ext **resSets, int(*restrict dst_removals_per_intersection)[2])
bool xt_idxlist_pos_ext_is_full_cover(Xt_idxlist idxlist, struct Xt_pos_ext_vec cover)
int xt_idxlist_get_pos_exts_of_index_stripes(Xt_idxlist idxlist, int num_stripes, const struct Xt_stripe stripes[num_stripes], int *num_ext, struct Xt_pos_ext **pos_ext, int single_match_only)
exchange map declarations
int xt_idxlist_get_index_at_position(Xt_idxlist idxlist, int position, Xt_int *index)
MPI_Comm(* get_communicator)(Xt_xmap)
static Xt_xmap_iter xmap_intersection_ext_get_out_iterator(Xt_xmap xmap)
static void xt_free_exchange_ext(size_t num_msg, struct exchange_ext *restrict msg)
static Xt_xmap xmap_intersection_ext_copy(Xt_xmap xmap)
static const struct Xt_xmap_vtable xmap_intersection_vtable
static int isign_mask(int x)
Xt_xmap xt_xmap_intersection_ext_new(int num_src_intersections, const struct Xt_com_list src_com[num_src_intersections], int num_dst_intersections, const struct Xt_com_list dst_com[num_dst_intersections], Xt_idxlist src_idxlist, Xt_idxlist dst_idxlist, MPI_Comm comm)
struct Xt_xmap_intersection_ext_ * Xt_xmap_intersection_ext
struct exchange_ext * in_msg
#define ENSURE_ARRAY_SIZE(arrayp, curr_array_size, req_size)
static void xmap_intersection_ext_delete(Xt_xmap xmap)
static MPI_Comm xmap_intersection_ext_get_communicator(Xt_xmap xmap)
static void generate_dir_transfer_pos_ext_src(int num_intersections, const struct Xt_com_list intersections[num_intersections], Xt_idxlist mypart_idxlist, int *resCount, struct exchange_ext **resSets, int(*restrict removals_per_intersection)[2], struct Xt_pos_ext *pos_updates)
static Xt_xmap_iter_intersection_ext xmiei(void *iter)
const struct Xt_xmap_iter_vtable * vtable
static void xmap_intersection_ext_get_destination_ranks(Xt_xmap xmap, int *ranks)
MPI_Comm xt_mpi_comm_smart_dup(MPI_Comm comm, int *tag_offset)
void xt_mpi_comm_smart_dedup(MPI_Comm *comm, int tag_offset)
static void xmap_intersection_ext_iterator_delete(Xt_xmap_iter iter)
static void xmap_intersection_ext_get_source_ranks(Xt_xmap xmap, int *ranks)
static void xmap_intersection_ext_msg_copy(size_t nmsg, struct exchange_ext *restrict msg, int *nmsg_copy, struct exchange_ext **msg_copy)
#define xt_mpi_call(call, comm)
struct exchange_ext * msg
static int xmap_intersection_ext_iterator_next(Xt_xmap_iter iter)
static const struct Xt_pos_ext * xmap_intersection_ext_iterator_get_transfer_pos_ext(Xt_xmap_iter iter)
static struct Xt_stripe * refine_stripes(int *num_stripes_, struct Xt_stripe *restrict intersection_idxstripes, size_t num_pos_updates, struct Xt_pos_ext *restrict pos_updates)
struct Xt_xmap_iter_intersection_ext_ * Xt_xmap_iter_intersection_ext
void xt_cover_start(struct Xt_pos_ext_vec *restrict cover, size_t initial_size)
void xt_cover_finish(struct Xt_pos_ext_vec *restrict cover)
static int const * xmap_intersection_ext_iterator_get_transfer_pos(Xt_xmap_iter iter)
static int xmap_intersection_ext_get_num_sources(Xt_xmap xmap)
size_t xt_cover_insert_or_overlap(struct Xt_pos_ext_vec *restrict cover, struct Xt_pos_range range, bool forward, size_t search_start_pos)
static int xmap_intersection_ext_get_num_destinations(Xt_xmap xmap)
static void remap_dst_intersections(int num_dst_intersections, const struct Xt_com_list dst_com[num_dst_intersections], Xt_idxlist mypart_idxlist, int resCount, struct exchange_ext resSets[resCount], int(*removals_per_intersection)[2])