-/* Copyright (c) 2010-2014. The SimGrid Team.
+/* Copyright (c) 2010-2015. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
void mpi_send_init_(void *buf, int* count, int* datatype, int* dst, int* tag,
int* comm, int* request, int* ierr) {
MPI_Request req;
-
+ buf = (char *) FORT_BOTTOM(buf);
*ierr = MPI_Send_init(buf, *count, smpi_type_f2c(*datatype), *dst, *tag,
smpi_comm_f2c(*comm), &req);
if(*ierr == MPI_SUCCESS) {
void mpi_send_(void* buf, int* count, int* datatype, int* dst,
int* tag, int* comm, int* ierr) {
+ buf = (char *) FORT_BOTTOM(buf);
*ierr = MPI_Send(buf, *count, smpi_type_f2c(*datatype), *dst, *tag,
smpi_comm_f2c(*comm));
}
void mpi_rsend_(void* buf, int* count, int* datatype, int* dst,
int* tag, int* comm, int* ierr) {
+ buf = (char *) FORT_BOTTOM(buf);
*ierr = MPI_Rsend(buf, *count, smpi_type_f2c(*datatype), *dst, *tag,
smpi_comm_f2c(*comm));
}
int* sendtag, void *recvbuf, int* recvcount,
int* recvtype, int* src, int* recvtag,
int* comm, MPI_Status* status, int* ierr) {
+ sendbuf = (char *) FORT_BOTTOM(sendbuf);
+ recvbuf = (char *) FORT_BOTTOM(recvbuf);
*ierr = MPI_Sendrecv(sendbuf, *sendcount, smpi_type_f2c(*sendtype), *dst,
*sendtag, recvbuf, *recvcount,smpi_type_f2c(*recvtype), *src, *recvtag,
smpi_comm_f2c(*comm), FORT_STATUS_IGNORE(status));
void mpi_recv_init_(void *buf, int* count, int* datatype, int* src, int* tag,
int* comm, int* request, int* ierr) {
MPI_Request req;
-
+ buf = (char *) FORT_BOTTOM(buf);
*ierr = MPI_Recv_init(buf, *count, smpi_type_f2c(*datatype), *src, *tag,
smpi_comm_f2c(*comm), &req);
if(*ierr == MPI_SUCCESS) {
void mpi_recv_(void* buf, int* count, int* datatype, int* src,
int* tag, int* comm, MPI_Status* status, int* ierr) {
- *ierr = MPI_Recv(buf, *count, smpi_type_f2c(*datatype), *src, *tag,
+ buf = (char *) FORT_BOTTOM(buf);
+ *ierr = MPI_Recv(buf, *count, smpi_type_f2c(*datatype), *src, *tag,
smpi_comm_f2c(*comm), status);
}
void mpi_type_struct_ (int* count, int* blocklens, MPI_Aint* indices, int* old_types, int* newtype, int* ierr) {
MPI_Datatype tmp;
- *ierr = MPI_Type_struct(*count, blocklens, indices, (MPI_Datatype*)old_types, &tmp);
+ int i=0;
+ MPI_Datatype* types = (MPI_Datatype*)xbt_malloc(*count*sizeof(MPI_Datatype));
+ for(i=0; i< *count; i++){
+ types[i] = smpi_type_f2c(old_types[i]);
+ }
+ *ierr = MPI_Type_struct(*count, blocklens, indices, types, &tmp);
if(*ierr == MPI_SUCCESS) {
*newtype = smpi_type_c2f(tmp);
}
+ xbt_free(types);
}
void mpi_type_create_struct_ (int* count, int* blocklens, MPI_Aint* indices, int* old_types, int* newtype, int* ierr) {
MPI_Datatype tmp;
- *ierr = MPI_Type_create_struct(*count, blocklens, indices, (MPI_Datatype*)old_types, &tmp);
+ int i=0;
+ MPI_Datatype* types = (MPI_Datatype*)xbt_malloc(*count*sizeof(MPI_Datatype));
+ for(i=0; i< *count; i++){
+ types[i] = smpi_type_f2c(old_types[i]);
+ }
+ *ierr = MPI_Type_create_struct(*count, blocklens, indices, types, &tmp);
if(*ierr == MPI_SUCCESS) {
*newtype = smpi_type_c2f(tmp);
}
+ xbt_free(types);
}
void mpi_ssend_ (void* buf, int* count, int* datatype, int* dest, int* tag, int* comm, int* ierr) {