Re: [OMPI users] Best way to communicate a 2d array with Java binding

2014-08-23 Thread Oscar Vega-Gisbert


El 22/08/14 21:31, Saliya Ekanayake escribió:
My apologies, I think I wasn't clear on my question. My question was, 
given that copying of data is necessary in both approaches (either by 
the system with arrays or by programmer with buffers), is there a 
foreseeable performance difference in terms of performance considering 
the time it takes for copying?


Both approaches need copying matrix row by row. In Java side there 
should not be differences, but in the C side (JNI) if the buffer is an 
array it will be necessary one more copy. The performance differences 
will be bigger as the matrix size is increased.




Thank you,
Saliya


On Fri, Aug 22, 2014 at 3:24 PM, Oscar Vega-Gisbert > wrote:


El 22/08/14 20:44, Saliya Ekanayake escribió:

Thank you Oscar for the detailed information, but I'm still
wondering how would the copying in 2 would be different than
what's done here with copying to a buffer.


If you have a buffer array like this:

double buffer[] = new double[m * n];

Copy the 2D matrix to the buffer:


for(int i = 0; i < m; i++)
System.arraycopy(matrix[i], 0, buffer, i * n, n);

Copy from the buffer to the 2D matrix:


for(int i = 0; i < m; i++)
System.arraycopy(buffer, i * n, matrix[i], 0, n);


On Fri, Aug 22, 2014 at 2:17 PM, Oscar Vega-Gisbert

>> wrote:

El 22/08/14 17:10, Saliya Ekanayake escribió:

Hi,

I've a quick question about the usage of Java binding.

Say there's a 2 dimensional double array (size m x n) that
needs to be sent to another rank. I see two options to get
this done,

1. Copy values to a direct buffer of size m*n and send it
2. Copy values to a 1D array of size m*n and send it

I guess 2 would internally do the copying to a buffer
and use
it, so suggesting 1. is the best option. Is this the
case or
is there a better way to do this?


The best option is 1 because 2 requires one extra copy to
C heap.
Supposing the matrix is the following:

double matrix[][] = new double[m][n];

Then you can allocate a direct DoubleBuffer:

DoubleBuffer buffer = MPI.newDoubleBuffer(m * n);

In order to send/receive the matrix I suggest to use the bulk
put/get methods:

for(int i = 0; i < m; i++)
buffer.put(matrix[i]); // Copy to the buffer.

MPI.COMM_WORLD.send(buffer, m*n, MPI.DOUBLE, 1, 0);

The receive code:

MPI.COMM_WORLD.recv(buffer, m*n, MPI.DOUBLE, 0, 0);

for(int i = 0; i < m; i++)
buffer.get(matrix[i]); // Copy from the buffer.

Note that bulk get/put methods increment the buffer
position in n.
So if you want reuse the buffer you must set the buffer
position
to 0 before copy the matrix:

buffer.position(0);

Regards,
Oscar


Thank you,
Saliya
-- Saliya Ekanayake esal...@gmail.com
 >

>>

http://saliya.org


___
users mailing list
us...@open-mpi.org 
>

Subscription:
http://www.open-mpi.org/mailman/listinfo.cgi/users
Link to this post:
http://www.open-mpi.org/community/lists/users/2014/08/25130.php


___
users mailing list
us...@open-mpi.org 
>

Subscription:
http://www.open-mpi.org/mailman/listinfo.cgi/users
Link to this post:
http://www.open-mpi.org/community/lists/users/2014/08/25131.php




-- 
Saliya Ekanayake esal...@gmail.com 

>

Cell 812-391-4914  Home 812-961-6383

http://saliya.org


___
users mailing list
us...@open-mpi.org 
Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
Link to 

Re: [OMPI users] Best way to communicate a 2d array with Java binding

2014-08-22 Thread Saliya Ekanayake
Please find inline comments.



On Fri, Aug 22, 2014 at 3:45 PM, Rob Latham  wrote:

>
>
> On 08/22/2014 02:40 PM, Saliya Ekanayake wrote:
>
>> Yes, these are all MPI_DOUBLE
>>
>
> well, yeah, but since you are talking about copying into a "direct buffer"
> there must be something tricker about the layout than just N*M doubles.
>
> sometimes people allocate 2d arrays by allocating one array of N elements,
> then allocating and storing an array of length M in each of the N slots.
>

Yes, the computation part of the program stores these values as an array of
arrays (N elements each pointing to an array of M elements).

>
> (you can find a dozen of these types of questions on stackoverflow, for
> example)
>
> if the java interface allows you to describe with an MPI Datatype,  or if
> you were working in C or Fortran, you can construct an HINDEXED type (or
> with very new MPICH, HINDEXED_BLOCK) and send that instead of copying.
>

I think this would work only if we have all M*N values allocated
continuously.

Thank you,
Saliya

>
> ==rob
>
>
>>
>> On Fri, Aug 22, 2014 at 3:38 PM, Rob Latham > > wrote:
>>
>>
>>
>> On 08/22/2014 10:10 AM, Saliya Ekanayake wrote:
>>
>> Hi,
>>
>> I've a quick question about the usage of Java binding.
>>
>> Say there's a 2 dimensional double array (size m x n) that needs
>> to be
>> sent to another rank. I see two options to get this done,
>>
>> 1. Copy values to a direct buffer of size m*n and send it
>> 2. Copy values to a 1D array of size m*n and send it
>>
>>
>> i have no idea about the java mpi bindings, but can you describe the
>> type with an mpi datatype?
>>
>> ==rob
>>
>>
>> I guess 2 would internally do the copying to a buffer and use it,
>> so
>> suggesting 1. is the best option. Is this the case or is there a
>> better
>> way to do this?
>>
>>
>> Thank you,
>> Saliya
>> --
>> Saliya Ekanayake esal...@gmail.com 
>> >
>>
>> http://saliya.org
>>
>>
>> _
>>
>> users mailing list
>> us...@open-mpi.org 
>> Subscription:
>> http://www.open-mpi.org/__mailman/listinfo.cgi/users
>>
>> 
>> Link to this post:
>> http://www.open-mpi.org/__community/lists/users/2014/08/
>> __25130.php
>>
>> 
>>
>>
>> --
>> Rob Latham
>> Mathematics and Computer Science Division
>> Argonne National Lab, IL USA
>>
>> _
>>
>> users mailing list
>> us...@open-mpi.org 
>> Subscription: http://www.open-mpi.org/__mailman/listinfo.cgi/users
>>
>> 
>> Link to this post:
>> http://www.open-mpi.org/__community/lists/users/2014/08/__25135.php
>> 
>>
>>
>>
>>
>> --
>> Saliya Ekanayake esal...@gmail.com 
>>
>> Cell 812-391-4914 Home 812-961-6383
>> http://saliya.org
>>
>>
>> ___
>> users mailing list
>> us...@open-mpi.org
>> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
>> Link to this post: http://www.open-mpi.org/community/lists/users/2014/08/
>> 25136.php
>>
>>
> --
> Rob Latham
> Mathematics and Computer Science Division
> Argonne National Lab, IL USA
> ___
> users mailing list
> us...@open-mpi.org
> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
> Link to this post: http://www.open-mpi.org/community/lists/users/2014/08/
> 25137.php
>



-- 
Saliya Ekanayake esal...@gmail.com
Cell 812-391-4914 Home 812-961-6383
http://saliya.org


Re: [OMPI users] Best way to communicate a 2d array with Java binding

2014-08-22 Thread Rob Latham



On 08/22/2014 02:40 PM, Saliya Ekanayake wrote:

Yes, these are all MPI_DOUBLE


well, yeah, but since you are talking about copying into a "direct 
buffer" there must be something tricker about the layout than just N*M 
doubles.


sometimes people allocate 2d arrays by allocating one array of N 
elements, then allocating and storing an array of length M in each of 
the N slots.


(you can find a dozen of these types of questions on stackoverflow, for 
example)


if the java interface allows you to describe with an MPI Datatype,  or 
if you were working in C or Fortran, you can construct an HINDEXED type 
(or with very new MPICH, HINDEXED_BLOCK) and send that instead of copying.


==rob




On Fri, Aug 22, 2014 at 3:38 PM, Rob Latham > wrote:



On 08/22/2014 10:10 AM, Saliya Ekanayake wrote:

Hi,

I've a quick question about the usage of Java binding.

Say there's a 2 dimensional double array (size m x n) that needs
to be
sent to another rank. I see two options to get this done,

1. Copy values to a direct buffer of size m*n and send it
2. Copy values to a 1D array of size m*n and send it


i have no idea about the java mpi bindings, but can you describe the
type with an mpi datatype?

==rob


I guess 2 would internally do the copying to a buffer and use it, so
suggesting 1. is the best option. Is this the case or is there a
better
way to do this?


Thank you,
Saliya
--
Saliya Ekanayake esal...@gmail.com 
>

http://saliya.org


_
users mailing list
us...@open-mpi.org 
Subscription:
http://www.open-mpi.org/__mailman/listinfo.cgi/users

Link to this post:
http://www.open-mpi.org/__community/lists/users/2014/08/__25130.php



--
Rob Latham
Mathematics and Computer Science Division
Argonne National Lab, IL USA

_
users mailing list
us...@open-mpi.org 
Subscription: http://www.open-mpi.org/__mailman/listinfo.cgi/users

Link to this post:
http://www.open-mpi.org/__community/lists/users/2014/08/__25135.php





--
Saliya Ekanayake esal...@gmail.com 
Cell 812-391-4914 Home 812-961-6383
http://saliya.org


___
users mailing list
us...@open-mpi.org
Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
Link to this post: 
http://www.open-mpi.org/community/lists/users/2014/08/25136.php



--
Rob Latham
Mathematics and Computer Science Division
Argonne National Lab, IL USA


Re: [OMPI users] Best way to communicate a 2d array with Java binding

2014-08-22 Thread Saliya Ekanayake
Yes, these are all MPI_DOUBLE


On Fri, Aug 22, 2014 at 3:38 PM, Rob Latham  wrote:

>
>
> On 08/22/2014 10:10 AM, Saliya Ekanayake wrote:
>
>> Hi,
>>
>> I've a quick question about the usage of Java binding.
>>
>> Say there's a 2 dimensional double array (size m x n) that needs to be
>> sent to another rank. I see two options to get this done,
>>
>> 1. Copy values to a direct buffer of size m*n and send it
>> 2. Copy values to a 1D array of size m*n and send it
>>
>
> i have no idea about the java mpi bindings, but can you describe the type
> with an mpi datatype?
>
> ==rob
>
>
>> I guess 2 would internally do the copying to a buffer and use it, so
>> suggesting 1. is the best option. Is this the case or is there a better
>> way to do this?
>>
>>
>> Thank you,
>> Saliya
>> --
>> Saliya Ekanayake esal...@gmail.com 
>>
>> http://saliya.org
>>
>>
>> ___
>> users mailing list
>> us...@open-mpi.org
>> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
>> Link to this post: http://www.open-mpi.org/community/lists/users/2014/08/
>> 25130.php
>>
>>
> --
> Rob Latham
> Mathematics and Computer Science Division
> Argonne National Lab, IL USA
>
> ___
> users mailing list
> us...@open-mpi.org
> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
> Link to this post: http://www.open-mpi.org/community/lists/users/2014/08/
> 25135.php
>



-- 
Saliya Ekanayake esal...@gmail.com
Cell 812-391-4914 Home 812-961-6383
http://saliya.org


Re: [OMPI users] Best way to communicate a 2d array with Java binding

2014-08-22 Thread Rob Latham



On 08/22/2014 10:10 AM, Saliya Ekanayake wrote:

Hi,

I've a quick question about the usage of Java binding.

Say there's a 2 dimensional double array (size m x n) that needs to be
sent to another rank. I see two options to get this done,

1. Copy values to a direct buffer of size m*n and send it
2. Copy values to a 1D array of size m*n and send it


i have no idea about the java mpi bindings, but can you describe the 
type with an mpi datatype?


==rob



I guess 2 would internally do the copying to a buffer and use it, so
suggesting 1. is the best option. Is this the case or is there a better
way to do this?


Thank you,
Saliya
--
Saliya Ekanayake esal...@gmail.com 
http://saliya.org


___
users mailing list
us...@open-mpi.org
Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
Link to this post: 
http://www.open-mpi.org/community/lists/users/2014/08/25130.php



--
Rob Latham
Mathematics and Computer Science Division
Argonne National Lab, IL USA


Re: [OMPI users] Best way to communicate a 2d array with Java binding

2014-08-22 Thread Saliya Ekanayake
My apologies, I think I wasn't clear on my question. My question was, given
that copying of data is necessary in both approaches (either by the system
with arrays or by programmer with buffers), is there a foreseeable
performance difference in terms of performance considering the time it
takes for copying?

Thank you,
Saliya


On Fri, Aug 22, 2014 at 3:24 PM, Oscar Vega-Gisbert 
wrote:

> El 22/08/14 20:44, Saliya Ekanayake escribió:
>
>  Thank you Oscar for the detailed information, but I'm still wondering how
>> would the copying in 2 would be different than what's done here with
>> copying to a buffer.
>>
>
> If you have a buffer array like this:
>
> double buffer[] = new double[m * n];
>
> Copy the 2D matrix to the buffer:
>
>
> for(int i = 0; i < m; i++)
> System.arraycopy(matrix[i], 0, buffer, i * n, n);
>
> Copy from the buffer to the 2D matrix:
>
>
> for(int i = 0; i < m; i++)
> System.arraycopy(buffer, i * n, matrix[i], 0, n);
>
>
>> On Fri, Aug 22, 2014 at 2:17 PM, Oscar Vega-Gisbert > > wrote:
>>
>> El 22/08/14 17:10, Saliya Ekanayake escribió:
>>
>> Hi,
>>
>> I've a quick question about the usage of Java binding.
>>
>> Say there's a 2 dimensional double array (size m x n) that
>> needs to be sent to another rank. I see two options to get
>> this done,
>>
>> 1. Copy values to a direct buffer of size m*n and send it
>> 2. Copy values to a 1D array of size m*n and send it
>>
>> I guess 2 would internally do the copying to a buffer and use
>> it, so suggesting 1. is the best option. Is this the case or
>> is there a better way to do this?
>>
>>
>> The best option is 1 because 2 requires one extra copy to C heap.
>> Supposing the matrix is the following:
>>
>> double matrix[][] = new double[m][n];
>>
>> Then you can allocate a direct DoubleBuffer:
>>
>> DoubleBuffer buffer = MPI.newDoubleBuffer(m * n);
>>
>> In order to send/receive the matrix I suggest to use the bulk
>> put/get methods:
>>
>> for(int i = 0; i < m; i++)
>> buffer.put(matrix[i]); // Copy to the buffer.
>>
>> MPI.COMM_WORLD.send(buffer, m*n, MPI.DOUBLE, 1, 0);
>>
>> The receive code:
>>
>> MPI.COMM_WORLD.recv(buffer, m*n, MPI.DOUBLE, 0, 0);
>>
>> for(int i = 0; i < m; i++)
>> buffer.get(matrix[i]); // Copy from the buffer.
>>
>> Note that bulk get/put methods increment the buffer position in n.
>> So if you want reuse the buffer you must set the buffer position
>> to 0 before copy the matrix:
>>
>> buffer.position(0);
>>
>> Regards,
>> Oscar
>>
>>
>> Thank you,
>> Saliya
>> -- Saliya Ekanayake esal...@gmail.com > esal...@gmail.com>
>> >
>>
>> http://saliya.org
>>
>>
>> ___
>> users mailing list
>> us...@open-mpi.org 
>>
>> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
>> Link to this post:
>> http://www.open-mpi.org/community/lists/users/2014/08/25130.php
>>
>>
>> ___
>> users mailing list
>> us...@open-mpi.org 
>>
>> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
>> Link to this post:
>> http://www.open-mpi.org/community/lists/users/2014/08/25131.php
>>
>>
>>
>>
>> --
>> Saliya Ekanayake esal...@gmail.com 
>>
>> Cell 812-391-4914 Home 812-961-6383
>> http://saliya.org
>>
>>
>> ___
>> users mailing list
>> us...@open-mpi.org
>> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
>> Link to this post: http://www.open-mpi.org/community/lists/users/2014/08/
>> 25132.php
>>
>
> ___
> users mailing list
> us...@open-mpi.org
> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
> Link to this post: http://www.open-mpi.org/community/lists/users/2014/08/
> 25133.php
>



-- 
Saliya Ekanayake esal...@gmail.com
Cell 812-391-4914 Home 812-961-6383
http://saliya.org


Re: [OMPI users] Best way to communicate a 2d array with Java binding

2014-08-22 Thread Oscar Vega-Gisbert

El 22/08/14 20:44, Saliya Ekanayake escribió:
Thank you Oscar for the detailed information, but I'm still wondering 
how would the copying in 2 would be different than what's done here 
with copying to a buffer.


If you have a buffer array like this:

double buffer[] = new double[m * n];

Copy the 2D matrix to the buffer:

for(int i = 0; i < m; i++)
System.arraycopy(matrix[i], 0, buffer, i * n, n);

Copy from the buffer to the 2D matrix:

for(int i = 0; i < m; i++)
System.arraycopy(buffer, i * n, matrix[i], 0, n);



On Fri, Aug 22, 2014 at 2:17 PM, Oscar Vega-Gisbert > wrote:


El 22/08/14 17:10, Saliya Ekanayake escribió:

Hi,

I've a quick question about the usage of Java binding.

Say there's a 2 dimensional double array (size m x n) that
needs to be sent to another rank. I see two options to get
this done,

1. Copy values to a direct buffer of size m*n and send it
2. Copy values to a 1D array of size m*n and send it

I guess 2 would internally do the copying to a buffer and use
it, so suggesting 1. is the best option. Is this the case or
is there a better way to do this?


The best option is 1 because 2 requires one extra copy to C heap.
Supposing the matrix is the following:

double matrix[][] = new double[m][n];

Then you can allocate a direct DoubleBuffer:

DoubleBuffer buffer = MPI.newDoubleBuffer(m * n);

In order to send/receive the matrix I suggest to use the bulk
put/get methods:

for(int i = 0; i < m; i++)
buffer.put(matrix[i]); // Copy to the buffer.

MPI.COMM_WORLD.send(buffer, m*n, MPI.DOUBLE, 1, 0);

The receive code:

MPI.COMM_WORLD.recv(buffer, m*n, MPI.DOUBLE, 0, 0);

for(int i = 0; i < m; i++)
buffer.get(matrix[i]); // Copy from the buffer.

Note that bulk get/put methods increment the buffer position in n.
So if you want reuse the buffer you must set the buffer position
to 0 before copy the matrix:

buffer.position(0);

Regards,
Oscar


Thank you,
Saliya
-- 
Saliya Ekanayake esal...@gmail.com 

>
http://saliya.org


___
users mailing list
us...@open-mpi.org 
Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
Link to this post:
http://www.open-mpi.org/community/lists/users/2014/08/25130.php


___
users mailing list
us...@open-mpi.org 
Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
Link to this post:
http://www.open-mpi.org/community/lists/users/2014/08/25131.php




--
Saliya Ekanayake esal...@gmail.com 
Cell 812-391-4914 Home 812-961-6383
http://saliya.org


___
users mailing list
us...@open-mpi.org
Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
Link to this post: 
http://www.open-mpi.org/community/lists/users/2014/08/25132.php




Re: [OMPI users] Best way to communicate a 2d array with Java binding

2014-08-22 Thread Saliya Ekanayake
Thank you Oscar for the detailed information, but I'm still wondering how
would the copying in 2 would be different than what's done here with
copying to a buffer.


On Fri, Aug 22, 2014 at 2:17 PM, Oscar Vega-Gisbert 
wrote:

> El 22/08/14 17:10, Saliya Ekanayake escribió:
>
>  Hi,
>>
>> I've a quick question about the usage of Java binding.
>>
>> Say there's a 2 dimensional double array (size m x n) that needs to be
>> sent to another rank. I see two options to get this done,
>>
>> 1. Copy values to a direct buffer of size m*n and send it
>> 2. Copy values to a 1D array of size m*n and send it
>>
>> I guess 2 would internally do the copying to a buffer and use it, so
>> suggesting 1. is the best option. Is this the case or is there a better way
>> to do this?
>>
>>
> The best option is 1 because 2 requires one extra copy to C heap.
> Supposing the matrix is the following:
>
> double matrix[][] = new double[m][n];
>
> Then you can allocate a direct DoubleBuffer:
>
> DoubleBuffer buffer = MPI.newDoubleBuffer(m * n);
>
> In order to send/receive the matrix I suggest to use the bulk put/get
> methods:
>
> for(int i = 0; i < m; i++)
> buffer.put(matrix[i]); // Copy to the buffer.
>
> MPI.COMM_WORLD.send(buffer, m*n, MPI.DOUBLE, 1, 0);
>
> The receive code:
>
> MPI.COMM_WORLD.recv(buffer, m*n, MPI.DOUBLE, 0, 0);
>
> for(int i = 0; i < m; i++)
> buffer.get(matrix[i]); // Copy from the buffer.
>
> Note that bulk get/put methods increment the buffer position in n. So if
> you want reuse the buffer you must set the buffer position to 0 before copy
> the matrix:
>
> buffer.position(0);
>
> Regards,
> Oscar
>
>
>> Thank you,
>> Saliya
>> --
>> Saliya Ekanayake esal...@gmail.com 
>> http://saliya.org
>>
>>
>> ___
>> users mailing list
>> us...@open-mpi.org
>> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
>> Link to this post: http://www.open-mpi.org/community/lists/users/2014/08/
>> 25130.php
>>
>
> ___
> users mailing list
> us...@open-mpi.org
> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
> Link to this post: http://www.open-mpi.org/community/lists/users/2014/08/
> 25131.php
>



-- 
Saliya Ekanayake esal...@gmail.com
Cell 812-391-4914 Home 812-961-6383
http://saliya.org


Re: [OMPI users] Best way to communicate a 2d array with Java binding

2014-08-22 Thread Oscar Vega-Gisbert

El 22/08/14 17:10, Saliya Ekanayake escribió:

Hi,

I've a quick question about the usage of Java binding.

Say there's a 2 dimensional double array (size m x n) that needs to be 
sent to another rank. I see two options to get this done,


1. Copy values to a direct buffer of size m*n and send it
2. Copy values to a 1D array of size m*n and send it

I guess 2 would internally do the copying to a buffer and use it, so 
suggesting 1. is the best option. Is this the case or is there a 
better way to do this?




The best option is 1 because 2 requires one extra copy to C heap.
Supposing the matrix is the following:

double matrix[][] = new double[m][n];

Then you can allocate a direct DoubleBuffer:

DoubleBuffer buffer = MPI.newDoubleBuffer(m * n);

In order to send/receive the matrix I suggest to use the bulk put/get 
methods:


for(int i = 0; i < m; i++)
buffer.put(matrix[i]); // Copy to the buffer.

MPI.COMM_WORLD.send(buffer, m*n, MPI.DOUBLE, 1, 0);

The receive code:

MPI.COMM_WORLD.recv(buffer, m*n, MPI.DOUBLE, 0, 0);

for(int i = 0; i < m; i++)
buffer.get(matrix[i]); // Copy from the buffer.

Note that bulk get/put methods increment the buffer position in n. So if 
you want reuse the buffer you must set the buffer position to 0 before 
copy the matrix:


buffer.position(0);

Regards,
Oscar



Thank you,
Saliya
--
Saliya Ekanayake esal...@gmail.com 
http://saliya.org


___
users mailing list
us...@open-mpi.org
Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
Link to this post: 
http://www.open-mpi.org/community/lists/users/2014/08/25130.php




[OMPI users] Best way to communicate a 2d array with Java binding

2014-08-22 Thread Saliya Ekanayake
Hi,

I've a quick question about the usage of Java binding.

Say there's a 2 dimensional double array (size m x n) that needs to be sent
to another rank. I see two options to get this done,

1. Copy values to a direct buffer of size m*n and send it
2. Copy values to a 1D array of size m*n and send it

I guess 2 would internally do the copying to a buffer and use it, so
suggesting 1. is the best option. Is this the case or is there a better way
to do this?


Thank you,
Saliya
-- 
Saliya Ekanayake esal...@gmail.com
http://saliya.org