~vcs-imports/escript-finley/trunk

« back to all changes in this revision

Viewing changes to paso/src/SharedComponents.c

  • Committer: jfenwick
  • Date: 2010-10-11 01:48:14 UTC
  • Revision ID: svn-v4:77569008-7704-0410-b7a0-a92fef0b09fd:trunk:3259
Merging dudley and scons updates from branches

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
/**************************************************************/
25
25
 
26
26
#include "SharedComponents.h"
 
27
#include "esysUtils/error.h"
27
28
 
28
29
/**************************************************************/
29
30
 
34
35
 
35
36
Paso_SharedComponents* Paso_SharedComponents_alloc(dim_t local_length,
36
37
                                                   dim_t numNeighbors,
37
 
                                                   Paso_MPI_rank* neighbor,
 
38
                                                   Esys_MPI_rank* neighbor,
38
39
                                                   index_t* shared,
39
40
                                                   index_t* offsetInShared,
40
41
                                                   index_t m, index_t b,
41
 
                                                   Paso_MPIInfo *mpi_info)
 
42
                                                   Esys_MPIInfo *mpi_info)
42
43
{
43
44
  dim_t i,j;
44
45
  register index_t itmp;
45
46
  Paso_SharedComponents* out=NULL;
46
 
  Paso_resetError();
 
47
  Esys_resetError();
47
48
  out=MEMALLOC(1,Paso_SharedComponents);
48
 
  if (!Paso_checkPtr(out)) {
 
49
  if (!Esys_checkPtr(out)) {
49
50
      out->local_length=local_length*m;
50
 
      out->mpi_info = Paso_MPIInfo_getReference(mpi_info);
 
51
      out->mpi_info = Esys_MPIInfo_getReference(mpi_info);
51
52
      out->numNeighbors=numNeighbors;
52
 
      out->neighbor=MEMALLOC(out->numNeighbors,Paso_MPI_rank);
 
53
      out->neighbor=MEMALLOC(out->numNeighbors,Esys_MPI_rank);
53
54
      if (offsetInShared == NULL) {
54
55
          out->numSharedComponents=0;
55
56
      } else {
58
59
      out->shared=MEMALLOC(out->numSharedComponents,index_t);
59
60
      out->offsetInShared=MEMALLOC(out->numNeighbors+1,index_t);
60
61
      out->reference_counter=1;
61
 
      if (! (Paso_checkPtr(out->neighbor) ||
62
 
             Paso_checkPtr(out->shared) || 
63
 
             Paso_checkPtr(out->offsetInShared) ) ) {
 
62
      if (! (Esys_checkPtr(out->neighbor) ||
 
63
             Esys_checkPtr(out->shared) || 
 
64
             Esys_checkPtr(out->offsetInShared) ) ) {
64
65
 
65
66
 
66
67
         if ((out->numNeighbors>0) && (offsetInShared!=NULL) ) {
84
85
      }
85
86
 
86
87
  }
87
 
  if (Paso_noError()) {
 
88
  if (Esys_noError()) {
88
89
     return out;
89
90
  } else {
90
91
     Paso_SharedComponents_free(out);
110
111
        MEMFREE(in->neighbor);
111
112
        MEMFREE(in->shared);
112
113
        MEMFREE(in->offsetInShared);
113
 
        Paso_MPIInfo_free(in->mpi_info);
 
114
        Esys_MPIInfo_free(in->mpi_info);
114
115
        MEMFREE(in);
115
116
        #ifdef Paso_TRACE
116
117
        printf("Paso_SharedComponents_dealloc: system matrix pattern as been deallocated.\n");