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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1140 - (show annotations)
Tue May 15 03:23:17 2007 UTC (13 years ago) by ksteube
File MIME type: text/plain
File size: 1909 byte(s)
MPI branch trunk-mpi-branch has been merged with trunk through revision
1125, so changes in trunk since 1125 are not reflected in
trunk-mpi-branch.

Originally we parallelized revision 989, but after this merge it's
as if we'd parallelized revision 1125.

run_simplesolve.py runs on 1, 2, 4 CPUs.

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: Mesh: NodeFile */
16
17 /* set tags to newTag where mask>0 */
18
19 /**************************************************************/
20
21 /* Author: gross@access.edu.au */
22 /* Version: $Id$ */
23
24 /**************************************************************/
25
26 #include "NodeFile.h"
27 #include "Util.h"
28
29 /**************************************************************/
30
31
32 void Finley_NodeFile_setTags(Finley_NodeFile* self,const int newTag, escriptDataC* mask) {
33 register dim_t n;
34 dim_t numNodes;
35 register double *mask_array;
36 register bool_t check;
37 Finley_resetError();
38
39 if (self==NULL) return;
40 numNodes=self->numNodes;
41 if (1!=getDataPointSize(mask)) {
42 Finley_setError(TYPE_ERROR,"Finley_NodeFile_setTags: number of components of mask is 1.");
43 } else if (!numSamplesEqual(mask,1,numNodes)) {
44 Finley_setError(TYPE_ERROR,"Finley_NodeFile_setTags: illegal number of samples of mask Data object");
45 }
46
47 /* now we can start */
48
49 if (Finley_noError()) {
50 #pragma omp parallel for private(n,check,mask_array) schedule(static)
51 for (n=0;n<numNodes;n++) {
52 mask_array=getSampleData(mask,n);
53 if (mask_array[0]>0) self->Tag[n]=newTag;
54 }
55 }
56 }
57 /*
58 * $Log$
59 *
60 */

  ViewVC Help
Powered by ViewVC 1.1.26