|
Last change
on this file since 365 was 365, checked in by Eric.Larour, 16 years ago |
|
diagnostic_core_nonlinear in parallel/ is now identical to serial matlab version. New get routine for input parameters
|
|
File size:
685 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 "../../petsc/patches/petscpatches.h"
|
|---|
| 10 | #include "./mpipatches.h"
|
|---|
| 11 |
|
|---|
| 12 | int MPI_Lowerrow(int n){
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 | int range;
|
|---|
| 16 | int lower_row;
|
|---|
| 17 | int upper_row;
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 | /*First, figure out our range : */
|
|---|
| 21 | range=PetscDetermineLocalSize(n);
|
|---|
| 22 |
|
|---|
| 23 | /*Now determien upper and lower boundaries: */
|
|---|
| 24 | MPI_Boundariesfromrange(&lower_row,&upper_row,range);
|
|---|
| 25 |
|
|---|
| 26 | return lower_row;
|
|---|
| 27 |
|
|---|
| 28 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.