/[escript]/trunk/dudley/src/ElementFile_scatter.c
ViewVC logotype

Annotation of /trunk/dudley/src/ElementFile_scatter.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1312 - (hide annotations)
Mon Sep 24 06:18:44 2007 UTC (12 years, 2 months ago) by ksteube
Original Path: trunk/finley/src/ElementFile_scatter.c
File MIME type: text/plain
File size: 2137 byte(s)
The MPI branch is hereby closed. All future work should be in trunk.

Previously in revision 1295 I merged the latest changes to trunk into trunk-mpi-branch.
In this revision I copied all files from trunk-mpi-branch over the corresponding
trunk files. I did not use 'svn merge', it was a copy.

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26