1 /* Copyright (c) 2007-2021. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
8 #include "smpi_comm.hpp"
10 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(smpi_pmpi);
12 /* PMPI User level calls */
14 int PMPI_Op_create(MPI_User_function * function, int commute, MPI_Op * op)
16 CHECK_NULL(1, MPI_ERR_ARG, function)
17 CHECK_NULL(3, MPI_ERR_ARG, op)
18 *op = new simgrid::smpi::Op(function, (commute!=0));
22 int PMPI_Op_free(MPI_Op * op)
24 CHECK_NULL(1, MPI_ERR_ARG, op)
25 CHECK_MPI_NULL(1, MPI_OP_NULL, MPI_ERR_OP, *op)
26 if((*op)->is_predefined())
28 (*op)->mark_as_deleted();
29 simgrid::smpi::Op::unref(op);
34 int PMPI_Op_commutative(MPI_Op op, int* commute){
35 CHECK_MPI_NULL(1, MPI_OP_NULL, MPI_ERR_OP, op)
36 CHECK_NULL(1, MPI_ERR_ARG, commute)
37 *commute = op->is_commutative();
41 MPI_Op PMPI_Op_f2c(MPI_Fint op){
44 return simgrid::smpi::Op::f2c(op);
47 MPI_Fint PMPI_Op_c2f(MPI_Op op){