Discussion:
[OMPI users] Java: wrong extent value for resized derived data type
Siegmar Gross
2018-07-19 09:10:51 UTC
Permalink
Hi,

I've installed openmpi-3.1.0 on my "SUSE Linux Enterprise Server
12.3 (x86_64)" with gcc-6.4.0. Why do I get "extent: 0" instead of
"extent: 1" for my small program. In my opinion the extent of the
old data type and the resized extent of the new data type should
be the same. Am I wrong, is something wrong with my program, or
results the unexpected value from an error of the MPI Java method
getExtent() for a derived data type? I get the value 1, if I use
MPI.DOUBLE.getSize() or MPI.DOUBLE.getExtent().

loki java 130 which \mpijavac
/usr/local/openmpi-3.1.0_64_gcc/bin/mpijavac
loki java 131 \mpijavac SizeExtentMain.java
loki java 132 mpiexec -np 1 java SizeExtentMain
strided vector:
size of old data type: 1
count: 2
blocklength: 2
stride: 4
size: 4
lower bound: 0
extent: 0
true lower bound: 0
true extent: 6
loki java 133

I would be grateful, if somebody can fix the problem, if it is a
problem of the MPI Java method or if somebody knows, what I'm doing
wrong in my program. Thank you very much for any help in advance.


Kind regards

Siegmar
Gilles Gouaillardet
2018-07-19 11:05:06 UTC
Permalink
Siegmar,


I must admit I am having a hard time understanding why MPI.DOUBLE.getSize()
returns 1 instead of 8 ...

Anyway, for the time being, I think you can get the expected result by
createResized(..., ..., 8).

If there is a consensus that your program is correct, I will be happy to
issue a PR
(Simply multiply lb and extent by baseSize before passing them to the
native function)

Cheers,

Gilles

On Thursday, July 19, 2018, Siegmar Gross <
Post by Siegmar Gross
Hi,
I've installed openmpi-3.1.0 on my "SUSE Linux Enterprise Server
12.3 (x86_64)" with gcc-6.4.0. Why do I get "extent: 0" instead of
"extent: 1" for my small program. In my opinion the extent of the
old data type and the resized extent of the new data type should
be the same. Am I wrong, is something wrong with my program, or
results the unexpected value from an error of the MPI Java method
getExtent() for a derived data type? I get the value 1, if I use
MPI.DOUBLE.getSize() or MPI.DOUBLE.getExtent().
loki java 130 which \mpijavac
/usr/local/openmpi-3.1.0_64_gcc/bin/mpijavac
loki java 131 \mpijavac SizeExtentMain.java
loki java 132 mpiexec -np 1 java SizeExtentMain
size of old data type: 1
count: 2
blocklength: 2
stride: 4
size: 4
lower bound: 0
extent: 0
true lower bound: 0
true extent: 6
loki java 133
I would be grateful, if somebody can fix the problem, if it is a
problem of the MPI Java method or if somebody knows, what I'm doing
wrong in my program. Thank you very much for any help in advance.
Kind regards
Siegmar
Siegmar Gross
2018-07-19 14:14:10 UTC
Permalink
Hi Gilles,

thank you very much for your reply.
Post by Gilles Gouaillardet
I must admit I am having a hard time understanding why MPI.DOUBLE.getSize()
returns 1 instead of 8 ...
Anyway, for the time being, I think you can get the expected result by
createResized(..., ..., 8).
I did that before. Unfortunately, MPI.DOUBLE.getSize() returns 1 and I will
use size 8 in createResized() which is hard to explain to students. If I
remember right, Oscar (who implemented the Java interface) told me years ago
that "size" in Java is not measured in bytes but in data items. In this case
"1" would make sense for size and extent, because both describe one data item
(getSize() and getExtent() return "1" for all basic data types).
Post by Gilles Gouaillardet
If there is a consensus that your program is correct, I will be happy to issue
a PR
(Simply multiply lb and extent by baseSize before passing them to the native
function)
I'm not sure if that will break something else, if you want to broadcast or
scatter a structure for example. Hopefully, you will find a solution.


Best regards and thank you very much for your help

Siegmar
Post by Gilles Gouaillardet
Cheers,
Gilles
On Thursday, July 19, 2018, Siegmar Gross
Hi,
I've installed openmpi-3.1.0 on my "SUSE Linux Enterprise Server
12.3 (x86_64)" with gcc-6.4.0. Why do I get "extent: 0" instead of
"extent: 1" for my small program. In my opinion the extent of the
old data type and the resized extent of the new data type should
be the same. Am I wrong, is something wrong with my program, or
results the unexpected value from an error of the MPI Java method
getExtent() for a derived data type? I get the value 1, if I use
MPI.DOUBLE.getSize() or MPI.DOUBLE.getExtent().
loki java 130 which \mpijavac
/usr/local/openmpi-3.1.0_64_gcc/bin/mpijavac
loki java 131 \mpijavac SizeExtentMain.java
loki java 132 mpiexec -np 1 java SizeExtentMain
  size of old data type: 1
  count:                 2
  blocklength:           2
  stride:                4
  size:                  4
  lower bound:           0
  extent:                0
  true lower bound:      0
  true extent:           6
loki java 133
I would be grateful, if somebody can fix the problem, if it is a
problem of the MPI Java method or if somebody knows, what I'm doing
wrong in my program. Thank you very much for any help in advance.
Kind regards
Siegmar
_______________________________________________
users mailing list
https://lists.open-mpi.org/mailman/listinfo/users
Loading...