Discussion:
Getting error in MPI_Group_incl
(too old to reply)
c***@gmail.com
2009-05-06 10:48:25 UTC
Permalink
folks i am trying to call MPI_Group_Incl using JNI.

this is the JNI Code snippet

.... (JNIEnv *env, jobject jthis, jintArray ranks).......
int n;
jint *rks;
jboolean isCopy=JNI_TRUE;
MPI_Group newgroup;
n=(*env)->GetArrayLength(env,ranks);
rks=(*env)->GetIntArrayElements(env,ranks,&isCopy);

MPI_Group existing = (MPI_Group)(*env)->GetLongField
(env,jthis,GrouphandleID);
MPI_Group_incl(existing,n,(int*)rks,&newgroup);
(*env)->ReleaseIntArrayElements(env,ranks,rks,0);
return (jlong)newgroup;

One thing i want to tell is that the rks pointer points to an array
that contains {0,1} as i am running it on 2 processors.. And existing
group is not erroneous...

This is the error

[cli_1]: aborting job:
Fatal error in MPI_Group_incl: Invalid rank, error stack:
MPI_Group_incl(143)..............: MPI_Group_incl(group=0x48000000,
n=1, ranks=0x9081a904, new_group=0xb7e0efb0) failed
MPIR_Group_check_valid_ranks(229): Invalid rank in rank array at index
0; value is 0 but must be in the range 0 to -1
rank 1 in job 113 chenab1_50502 caused collective abort of all
ranks
exit status of rank 1: return code 1
rank 0 in job 113 chenab1_50502 caused collective abort of all
ranks


Plz helpout...
Michael Hofmann
2009-05-06 12:37:04 UTC
Permalink
Post by c***@gmail.com
folks i am trying to call MPI_Group_Incl using JNI.
this is the JNI Code snippet
.... (JNIEnv *env, jobject jthis, jintArray ranks).......
int n;
jint *rks;
jboolean isCopy=JNI_TRUE;
MPI_Group newgroup;
n=(*env)->GetArrayLength(env,ranks);
rks=(*env)->GetIntArrayElements(env,ranks,&isCopy);
MPI_Group existing = (MPI_Group)(*env)->GetLongField
(env,jthis,GrouphandleID);
MPI_Group_incl(existing,n,(int*)rks,&newgroup);
(*env)->ReleaseIntArrayElements(env,ranks,rks,0);
return (jlong)newgroup;
One thing i want to tell is that the rks pointer points to an array
that contains {0,1} as i am running it on 2 processors.. And existing
group is not erroneous...
This is the error
MPI_Group_incl(143)..............: MPI_Group_incl(group=0x48000000,
n=1, ranks=0x9081a904, new_group=0xb7e0efb0) failed
MPIR_Group_check_valid_ranks(229): Invalid rank in rank array at index
0; value is 0 but must be in the range 0 to -1
^^^^^^^^^^^^^

The valid range of ranks is 0...size_of_the_old_group-1. It seems that
your "existing" group is empty.


Michael
c***@gmail.com
2009-05-07 03:42:08 UTC
Permalink
Post by Michael Hofmann
Post by c***@gmail.com
folks i am trying to call MPI_Group_Incl using JNI.
this is the JNI Code snippet
.... (JNIEnv *env, jobject jthis, jintArray ranks).......
int n;
jint *rks;
jboolean isCopy=JNI_TRUE;
MPI_Group newgroup;
n=(*env)->GetArrayLength(env,ranks);
rks=(*env)->GetIntArrayElements(env,ranks,&isCopy);
MPI_Group existing = (MPI_Group)(*env)->GetLongField
(env,jthis,GrouphandleID);
MPI_Group_incl(existing,n,(int*)rks,&newgroup);
(*env)->ReleaseIntArrayElements(env,ranks,rks,0);
return (jlong)newgroup;
One thing i want to tell is that the rks pointer points to an array
that contains {0,1} as i am running it on 2 processors.. And existing
group is not erroneous...
This is the error
MPI_Group_incl(143)..............: MPI_Group_incl(group=0x48000000,
n=1, ranks=0x9081a904, new_group=0xb7e0efb0) failed
MPIR_Group_check_valid_ranks(229): Invalid rank in rank array at index
0; value is 0 but must be in the range 0 to -1
^^^^^^^^^^^^^
The valid range of ranks is 0...size_of_the_old_group-1. It seems that
your "existing" group is empty.
Michael
Thats right.. infact i initialized it to MPI_GROUP_EMPTY in JNI. But
this is deleberate. Shouldnt this work...? If not then what should i
do because i am only trying to run hello world and so i passed
MPI_GROUP_EMPTY
Michael Hofmann
2009-05-07 06:19:56 UTC
Permalink
Post by c***@gmail.com
Thats right.. infact i initialized it to MPI_GROUP_EMPTY in JNI. But
this is deleberate. Shouldnt this work...?
No, what processes do you want to include from an empty group? There is no
0th or 1st process inside.
Post by c***@gmail.com
If not then what should i
do because i am only trying to run hello world and so i passed
MPI_GROUP_EMPTY
You can use MPI_Comm_group to create a non-empty group from an existing
communicator (e.g., from MPI_COMM_WORLD).


Michael

Loading...