/[escript]/trunk-mpi-branch/finley/src/Assemble_CopyNodalData.c
ViewVC logotype

Diff of /trunk-mpi-branch/finley/src/Assemble_CopyNodalData.c

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

revision 1222 by ksteube, Tue May 15 03:23:17 2007 UTC revision 1223 by gross, Fri Aug 3 02:40:39 2007 UTC
# Line 29  Line 29 
29  #include "./paso/CommBuffer.h"  #include "./paso/CommBuffer.h"
30  #endif  #endif
31    
   
 #ifdef PASO_MPI  
 /*    
   this function does no checking that the input are OK, so it has been put here, to  
   only be used in Finley_Assemble_CopyNodalData() which does the checking for it.  
   
   bufferExternal must be large enough to accomdate the external nodal data (numComps*numExternal)  
 */  
 static bool_t getExternalDOF( Finley_NodeFile *nodes, escriptDataC* in, double *externalBuffer, dim_t numComps, bool_t doReduced )  
 {  
   double *sendBuffer=NULL;  
   index_t n, i, myMax=0;  
   bool_t result=TRUE;  
     Finley_NodeDistribution *distribution=NULL;  
     Paso_CommBuffer *CommBuffer=NULL;  
     if( doReduced ) {  
         distribution = nodes->reducedDegreeOfFreedomDistribution;  
         CommBuffer = nodes->reducedCommBuffer;  
     }  
     else {  
         distribution = nodes->degreeOfFreedomDistribution;  
         CommBuffer = nodes->CommBuffer;  
     }  
   
   for( i=0; i<distribution->numNeighbours; i++ )  
     if( myMax < distribution->edges[i]->numForward )  
       myMax = distribution->edges[i]->numForward;  
   if( myMax )  
     sendBuffer = MEMALLOC( myMax*numComps, double );  
   
   /* pack and send DOF information to neighbour domains */  
   for( n=0; n<distribution->numNeighbours; n++ )  
   {  
     /* pack data */  
       for( i=0; i<distribution->edges[n]->numForward; i++ )  
       memcpy( sendBuffer + i*numComps, getSampleData(in,distribution->edges[n]->indexForward[i]), numComps*sizeof(double) );  
       
     /* place it in the send buffer */  
     Paso_CommBuffer_pack( CommBuffer, distribution->neighbours[n], NULL, sendBuffer, numComps*sizeof(double), 0 );  
     
     /* send it */  
     result = Paso_CommBuffer_send( CommBuffer, distribution->neighbours[n], numComps*sizeof(double) );  
     if( result==FALSE )  
       return FALSE;  
   }  
   
   MEMFREE( sendBuffer );  
   
   /* receive and unpack external DOF information from neigbours */  
   for( n=0; n<distribution->numNeighbours; n++ )  
   {  
     /* receive data */  
     result = Paso_CommBuffer_recv( CommBuffer, distribution->neighbours[n], numComps*sizeof(double) );  
     if( result==FALSE )  
       return FALSE;  
   
     /* unpack the data */  
     Paso_CommBuffer_unpack( CommBuffer, distribution->neighbours[n], distribution->edges[n]->indexBackward, externalBuffer, numComps*sizeof(double), -distribution->numLocal );  
   }  
   
   return TRUE;  
 }  
 #endif  
   
 /******************************************************************************************************/  
   
   
32  void Finley_Assemble_CopyNodalData(Finley_NodeFile* nodes,escriptDataC* out,escriptDataC* in) {  void Finley_Assemble_CopyNodalData(Finley_NodeFile* nodes,escriptDataC* out,escriptDataC* in) {
33      dim_t n,i;      dim_t n,i,k,l;
34      dim_t numComps=getDataPointSize(out);      dim_t numComps=getDataPointSize(out);
35      type_t in_data_type=getFunctionSpaceType(in);      type_t in_data_type=getFunctionSpaceType(in);
36      type_t out_data_type=getFunctionSpaceType(out);      type_t out_data_type=getFunctionSpaceType(out);
37        index_t upperBound;
38        double* recv_buffer;
39        size_t numComps_size=0;
40      Finley_resetError();      Finley_resetError();
41      if (nodes==NULL) return;      if (nodes==NULL) return;
42    
# Line 111  void Finley_Assemble_CopyNodalData(Finle Line 47  void Finley_Assemble_CopyNodalData(Finle
47         Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: expanded Data object is expected for output data.");         Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: expanded Data object is expected for output data.");
48      }      }
49    
     /* TODO */  
50      /* more sophisticated test needed for overlapping node/DOF counts */      /* more sophisticated test needed for overlapping node/DOF counts */
51      if (in_data_type == FINLEY_NODES) {      if (in_data_type == FINLEY_NODES) {
52          if (! numSamplesEqual(in,1,nodes->numNodes)) {          if (! numSamplesEqual(in,1,Finley_NodeFile_getNumNodes(nodes))) {
53                 Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: illegal number of samples of input Data object");                 Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: illegal number of samples of input Data object");
54         }         }
55      } else if (in_data_type == FINLEY_REDUCED_NODES) {      } else if (in_data_type == FINLEY_REDUCED_NODES) {
56         /* TODO */         if (! numSamplesEqual(in,1,Finley_NodeFile_getNumReducedNodes(nodes))) {
57         Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: reduced nodes is not supported yet.");                 Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: illegal number of samples of input Data object");
58           }
59      } else if (in_data_type == FINLEY_DEGREES_OF_FREEDOM) {      } else if (in_data_type == FINLEY_DEGREES_OF_FREEDOM) {
60  #ifdef PASO_MPI          if (! numSamplesEqual(in,1,Finley_NodeFile_getNumDegreesOfFreedom(nodes))) {
         if (! numSamplesEqual(in,1,nodes->degreeOfFreedomDistribution->numLocal)) {  
 #else  
         if (! numSamplesEqual(in,1,nodes->numDegreesOfFreedom)) {  
 #endif  
61                 Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: illegal number of samples of input Data object");                 Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: illegal number of samples of input Data object");
62         }         }
63      } else if (in_data_type == FINLEY_REDUCED_DEGREES_OF_FREEDOM) {      } else if (in_data_type == FINLEY_REDUCED_DEGREES_OF_FREEDOM) {
64  #ifdef PASO_MPI          if (! numSamplesEqual(in,1,Finley_NodeFile_getNumReducedDegreesOfFreedom(nodes))) {
65          if (! numSamplesEqual(in,1,nodes->reducedDegreeOfFreedomDistribution->numLocal)) {              Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: illegal number of samples of input Data object");
 #else  
         if (! numSamplesEqual(in,1,nodes->reducedNumDegreesOfFreedom)) {  
 #endif  
                Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: illegal number of samples of input Data object");  
66         }         }
67      } else {      } else {
68         Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: illegal function space type for target object");         Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: illegal function space type for target object");
69      }      }
70            
71      if (out_data_type == FINLEY_NODES) {      if (out_data_type == FINLEY_NODES) {
72          if (! numSamplesEqual(out,1,nodes->numNodes)) {          if (! numSamplesEqual(out,1,Finley_NodeFile_getNumNodes(nodes))) {
73                 Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: illegal number of samples of output Data object");                 Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: illegal number of samples of output Data object");
74         }         }
75      } else if (out_data_type == FINLEY_REDUCED_NODES) {      } else if (out_data_type == FINLEY_REDUCED_NODES) {
76         /* TODO */         if (! numSamplesEqual(out,1,Finley_NodeFile_getNumReducedNodes(nodes))) {
77         Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: reduced nodes is not supported yet.");                 Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: illegal number of samples of output Data object");
78           }
79      } else if (out_data_type == FINLEY_DEGREES_OF_FREEDOM) {      } else if (out_data_type == FINLEY_DEGREES_OF_FREEDOM) {
80  #ifdef PASO_MPI          if (! numSamplesEqual(out,1,Finley_NodeFile_getNumDegreesOfFreedom(nodes))) {
         if (! numSamplesEqual(out,1,nodes->degreeOfFreedomDistribution->numLocal)) {  
 #else  
         if (! numSamplesEqual(out,1,nodes->numDegreesOfFreedom)) {  
 #endif  
81                 Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: illegal number of samples of output Data object");                 Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: illegal number of samples of output Data object");
82         }         }
83      } else if (out_data_type == FINLEY_REDUCED_DEGREES_OF_FREEDOM) {      } else if (out_data_type == FINLEY_REDUCED_DEGREES_OF_FREEDOM) {
84  #ifdef PASO_MPI          if (! numSamplesEqual(out,1,Finley_NodeFile_getNumReducedDegreesOfFreedom(nodes))) {
         if (! numSamplesEqual(out,1,nodes->reducedDegreeOfFreedomDistribution->numLocal)) {  
 #else  
         if (! numSamplesEqual(out,1,nodes->reducedNumDegreesOfFreedom)) {  
 #endif  
85                 Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: illegal number of samples of output Data object");                 Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: illegal number of samples of output Data object");
86         }         }
87      } else {      } else {
# Line 169  void Finley_Assemble_CopyNodalData(Finle Line 90  void Finley_Assemble_CopyNodalData(Finle
90    
91      /* now we can start */      /* now we can start */
92    
    /* This is where the "MPI magic" that shares the data accross domain boundaries occurs.  
       when the user asks to copy from DegreesOfFreedom (non-overlapping solution) to  
       Nodes (overlapping continuous), communication is required to get the DOF values  
       corresponding to external nodes from neighbouring domains. Communication is handled by  
       the Paso_CommBuffer that is attached to nodes. Copying the other direction (nodes to DOF)  
       is similar to the serial case, with just a little bit more care required to ensure that  
       only local values are copied. */  
93      if (Finley_noError()) {      if (Finley_noError()) {
94            /*********************** FINLEY_NODES **************************************************/
95            numComps_size=(size_t)numComps*sizeof(double);
96          if (in_data_type == FINLEY_NODES) {          if (in_data_type == FINLEY_NODES) {
97    
98             if  (out_data_type == FINLEY_NODES) {             if  (out_data_type == FINLEY_NODES) {
99                #pragma omp parallel for private(n) schedule(static)                #pragma omp parallel for private(n) schedule(static)
100                for (n=0;n<nodes->numNodes;n++)                for (n=0;n<nodes->nodesMapping->numNodes;n++) {
101                     Finley_copyDouble(numComps,getSampleData(in,n),getSampleData(out,n));                     memcpy(getSampleDataFast(out,n), getSampleDataFast(in,n), numComps_size);
102             } else if (in_data_type == FINLEY_REDUCED_NODES) { /* TODO */                }
103               Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: cannot copy from nodes to reduced nodes.");  
104               } else if (in_data_type == FINLEY_REDUCED_NODES) {
105                  #pragma omp parallel for private(n,i) schedule(static)
106                  for (n=0;n<nodes->reducedNodesMapping->numTargets;n++) {
107                       memcpy(getSampleDataFast(in,nodes->reducedNodesMapping->map[n]),
108                              getSampleDataFast(out,n),numComps_size);
109                  }
110             } else if (out_data_type == FINLEY_DEGREES_OF_FREEDOM) {             } else if (out_data_type == FINLEY_DEGREES_OF_FREEDOM) {
111                #pragma omp parallel for private(n) schedule(static)                #pragma omp parallel for private(n) schedule(static)
112                for (n=0;n<nodes->numNodes;n++)                for (n=0;n<Paso_Distribution_getMyNumComponents(nodes->degreesOfFreedomDistribution);n++) {
113  #ifdef PASO_MPI                     memcpy(getSampleDataFast(out,n),
114                  if( nodes->degreeOfFreedom[n]<nodes->degreeOfFreedomDistribution->numLocal )                            getSampleDataFast(in,nodes->degreesOfFreedomMapping->map[n]),
115  #endif                            numComps_size);
116                     Finley_copyDouble(numComps,getSampleData(in,n),getSampleData(out,nodes->degreeOfFreedom[n]));                }
117    
118             } else if (out_data_type == FINLEY_REDUCED_DEGREES_OF_FREEDOM) {             } else if (out_data_type == FINLEY_REDUCED_DEGREES_OF_FREEDOM) {
119                #pragma omp parallel for private(n,i) schedule(static)                #pragma omp parallel for private(n,i) schedule(static)
120                for (i=0;i<nodes->numNodes;i++) {                for (n=0;n<Paso_Distribution_getMyNumComponents(nodes->reducedDegreesOfFreedomDistribution);n++) {
121                     n=nodes->reducedDegreeOfFreedom[i];                     memcpy(getSampleDataFast(out,n),
122  #ifdef PASO_MPI                            getSampleDataFast(in,nodes->reducedDegreesOfFreedomMapping->map[n]),
123                  if( n>=0 && nodes->degreeOfFreedom[n]<nodes->degreeOfFreedomDistribution->numLocal )                            numComps_size);
 #else  
                 if (n>=0)  
 #endif            
                   Finley_copyDouble(numComps,getSampleData(in,i),getSampleData(out,n));  
124                }                }
125             }             }
126            /*********************** FINLEY_REDUCED_NODES **************************************************/
127          } else if (in_data_type == FINLEY_REDUCED_NODES) {          } else if (in_data_type == FINLEY_REDUCED_NODES) {
128    
129             if  (out_data_type == FINLEY_NODES) {             if  (out_data_type == FINLEY_NODES) {
130               Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: cannot copy from reduced nodes to nodes.");               Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: cannot copy from reduced nodes to nodes.");
131             } else if (in_data_type == FINLEY_REDUCED_NODES) { /* TODO */  
132               Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: cannot copy from reduced nodes to reduced nodes.");             } else if (in_data_type == FINLEY_REDUCED_NODES) {
133                  #pragma omp parallel for private(n) schedule(static)
134                  for (n=0;n<nodes->reducedNodesMapping->numNodes;n++) {
135                       memcpy(getSampleDataFast(out,n),getSampleDataFast(in,n),numComps_size);
136                  }
137    
138             } else if (out_data_type == FINLEY_DEGREES_OF_FREEDOM) {             } else if (out_data_type == FINLEY_DEGREES_OF_FREEDOM) {
139               Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: cannot copy from reduced nodes to degrees of freedom.");               Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: cannot copy from reduced nodes to degrees of freedom.");
140             } else if (out_data_type == FINLEY_REDUCED_DEGREES_OF_FREEDOM) {             } else if (out_data_type == FINLEY_REDUCED_DEGREES_OF_FREEDOM) {
141               Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: cannot copy from reduced nodes to reduced degrees of freedom.");                #pragma omp parallel for private(n,k) schedule(static)
142                  for (n=0;n<Paso_Distribution_getMyNumComponents(nodes->reducedDegreesOfFreedomDistribution);n++) {
143                       k=nodes->reducedDegreesOfFreedomMapping->map[n];
144                       memcpy(getSampleDataFast(out,n),
145                              getSampleDataFast(in,nodes->reducedNodesMapping->target[k]),
146                              numComps_size);
147                  }
148             }             }
149    
150            /*********************** FINLEY_DEGREES_OF_FREEDOM **************************************************/
151          } else if (in_data_type == FINLEY_DEGREES_OF_FREEDOM) {          } else if (in_data_type == FINLEY_DEGREES_OF_FREEDOM) {
152              if  (out_data_type == FINLEY_NODES)  
153              {              if  (out_data_type == FINLEY_NODES) {
154  #ifdef PASO_MPI                 Paso_Coupler_allocBuffer(nodes->degreesOfFreedomCoupler,numComps);
155                double *externalBuffer = MEMALLOC( numComps*nodes->degreeOfFreedomDistribution->numExternal, double );                 if (Paso_noError()) {
156                getExternalDOF( nodes, in, externalBuffer, numComps, FALSE );                      Paso_Coupler_startCollect(nodes->degreesOfFreedomCoupler,getSampleDataFast(in,0));
157                for (n=0;n<nodes->numNodes;n++) {                      recv_buffer=Paso_Coupler_finishCollect(nodes->degreesOfFreedomCoupler);
158                  if( nodes->degreeOfFreedom[n]<nodes->degreeOfFreedomDistribution->numLocal )                      upperBound=Paso_Distribution_getMyNumComponents(nodes->degreesOfFreedomDistribution);
159                    Finley_copyDouble(numComps,getSampleData(in,nodes->degreeOfFreedom[n]),getSampleData(out,n));                      #pragma omp parallel for private(n,k) schedule(static)
160                  else                      for (n=0;n<nodes->numNodes;n++) {
161                    Finley_copyDouble(numComps,externalBuffer + numComps*(nodes->degreeOfFreedom[n] - nodes->degreeOfFreedomDistribution->numLocal),getSampleData(out,n));                            k=nodes->degreesOfFreedomMapping->target[n];
162                              }                            if (k < upperBound) {
163                                                  memcpy(getSampleDataFast(out,n),
164                MEMFREE( externalBuffer );                                         getSampleDataFast(in,k),
165  #else                                         numComps_size);
166                #pragma omp parallel for private(n) schedule(static)                             } else {
167                for (n=0;n<nodes->numNodes;n++)                                  memcpy(getSampleDataFast(out,n),
168                     Finley_copyDouble(numComps,getSampleData(in,nodes->degreeOfFreedom[n]),getSampleData(out,n));                                         &recv_buffer[k-upperBound],
169  #endif                                         numComps_size);
170                               }
171                        }
172                        Paso_Coupler_freeBuffer(nodes->degreesOfFreedomCoupler);
173                   }
174    
175                } else if  (out_data_type == FINLEY_REDUCED_NODES) {
176                   Paso_Coupler_allocBuffer(nodes->degreesOfFreedomCoupler,numComps);
177                   if (Paso_noError()) {
178                        Paso_Coupler_startCollect(nodes->degreesOfFreedomCoupler,getSampleDataFast(in,0));
179                        recv_buffer=Paso_Coupler_finishCollect(nodes->degreesOfFreedomCoupler);
180                        upperBound=Paso_Distribution_getMyNumComponents(nodes->degreesOfFreedomDistribution);
181                        #pragma omp parallel for private(n,k,l) schedule(static)
182                        for (n=0;n<nodes->reducedNodesMapping->numTargets;n++) {
183                              l=nodes->reducedNodesMapping->map[n];
184                              k=nodes->degreesOfFreedomMapping->target[l];
185                              if (k < upperBound) {
186                                    memcpy(getSampleDataFast(out,n),
187                                           getSampleDataFast(in,k),
188                                           numComps_size);
189                               } else {
190                                    memcpy(getSampleDataFast(out,n),
191                                           &recv_buffer[k-upperBound],
192                                           numComps_size);
193                               }
194                        }
195                        Paso_Coupler_freeBuffer(nodes->degreesOfFreedomCoupler);
196                   }
197             } else if (out_data_type == FINLEY_DEGREES_OF_FREEDOM) {             } else if (out_data_type == FINLEY_DEGREES_OF_FREEDOM) {
198                #pragma omp parallel for private(n) schedule(static)                #pragma omp parallel for private(n) schedule(static)
199                for (n=0;n<nodes->numDegreesOfFreedom;n++)                for (n=0;n<Paso_Distribution_getMyNumComponents(nodes->degreesOfFreedomDistribution);n++) {
200                      Finley_copyDouble(numComps,getSampleData(in,n),getSampleData(out,n));                      memcpy(getSampleDataFast(out,n),getSampleDataFast(in,n),numComps_size);
201                  }
202    
203             } else if (out_data_type == FINLEY_REDUCED_DEGREES_OF_FREEDOM) {             } else if (out_data_type == FINLEY_REDUCED_DEGREES_OF_FREEDOM) {
204                #pragma omp parallel for private(n,i) schedule(static)                #pragma omp parallel for private(n,k) schedule(static)
205                for (i=0;i<nodes->numNodes;i++) {                for (n=0;n<Paso_Distribution_getMyNumComponents(nodes->reducedDegreesOfFreedomDistribution);n++) {
206                    n=nodes->reducedDegreeOfFreedom[i];                     k=nodes->reducedDegreesOfFreedomMapping->map[n];
207  #ifdef PASO_MPI                     memcpy(getSampleDataFast(out,n),
208                  if( n>=0 && n<nodes->reducedDegreeOfFreedomDistribution->numLocal )                            getSampleDataFast(in,nodes->degreesOfFreedomMapping->target[k]),
209  #else                            numComps_size);
                 if (n>=0)  
 #endif    
                    Finley_copyDouble(numComps,getSampleData(in,nodes->degreeOfFreedom[i]),getSampleData(out,n));  
210                }                }
211             }             }
212    
213          } else if (in_data_type == FINLEY_REDUCED_DEGREES_OF_FREEDOM) {          } else if (in_data_type == FINLEY_REDUCED_DEGREES_OF_FREEDOM) {
214             if (out_data_type == FINLEY_REDUCED_DEGREES_OF_FREEDOM) {  
215                #pragma omp parallel for private(n) schedule(static)             if  (out_data_type == FINLEY_NODES) {
216                for (n=0;n<nodes->reducedNumDegreesOfFreedom;n++)               Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: cannot copy from reduced degrees of freedom to nodes.");
217                      Finley_copyDouble(numComps,getSampleData(in,n),getSampleData(out,n));  
218             } else if (out_data_type == FINLEY_DEGREES_OF_FREEDOM ) {             } else if (in_data_type == FINLEY_REDUCED_NODES) {
219                #pragma omp parallel for private(n) schedule(static)                 Paso_Coupler_allocBuffer(nodes->reducedDegreesOfFreedomCoupler,numComps);
220                for (i=0;i<nodes->numNodes;i++) {                 if (Paso_noError()) {
221                    n=nodes->reducedDegreeOfFreedom[i];                      Paso_Coupler_startCollect(nodes->reducedDegreesOfFreedomCoupler,getSampleDataFast(in,0));
222  #ifdef PASO_MPI                      recv_buffer=Paso_Coupler_finishCollect(nodes->reducedDegreesOfFreedomCoupler);
223                      if( n>=0 && nodes->reducedDegreeOfFreedom[n]<nodes->reducedDegreeOfFreedomDistribution->numLocal )                      upperBound=Paso_Distribution_getMyNumComponents(nodes->reducedDegreesOfFreedomDistribution);
224  #else                      #pragma omp parallel for private(n,k,l) schedule(static)
225                    if (n>=0)                      for (n=0;n<nodes->reducedNodesMapping->numTargets;n++) {
226  #endif                            l=nodes->reducedNodesMapping->map[n];
227                      Finley_copyDouble(numComps,getSampleData(in,n),getSampleData(out,nodes->degreeOfFreedom[i]));                            k=nodes->reducedDegreesOfFreedomMapping->target[l];
228                }                            if (k < upperBound) {
229             } else if (out_data_type == FINLEY_NODES ) {                                  memcpy(getSampleDataFast(out,n),
230  #ifdef PASO_MPI                                         getSampleDataFast(in,k),
231                double *externalBuffer = MEMALLOC( numComps*nodes->reducedDegreeOfFreedomDistribution->numExternal, double );                                         numComps_size);
232                getExternalDOF( nodes, in, externalBuffer, numComps, TRUE );                             } else {
233                for (n=0;n<nodes->numNodes;n++) {                                  memcpy(getSampleDataFast(out,n),
234                                  i = nodes->reducedDegreeOfFreedom[n];                                         &recv_buffer[k-upperBound],
235                                  if( i>=0 ) {                                         numComps_size);
236                                      if( i<nodes->reducedDegreeOfFreedomDistribution->numLocal )                             }
237                                          Finley_copyDouble(numComps,getSampleData(in,i),getSampleData(out,n));                      }
238                                      else                      Paso_Coupler_freeBuffer(nodes->reducedDegreesOfFreedomCoupler);
239                                          Finley_copyDouble(numComps,externalBuffer + numComps*(i - nodes->reducedDegreeOfFreedomDistribution->numLocal),getSampleData(out,n));                 }
240                                  }  
241                              }             } else if (out_data_type == FINLEY_REDUCED_DEGREES_OF_FREEDOM) {
                 
               MEMFREE( externalBuffer );  
 #else  
242                #pragma omp parallel for private(n) schedule(static)                #pragma omp parallel for private(n) schedule(static)
243                for (i=0;i<nodes->numNodes;i++) {                for (n=0;n<Paso_Distribution_getMyNumComponents(nodes->reducedDegreesOfFreedomDistribution);n++) {
244                    n=nodes->reducedDegreeOfFreedom[i];                      memcpy(getSampleDataFast(out,n),getSampleDataFast(in,n),numComps_size);
                   if (n>=0)  
                                         Finley_copyDouble(numComps,getSampleData(in,n),getSampleData(out,i));  
245                }                }
246  #endif  
247             } else {             } else if (out_data_type == FINLEY_DEGREES_OF_FREEDOM ) {
248               Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: cannot copy from data on reduced degrees of freedom");               Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: cannot copy from reduced degrees of freedom to degrees of freedom.");
249             }             }
250          }          }
251     }     }
252     return;     return;
253  }  }
254    
   
   
 /*  
  * $Log$  
  * Revision 1.4  2005/09/15 03:44:21  jgs  
  * Merge of development branch dev-02 back to main trunk on 2005-09-15  
  *  
  * Revision 1.3  2005/08/12 01:45:42  jgs  
  * erge of development branch dev-02 back to main trunk on 2005-08-12  
  *  
  * Revision 1.2.2.3  2005/09/07 06:26:17  gross  
  * the solver from finley are put into the standalone package paso now  
  *  
  * Revision 1.2.2.2  2005/08/09 02:23:12  gross  
  * print statement removed  
  *  
  * Revision 1.2.2.1  2005/08/03 09:55:33  gross  
  * ContactTest is passing now./mk install!  
  *  
  * Revision 1.2  2005/07/08 04:07:45  jgs  
  * Merge of development branch back to main trunk on 2005-07-08  
  *  
  * Revision 1.1.1.1.2.1  2005/06/29 02:34:46  gross  
  * some changes towards 64 integers in finley  
  *  
  * Revision 1.1.1.1  2004/10/26 06:53:56  jgs  
  * initial import of project esys2  
  *  
  * Revision 1.2  2004/07/21 05:00:54  gross  
  * name changes in DataC  
  *  
  * Revision 1.1  2004/07/02 04:21:13  gross  
  * Finley C code has been included  
  *  
  *  
  */  

Legend:
Removed from v.1222  
changed lines
  Added in v.1223

  ViewVC Help
Powered by ViewVC 1.1.26