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

Contents of /trunk-mpi-branch/finley/src/DOFMap.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: 1962 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 /* Author: gross@access.edu.au */
15 /* Version: $Id$ */
16
17 /**************************************************************/
18
19 #include "DOFMap.h"
20
21 Finley_DOFMap* Finley_DOFMap_alloc(dim_t numNodes, index_t* globalID, Paso_Distribution* distribution)
22 {
23 Finley_DOFMap* out=NULL;
24 /* allocate the return value */
25 out=MEMALLOC(1,Finley_DOFMap);
26 if (Finley_checkPtr(out)) return NULL;
27
28 out->distribution=Paso_Distribution_getReference(distribution);
29 out->MPIInfo=Paso_MPIInfo_getReference(distribution->mpi_info);
30 out->numNodes=0;
31 out->ID=NULL;
32 out->myNumDOFs=0;
33 out->numDOFs=0;
34 out->numRemotes=0;
35 out->remoteID=NULL;
36 out->remoteProcessor=NULL;
37 out->offsetInRemoteID=NULL;
38 out->numNeighbours=0;
39 out->neighbours=NULL;
40 out->reference_counter=1;
41 }
42
43 void Finley_DOFMap_free(Finley_DOFMap* in) {
44 if ( in ) {
45 in->reference_counter--;
46 if (in->reference_counter<=0) {
47 Paso_Distribution_free(in->distribution);
48 Paso_MPIInfo_free(in->MPIInfo);
49 MEMFREE(in->ID);
50 MEMFREE(in->remoteID);
51 MEMFREE(in->remoteProcessor);
52 MEMFREE(in->offsetInRemoteID);
53 MEMFREE(in->neighbours);
54 MEMFREE(in);
55 }
56 }
57 }
58 Finley_DOFMap* DOFMap_getReference(Finley_DOFMap *in )
59 {
60 if ( in )
61 in->reference_counter++;
62 return in;
63 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26