- int retval = 0;
- smpi_bench_end();
-
- if (comm_out == nullptr) {
- retval = MPI_ERR_ARG;
- } else if (comm == MPI_COMM_NULL) {
- retval = MPI_ERR_COMM;
- } else {
- *comm_out = comm->split(color, key);
- retval = MPI_SUCCESS;
- }
- smpi_bench_begin();
-
- return retval;
+ CHECK_NULL(4, MPI_ERR_ARG, comm_out)
+ CHECK_COMM2(1, comm)
+ CHECK_COLLECTIVE(comm, __func__)
+ if( color != MPI_UNDEFINED)//we use a negative value for MPI_UNDEFINED
+ CHECK_NEGATIVE(3, MPI_ERR_ARG, color)
+ const SmpiBenchGuard suspend_bench;
+ *comm_out = comm->split(color, key);
+ return MPI_SUCCESS;