- Timestamp:
- 11/16/12 08:10:16 (12 years ago)
- Location:
- issm/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk
- Property svn:mergeinfo changed
/issm/trunk-jpl merged: 13397-13398,13401,13407-13582,13584-13974
- Property svn:mergeinfo changed
-
issm/trunk/src
- Property svn:mergeinfo changed
-
issm/trunk/src/c/toolkits/mpi/patches/DetermineLocalSize.cpp
r12706 r13975 6 6 #include <math.h> 7 7 #include "../../../shared/shared.h" 8 #include "../../../include/types.h" 8 9 9 int DetermineLocalSize(int global_size ){10 int DetermineLocalSize(int global_size,COMM comm){ 10 11 11 12 /*output: */ … … 18 19 19 20 /*from MPI: */ 20 extern int num_procs; 21 extern int my_rank; 22 21 int num_procs; 22 int my_rank; 23 24 /*recover my_rank*/ 25 MPI_Comm_rank(comm,&my_rank); 26 MPI_Comm_size(comm,&num_procs); 27 23 28 /*We are not bound by any library, just use what seems most logical*/ 24 29 num_local_rows=xNew<int>(num_procs); … … 30 35 num_local_rows[i]=(int)floor((double)global_size/(double)num_procs); 31 36 } 32 37 33 38 /*There may be some rows left. Distribute evenly.*/ 34 39 row_rest=global_size - num_procs*(int)floor((double)global_size/(double)num_procs); … … 37 42 } 38 43 local_size=num_local_rows[my_rank]; 39 44 40 45 /*free ressources: */ 41 46 xDelete<int>(num_local_rows);
Note:
See TracChangeset
for help on using the changeset viewer.