parameter(MPI_BAND=9)
parameter(MPI_BOR=10)
parameter(MPI_BXOR=11)
+
+ INTEGER MPI_ADDRESS_KIND, MPI_OFFSET_KIND
+ PARAMETER (MPI_ADDRESS_KIND=8)
+ PARAMETER (MPI_OFFSET_KIND=8)
+
+ INTEGER MPI_MODE_NOPRECEDE
+ PARAMETER (MPI_MODE_NOPRECEDE=8192)
external MPI_INIT, MPI_FINALIZE, MPI_ABORT
external MPI_COMM_RANK, MPI_COMM_SIZE, MPI_COMM_DUP, MPI_COMM_SPLIT
//FIXME: these are not yet implemented
typedef void MPI_Handler_function(MPI_Comm*, int*, ...);
+typedef int MPI_Win;
+typedef int MPI_Info;
typedef void* MPI_Errhandler;
typedef int MPI_Copy_function(MPI_Comm oldcomm, int keyval, void* extra_state, void* attribute_val_in,
void* attribute_val_out, int* flag);
MPI_CALL(XBT_PUBLIC(int), MPI_Dims_create, (int nnodes, int ndims, int* dims));
MPI_CALL(XBT_PUBLIC(int), MPI_Initialized, (int* flag));
MPI_CALL(XBT_PUBLIC(int), MPI_Pcontrol, (const int level ));
+MPI_CALL(XBT_PUBLIC(int), MPI_Win_fence,( int assert, MPI_Win win));
+MPI_CALL(XBT_PUBLIC(int), MPI_Win_free,( MPI_Win* win));
+MPI_CALL(XBT_PUBLIC(int), MPI_Win_create,( void *base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, MPI_Win *win));
+MPI_CALL(XBT_PUBLIC(int), MPI_Info_create,( MPI_Info *info));
+MPI_CALL(XBT_PUBLIC(int), MPI_Info_set,( MPI_Info *info, char *key, char *value));
+MPI_CALL(XBT_PUBLIC(int), MPI_Info_free,( MPI_Info *info));
+MPI_CALL(XBT_PUBLIC(int), MPI_Get,( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank,
+ MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Win win));
//FIXME: End of all the not yet implemented stuff
void mpi_get_count__(MPI_Status * status, int* datatype, int *count, int* ierr);
void mpi_type_extent__(int* datatype, MPI_Aint * extent, int* ierr);
void mpi_attr_get__(int* comm, int* keyval, void* attr_value, int* flag, int* ierr );
+void mpi_type_commit__(int* datatype, int* ierr);
+void mpi_type_vector__(int* count, int* blocklen, int* stride, int* old_type, int* newtype, int* ierr);
+void mpi_type_create_vector__(int* count, int* blocklen, int* stride, int* old_type, int* newtype, int* ierr);
+void mpi_type_hvector__(int* count, int* blocklen, MPI_Aint* stride, int* old_type, int* newtype, int* ierr);
+void mpi_type_create_hvector__(int* count, int* blocklen, MPI_Aint* stride, int* old_type, int* newtype, int* ierr);
+void mpi_type_free__(int* datatype, int* ierr);
void mpi_type_lb__(int* datatype, MPI_Aint * extent, int* ierr);
void mpi_type_ub__(int* datatype, MPI_Aint * extent, int* ierr);
+void mpi_win_fence__( int* assert, int* win, int* ierr);
+void mpi_win_free__( int* win, int* ierr);
+void mpi_win_create__( int *base, MPI_Aint* size, int* disp_unit, int* info, int* comm, int *win, int* ierr);
+void mpi_info_create__( int *info, int* ierr);
+void mpi_info_set__( int *info, char *key, char *value, int* ierr);
+void mpi_info_free__(int* info, int* ierr);
+void mpi_get__( int *origin_addr, int* origin_count, int* origin_datatype, int* target_rank,
+ MPI_Aint* target_disp, int* target_count, int* target_datatype, int* win, int* ierr);
void mpi_error_string__(int* errorcode, char* string, int* resultlen, int* ierr);
void mpi_sendrecv__(void* sendbuf, int* sendcount, int* sendtype, int* dst,
int* sendtag, void *recvbuf, int* recvcount,
: MPI_DATATYPE_NULL;
}
+static void free_datatype(int datatype) {
+ xbt_dynar_remove_at(datatype_lookup, datatype, NULL);
+}
+
static int new_op(MPI_Op op) {
xbt_dynar_push(op_lookup, &op);
return (int)xbt_dynar_length(op_lookup) - 1;
*ierr= MPI_Type_extent(get_datatype(*datatype), extent);
}
+void mpi_type_commit__(int* datatype, int* ierr){
+ MPI_Datatype tmp= get_datatype(*datatype);
+ *ierr= MPI_Type_commit(&tmp);
+}
+
+void mpi_type_vector__(int* count, int* blocklen, int* stride, int* old_type, int* newtype, int* ierr){
+ MPI_Datatype tmp;
+ *ierr= MPI_Type_vector(*count, *blocklen, *stride, get_datatype(*old_type), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *newtype = new_datatype(tmp);
+ }
+}
+
+void mpi_type_create_vector__(int* count, int* blocklen, int* stride, int* old_type, int* newtype, int* ierr){
+ MPI_Datatype tmp;
+ *ierr= MPI_Type_vector(*count, *blocklen, *stride, get_datatype(*old_type), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *newtype = new_datatype(tmp);
+ }
+}
+
+void mpi_type_hvector__(int* count, int* blocklen, MPI_Aint* stride, int* old_type, int* newtype, int* ierr){
+ MPI_Datatype tmp;
+ *ierr= MPI_Type_hvector (*count, *blocklen, *stride, get_datatype(*old_type), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *newtype = new_datatype(tmp);
+ }
+}
+
+void mpi_type_create_hvector__(int* count, int* blocklen, MPI_Aint* stride, int* old_type, int* newtype, int* ierr){
+ MPI_Datatype tmp;
+ *ierr= MPI_Type_hvector(*count, *blocklen, *stride, get_datatype(*old_type), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *newtype = new_datatype(tmp);
+ }
+}
+
+void mpi_type_free__(int* datatype, int* ierr){
+ MPI_Datatype tmp= get_datatype(*datatype);
+ *ierr= MPI_Type_free (&tmp);
+ if(*ierr == MPI_SUCCESS) {
+ free_datatype(*datatype);
+ }
+}
+
void mpi_type_ub__(int* datatype, MPI_Aint * disp, int* ierr){
*ierr= MPI_Type_ub(get_datatype(*datatype), disp);
}
void mpi_error_string__(int* errorcode, char* string, int* resultlen, int* ierr){
*ierr = MPI_Error_string(*errorcode, string, resultlen);
}
+
+void mpi_win_fence__( int* assert, int* win, int* ierr){
+ *ierr = MPI_Win_fence(* assert, *(MPI_Win*)win);
+}
+
+void mpi_win_free__( int* win, int* ierr){
+ *ierr = MPI_Win_free( (MPI_Win*)win);
+}
+
+void mpi_win_create__( int *base, MPI_Aint* size, int* disp_unit, int* info, int* comm, int *win, int* ierr){
+ *ierr = MPI_Win_create( (void*)base, *size, *disp_unit, *(MPI_Info*)info, get_comm(*comm),(MPI_Win*)win);
+}
+
+void mpi_info_create__( int *info, int* ierr){
+ *ierr = MPI_Info_create( (MPI_Info *)info);
+}
+
+void mpi_info_set__( int *info, char *key, char *value, int* ierr){
+ *ierr = MPI_Info_set( (MPI_Info *)info, key, value);
+}
+
+void mpi_info_free__(int* info, int* ierr){
+ *ierr = MPI_Info_free((MPI_Info *) info);
+}
+
+void mpi_get__( int *origin_addr, int* origin_count, int* origin_datatype, int *target_rank,
+ MPI_Aint* target_disp, int *target_count, int* target_datatype, int* win, int* ierr){
+ *ierr = MPI_Get( (void*)origin_addr,*origin_count, get_datatype(*origin_datatype),*target_rank,
+ *target_disp, *target_count,get_datatype(*target_datatype), *(MPI_Win *)win);
+}
int MPI_Initialized(int* flag) {
return PMPI_Initialized(flag);
}
+
+int MPI_Win_fence( int assert, MPI_Win win){
+ return PMPI_Win_fence( assert, win);
+}
+
+int MPI_Win_free( MPI_Win* win){
+ return PMPI_Win_free( win);
+}
+
+int MPI_Win_create( void *base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, MPI_Win *win){
+ return PMPI_Win_create( base, size, disp_unit, info, comm,win);
+}
+
+int MPI_Info_create( MPI_Info *info){
+ return PMPI_Info_create( info);
+}
+
+int MPI_Info_set( MPI_Info *info, char *key, char *value){
+ return PMPI_Info_set( info, key, value);
+}
+
+int MPI_Info_free( MPI_Info *info){
+ return PMPI_Info_free( info);
+}
+
+int MPI_Get( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank,
+ MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Win win){
+ return PMPI_Get( origin_addr,origin_count, origin_datatype,target_rank,
+ target_disp, target_count,target_datatype, win);
+}
return not_yet_implemented();
}
+int PMPI_Win_fence( int assert, MPI_Win win){
+ return not_yet_implemented();
+}
+
+int PMPI_Win_free( MPI_Win* win){
+ return not_yet_implemented();
+}
+
+int PMPI_Win_create( void *base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, MPI_Win *win){
+ return not_yet_implemented();
+}
+
+int PMPI_Info_create( MPI_Info *info){
+ return not_yet_implemented();
+}
+
+int PMPI_Info_set( MPI_Info *info, char *key, char *value){
+ return not_yet_implemented();
+}
+
+int PMPI_Info_free( MPI_Info *info){
+ return not_yet_implemented();
+}
+
+int PMPI_Get( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank,
+ MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Win win){
+ return not_yet_implemented();
+}