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

Contents of /trunk-mpi-branch/finley/src/ElementFile_scatter.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1223 - (show annotations)
Fri Aug 3 02:40:39 2007 UTC (12 years, 10 months ago) by gross
File MIME type: text/plain
File size: 2448 byte(s)
first attemt towards an improved MPI version.  

1 /*
2 ************************************************************
3 * Copyright 2006 by ACcESS MNRF *
4 * *
5 * http://www.access.edu.au *
6 * Primary Business: Queensland, Australia *
7 * Licensed under the Open Software License version 3.0 *
8 * http://www.opensource.org/licenses/osl-3.0.php *
9 * *
10 ************************************************************
11 */
12
13 /**************************************************************/
14 /* */
15 /* Finley: ElementFile */
16 /* */
17 /* scatter the ElementFile in into the ElementFile out using index[0:out->numElements-1]. */
18 /* index has to be between 0 and in->numElements-1. */
19 /* a conservative assumtion on the coloring is made */
20 /* */
21 /**************************************************************/
22
23 /* Author: gross@access.edu.au */
24 /* Version: $Id$ */
25
26 /**************************************************************/
27
28 #include "ElementFile.h"
29
30 /**************************************************************/
31
32 void Finley_ElementFile_scatter(index_t* index, Finley_ElementFile* in, Finley_ElementFile* out) {
33 index_t k;
34 dim_t e,j;
35 if (in!=NULL) {
36 dim_t NN_in=in->ReferenceElement->Type->numNodes;
37 dim_t NN_out=out->ReferenceElement->Type->numNodes;
38 /*OMP */
39 #pragma omp parallel for private(e,k,j) schedule(static)
40 for (e=0;e<in->numElements;e++) {
41 k=index[e];
42 out->Owner[k]=in->Owner[e];
43 out->Id[k]=in->Id[e];
44 out->Tag[k]=in->Tag[e];
45 out->Color[k]=in->Color[e]+out->maxColor+1;
46 for(j=0;j<MIN(NN_out,NN_in);j++) out->Nodes[INDEX2(j,k,NN_out)]=in->Nodes[INDEX2(j,e,NN_in)];
47 }
48 out->minColor=MIN(out->minColor,in->minColor+out->maxColor+1);
49 out->maxColor=MAX(out->maxColor,in->maxColor+out->maxColor+1);
50 out->isPrepared = MIN(in-> isPrepared, out->isPrepared);
51 }
52 }

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26