Lines Matching refs:gs

127 static PetscErrorCode gsi_via_bit_mask(PCTFS_gs_id *gs);
128 static PetscErrorCode get_ngh_buf(PCTFS_gs_id *gs);
129 static PetscErrorCode set_pairwise(PCTFS_gs_id *gs);
131 static PetscErrorCode set_tree(PCTFS_gs_id *gs);
134 static PetscErrorCode PCTFS_gs_gop_local_out(PCTFS_gs_id *gs, PetscScalar *vals);
136 static PetscErrorCode PCTFS_gs_gop_vec_local_out(PCTFS_gs_id *gs, PetscScalar *vals, PetscInt step);
138 static PetscErrorCode PCTFS_gs_gop_vec_plus(PCTFS_gs_id *gs, PetscScalar *in_vals, PetscInt step);
139 static PetscErrorCode PCTFS_gs_gop_vec_pairwise_plus(PCTFS_gs_id *gs, PetscScalar *in_vals, PetscIn…
140 static PetscErrorCode PCTFS_gs_gop_vec_local_plus(PCTFS_gs_id *gs, PetscScalar *vals, PetscInt step…
141 static PetscErrorCode PCTFS_gs_gop_vec_local_in_plus(PCTFS_gs_id *gs, PetscScalar *vals, PetscInt s…
142 static PetscErrorCode PCTFS_gs_gop_vec_tree_plus(PCTFS_gs_id *gs, PetscScalar *vals, PetscInt step);
144 static PetscErrorCode PCTFS_gs_gop_local_plus(PCTFS_gs_id *gs, PetscScalar *vals);
145 static PetscErrorCode PCTFS_gs_gop_local_in_plus(PCTFS_gs_id *gs, PetscScalar *vals);
147 static PetscErrorCode PCTFS_gs_gop_plus_hc(PCTFS_gs_id *gs, PetscScalar *in_vals, PetscInt dim);
148 static PetscErrorCode PCTFS_gs_gop_pairwise_plus_hc(PCTFS_gs_id *gs, PetscScalar *in_vals, PetscInt…
149 static PetscErrorCode PCTFS_gs_gop_tree_plus_hc(PCTFS_gs_id *gs, PetscScalar *vals, PetscInt dim);
182 PCTFS_gs_id *gs; in PCTFS_gs_init() local
191 gs = gsi_check_args(elms, nel, level); in PCTFS_gs_init()
195 PetscCallAbort(PETSC_COMM_WORLD, gsi_via_bit_mask(gs)); in PCTFS_gs_init()
201 gs->PCTFS_gs_comm = PCTFS_gs_comm; in PCTFS_gs_init()
203 return gs; in PCTFS_gs_init()
209 PCTFS_gs_id *gs; in gsi_new() local
210 gs = (PCTFS_gs_id *)malloc(sizeof(PCTFS_gs_id)); in gsi_new()
211 PetscCallAbort(PETSC_COMM_WORLD, PetscMemzero(gs, sizeof(PCTFS_gs_id))); in gsi_new()
212 return gs; in gsi_new()
224 PCTFS_gs_id *gs; in gsi_check_args() local
232 gs = gsi_new(); in gsi_check_args()
233 gs->id = ++num_gs_ids; in gsi_check_args()
295 gs->repeats = k; in gsi_check_args()
296 gs->nel = nel - k; in gsi_check_args()
299 gs->num_local = num_local; in gsi_check_args()
301 gs->local_reduce = local_reduce = (PetscInt **)malloc(num_local * sizeof(PetscInt *)); in gsi_check_args()
302 gs->num_local_reduce = num_to_reduce = (PetscInt *)malloc(num_local * sizeof(PetscInt)); in gsi_check_args()
304 unique = (PetscInt *)malloc((gs->nel + 1) * sizeof(PetscInt)); in gsi_check_args()
305 gs->elms = unique; in gsi_check_args()
306 gs->nel_total = nel; in gsi_check_args()
307 gs->local_elms = elms; in gsi_check_args()
308 gs->companion = companion; in gsi_check_args()
311 for (num_local = i = j = 0; i < gs->nel; i++) { in gsi_check_args()
334 unique[gs->nel] = INT_MAX; in gsi_check_args()
345 if (gs->nel > 0) { in gsi_check_args()
347 vals[4] = unique[gs->nel - 1]; in gsi_check_args()
363 gs->nel_min = vals[0]; in gsi_check_args()
364 gs->nel_max = vals[1]; in gsi_check_args()
365 gs->nel_sum = vals[2]; in gsi_check_args()
366 gs->gl_min = vals[3]; in gsi_check_args()
367 gs->gl_max = vals[4]; in gsi_check_args()
368 gs->negl = vals[4] - vals[3] + 1; in gsi_check_args()
370 …if (gs->negl <= 0) SETERRABORT(PETSC_COMM_WORLD, PETSC_ERR_PLIB, "gsi_check_args() :: system empty… in gsi_check_args()
375 gs->level = vals[5]; in gsi_check_args()
377 return gs; in gsi_check_args()
381 static PetscErrorCode gsi_via_bit_mask(PCTFS_gs_id *gs) in gsi_via_bit_mask() argument
390 PetscCall(get_ngh_buf(gs)); in gsi_via_bit_mask()
392 if (gs->level) PetscCall(set_pairwise(gs)); in gsi_via_bit_mask()
393 if (gs->max_left_over) PetscCall(set_tree(gs)); in gsi_via_bit_mask()
396 gs->num_local_total = gs->num_local; in gsi_via_bit_mask()
397 gs->gop_local_reduce = gs->local_reduce; in gsi_via_bit_mask()
398 gs->num_gop_local_reduce = gs->num_local_reduce; in gsi_via_bit_mask()
400 map = gs->companion; in gsi_via_bit_mask()
403 if (!gs->num_local) { in gsi_via_bit_mask()
404 gs->local_strength = NONE; in gsi_via_bit_mask()
405 gs->num_local_gop = 0; in gsi_via_bit_mask()
408 map = gs->companion; in gsi_via_bit_mask()
409 reduce = gs->local_reduce; in gsi_via_bit_mask()
410 for (i = 0, t1 = 0; i < gs->num_local; i++, reduce++) { in gsi_via_bit_mask()
411 …vec_binary_search(**reduce, gs->pw_elm_list, gs->len_pw_list) >= 0) || PCTFS_ivec_binary_search(**… in gsi_via_bit_mask()
413 PetscCheck(gs->num_local_reduce[i] > 0, PETSC_COMM_SELF, PETSC_ERR_PLIB, "nobody in list?"); in gsi_via_bit_mask()
414 gs->num_local_reduce[i] *= -1; in gsi_via_bit_mask()
421 gs->local_strength = FULL; in gsi_via_bit_mask()
422 gs->num_local_gop = 0; in gsi_via_bit_mask()
424 gs->local_strength = PARTIAL; in gsi_via_bit_mask()
426 …PetscCall(PCTFS_SMI_sort((void *)gs->num_local_reduce, (void *)gs->local_reduce, gs->num_local + 1… in gsi_via_bit_mask()
428 gs->num_local_gop = t1; in gsi_via_bit_mask()
429 gs->num_local_total = gs->num_local; in gsi_via_bit_mask()
430 gs->num_local -= t1; in gsi_via_bit_mask()
431 gs->gop_local_reduce = gs->local_reduce; in gsi_via_bit_mask()
432 gs->num_gop_local_reduce = gs->num_local_reduce; in gsi_via_bit_mask()
435 …PetscCheck(gs->num_gop_local_reduce[i] < 0, PETSC_COMM_SELF, PETSC_ERR_PLIB, "they aren't negative… in gsi_via_bit_mask()
436 gs->num_gop_local_reduce[i] *= -1; in gsi_via_bit_mask()
437 gs->local_reduce++; in gsi_via_bit_mask()
438 gs->num_local_reduce++; in gsi_via_bit_mask()
440 gs->local_reduce++; in gsi_via_bit_mask()
441 gs->num_local_reduce++; in gsi_via_bit_mask()
445 elms = gs->pw_elm_list; in gsi_via_bit_mask()
446 nel = gs->len_pw_list; in gsi_via_bit_mask()
449 elms = gs->tree_map_in; in gsi_via_bit_mask()
450 nel = gs->tree_map_sz; in gsi_via_bit_mask()
454 free((void *)gs->local_elms); in gsi_via_bit_mask()
455 free((void *)gs->companion); in gsi_via_bit_mask()
456 free((void *)gs->elms); in gsi_via_bit_mask()
457 free((void *)gs->ngh_buf); in gsi_via_bit_mask()
458 gs->local_elms = gs->companion = gs->elms = gs->ngh_buf = NULL; in gsi_via_bit_mask()
487 static PetscErrorCode get_ngh_buf(PCTFS_gs_id *gs) in get_ngh_buf() argument
500 nel = gs->nel; in get_ngh_buf()
501 elms = gs->elms; in get_ngh_buf()
502 level = gs->level; in get_ngh_buf()
509 gs->nghs = sh_proc_mask = (PetscInt *)malloc(p_mask_size); in get_ngh_buf()
510 gs->pw_nghs = pw_sh_proc_mask = (PetscInt *)malloc(p_mask_size); in get_ngh_buf()
511 gs->ngh_buf_sz = ngh_buf_size = p_mask_size * nel; in get_ngh_buf()
513 gs->ngh_buf = ngh_buf = (PetscInt *)malloc(ngh_buf_size); in get_ngh_buf()
519 per_load = negl = gs->negl; in get_ngh_buf()
520 gs->num_loads = num_loads = 1; in get_ngh_buf()
539 gs->num_loads = num_loads = negl / per_load + (negl % per_load > 0); in get_ngh_buf()
551 gs->mask_sz = p_mask_size; in get_ngh_buf()
563 for (ptr1 = ngh_buf, ptr2 = elms, end = gs->gl_min, or_ct = i = 0; or_ct < num_loads; or_ct++) { in get_ngh_buf()
631 gs->len_pw_list = npw; in get_ngh_buf()
632 gs->num_nghs = PCTFS_ct_bits((char *)sh_proc_mask, p_mask_size * sizeof(PetscInt)); in get_ngh_buf()
635 gs->nghs = (PetscInt *)malloc(gs->num_nghs * sizeof(PetscInt)); in get_ngh_buf()
636 PetscCall(PCTFS_bm_to_proc((char *)sh_proc_mask, p_mask_size * sizeof(PetscInt), gs->nghs)); in get_ngh_buf()
638 gs->num_pw_nghs = PCTFS_ct_bits((char *)pw_sh_proc_mask, p_mask_size * sizeof(PetscInt)); in get_ngh_buf()
641 ct1 = gs->num_nghs; in get_ngh_buf()
643 gs->max_nghs = ct1; in get_ngh_buf()
645 gs->tree_map_sz = ntree_map; in get_ngh_buf()
646 gs->max_left_over = ntree; in get_ngh_buf()
654 static PetscErrorCode set_pairwise(PCTFS_gs_id *gs) in set_pairwise() argument
668 nel = gs->nel; in set_pairwise()
669 elms = gs->elms; in set_pairwise()
670 ngh_buf = gs->ngh_buf; in set_pairwise()
671 sh_proc_mask = gs->pw_nghs; in set_pairwise()
683 len_pair_list = gs->len_pw_list; in set_pairwise()
684 gs->pw_elm_list = pairwise_elm_list = (PetscInt *)malloc((len_pair_list + 1) * sizeof(PetscInt)); in set_pairwise()
687 nprs = gs->num_pairs = PCTFS_ct_bits((char *)sh_proc_mask, p_mask_size * sizeof(PetscInt)); in set_pairwise()
690 gs->pair_list = msg_list = (PetscInt *)malloc(sizeof(PetscInt) * nprs); in set_pairwise()
691 gs->msg_sizes = msg_size = (PetscInt *)malloc(sizeof(PetscInt) * nprs); in set_pairwise()
692 gs->node_list = msg_nodes = (PetscInt **)malloc(sizeof(PetscInt *) * (nprs + 1)); in set_pairwise()
709 gs->msg_ids_out = (MPI_Request *)malloc(sizeof(MPI_Request) * (nprs + 1)); in set_pairwise()
710 gs->msg_ids_out[nprs] = MPI_REQUEST_NULL; in set_pairwise()
711 gs->msg_ids_in = (MPI_Request *)malloc(sizeof(MPI_Request) * (nprs + 1)); in set_pairwise()
712 gs->msg_ids_in[nprs] = MPI_REQUEST_NULL; in set_pairwise()
713 gs->pw_vals = (PetscScalar *)malloc(sizeof(PetscScalar) * len_pair_list * vec_sz); in set_pairwise()
741 j = gs->loc_node_pairs = i_start; in set_pairwise()
744 gs->max_node_pairs = i_start; in set_pairwise()
749 gs->min_node_pairs = i_start; in set_pairwise()
754 gs->avg_node_pairs = i_start / PCTFS_num_nodes + 1; in set_pairwise()
759 gs->max_pairs = i_start; in set_pairwise()
762 gs->msg_total = PCTFS_ivec_sum(gs->msg_sizes, nprs); in set_pairwise()
763 gs->out = (PetscScalar *)malloc(sizeof(PetscScalar) * gs->msg_total * vec_sz); in set_pairwise()
764 gs->in = (PetscScalar *)malloc(sizeof(PetscScalar) * gs->msg_total * vec_sz); in set_pairwise()
774 static PetscErrorCode set_tree(PCTFS_gs_id *gs) in set_tree() argument
781 elms = gs->elms; in set_tree()
782 nel = gs->nel; in set_tree()
785 gs->tree_nel = n = ntree; in set_tree()
786 gs->tree_elms = tree_elms = iptr_in = tree_buf; in set_tree()
787 gs->tree_buf = (PetscScalar *)malloc(sizeof(PetscScalar) * n * vec_sz); in set_tree()
788 gs->tree_work = (PetscScalar *)malloc(sizeof(PetscScalar) * n * vec_sz); in set_tree()
789 j = gs->tree_map_sz; in set_tree()
790 gs->tree_map_in = iptr_in = (PetscInt *)malloc(sizeof(PetscInt) * (j + 1)); in set_tree()
791 gs->tree_map_out = iptr_out = (PetscInt *)malloc(sizeof(PetscInt) * (j + 1)); in set_tree()
818 static PetscErrorCode PCTFS_gs_gop_local_out(PCTFS_gs_id *gs, PetscScalar *vals) in PCTFS_gs_gop_local_out() argument
824 num = gs->num_gop_local_reduce; in PCTFS_gs_gop_local_out()
825 reduce = gs->gop_local_reduce; in PCTFS_gs_gop_local_out()
847 static PetscErrorCode PCTFS_gs_gop_local_plus(PCTFS_gs_id *gs, PetscScalar *vals) in PCTFS_gs_gop_local_plus() argument
853 num = gs->num_local_reduce; in PCTFS_gs_gop_local_plus()
854 reduce = gs->local_reduce; in PCTFS_gs_gop_local_plus()
882 static PetscErrorCode PCTFS_gs_gop_local_in_plus(PCTFS_gs_id *gs, PetscScalar *vals) in PCTFS_gs_gop_local_in_plus() argument
888 num = gs->num_gop_local_reduce; in PCTFS_gs_gop_local_in_plus()
889 reduce = gs->gop_local_reduce; in PCTFS_gs_gop_local_in_plus()
911 PetscErrorCode PCTFS_gs_free(PCTFS_gs_id *gs) in PCTFS_gs_free() argument
916 PetscCallMPI(MPI_Comm_free(&gs->PCTFS_gs_comm)); in PCTFS_gs_free()
917 if (gs->nghs) free((void *)gs->nghs); in PCTFS_gs_free()
918 if (gs->pw_nghs) free((void *)gs->pw_nghs); in PCTFS_gs_free()
921 if (gs->max_left_over) { in PCTFS_gs_free()
922 if (gs->tree_elms) free((void *)gs->tree_elms); in PCTFS_gs_free()
923 if (gs->tree_buf) free((void *)gs->tree_buf); in PCTFS_gs_free()
924 if (gs->tree_work) free((void *)gs->tree_work); in PCTFS_gs_free()
925 if (gs->tree_map_in) free((void *)gs->tree_map_in); in PCTFS_gs_free()
926 if (gs->tree_map_out) free((void *)gs->tree_map_out); in PCTFS_gs_free()
930 if (gs->num_pairs) { in PCTFS_gs_free()
932 if (gs->ngh_buf) free((void *)gs->ngh_buf); in PCTFS_gs_free()
933 if (gs->elms) free((void *)gs->elms); in PCTFS_gs_free()
934 if (gs->local_elms) free((void *)gs->local_elms); in PCTFS_gs_free()
935 if (gs->companion) free((void *)gs->companion); in PCTFS_gs_free()
938 if (gs->vals) free((void *)gs->vals); in PCTFS_gs_free()
939 if (gs->in) free((void *)gs->in); in PCTFS_gs_free()
940 if (gs->out) free((void *)gs->out); in PCTFS_gs_free()
941 if (gs->msg_ids_in) free((void *)gs->msg_ids_in); in PCTFS_gs_free()
942 if (gs->msg_ids_out) free((void *)gs->msg_ids_out); in PCTFS_gs_free()
943 if (gs->pw_vals) free((void *)gs->pw_vals); in PCTFS_gs_free()
944 if (gs->pw_elm_list) free((void *)gs->pw_elm_list); in PCTFS_gs_free()
945 if (gs->node_list) { in PCTFS_gs_free()
946 for (i = 0; i < gs->num_pairs; i++) { in PCTFS_gs_free()
947 if (gs->node_list[i]) free((void *)gs->node_list[i]); in PCTFS_gs_free()
949 free((void *)gs->node_list); in PCTFS_gs_free()
951 if (gs->msg_sizes) free((void *)gs->msg_sizes); in PCTFS_gs_free()
952 if (gs->pair_list) free((void *)gs->pair_list); in PCTFS_gs_free()
956 if (gs->num_local_total >= 0) { in PCTFS_gs_free()
957 for (i = 0; i < gs->num_local_total + 1; i++) { in PCTFS_gs_free()
958 if (gs->num_gop_local_reduce[i]) free((void *)gs->gop_local_reduce[i]); in PCTFS_gs_free()
963 if (gs->gop_local_reduce) free((void *)gs->gop_local_reduce); in PCTFS_gs_free()
964 if (gs->num_gop_local_reduce) free((void *)gs->num_gop_local_reduce); in PCTFS_gs_free()
966 free((void *)gs); in PCTFS_gs_free()
971 PetscErrorCode PCTFS_gs_gop_vec(PCTFS_gs_id *gs, PetscScalar *vals, const char *op, PetscInt step) in PCTFS_gs_gop_vec() argument
976 PetscCall(PCTFS_gs_gop_vec_plus(gs, vals, step)); in PCTFS_gs_gop_vec()
981 PetscCall(PCTFS_gs_gop_vec_plus(gs, vals, step)); in PCTFS_gs_gop_vec()
988 static PetscErrorCode PCTFS_gs_gop_vec_plus(PCTFS_gs_id *gs, PetscScalar *vals, PetscInt step) in PCTFS_gs_gop_vec_plus() argument
991 PetscCheck(gs, PETSC_COMM_SELF, PETSC_ERR_PLIB, "PCTFS_gs_gop_vec() passed NULL gs handle!!!"); in PCTFS_gs_gop_vec_plus()
994 if (gs->num_local) PetscCall(PCTFS_gs_gop_vec_local_plus(gs, vals, step)); in PCTFS_gs_gop_vec_plus()
997 if (gs->num_local_gop) { in PCTFS_gs_gop_vec_plus()
998 PetscCall(PCTFS_gs_gop_vec_local_in_plus(gs, vals, step)); in PCTFS_gs_gop_vec_plus()
1001 if (gs->num_pairs) PetscCall(PCTFS_gs_gop_vec_pairwise_plus(gs, vals, step)); in PCTFS_gs_gop_vec_plus()
1004 else if (gs->max_left_over) PetscCall(PCTFS_gs_gop_vec_tree_plus(gs, vals, step)); in PCTFS_gs_gop_vec_plus()
1006 PetscCall(PCTFS_gs_gop_vec_local_out(gs, vals, step)); in PCTFS_gs_gop_vec_plus()
1009 if (gs->num_pairs) PetscCall(PCTFS_gs_gop_vec_pairwise_plus(gs, vals, step)); in PCTFS_gs_gop_vec_plus()
1012 else if (gs->max_left_over) PetscCall(PCTFS_gs_gop_vec_tree_plus(gs, vals, step)); in PCTFS_gs_gop_vec_plus()
1018 static PetscErrorCode PCTFS_gs_gop_vec_local_plus(PCTFS_gs_id *gs, PetscScalar *vals, PetscInt step) in PCTFS_gs_gop_vec_local_plus() argument
1024 num = gs->num_local_reduce; in PCTFS_gs_gop_vec_local_plus()
1025 reduce = gs->local_reduce; in PCTFS_gs_gop_vec_local_plus()
1065 static PetscErrorCode PCTFS_gs_gop_vec_local_in_plus(PCTFS_gs_id *gs, PetscScalar *vals, PetscInt s… in PCTFS_gs_gop_vec_local_in_plus() argument
1071 num = gs->num_gop_local_reduce; in PCTFS_gs_gop_vec_local_in_plus()
1072 reduce = gs->gop_local_reduce; in PCTFS_gs_gop_vec_local_in_plus()
1098 static PetscErrorCode PCTFS_gs_gop_vec_local_out(PCTFS_gs_id *gs, PetscScalar *vals, PetscInt step) in PCTFS_gs_gop_vec_local_out() argument
1104 num = gs->num_gop_local_reduce; in PCTFS_gs_gop_vec_local_out()
1105 reduce = gs->gop_local_reduce; in PCTFS_gs_gop_vec_local_out()
1131 static PetscErrorCode PCTFS_gs_gop_vec_pairwise_plus(PCTFS_gs_id *gs, PetscScalar *in_vals, PetscIn… in PCTFS_gs_gop_vec_pairwise_plus() argument
1142 msg_list = list = gs->pair_list; in PCTFS_gs_gop_vec_pairwise_plus()
1143 msg_size = size = gs->msg_sizes; in PCTFS_gs_gop_vec_pairwise_plus()
1144 msg_nodes = nodes = gs->node_list; in PCTFS_gs_gop_vec_pairwise_plus()
1145 iptr = pw = gs->pw_elm_list; in PCTFS_gs_gop_vec_pairwise_plus()
1146 dptr1 = dptr3 = gs->pw_vals; in PCTFS_gs_gop_vec_pairwise_plus()
1147 msg_ids_in = ids_in = gs->msg_ids_in; in PCTFS_gs_gop_vec_pairwise_plus()
1148 msg_ids_out = ids_out = gs->msg_ids_out; in PCTFS_gs_gop_vec_pairwise_plus()
1149 dptr2 = gs->out; in PCTFS_gs_gop_vec_pairwise_plus()
1150 in1 = in2 = gs->in; in PCTFS_gs_gop_vec_pairwise_plus()
1157 …PetscCallMPI(MPIU_Irecv(in1, *size * step, MPIU_SCALAR, MPI_ANY_SOURCE, MSGTAG1 + *list, gs->PCTFS… in PCTFS_gs_gop_vec_pairwise_plus()
1179 …nd(dptr3, *msg_size * step, MPIU_SCALAR, *msg_list, MSGTAG1 + PCTFS_my_id, gs->PCTFS_gs_comm, msg_… in PCTFS_gs_gop_vec_pairwise_plus()
1186 if (gs->max_left_over) PetscCall(PCTFS_gs_gop_vec_tree_plus(gs, in_vals, step)); in PCTFS_gs_gop_vec_pairwise_plus()
1225 static PetscErrorCode PCTFS_gs_gop_vec_tree_plus(PCTFS_gs_id *gs, PetscScalar *vals, PetscInt step) in PCTFS_gs_gop_vec_tree_plus() argument
1235 in = gs->tree_map_in; in PCTFS_gs_gop_vec_tree_plus()
1236 out = gs->tree_map_out; in PCTFS_gs_gop_vec_tree_plus()
1237 buf = gs->tree_buf; in PCTFS_gs_gop_vec_tree_plus()
1238 work = gs->tree_work; in PCTFS_gs_gop_vec_tree_plus()
1239 size = gs->tree_nel * step; in PCTFS_gs_gop_vec_tree_plus()
1255 in = gs->tree_map_in; in PCTFS_gs_gop_vec_tree_plus()
1256 out = gs->tree_map_out; in PCTFS_gs_gop_vec_tree_plus()
1267 PetscErrorCode PCTFS_gs_gop_hc(PCTFS_gs_id *gs, PetscScalar *vals, const char *op, PetscInt dim) in PCTFS_gs_gop_hc() argument
1272 PetscCall(PCTFS_gs_gop_plus_hc(gs, vals, dim)); in PCTFS_gs_gop_hc()
1277 PetscCall(PCTFS_gs_gop_plus_hc(gs, vals, dim)); in PCTFS_gs_gop_hc()
1284 static PetscErrorCode PCTFS_gs_gop_plus_hc(PCTFS_gs_id *gs, PetscScalar *vals, PetscInt dim) in PCTFS_gs_gop_plus_hc() argument
1294 if (gs->num_local) PetscCall(PCTFS_gs_gop_local_plus(gs, vals)); in PCTFS_gs_gop_plus_hc()
1297 if (gs->num_local_gop) { in PCTFS_gs_gop_plus_hc()
1298 PetscCall(PCTFS_gs_gop_local_in_plus(gs, vals)); in PCTFS_gs_gop_plus_hc()
1301 if (gs->num_pairs) PetscCall(PCTFS_gs_gop_pairwise_plus_hc(gs, vals, dim)); /* tree only */ in PCTFS_gs_gop_plus_hc()
1302 else if (gs->max_left_over) PetscCall(PCTFS_gs_gop_tree_plus_hc(gs, vals, dim)); in PCTFS_gs_gop_plus_hc()
1304 PetscCall(PCTFS_gs_gop_local_out(gs, vals)); in PCTFS_gs_gop_plus_hc()
1307 if (gs->num_pairs) PetscCall(PCTFS_gs_gop_pairwise_plus_hc(gs, vals, dim)); /* tree */ in PCTFS_gs_gop_plus_hc()
1308 else if (gs->max_left_over) PetscCall(PCTFS_gs_gop_tree_plus_hc(gs, vals, dim)); in PCTFS_gs_gop_plus_hc()
1314 static PetscErrorCode PCTFS_gs_gop_pairwise_plus_hc(PCTFS_gs_id *gs, PetscScalar *in_vals, PetscInt… in PCTFS_gs_gop_pairwise_plus_hc() argument
1330 msg_list = list = gs->pair_list; in PCTFS_gs_gop_pairwise_plus_hc()
1331 msg_size = size = gs->msg_sizes; in PCTFS_gs_gop_pairwise_plus_hc()
1332 msg_nodes = nodes = gs->node_list; in PCTFS_gs_gop_pairwise_plus_hc()
1333 iptr = pw = gs->pw_elm_list; in PCTFS_gs_gop_pairwise_plus_hc()
1334 dptr1 = dptr3 = gs->pw_vals; in PCTFS_gs_gop_pairwise_plus_hc()
1335 msg_ids_in = ids_in = gs->msg_ids_in; in PCTFS_gs_gop_pairwise_plus_hc()
1336 msg_ids_out = ids_out = gs->msg_ids_out; in PCTFS_gs_gop_pairwise_plus_hc()
1337 dptr2 = gs->out; in PCTFS_gs_gop_pairwise_plus_hc()
1338 in1 = in2 = gs->in; in PCTFS_gs_gop_pairwise_plus_hc()
1346 …PetscCallMPI(MPIU_Irecv(in1, *size, MPIU_SCALAR, MPI_ANY_SOURCE, MSGTAG1 + *list, gs->PCTFS_gs_com… in PCTFS_gs_gop_pairwise_plus_hc()
1368 …PetscCallMPI(MPIU_Isend(dptr3, *msg_size, MPIU_SCALAR, *list, MSGTAG1 + PCTFS_my_id, gs->PCTFS_gs_… in PCTFS_gs_gop_pairwise_plus_hc()
1379 if (gs->max_left_over) PetscCall(PCTFS_gs_gop_tree_plus_hc(gs, in_vals, dim)); in PCTFS_gs_gop_pairwise_plus_hc()
1413 static PetscErrorCode PCTFS_gs_gop_tree_plus_hc(PCTFS_gs_id *gs, PetscScalar *vals, PetscInt dim) in PCTFS_gs_gop_tree_plus_hc() argument
1421 in = gs->tree_map_in; in PCTFS_gs_gop_tree_plus_hc()
1422 out = gs->tree_map_out; in PCTFS_gs_gop_tree_plus_hc()
1423 buf = gs->tree_buf; in PCTFS_gs_gop_tree_plus_hc()
1424 work = gs->tree_work; in PCTFS_gs_gop_tree_plus_hc()
1425 size = gs->tree_nel; in PCTFS_gs_gop_tree_plus_hc()
1431 in = gs->tree_map_in; in PCTFS_gs_gop_tree_plus_hc()
1432 out = gs->tree_map_out; in PCTFS_gs_gop_tree_plus_hc()