I'm just wondering if this is possible and if it is would any one have an example of using the MPI_Op_create to create a Op with a function that has many gsl and or boost functions inside of it to pass it on to an mpi_reduce command. In my situation order doesn't matter but serial and Openmp are too slow for what i want to do, so i want to try to convert it to mpi.
instead of a standard C example
void addem ( int *, int *, int *, MPI_Datatype * );
void addem(int *invec, int *inoutvec, int *len, MPI_Datatype *dtype)
{
int i;
for ( i=0; i<*len; i++ )
inoutvec[i] += invec[i];
}
which is then passed on to
MPI_Op_create( (MPI_User_function *)addem, 1, &op );
i would change that to something similar but much more complicated then this
void addgsl(gsl_vector* vec,gsl matrix* mat, int num,.....,MPI_Datatype *dtype)
for (int i=0; i <num; i++) {
//some complicated boost or gsl mathematical formula here
}