void ompi_ireduce_scatter_f(char *sendbuf, char *recvbuf, 
                            MPI_Fint *recvcounts, MPI_Fint *datatype,
                            MPI_Fint *op, MPI_Fint *comm, MPI_Fint *request, 
                            MPI_Fint *ierr)
{
    int c_ierr;
    MPI_Comm c_comm;
    MPI_Datatype c_type;
    MPI_Request c_request;
    MPI_Op c_op;
    int size;
    OMPI_ARRAY_NAME_DECL(recvcounts);

    c_comm = MPI_Comm_f2c(*comm);
    c_type = MPI_Type_f2c(*datatype);
    c_op = MPI_Op_f2c(*op);

    MPI_Comm_size(c_comm, &size);
    OMPI_ARRAY_FINT_2_INT(recvcounts, size);

    sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf);
    sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf);
    recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf);
    
    c_ierr = MPI_Ireduce_scatter(sendbuf, recvbuf,
                                 OMPI_ARRAY_NAME_CONVERT(recvcounts),
                                 c_type, c_op, c_comm, &c_request);
    if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
    if (MPI_SUCCESS == c_ierr) *request = MPI_Request_c2f(c_request);
}
void mpi_reduce_scatter_f(char *sendbuf, char *recvbuf, 
			  MPI_Fint *recvcounts, MPI_Fint *datatype,
			  MPI_Fint *op, MPI_Fint *comm, MPI_Fint *ierr)
{
    MPI_Comm c_comm;
    MPI_Datatype c_type;
    MPI_Op c_op;
    int size;
    OMPI_ARRAY_NAME_DECL(recvcounts);

    c_comm = MPI_Comm_f2c(*comm);
    c_type = MPI_Type_f2c(*datatype);
    c_op = MPI_Op_f2c(*op);

    MPI_Comm_size(c_comm, &size);
    OMPI_ARRAY_FINT_2_INT(recvcounts, size);

    sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf);
    sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf);
    recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf);
    
    *ierr = OMPI_INT_2_FINT(MPI_Reduce_scatter(sendbuf, recvbuf,
				       OMPI_ARRAY_NAME_CONVERT(recvcounts),
				       c_type, c_op, c_comm));
}
Example #3
0
void mpi_reduce (void *sendbuf, void *recvbuf, MPI_Fint *count, 
		 MPI_Fint *datatype, MPI_Fint *op, MPI_Fint *root, 
		 MPI_Fint *comm, MPI_Fint *__ierr)
{
  *__ierr = MPI_Reduce (sendbuf, recvbuf, *count, MPI_Type_f2c(*datatype),
			MPI_Op_f2c(*op), *root, MPI_Comm_f2c(*comm));
}
Example #4
0
void ompi_ireduce_f(char *sendbuf, char *recvbuf, MPI_Fint *count,
                    MPI_Fint *datatype, MPI_Fint *op, 
                    MPI_Fint *root, MPI_Fint *comm, MPI_Fint *request, 
                    MPI_Fint *ierr)
{
    int c_ierr;
    MPI_Datatype c_type;
    MPI_Request c_request;
    MPI_Op c_op;
    MPI_Comm c_comm;

    c_type = MPI_Type_f2c(*datatype);
    c_op = MPI_Op_f2c(*op);
    c_comm = MPI_Comm_f2c(*comm);

    sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf);
    sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf);
    recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf);

    c_ierr = MPI_Ireduce(sendbuf, recvbuf,
                         OMPI_FINT_2_INT(*count),
                         c_type, c_op, 
                         OMPI_FINT_2_INT(*root),
                         c_comm, &c_request);
    if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
    if (MPI_SUCCESS == c_ierr) *request = MPI_Request_c2f(c_request);
}
Example #5
0
MPI_Fint c2fop_ ( MPI_Fint *op )
{
    MPI_Op cOp = MPI_Op_f2c( *op );
    
    if (cOp != MPI_SUM) {
	fprintf( stderr, "Op: did not get sum\n" );
	return 1;
    }
    return 0;
}
void ompi_op_commutative_f(MPI_Fint *op, MPI_Fint *commute, MPI_Fint *ierr)
{
    int c_ierr;
    MPI_Op c_op;
    OMPI_SINGLE_NAME_DECL(commute);

    c_op = MPI_Op_f2c(*op);

    c_ierr = MPI_Op_commutative(c_op, OMPI_SINGLE_NAME_CONVERT(commute));
    if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);

    if (MPI_SUCCESS == c_ierr) {
        OMPI_SINGLE_INT_2_FINT(commute);
    }
}
void mpi_reduce_local_f(char *inbuf, char *inoutbuf, MPI_Fint *count,
                        MPI_Fint *datatype, MPI_Fint *op, MPI_Fint *ierr)
{
    MPI_Datatype c_type;
    MPI_Op c_op;

    c_type = MPI_Type_f2c(*datatype);
    c_op = MPI_Op_f2c(*op);

    inbuf = (char *) OMPI_F2C_BOTTOM(inbuf);
    inoutbuf = (char *) OMPI_F2C_BOTTOM(inoutbuf);

    *ierr = OMPI_INT_2_FINT(MPI_Reduce_local(inbuf, inoutbuf,
                                             OMPI_FINT_2_INT(*count),
                                             c_type, c_op));
}
Example #8
0
File: shim.c Project: zrafa/paralab
void mpi_allreduce(void *sendbuf, void *recvbuf, int *count, MPI_Fint *datatype, MPI_Fint *op, MPI_Fint *comm, int *ierr)
{
        __SHIM__REGISTER_F(allreduce);
	caller = __SHIM__get_caller();

        MPI_Datatype cb_datatype;
        MPI_Comm cb_comm;
	MPI_Op cb_op;

        cb_datatype = MPI_Type_f2c(*datatype);
        cb_comm = MPI_Comm_f2c(*comm);
        cb_op = MPI_Op_f2c(*op);

        tor_MPI_Allreduce_pre(sendbuf,recvbuf, *count, cb_datatype, cb_op, cb_comm,caller);
         __SHIM__FUNC_F(sendbuf,recvbuf,count,datatype,op,comm,ierr);
        tor_MPI_Allreduce_pos(sendbuf,recvbuf, *count, cb_datatype, cb_op, cb_comm,caller,*ierr);
        return;
}
Example #9
0
void mpi_allreduce_f(char *sendbuf, char *recvbuf, MPI_Fint *count,
		     MPI_Fint *datatype, MPI_Fint *op, MPI_Fint *comm,
		     MPI_Fint *ierr)
{
    MPI_Comm c_comm;
    MPI_Datatype c_type;
    MPI_Op c_op;

    c_comm = MPI_Comm_f2c(*comm);
    c_type = MPI_Type_f2c(*datatype);
    c_op = MPI_Op_f2c(*op);

    sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf);
    sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf);
    recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf);

    *ierr = OMPI_INT_2_FINT(MPI_Allreduce(sendbuf, recvbuf,
					  OMPI_FINT_2_INT(*count),
					  c_type, c_op, c_comm));
}
void ompi_accumulate_f(char *origin_addr, MPI_Fint *origin_count,
		      MPI_Fint *origin_datatype, MPI_Fint *target_rank,
		      MPI_Aint *target_disp, MPI_Fint *target_count,
		      MPI_Fint *target_datatype, MPI_Fint *op, MPI_Fint *win,
		      MPI_Fint *ierr)
{
    int ierr_c;

    MPI_Datatype c_origin_datatype = MPI_Type_f2c(*origin_datatype);
    MPI_Datatype c_target_datatype = MPI_Type_f2c(*target_datatype);
    MPI_Win c_win = MPI_Win_f2c(*win);
    MPI_Op c_op = MPI_Op_f2c(*op);

    ierr_c = MPI_Accumulate(OMPI_F2C_BOTTOM(origin_addr), 
                            OMPI_FINT_2_INT(*origin_count),
                            c_origin_datatype, 
                            OMPI_FINT_2_INT(*target_rank),
                            *target_disp,
                            OMPI_FINT_2_INT(*target_count),
                            c_target_datatype, c_op, c_win);

    if (NULL != ierr) *ierr = OMPI_INT_2_FINT(ierr_c);
}