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

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

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

revision 4331 by jfenwick, Wed Feb 27 06:09:33 2013 UTC revision 4332 by jfenwick, Thu Mar 21 04:21:14 2013 UTC
# Line 32  Dudley_NodeMapping *Dudley_NodeMapping_a Line 32  Dudley_NodeMapping *Dudley_NodeMapping_a
32      /* now we assume min_target=0! */      /* now we assume min_target=0! */
33      max_target = Dudley_Util_getFlaggedMaxInt(1, numNodes, target, unused);      max_target = Dudley_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, Dudley_NodeMapping);      out = new Dudley_NodeMapping;
36      if (!Dudley_checkPtr(out))      if (!Dudley_checkPtr(out))
37      {      {
38      out->reference_counter = 1;      out->reference_counter = 1;
39      out->unused = unused;      out->unused = unused;
40      out->numNodes = numNodes;      out->numNodes = numNodes;
41      out->numTargets = numTargets;      out->numTargets = numTargets;
42      out->map = MEMALLOC(numTargets, index_t);      out->map = new  index_t[numTargets];
43      out->target = MEMALLOC(numNodes, index_t);      out->target = new  index_t[numNodes];
44      if (!(Dudley_checkPtr(out->target) || Dudley_checkPtr(out->map)))      if (!(Dudley_checkPtr(out->target) || Dudley_checkPtr(out->map)))
45      {      {
46  #pragma omp parallel  #pragma omp parallel
# Line 82  void Dudley_NodeMapping_free(Dudley_Node Line 82  void Dudley_NodeMapping_free(Dudley_Node
82      in->reference_counter--;      in->reference_counter--;
83      if (in->reference_counter <= 0)      if (in->reference_counter <= 0)
84      {      {
85          MEMFREE(in->target);          delete[] in->target;
86          MEMFREE(in->map);          delete[] in->map;
87          MEMFREE(in);          delete in;
88      }      }
89      }      }
90  }  }

Legend:
Removed from v.4331  
changed lines
  Added in v.4332

  ViewVC Help
Powered by ViewVC 1.1.26