int MPI_Reduce(void* sbuff, void* rbuff, int cnt, MPI_Datatype dt, MPI_Op op, int root, MPI_Comm comm) { int g2g = 1; char call[COLLCHK_SM_STRLEN]; sprintf(call, "REDUCE"); /* Check if init has been called */ g2g = CollChk_is_init(); if(g2g) { /* check call consistancy */ CollChk_same_call(comm, call); /* check root consistancy */ CollChk_same_root(comm, root, call); /* check operation consistancy */ CollChk_same_op(comm, op, call); /* check datatype signature consistancy */ CollChk_dtype_bcast(comm, dt, cnt, root, call); /* make the call */ return PMPI_Reduce(sbuff, rbuff, cnt, dt, op, root, comm); } else { /* init not called */ return CollChk_err_han("MPI_Init() has not been called!", COLLCHK_ERR_NOT_INIT, call, comm); } }
int MPI_Reduce_scatter(const void* sbuff, void* rbuff, const int rcnts[], MPI_Datatype dt, MPI_Op op, MPI_Comm comm) { int g2g = 1; char call[COLLCHK_SM_STRLEN]; sprintf(call, "REDUCE_SCATTER"); /* Check if init has been called */ g2g = CollChk_is_init(); if(g2g) { /* check for call consistancy */ CollChk_same_call(comm, call); /* check for MPI_IN_PLACE consistency if needed */ CollChk_check_buff(comm, sbuff, call); /* check for same operation */ CollChk_same_op(comm, op, call); /* check for same datatypes */ CollChk_dtype_bcast(comm, dt, 1, 0, call); /* make the call */ return PMPI_Reduce_scatter(sbuff, rbuff, rcnts, dt, op, comm); } else { /* init not called */ return CollChk_err_han("MPI_Init() has not been called!", COLLCHK_ERR_NOT_INIT, call, comm); } }
int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype, MPI_Datatype filetype, char *datarep, MPI_Info info) { int g2g = 1; char call[COLLCHK_SM_STRLEN]; MPI_Comm comm; sprintf(call, "FILE_SET_VIEW"); /* Check if init has been called */ g2g = CollChk_is_init(); if(g2g) { /* get the comm */ if (!CollChk_get_fh(fh, &comm)) { return CollChk_err_han("File has not been Opened", COLLCHK_ERR_FILE_NOT_OPEN, call, MPI_COMM_WORLD); } /* check for call consistancy */ CollChk_same_call(comm, call); /* check type consistancy */ CollChk_dtype_bcast(comm, etype, 1, 0, call); /* check datarep consistancy */ CollChk_same_datarep(comm, datarep, call); /* make the call */ return PMPI_File_set_view(fh, disp, etype, filetype, datarep, info); } else { /* init not called */ return CollChk_err_han("MPI_Init() has not been called!", COLLCHK_ERR_NOT_INIT, call, MPI_COMM_WORLD); } }