/[escript]/branches/doubleplusgood/paso/src/Distribution.cpp
ViewVC logotype

Diff of /branches/doubleplusgood/paso/src/Distribution.cpp

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

revision 4323 by jfenwick, Wed Feb 27 06:09:33 2013 UTC revision 4324 by jfenwick, Wed Mar 20 00:55:44 2013 UTC
# Line 34  Paso_Distribution* Paso_Distribution_all Line 34  Paso_Distribution* Paso_Distribution_all
34  {  {
35    int i;    int i;
36    Paso_Distribution *out=NULL;    Paso_Distribution *out=NULL;
37    out = MEMALLOC( 1, Paso_Distribution );    out = new Paso_Distribution;
38    if (Esys_checkPtr(out)) return NULL;    if (Esys_checkPtr(out)) return NULL;
39    out->mpi_info = Esys_MPIInfo_getReference(mpi_info);    out->mpi_info = Esys_MPIInfo_getReference(mpi_info);
40    out->reference_counter = 0;    out->reference_counter = 0;
41    out->first_component=NULL;    out->first_component=NULL;
42    
43    out->first_component = MEMALLOC( (mpi_info->size)+1, index_t );    out->first_component = new index_t[(mpi_info->size)+1];
44    if (Esys_checkPtr(out->first_component)) {    if (Esys_checkPtr(out->first_component)) {
45         Paso_Distribution_free(out);         Paso_Distribution_free(out);
46         return NULL;         return NULL;
# Line 56  void Paso_Distribution_free( Paso_Distri Line 56  void Paso_Distribution_free( Paso_Distri
56      --(in->reference_counter);      --(in->reference_counter);
57      if (in->reference_counter<=0) {      if (in->reference_counter<=0) {
58        Esys_MPIInfo_free( in->mpi_info );        Esys_MPIInfo_free( in->mpi_info );
59        MEMFREE( in->first_component );        delete[] in->first_component;
60        MEMFREE( in );        delete in;
61      }      }
62    }    }
63  }  }
# Line 121  double* Paso_Distribution_createRandomVe Line 121  double* Paso_Distribution_createRandomVe
121     const index_t n = ( Paso_Distribution_getMaxGlobalComponents(in)-Paso_Distribution_getMinGlobalComponents(in) ) * block;     const index_t n = ( Paso_Distribution_getMaxGlobalComponents(in)-Paso_Distribution_getMinGlobalComponents(in) ) * block;
122     const dim_t my_n = n_1-n_0;     const dim_t my_n = n_1-n_0;
123        
124     out=MEMALLOC(my_n , double);     out=new double[my_n];
125    
126     #pragma omp parallel for private(i) schedule(static)     #pragma omp parallel for private(i) schedule(static)
127     for (i=0; i<my_n ;++i) {     for (i=0; i<my_n ;++i) {

Legend:
Removed from v.4323  
changed lines
  Added in v.4324

  ViewVC Help
Powered by ViewVC 1.1.26