/[escript]/branches/doubleplusgood/finley/src/NodeMapping.cpp
ViewVC logotype

Diff of /branches/doubleplusgood/finley/src/NodeMapping.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4326 by jfenwick, Wed Feb 27 06:09:33 2013 UTC revision 4327 by jfenwick, Wed Mar 20 05:09:11 2013 UTC
# Line 32  Finley_NodeMapping* Finley_NodeMapping_a Line 32  Finley_NodeMapping* Finley_NodeMapping_a
32    /* now we assume min_target=0! */    /* now we assume min_target=0! */
33    max_target=Finley_Util_getFlaggedMaxInt(1,numNodes,target,unused);    max_target=Finley_Util_getFlaggedMaxInt(1,numNodes,target,unused);
34    numTargets= min_target<=max_target ? max_target+1 :0;    numTargets= min_target<=max_target ? max_target+1 :0;
35    out=MEMALLOC(1,Finley_NodeMapping);    out=new Finley_NodeMapping;
36    if (!Finley_checkPtr(out)) {    if (!Finley_checkPtr(out)) {
37       out->reference_counter=1;       out->reference_counter=1;
38       out->unused=unused;       out->unused=unused;
39       out->numNodes=numNodes;       out->numNodes=numNodes;
40       out->numTargets=numTargets;       out->numTargets=numTargets;
41       out->map=MEMALLOC(numTargets,index_t);       out->map=new index_t[numTargets];
42       out->target=MEMALLOC(numNodes,index_t);       out->target=new index_t[numNodes];
43       if (! (Finley_checkPtr(out->target) || Finley_checkPtr(out->map) ) ) {       if (! (Finley_checkPtr(out->target) || Finley_checkPtr(out->map) ) ) {
44          #pragma omp parallel          #pragma omp parallel
45          {          {
# Line 70  void Finley_NodeMapping_free(Finley_Node Line 70  void Finley_NodeMapping_free(Finley_Node
70    if (in != NULL) {    if (in != NULL) {
71        in->reference_counter--;        in->reference_counter--;
72        if (in->reference_counter<=0) {        if (in->reference_counter<=0) {
73           MEMFREE(in->target);           delete[] in->target;
74           MEMFREE(in->map);           delete[] in->map;
75           MEMFREE(in);             delete in;  
76       }       }
77    }    }
78  }  }

Legend:
Removed from v.4326  
changed lines
  Added in v.4327

  ViewVC Help
Powered by ViewVC 1.1.26