- if(!smpi_process_get_replaying())
- op->func(const_cast<void*>(invec), inoutvec, len, datatype);
+ if(!smpi_process_get_replaying()){
+ if(! op->is_fortran_op)
+ op->func(invec, inoutvec, len, datatype);
+ else{
+ int tmp = smpi_type_c2f(*datatype);
+ /* Unfortunately, the C and Fortran version of the MPI standard do not agree on the type here,
+ thus the reinterpret_cast. */
+ op->func(invec, inoutvec, len, reinterpret_cast<MPI_Datatype*>(&tmp) );
+ }
+ }