*********************************************************** java code ********************************************************** public void Send(Object buf, int offset, int count, Datatype type, int dest, int tag) { if (type.isObject(type)){ byte[] byte_buf = Object_Serialize(buf,offset,count,type); int[] length_buf = new int[2]; length_buf[0] = byte_buf.length; length_buf[1] = count; Send(length_buf,0, MPI.INT.Size(),2,MPI.INT, dest, tag); Send(byte_buf,0,MPI.BYTE.Size(),length_buf[0],MPI.BYTE,dest, tag); if(isVector){ SendVector(vector,dest, tag); } } else Send(buf, offset, type.baseSize(), count, type, dest, tag); } private native void SendVector(Object vector, int dest, int tag); public Status Recv(Object buf, int offset, int count, Datatype type, int source, int tag) { if (type.isObject(type)){ Status status = new Status(); int[] length_buf= new int[2]; Recv(length_buf,0,2, MPI.INT, source, tag, new Status()); byte[] byte_buf = new byte[length_buf[0]]; Recv(byte_buf,0,length_buf[0], MPI.BYTE, source, tag,status); status.object_count = length_buf[1]; Object_Deserialize(buf,byte_buf,offset,length_buf[1],type); if (isVector){ RecvVector(vector,source,tag); } return status; } else return Recv(buf, offset*type.baseSize(), count, type, source, tag, new Status()); } private native void RecvVector(Object buf, int source, int tag); *******************************************************88 c code ********************************************************* JNIEXPORT void JNICALL Java_mpi_Comm_SendVector (JNIEnv *env, jobject jthis, jobject buf, jint dest, jint tag) JNIEXPORT void JNICALL Java_mpi_Comm_RecvVector (JNIEnv *env, jobject jthis, jobject buf, jint source, jint tag)