36 int ni = pane->size_i();
37 int nj = pane->size_j();
38 int ghost_layers = pane->size_of_ghost_layers();
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 q=0;
q< num_com_panes;
q++){
131 real_size += real2send[
q].size();
135 for (
int q=0;
q< num_com_panes;
q++){
136 ghost_size += ghost2recv[
q].size();
139 int big_size = size+ 2*(1 + 2*num_com_panes) +
140 real_size + ghost_size;
142 int new_pconn[big_size];
145 for (
int j=0;
j<size;
j++){
146 new_pconn[
j] = pconn[
j];
150 new_pconn[indx] = num_com_panes;
152 for (
int k=0;
k< num_com_panes;
k++){
153 new_pconn[indx] = pane_info[
k];
155 new_pconn[indx] = real2send[
k].size();
157 for (
int m=0; m< real2send[
k].size(); m++){
158 new_pconn[indx] = real2send[
k][m];
164 new_pconn[indx] = num_com_panes;
166 for (
int k=0;
k< num_com_panes;
k++){
167 new_pconn[indx] = pane_info[
k];
169 new_pconn[indx] = ghost2recv[
k].size();
171 for (
int m=0; m< ghost2recv[
k].size(); m++){
172 new_pconn[indx] = ghost2recv[
k][m];
177 const std::string win_name = (pane->window())->name();
178 const std::string pconn_att = win_name+
".pconn";
static int abs_val(int a)
#define COM_assertion_msg(EX, msg)
void COM_set_array(const char *wa_str, int pane_id, void *addr, int strd=0, int cap=0)
Associates an array with an attribute for a specific pane.
unsigned long id(const Leda_like_handle &x)
void int int REAL REAL REAL *z blockDim dim * ni