2012-02-20 22:12:43 +00:00
|
|
|
/*
|
2013-09-26 21:44:39 +00:00
|
|
|
* Copyright (c) 2011-2013 Cisco Systems, Inc. All rights reserved.
|
2012-02-20 22:12:43 +00:00
|
|
|
*
|
|
|
|
* $COPYRIGHT$
|
2013-09-26 21:44:39 +00:00
|
|
|
*
|
2012-02-20 22:12:43 +00:00
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
2013-09-26 21:44:39 +00:00
|
|
|
* $HEADER$
|
2012-02-20 22:12:43 +00:00
|
|
|
*/
|
|
|
|
|
2013-09-26 21:44:39 +00:00
|
|
|
#ifndef _MPIJAVA_H_
|
|
|
|
#define _MPIJAVA_H_
|
2012-02-20 22:12:43 +00:00
|
|
|
|
|
|
|
#include "mpi.h"
|
|
|
|
|
|
|
|
typedef struct {
|
2013-09-26 21:44:39 +00:00
|
|
|
jfieldID CommHandle;
|
|
|
|
jfieldID ErrHandle;
|
|
|
|
jfieldID GroupHandle;
|
|
|
|
jclass CartParmsClass;
|
|
|
|
jmethodID CartParmsInit;
|
|
|
|
jclass ShiftParmsClass;
|
|
|
|
jmethodID ShiftParmsInit;
|
|
|
|
jclass GraphParmsClass;
|
|
|
|
jmethodID GraphParmsInit;
|
|
|
|
jclass DistGraphNeighborsClass;
|
|
|
|
jmethodID DistGraphNeighborsInit;
|
|
|
|
jfieldID DatatypeHandle;
|
|
|
|
jfieldID DatatypeBaseType;
|
|
|
|
jfieldID DatatypeBaseSize;
|
|
|
|
jfieldID MessageHandle;
|
|
|
|
jfieldID OpHandle;
|
|
|
|
jfieldID OpCommute;
|
|
|
|
jmethodID OpCall;
|
|
|
|
jclass StatusClass;
|
|
|
|
jmethodID StatusInit;
|
|
|
|
jfieldID StSource;
|
|
|
|
jfieldID StTag;
|
|
|
|
jfieldID StError;
|
|
|
|
jfieldID St_cancelled;
|
|
|
|
jfieldID St_ucount;
|
|
|
|
jfieldID StIndex;
|
|
|
|
jfieldID StElements;
|
|
|
|
jfieldID StUsingBuffer;
|
|
|
|
jfieldID ReqHandle;
|
|
|
|
jclass ExceptionClass;
|
|
|
|
jmethodID ExceptionInit;
|
|
|
|
jclass IntegerClass;
|
|
|
|
jmethodID IntegerValueOf;
|
|
|
|
jclass LongClass;
|
|
|
|
jmethodID LongValueOf;
|
|
|
|
jclass ByteBufferClass;
|
|
|
|
jmethodID ByteBufferArray;
|
|
|
|
jmethodID ByteBufferArrayOffset;
|
|
|
|
int dtSizes[12];
|
2012-02-20 22:12:43 +00:00
|
|
|
} ompi_java_globals_t;
|
2013-09-26 21:44:39 +00:00
|
|
|
|
2012-02-20 22:12:43 +00:00
|
|
|
extern ompi_java_globals_t ompi_java;
|
|
|
|
|
2013-09-26 21:44:39 +00:00
|
|
|
void ompi_java_init_native_Datatype(JNIEnv *env);
|
|
|
|
|
|
|
|
void* ompi_java_getBufPtr(
|
|
|
|
void** bufBase, JNIEnv *env, jobject buf, int baseType, int offset);
|
|
|
|
|
|
|
|
void ompi_java_releaseBufPtr(
|
|
|
|
JNIEnv *env, jobject buf, void* bufBase, int baseType);
|
|
|
|
|
|
|
|
void ompi_java_releaseReadBufPtr(
|
|
|
|
JNIEnv *env, jobject buf, void *bufBase, int baseType);
|
|
|
|
|
|
|
|
void ompi_java_setStaticLongField(JNIEnv *env, jclass c,
|
|
|
|
char *field, jlong value);
|
2012-02-20 22:12:43 +00:00
|
|
|
|
2013-09-26 21:44:39 +00:00
|
|
|
void ompi_java_setIntField(JNIEnv *env, jclass c, jobject obj,
|
|
|
|
char *field, jint value);
|
2012-02-20 22:12:43 +00:00
|
|
|
|
2013-09-26 21:44:39 +00:00
|
|
|
void ompi_java_findClasses(JNIEnv *env);
|
|
|
|
jclass ompi_java_findClass(JNIEnv *env, const char *className);
|
|
|
|
void ompi_java_deleteClasses(JNIEnv *env);
|
2012-02-20 22:12:43 +00:00
|
|
|
|
2013-09-26 21:44:39 +00:00
|
|
|
jobject ompi_java_Integer_valueOf(JNIEnv *env, jint i);
|
|
|
|
jobject ompi_java_Long_valueOf(JNIEnv *env, jlong i);
|
2012-02-20 22:12:43 +00:00
|
|
|
|
2013-09-26 21:44:39 +00:00
|
|
|
void ompi_java_getIntArray(
|
|
|
|
JNIEnv *env, jintArray array, jint **jptr, int **cptr);
|
|
|
|
void ompi_java_releaseIntArray(
|
|
|
|
JNIEnv *env, jintArray array, jint *jptr, int *cptr);
|
|
|
|
void ompi_java_forgetIntArray(
|
|
|
|
JNIEnv *env, jintArray array, jint *jptr, int *cptr);
|
2012-02-20 22:12:43 +00:00
|
|
|
|
2013-09-26 21:44:39 +00:00
|
|
|
void ompi_java_getBooleanArray(
|
|
|
|
JNIEnv *env, jbooleanArray array, jboolean **jptr, int **cptr);
|
|
|
|
void ompi_java_releaseBooleanArray(
|
|
|
|
JNIEnv *env, jbooleanArray array, jboolean *jptr, int *cptr);
|
|
|
|
void ompi_java_forgetBooleanArray(
|
|
|
|
JNIEnv *env, jbooleanArray array, jboolean *jptr, int *cptr);
|
2012-02-20 22:12:43 +00:00
|
|
|
|
2013-09-26 21:44:39 +00:00
|
|
|
jboolean ompi_java_exceptionCheck(JNIEnv *env, int rc);
|
2012-02-20 22:12:43 +00:00
|
|
|
|
2013-09-26 21:44:39 +00:00
|
|
|
void* ompi_java_attrSet(JNIEnv *env, jbyteArray jval);
|
|
|
|
jbyteArray ompi_java_attrGet(JNIEnv *env, void *cval);
|
|
|
|
int ompi_java_attrCopy(void *attrValIn, void *attrValOut, int *flag);
|
|
|
|
int ompi_java_attrDelete(void *attrVal);
|
2012-02-20 22:12:43 +00:00
|
|
|
|
2013-09-26 21:44:39 +00:00
|
|
|
MPI_Op ompi_java_op_getHandle(JNIEnv *env, jobject jthis, int baseType);
|
2012-02-20 22:12:43 +00:00
|
|
|
|
2013-09-26 21:44:39 +00:00
|
|
|
void ompi_java_status_get(MPI_Status *status, JNIEnv *env, jobject obj);
|
|
|
|
void ompi_java_status_set(MPI_Status *status, JNIEnv *env, jobject obj);
|
|
|
|
jobject ompi_java_status_new(MPI_Status *status, JNIEnv *env);
|
2012-02-20 22:12:43 +00:00
|
|
|
|
2013-09-26 21:44:39 +00:00
|
|
|
#endif /* _MPIJAVA_H_ */
|