/[escript]/trunk/paso/src/Paso_MPI.c
ViewVC logotype

Diff of /trunk/paso/src/Paso_MPI.c

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

revision 1628 by phornby, Fri Jul 11 13:12:46 2008 UTC revision 1738 by gross, Fri Aug 29 05:06:45 2008 UTC
# Line 101  dim_t Paso_MPIInfo_setDistribution(Paso_ Line 101  dim_t Paso_MPIInfo_setDistribution(Paso_
101     dim_t out;     dim_t out;
102     int s=mpi_info->size;     int s=mpi_info->size;
103     dim_t N=max_id-min_id+1;     dim_t N=max_id-min_id+1;
104     int local_N=N/s;     if (N>0) {
105     rest=N-local_N*s;        int local_N=N/s;
106     for (p=0; p<s; ++p) {        rest=N-local_N*s;
107        if (p<rest) {        for (p=0; p<s; ++p) {
108            distribution[p]=min_id+(local_N+1)*p;           if (p<rest) {
109            out=local_N+1;               distribution[p]=min_id+(local_N+1)*p;
110                 out=local_N+1;
111             } else {
112                 distribution[p]=min_id+rest+local_N*p;
113             }
114          }
115          distribution[s]=max_id+1;
116          if (rest==0) {
117             return local_N;
118        } else {        } else {
119            distribution[p]=min_id+rest+local_N*p;           return local_N+1;
120        }        }
121     }    } else {
122     distribution[s]=max_id+1;        for (p=0; p<s+1; ++p) distribution[p]=min_id;
123     if (rest==0) {        return 0;
124        return local_N;    }
    } else {  
       return local_N+1;  
    }  
125  }  }
126    
127  /* checks that there is no error accross all processes in a communicator */  /* checks that there is no error accross all processes in a communicator */

Legend:
Removed from v.1628  
changed lines
  Added in v.1738

  ViewVC Help
Powered by ViewVC 1.1.26