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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1223 - (show annotations)
Fri Aug 3 02:40:39 2007 UTC (11 years, 8 months ago) by gross
File MIME type: text/plain
File size: 2353 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 /* copies element file in into element file out starting from offset */
18 /* the elements offset to in->numElements+offset-1 in out will be overwritten */
19
20 /**************************************************************/
21
22 /* Author: gross@access.edu.au */
23 /* Version: $Id$ */
24
25 /**************************************************************/
26
27 #include "ElementFile.h"
28
29 /****************************************************************************/
30
31
32 void Finley_ElementFile_copyTable(index_t offset,Finley_ElementFile* out,index_t node_offset, index_t idOffset,Finley_ElementFile* in) {
33 dim_t i,n;
34 dim_t NN=out->numNodes;
35 if (in==NULL) return;
36 if (out->ReferenceElement->Type->TypeId!=in->ReferenceElement->Type->TypeId) {
37 Finley_setError(TYPE_ERROR,"Finley_ElementFile_copyTable: dimensions of element files don't match");
38 }
39 if (out->MPIInfo->comm!=in->MPIInfo->comm) {
40 Finley_setError(TYPE_ERROR,"Finley_ElementFile_copyTable: MPI communicators of element files don't match");
41 }
42 if (Finley_noError()) {
43 #pragma omp parallel for private(i,n) schedule(static)
44 for(n=0;n<in->numElements;n++) {
45 out->Owner[offset+n]=out->Owner[n];
46 out->Id[offset+n]=in->Id[n]+idOffset;
47 out->Tag[offset+n]=in->Tag[n];
48 for(i=0;i<NN;i++) out->Nodes[INDEX2(i,offset+n,NN)]=in->Nodes[INDEX2(i,n,in->ReferenceElement->Type->numNodes)]+node_offset;
49 }
50 out->isPrepared=FINLEY_UNPREPARED;
51 }
52 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26