Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] some comments on derived datatypes in mpiJava
From: Jeff Squyres (jsquyres) (jsquyres_at_[hidden])
Date: 2013-01-11 11:05:03

On Jan 8, 2013, at 9:56 AM, Siegmar Gross <Siegmar.Gross_at_[hidden]> wrote:

> Jeff suggested some possible solutions in the last
> weeks which I will now discuss.
> 1) Simulate a 2-dimensional (m,n)-array in one 1-dimensional array
> with m*n elements and perform all necessary index computations
> yourself. This solution works and with the new method
> Datatype.Resized you can scatter all columns of a matrix to
> different processes.
> The problem is that you don't use a multi-dimensional array
> from Java. I'm not a Java expert, but I suppose that it even
> contradicts the philosophy of object-oriented programming.
> In my opinion this solution will also add new sources of errors
> if you must implement complicated algorithms (bugs with index
> computations, unreadable source code, etc.).


> 2) Implement a wrapper class in Java so that you don't have to deal
> with index computations in your normal program.
> As far as I know, it would have been necessary to use set- and
> get-methods to write and read matrix elements in that case,
> because Java doesn't allow operator overloading (I'm not even
> sure, if it would have been possible to overload "[][]" in the
> case that overloading would have been supported).

Oh! Bummer; I didn't realize you couldn't overload [] in Java.

> 3) Implement a wrapper class which possibly needs to be written in C.

Some other options I just sent to you in an off-list mail (sorry, I'm still slogging through all my vacation-accumulated mail...):

4. Have the Java language gods make a standardized way to pass buffers to C (like Fortran did for MPI-3). That would obviate the problem.

5. Make the Java MPI interface just magically do the Right Thing to make MPI_Type_vector "just work" behind the scenes. I'm not 100% sure this is possible, but perhaps someone could figure out a way.

Jeff Squyres
For corporate legal information go to: