source: issm/trunk/src/c/toolkits/mpi/patches/MPI_Lowerrow.cpp@ 11995

Last change on this file since 11995 was 11995, checked in by Mathieu Morlighem, 13 years ago

merged trunk-jpl and trunk for revision 11994M

File size: 634 bytes
Line 
1/*!\file MPI_Lowerrow.cpp
2 * \brief: routine to distribute jobs in parallel.
3 * This handy routine will provide, along with the MPI_Upperrow, a distributed range
4 * for an index (like i,j, in a for loop).
5 * Ex: for(i=MPI_Lowerrow(num_procs)0;i<MPI_Upperrow(num_procs);i++)
6 * This ensures easy parallelisation of loops if needed.
7 */
8
9#include "./mpipatches.h"
10
11int MPI_Lowerrow(int n){
12
13
14 int range;
15 int lower_row;
16 int upper_row;
17
18
19 /*First, figure out our range : */
20 range=DetermineLocalSize(n);
21
22 /*Now determien upper and lower boundaries: */
23 MPI_Boundariesfromrange(&lower_row,&upper_row,range);
24
25 return lower_row;
26
27}
Note: See TracBrowser for help on using the repository browser.