Discussion:
Garbled address of MPI_Group
(too old to reply)
c***@gmail.com
2009-05-13 05:57:47 UTC
Permalink
Folks i am setting a long field in Java through JNI in one file "mm.c"
as

MPI_Group group;
MPI_Comm_group((MPI_Comm)((*env)->GetLongField
(env,jthis,CommhandleID)),
&group);

return (jlong)group;

Now this returned field is set to "handle" and when i print handle ,
it gives me this -2013265920

When in another file "nn.c" i try to get the handle

jlong handle = (*env)->GetLongField(env,jthis,GrouphandleID);

It gives me 1140850688 i-e not the one which i set from "mm.c"

Can any one help?
Michael Hofmann
2009-05-13 11:58:24 UTC
Permalink
Post by c***@gmail.com
Folks i am setting a long field in Java through JNI in one file "mm.c"
as
MPI_Group group;
MPI_Comm_group((MPI_Comm)((*env)->GetLongField
(env,jthis,CommhandleID)),
&group);
return (jlong)group;
Now this returned field is set to "handle" and when i print handle ,
it gives me this -2013265920
When in another file "nn.c" i try to get the handle
jlong handle = (*env)->GetLongField(env,jthis,GrouphandleID);
It gives me 1140850688 i-e not the one which i set from "mm.c"
Can any one help?
This is not an MPI problem. It is a problem somewhere else in your code.

Just a guess: the original value "-2013265920" is hexadecimal "88000000"
while the wrong value "1140850688" is hexadecimal "44000000" (the half of
"88000000"). Maybe there is some integer arithmetic trouble with
signed/unsigned values, different max. values, casting etc.


Michael

Loading...