Re: [OMPI users] MPI-Send for entire entire matrix when allocating memory dynamically

2009-10-31 Thread Justin Luitjens
Here is how you can do this without having to redescribe the data type all the time. This will also keep your data layout together and improve cache coherency. #include #include #include using namespace std; int main() { int N=2, M=3; //Allocate the matrix double **A=(double**)malloc(si

Re: [OMPI users] MPI-Send for entire entire matrix when allocating memory dynamically

2009-10-31 Thread George Bosilca
Eugene is right, every time you create a new matrix you will have to describe it with a new datatype (even when using MPI_BOTTOM). george. On Oct 30, 2009, at 18:11 , Natarajan CS wrote: Thanks for the replies guys! Definitely two suggestions worth trying. Definitely didn't consider a deriv

Re: [OMPI users] MPI-Send for entire entire matrix when allocating memory dynamically

2009-10-30 Thread Natarajan CS
Thanks for the replies guys! Definitely two suggestions worth trying. Definitely didn't consider a derived datatype. I wasn't really sure that the MPI_Send call overhead was significant enough that increasing the buffer size and decreasing the number of calls would cause any speed up. Will change t

Re: [OMPI users] MPI-Send for entire entire matrix when allocating memory dynamically

2009-10-30 Thread Eugene Loh
Wouldn't you need to create a different datatype for each matrix instance? E.g., let's say you create twelve 5x5 matrices. Wouldn't you need twelve different derived datatypes? I would think so because each time you create a matrix, the footprint of that matrix in memory will depend on the w

Re: [OMPI users] MPI-Send for entire entire matrix when allocating memory dynamically

2009-10-30 Thread George Bosilca
Even with the original way to create the matrices, one can use MPI_Create_type_struct to create an MPI datatype (http://web.mit.edu/course/13/13.715/OldFiles/build/mpich2-1.0.6p1/www/www3/MPI_Type_create_struct.html ) using MPI_BOTTOM as the original displacement. george. On Oct 29, 2009, a

Re: [OMPI users] MPI-Send for entire entire matrix when allocating memory dynamically

2009-10-29 Thread Justin Luitjens
Why not do something like this: double **A=new double*[N]; double *A_data new double [N*N]; for(int i=0;i wrote: > Hi >thanks for the quick response. Yes, that is what I meant. I thought > there was no other way around what I am doing but It is always good to ask a > expert rather than assum

Re: [OMPI users] MPI-Send for entire entire matrix when allocating memory dynamically

2009-10-29 Thread Natarajan CS
Hi thanks for the quick response. Yes, that is what I meant. I thought there was no other way around what I am doing but It is always good to ask a expert rather than assume! Cheers, C.S.N On Thu, Oct 29, 2009 at 11:25 AM, Eugene Loh wrote: > Natarajan CS wrote: > > Hello all, >>Fi

Re: [OMPI users] MPI-Send for entire entire matrix when allocating memory dynamically

2009-10-29 Thread Eugene Loh
Natarajan CS wrote: Hello all, Firstly, My apologies for a duplicate post in LAM/MPI list I have the following simple MPI code. I was wondering if there was a workaround for sending a dynamically allocated 2-D matrix? Currently I can send the matrix row-by-row, however, since rows are

[OMPI users] MPI-Send for entire entire matrix when allocating memory dynamically

2009-10-28 Thread Natarajan CS
Hello all, Firstly, My apologies for a duplicate post in LAM/MPI list I have the following simple MPI code. I was wondering if there was a workaround for sending a dynamically allocated 2-D matrix? Currently I can send the matrix row-by-row, however, since rows are not contiguous I cannot s