40 int num_com_panes = pconn[0];
46 std::vector< std::vector<int> > real2send(num_com_panes);
47 std::vector< std::vector<int> > ghost2recv(num_com_panes);
48 std::vector< std::vector<int> > shared_nodes(num_com_panes);
49 std::vector< int > pane_info(num_com_panes);
51 std::vector< std::vector<int> >::iterator
s = shared_nodes.begin();
52 std::vector< std::vector<int> >::iterator s_end = shared_nodes.end();
54 for (
int q=0;
q< num_com_panes;
q++){
55 int id_num = pconn[indx];
56 pane_info[
q] = id_num;
58 int count = pconn[indx];
60 int val = indx + count;
61 for ( ; indx < val; indx++){
62 (shared_nodes[
q]).push_back(pconn[indx]);
66 std::vector< std::vector<int> >::iterator p2 = real2send.begin();
67 std::vector< std::vector<int> >::iterator g2 = ghost2recv.begin();
68 std::vector< std::vector<int> >::iterator s2 = shared_nodes.begin();
70 for ( ; s2 != s_end; p2++,g2++,s2++){
73 int diff =
abs_val(node1-node2);
75 if ( (node1 - ni*ghost_layers) < ni ) {
77 int size = (*s2).size();
78 for (
int k=0;
k < size;
k++){
79 for (
int m=0; m< ghost_layers; m++){
80 (*p2).push_back( (*s2)[
k] + (m+1)*ni);
81 (*g2).push_back( (*s2)[
k] - (m+1)*ni);
84 }
else if ( ni*(nj-ghost_layers) - node1 < ni){
86 int size = (*s2).size();
87 for (
int k=0;
k < size;
k++){
88 for (
int m=0; m< ghost_layers; m++){
89 (*p2).push_back( (*s2)[
k] - (m+1)*ni);
90 (*g2).push_back( (*s2)[
k] + (m+1)*ni);
98 }
else if ( diff == ni ) {
99 if ( (node1 % ni) == (ni - ghost_layers)){
101 int size = (*s2).size();
102 for (
int k=0;
k < size;
k++){
103 for (
int m=0; m< ghost_layers; m++){
104 (*p2).push_back( (*s2)[
k] - (m+1));
105 (*g2).push_back( (*s2)[
k] + (m+1));
109 }
else if ( (node1 % ni) == (ghost_layers+1) ) {
111 int size = (*s2).size();
112 for (
int k=0;
k < size;
k++){
113 for (
int m=0; m< ghost_layers; m++){
114 (*p2).push_back( (*s2)[
k] + (m+1));
115 (*g2).push_back( (*s2)[
k] - (m+1));
130 for (
int j=0;
j<size;
j++){
131 new_pconn[
j] = pconn[
j];
135 new_pconn[indx] = num_com_panes;
137 for (
int k=0;
k< num_com_panes;
k++){
138 new_pconn[indx] = pane_info[
k];
140 new_pconn[indx] = real2send[
k].size();
142 for (
int m=0; m< real2send[
k].size(); m++){
143 new_pconn[indx] = real2send[
k][m];
149 new_pconn[indx] = num_com_panes;
151 for (
int k=0;
k< num_com_panes;
k++){
152 new_pconn[indx] = pane_info[
k];
154 new_pconn[indx] = ghost2recv[
k].size();
156 for (
int m=0; m< ghost2recv[
k].size(); m++){
157 new_pconn[indx] = ghost2recv[
k][m];
#define COM_assertion_msg(EX, msg)
static int abs_val(int a)
void int int REAL REAL REAL *z blockDim dim * ni