project3d_Cart.h File Reference

#include "mpi.h"
#include "emdata.h"

Include dependency graph for project3d_Cart.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int sphpart (MPI_Comm comm_2d, int nrays, int *ptrs, int *nnzbase, int *ptrstart)
int getcb2sph (Vec3i volsize, int ri, Vec3i origin, int nnz0, int *ptrs, int *cord)
int fwdpj3_Cart (Vec3i volsize, int nraysloc, int nnzloc, float *dm, Vec3i origin, int ri, int *ptrs, int *cord, int myptrstart, float *x, float *y)
int bckpj3_Cart (Vec3i volsize, int nraysloc, int nnzloc, float *dm, Vec3i origin, int ri, int *ptrs, int *cord, int myptrstart, float *x, float *y)


Function Documentation

int bckpj3_Cart ( Vec3i  volsize,
int  nraysloc,
int  nnzloc,
float *  dm,
Vec3i  origin,
int  ri,
int *  ptrs,
int *  cord,
int  myptrstart,
float *  x,
float *  y 
)

int fwdpj3_Cart ( Vec3i  volsize,
int  nraysloc,
int  nnzloc,
float *  dm,
Vec3i  origin,
int  ri,
int *  ptrs,
int *  cord,
int  myptrstart,
float *  x,
float *  y 
)

int getcb2sph ( Vec3i  volsize,
int  ri,
Vec3i  origin,
int  nnz0,
int *  ptrs,
int *  cord 
)

int sphpart ( MPI_Comm  comm_2d,
int  nrays,
int *  ptrs,
int *  nnzbase,
int *  ptrstart 
)

Definition at line 85 of file project3d_Cart.cpp.

00088              :
00089             comm_2d - Cartesian communicator
00090               nrays - total number of rays
00091                ptrs - vector containing pointers
00092             nnzbase - ideal volume partition of nnz
00093         Output:
00094            ptrstart - vector containing all the starting pointers for each column processor group
00095            nraysloc - actual number of local rays
00096 */
00097 {
00098         int ROW = 0, COL = 1;
00099         int dims[2], periods[2], mycoords[2];
00100         int nraysloc = 0;
00101         
00102         // Get information associated with comm_2d
00103         MPI_Cart_get(comm_2d, 2, dims, periods, mycoords);
00104 
00105         int count = 1;
00106         if (mycoords[COL] == 0){ // First column starts out with the first ray
00107           nraysloc++;
00108         }
00109         ptrstart[0] = 0;
00110 
00111         for(int i=1; i<nrays ; i++){
00112           if (ptrs[i]-1 <= nnzbase[count] && ptrs[i+1]-1 >= nnzbase[count]){ 
00113                 //nnzbase is between or equal to ptrs
00114 
00115             if (nnzbase[count]-(ptrs[i]-1)>= ptrs[i+1]-1-nnzbase[count]){
00116               if(mycoords[COL] == count-1){  // ray belongs to count-1
00117                 nraysloc++;
00118               }
00119               ptrstart[count] = i+1;
00120               count++;
00121 
00122             } else { //nnzbase[count]-(ptrs[i]-1)>= ptrs[i+1]-1-nnzbase[count]
00123                 if(mycoords[COL] == count){// ray belongs to count and it's a new starting ray
00124                   nraysloc++;
00125                 }
00126                 ptrstart[count] = i;
00127                 count++;
00128             }
00129 
00130         }
00131         else {  //ptrs[i]-1 > nnzbase[count] so ray belongs to count-1
00132           if(mycoords[COL] == count-1){
00133             nraysloc++;
00134           }
00135 
00136         }
00137         } // end for
00138         ptrstart[dims[COL]] = nrays;
00139         return nraysloc;
00140 
00141 }


Generated on Tue Jun 11 12:41:36 2013 for EMAN2 by  doxygen 1.4.7