/[escript]/trunk/paso/src/Coupler.c
ViewVC logotype

Diff of /trunk/paso/src/Coupler.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1639 by gross, Mon Jul 14 08:55:25 2008 UTC revision 1758 by gross, Mon Sep 8 02:29:33 2008 UTC
# Line 49  Paso_Connector* Paso_Connector_alloc(Pas Line 49  Paso_Connector* Paso_Connector_alloc(Pas
49        out->recv= Paso_SharedComponents_getReference(recv);        out->recv= Paso_SharedComponents_getReference(recv);
50        out->mpi_info = Paso_MPIInfo_getReference(send->mpi_info);        out->mpi_info = Paso_MPIInfo_getReference(send->mpi_info);
51        out->reference_counter=1;        out->reference_counter=1;
52    /*
53    { int i;
54    for (i=0; i< out->recv->numNeighbors; ++i)
55       printf("Coupler: %d receive %d data at %d from %d\n",send->mpi_info->rank,out->recv->offsetInShared[i+1]- out->recv->offsetInShared[i],
56    out->recv->offsetInShared[i],out->recv->neighbor[i]);
57    for (i=0; i< out->send->numNeighbors; ++i)
58    printf("Coupler: %d send %d data at %d to %d\n",send->mpi_info->rank,out->send->offsetInShared[i+1]- out->send->offsetInShared[i],
59    out->send->offsetInShared[i],out->send->neighbor[i]);
60    }
61    */
62    }    }
63    if (Paso_noError()) {    if (Paso_noError()) {
64       return out;       return out;
# Line 219  void Paso_Coupler_startCollect(Paso_Coup Line 229  void Paso_Coupler_startCollect(Paso_Coup
229          }          }
230       }       }
231       /* collect values into buffer */       /* collect values into buffer */
232       #pragma omp parallel for private(i)       if (block_size>1) {
233       for (i=0; i < coupler->connector->send->numSharedComponents;++i) {          #pragma omp parallel for private(i)
234          memcpy(&(coupler->send_buffer[(block_size)*i]),&(in[ block_size * coupler->connector->send->shared[i]]), block_size_size);          for (i=0; i < coupler->connector->send->numSharedComponents;++i) {
235               memcpy(&(coupler->send_buffer[(block_size)*i]),&(in[ block_size * coupler->connector->send->shared[i]]), block_size_size);
236            }
237         } else {
238            #pragma omp parallel for private(i)
239            for (i=0; i < coupler->connector->send->numSharedComponents;++i) coupler->send_buffer[i]=in[coupler->connector->send->shared[i]];
240       }       }
241       /* send buffer out */       /* send buffer out */
242       {       {
# Line 252  double* Paso_Coupler_finishCollect(Paso_ Line 267  double* Paso_Coupler_finishCollect(Paso_
267                      coupler->mpi_stati);                      coupler->mpi_stati);
268          #endif          #endif
269    }    }
270    
271    return coupler->recv_buffer;    return coupler->recv_buffer;
272  }  }
273  dim_t Paso_Coupler_getLocalLength(const Paso_Coupler* in) {  dim_t Paso_Coupler_getLocalLength(const Paso_Coupler* in) {
274       return in->connector->send->local_length;       return in->connector->send->local_length;
   
275  }  }
276  void Paso_Coupler_copyAll(const Paso_Coupler* src, Paso_Coupler* target)  void Paso_Coupler_copyAll(const Paso_Coupler* src, Paso_Coupler* target)
277  {  {

Legend:
Removed from v.1639  
changed lines
  Added in v.1758

  ViewVC Help
Powered by ViewVC 1.1.26