/[escript]/branches/doubleplusgood/dudley/src/ElementFile_gather.cpp
ViewVC logotype

Annotation of /branches/doubleplusgood/dudley/src/ElementFile_gather.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1312 - (hide annotations)
Mon Sep 24 06:18:44 2007 UTC (11 years, 7 months ago) by ksteube
Original Path: trunk/finley/src/ElementFile_gather.c
File MIME type: text/plain
File size: 1648 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     /* gathers the ElementFile out from the ElementFile in 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_gather(index_t* index, Finley_ElementFile* in, Finley_ElementFile* out) {
31     index_t k;
32     dim_t e,j;
33 ksteube 1312 dim_t NN_in=in->numNodes;
34     dim_t NN_out=out->numNodes;
35 jgs 82 if (in!=NULL) {
36     /*OMP */
37     #pragma omp parallel for private(e,k,j) schedule(static)
38     for (e=0;e<out->numElements;e++) {
39     k=index[e];
40     out->Id[e]=in->Id[k];
41     out->Tag[e]=in->Tag[k];
42 ksteube 1312 out->Owner[e]=in->Owner[k];
43 jgs 123 out->Color[e]=in->Color[k]+out->maxColor+1;
44 jgs 82 for(j=0;j<MIN(NN_out,NN_in);j++) out->Nodes[INDEX2(j,e,NN_out)]=in->Nodes[INDEX2(j,k,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