/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include <simgrid/s4u/host.hpp>
-
-#include "private.h"
+#include "simgrid/s4u/Engine.hpp"
+#include "simgrid/s4u/Host.hpp"
+#include "src/smpi/private.h"
+#include "src/smpi/smpi_comm.hpp"
+#include "src/smpi/smpi_coll.hpp"
+#include "src/smpi/smpi_datatype_derived.hpp"
+#include "src/smpi/smpi_op.hpp"
+#include "src/smpi/smpi_process.hpp"
+#include "src/smpi/smpi_request.hpp"
+#include "src/smpi/smpi_status.hpp"
+#include "src/smpi/smpi_win.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_pmpi, smpi, "Logging specific to SMPI (pmpi)");
int PMPI_Init(int *argc, char ***argv)
{
- // PMPI_Init is call only one time by only by SMPI process
+ xbt_assert(simgrid::s4u::Engine::isInitialized(),
+ "Your MPI program was not properly initialized. The easiest is to use smpirun to start it.");
+ // PMPI_Init is called only once per SMPI process
int already_init;
MPI_Initialized(&already_init);
if(already_init == 0){
int PMPI_Get_library_version (char *version,int *len){
smpi_bench_end();
- snprintf(version,MPI_MAX_LIBRARY_VERSION_STRING,"SMPI Version %d.%d. Copyright The Simgrid Team 2007-2015",
+ snprintf(version, MPI_MAX_LIBRARY_VERSION_STRING, "SMPI Version %d.%d. Copyright The Simgrid Team 2007-2017",
SIMGRID_VERSION_MAJOR, SIMGRID_VERSION_MINOR);
*len = strlen(version) > MPI_MAX_LIBRARY_VERSION_STRING ? MPI_MAX_LIBRARY_VERSION_STRING : strlen(version);
smpi_bench_begin();
retval = MPI_ERR_ARG;
} else if (comm == MPI_COMM_NULL) {
retval = MPI_ERR_COMM;
- } else if (!datatype->is_valid()) {
- retval = MPI_ERR_TYPE;
+ } else if (not datatype->is_valid()) {
+ retval = MPI_ERR_TYPE;
} else if (dst == MPI_PROC_NULL) {
retval = MPI_SUCCESS;
} else {
retval = MPI_ERR_ARG;
} else if (comm == MPI_COMM_NULL) {
retval = MPI_ERR_COMM;
- } else if (!datatype->is_valid()) {
- retval = MPI_ERR_TYPE;
+ } else if (not datatype->is_valid()) {
+ retval = MPI_ERR_TYPE;
} else if (src == MPI_PROC_NULL) {
retval = MPI_SUCCESS;
} else {
retval = MPI_ERR_ARG;
} else if (comm == MPI_COMM_NULL) {
retval = MPI_ERR_COMM;
- } else if (!datatype->is_valid()) {
- retval = MPI_ERR_TYPE;
+ } else if (not datatype->is_valid()) {
+ retval = MPI_ERR_TYPE;
} else if (dst == MPI_PROC_NULL) {
retval = MPI_SUCCESS;
} else {
retval = MPI_ERR_RANK;
} else if ((count < 0) || (buf==nullptr && count > 0)) {
retval = MPI_ERR_COUNT;
- } else if (!datatype->is_valid()) {
- retval = MPI_ERR_TYPE;
+ } else if (not datatype->is_valid()) {
+ retval = MPI_ERR_TYPE;
} else if(tag<0 && tag != MPI_ANY_TAG){
retval = MPI_ERR_TAG;
} else {
retval = MPI_ERR_RANK;
} else if ((count < 0) || (buf==nullptr && count > 0)) {
retval = MPI_ERR_COUNT;
- } else if (!datatype->is_valid()) {
- retval = MPI_ERR_TYPE;
+ } else if (not datatype->is_valid()) {
+ retval = MPI_ERR_TYPE;
} else if(tag<0 && tag != MPI_ANY_TAG){
retval = MPI_ERR_TAG;
} else {
retval = MPI_ERR_RANK;
} else if ((count < 0)|| (buf==nullptr && count > 0)) {
retval = MPI_ERR_COUNT;
- } else if (!datatype->is_valid()) {
- retval = MPI_ERR_TYPE;
+ } else if (not datatype->is_valid()) {
+ retval = MPI_ERR_TYPE;
} else if(tag<0 && tag != MPI_ANY_TAG){
retval = MPI_ERR_TAG;
} else {
retval = MPI_ERR_RANK;
} else if ((count < 0) || (buf==nullptr && count > 0)) {
retval = MPI_ERR_COUNT;
- } else if (!datatype->is_valid()) {
- retval = MPI_ERR_TYPE;
+ } else if (not datatype->is_valid()) {
+ retval = MPI_ERR_TYPE;
} else if(tag<0 && tag != MPI_ANY_TAG){
retval = MPI_ERR_TAG;
} else {
// the src may not have been known at the beginning of the recv (MPI_ANY_SOURCE)
if (status != MPI_STATUS_IGNORE) {
src_traced = comm->group()->index(status->MPI_SOURCE);
- if (!TRACE_smpi_view_internals()) {
+ if (not TRACE_smpi_view_internals()) {
TRACE_smpi_recv(rank, src_traced, rank, tag);
}
}
retval = MPI_ERR_RANK;
} else if ((count < 0) || (buf == nullptr && count > 0)) {
retval = MPI_ERR_COUNT;
- } else if (!datatype->is_valid()) {
+ } else if (not datatype->is_valid()) {
retval = MPI_ERR_TYPE;
} else if(tag < 0 && tag != MPI_ANY_TAG){
retval = MPI_ERR_TAG;
}
extra->send_size = count*dt_size_send;
TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, extra);
- if (!TRACE_smpi_view_internals()) {
+ if (not TRACE_smpi_view_internals()) {
TRACE_smpi_send(rank, rank, dst_traced, tag,count*datatype->size());
}
retval = MPI_ERR_RANK;
} else if ((count < 0) || (buf==nullptr && count > 0)) {
retval = MPI_ERR_COUNT;
- } else if (!datatype->is_valid()){
+ } else if (not datatype->is_valid()) {
retval = MPI_ERR_TYPE;
} else if(tag<0 && tag != MPI_ANY_TAG){
retval = MPI_ERR_TAG;
extra->send_size = count*dt_size_send;
TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, extra);
TRACE_smpi_send(rank, rank, dst_traced, tag,count*datatype->size());
-
+
simgrid::smpi::Request::ssend(buf, count, datatype, dst, tag, comm);
retval = MPI_SUCCESS;
-
+
TRACE_smpi_ptp_out(rank, rank, dst_traced, __FUNCTION__);
}
if (comm == MPI_COMM_NULL) {
retval = MPI_ERR_COMM;
- } else if (!sendtype->is_valid() || !recvtype->is_valid()) {
+ } else if (not sendtype->is_valid() || not recvtype->is_valid()) {
retval = MPI_ERR_TYPE;
} else if (src == MPI_PROC_NULL || dst == MPI_PROC_NULL) {
simgrid::smpi::Status::empty(status);
}else if (dst >= comm->group()->size() || dst <0 ||
(src!=MPI_ANY_SOURCE && (src >= comm->group()->size() || src <0))){
retval = MPI_ERR_RANK;
- } else if ((sendcount < 0 || recvcount<0) ||
+ } else if ((sendcount < 0 || recvcount<0) ||
(sendbuf==nullptr && sendcount > 0) || (recvbuf==nullptr && recvcount>0)) {
retval = MPI_ERR_COUNT;
} else if((sendtag<0 && sendtag != MPI_ANY_TAG)||(recvtag<0 && recvtag != MPI_ANY_TAG)){
MPI_Comm comm, MPI_Status* status)
{
int retval = 0;
- if (!datatype->is_valid()) {
+ if (not datatype->is_valid()) {
return MPI_ERR_TYPE;
} else if (count < 0) {
return MPI_ERR_COUNT;
if (comm == MPI_COMM_NULL) {
retval = MPI_ERR_COMM;
- } else if (!datatype->is_valid()) {
+ } else if (not datatype->is_valid()) {
retval = MPI_ERR_ARG;
} else {
int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
int root_traced = comm->group()->index(root);
- int i = 0;
int size = comm->size();
instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1);
extra->type = TRACING_GATHERV;
int dt_size_recv = 1;
if (known == 0)
dt_size_recv = recvtype->size();
- if ((comm->rank() == root)) {
+ if (comm->rank() == root) {
extra->recvcounts = xbt_new(int, size);
- for (i = 0; i < size; i++) // copy data to avoid bad free
+ for (int i = 0; i < size; i++) // copy data to avoid bad free
extra->recvcounts[i] = recvcounts[i] * dt_size_recv;
}
TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__, extra);
if (comm == MPI_COMM_NULL) {
retval = MPI_ERR_COMM;
- } else if (((comm->rank() == root) && (!sendtype->is_valid())) ||
- ((recvbuf != MPI_IN_PLACE) && (!recvtype->is_valid()))) {
+ } else if (((comm->rank() == root) && (not sendtype->is_valid())) ||
+ ((recvbuf != MPI_IN_PLACE) && (not recvtype->is_valid()))) {
retval = MPI_ERR_TYPE;
} else if ((sendbuf == recvbuf) ||
((comm->rank()==root) && sendcount>0 && (sendbuf == nullptr))){
}
int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
int root_traced = comm->group()->index(root);
- int i = 0;
int size = comm->size();
instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1);
extra->type = TRACING_SCATTERV;
int dt_size_send = 1;
if (known == 0)
dt_size_send = sendtype->size();
- if ((comm->rank() == root)) {
+ if (comm->rank() == root) {
extra->sendcounts = xbt_new(int, size);
- for (i = 0; i < size; i++) // copy data to avoid bad free
+ for (int i = 0; i < size; i++) // copy data to avoid bad free
extra->sendcounts[i] = sendcounts[i] * dt_size_send;
}
extra->datatype2 = encode_datatype(recvtype, &known);
if (comm == MPI_COMM_NULL) {
retval = MPI_ERR_COMM;
- } else if (!datatype->is_valid() || op == MPI_OP_NULL) {
+ } else if (not datatype->is_valid() || op == MPI_OP_NULL) {
retval = MPI_ERR_ARG;
} else {
int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
int retval = 0;
smpi_bench_end();
- if (!datatype->is_valid() || op == MPI_OP_NULL) {
+ if (not datatype->is_valid() || op == MPI_OP_NULL) {
retval = MPI_ERR_ARG;
} else {
op->apply(inbuf, inoutbuf, &count, datatype);
if (comm == MPI_COMM_NULL) {
retval = MPI_ERR_COMM;
- } else if (!datatype->is_valid()) {
+ } else if (not datatype->is_valid()) {
retval = MPI_ERR_TYPE;
} else if (op == MPI_OP_NULL) {
retval = MPI_ERR_OP;
if (comm == MPI_COMM_NULL) {
retval = MPI_ERR_COMM;
- } else if (!datatype->is_valid()) {
+ } else if (not datatype->is_valid()) {
retval = MPI_ERR_TYPE;
} else if (op == MPI_OP_NULL) {
retval = MPI_ERR_OP;
if (comm == MPI_COMM_NULL) {
retval = MPI_ERR_COMM;
- } else if (!datatype->is_valid()) {
+ } else if (not datatype->is_valid()) {
retval = MPI_ERR_TYPE;
} else if (op == MPI_OP_NULL) {
retval = MPI_ERR_OP;
if (comm == MPI_COMM_NULL) {
retval = MPI_ERR_COMM;
- } else if (!datatype->is_valid()) {
+ } else if (not datatype->is_valid()) {
retval = MPI_ERR_TYPE;
} else if (op == MPI_OP_NULL) {
retval = MPI_ERR_OP;
if (comm == MPI_COMM_NULL) {
retval = MPI_ERR_COMM;
- } else if (!datatype->is_valid()) {
+ } else if (not datatype->is_valid()) {
retval = MPI_ERR_TYPE;
} else if (op == MPI_OP_NULL) {
retval = MPI_ERR_OP;
extra->recvcounts = xbt_new(int, size);
extra->sendcounts = xbt_new(int, size);
int known = 0;
- int dt_size_recv = 1;
extra->datatype2 = encode_datatype(recvtype, &known);
- dt_size_recv = recvtype->size();
+ int dt_size_recv = recvtype->size();
void* sendtmpbuf = static_cast<char*>(sendbuf);
int* sendtmpcounts = sendcounts;
{
if (status == nullptr || count == nullptr) {
return MPI_ERR_ARG;
- } else if (!datatype->is_valid()) {
+ } else if (not datatype->is_valid()) {
return MPI_ERR_TYPE;
} else {
size_t size = datatype->size();
retval = MPI_SUCCESS;
} else if (target_rank <0){
retval = MPI_ERR_RANK;
- } else if (win->dynamic()==0 && target_disp <0){
+ } else if (win->dynamic()==0 && target_disp <0){
//in case of dynamic window, target_disp can be mistakenly seen as negative, as it is an address
retval = MPI_ERR_ARG;
} else if ((origin_count < 0 || target_count < 0) ||
(origin_addr==nullptr && origin_count > 0)){
retval = MPI_ERR_COUNT;
- } else if ((!origin_datatype->is_valid()) || (!target_datatype->is_valid())) {
+ } else if ((not origin_datatype->is_valid()) || (not target_datatype->is_valid())) {
retval = MPI_ERR_TYPE;
} else {
int rank = smpi_process()->index();
retval = MPI_SUCCESS;
} else if (target_rank <0){
retval = MPI_ERR_RANK;
- } else if (win->dynamic()==0 && target_disp <0){
+ } else if (win->dynamic()==0 && target_disp <0){
//in case of dynamic window, target_disp can be mistakenly seen as negative, as it is an address
retval = MPI_ERR_ARG;
} else if ((origin_count < 0 || target_count < 0) ||
(origin_addr==nullptr && origin_count > 0)){
retval = MPI_ERR_COUNT;
- } else if ((!origin_datatype->is_valid()) || (!target_datatype->is_valid())) {
+ } else if ((not origin_datatype->is_valid()) || (not target_datatype->is_valid())) {
retval = MPI_ERR_TYPE;
} else if(request == nullptr){
retval = MPI_ERR_REQUEST;
retval = MPI_SUCCESS;
} else if (target_rank <0){
retval = MPI_ERR_RANK;
- } else if (win->dynamic()==0 && target_disp <0){
+ } else if (win->dynamic()==0 && target_disp <0){
//in case of dynamic window, target_disp can be mistakenly seen as negative, as it is an address
retval = MPI_ERR_ARG;
} else if ((origin_count < 0 || target_count < 0) ||
(origin_addr==nullptr && origin_count > 0)){
retval = MPI_ERR_COUNT;
- } else if ((!origin_datatype->is_valid()) || (!target_datatype->is_valid())) {
+ } else if ((not origin_datatype->is_valid()) || (not target_datatype->is_valid())) {
retval = MPI_ERR_TYPE;
} else {
int rank = smpi_process()->index();
retval = MPI_SUCCESS;
} else if (target_rank <0){
retval = MPI_ERR_RANK;
- } else if (win->dynamic()==0 && target_disp <0){
+ } else if (win->dynamic()==0 && target_disp <0){
//in case of dynamic window, target_disp can be mistakenly seen as negative, as it is an address
retval = MPI_ERR_ARG;
} else if ((origin_count < 0 || target_count < 0) ||
(origin_addr==nullptr && origin_count > 0)){
retval = MPI_ERR_COUNT;
- } else if ((!origin_datatype->is_valid()) || (!target_datatype->is_valid())) {
+ } else if ((not origin_datatype->is_valid()) || (not target_datatype->is_valid())) {
retval = MPI_ERR_TYPE;
} else if(request == nullptr){
retval = MPI_ERR_REQUEST;
retval = MPI_SUCCESS;
} else if (target_rank <0){
retval = MPI_ERR_RANK;
- } else if (win->dynamic()==0 && target_disp <0){
+ } else if (win->dynamic()==0 && target_disp <0){
//in case of dynamic window, target_disp can be mistakenly seen as negative, as it is an address
retval = MPI_ERR_ARG;
} else if ((origin_count < 0 || target_count < 0) ||
(origin_addr==nullptr && origin_count > 0)){
retval = MPI_ERR_COUNT;
- } else if ((!origin_datatype->is_valid()) ||
- (!target_datatype->is_valid())) {
+ } else if ((not origin_datatype->is_valid()) || (not target_datatype->is_valid())) {
retval = MPI_ERR_TYPE;
} else if (op == MPI_OP_NULL) {
retval = MPI_ERR_OP;
retval = MPI_SUCCESS;
} else if (target_rank <0){
retval = MPI_ERR_RANK;
- } else if (win->dynamic()==0 && target_disp <0){
+ } else if (win->dynamic()==0 && target_disp <0){
//in case of dynamic window, target_disp can be mistakenly seen as negative, as it is an address
retval = MPI_ERR_ARG;
} else if ((origin_count < 0 || target_count < 0) ||
(origin_addr==nullptr && origin_count > 0)){
retval = MPI_ERR_COUNT;
- } else if ((!origin_datatype->is_valid()) ||
- (!target_datatype->is_valid())) {
+ } else if ((not origin_datatype->is_valid()) || (not target_datatype->is_valid())) {
retval = MPI_ERR_TYPE;
} else if (op == MPI_OP_NULL) {
retval = MPI_ERR_OP;
return retval;
}
-int PMPI_Get_accumulate(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, void *result_addr,
-int result_count, MPI_Datatype result_datatype, int target_rank, MPI_Aint target_disp, int target_count,
+int PMPI_Get_accumulate(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, void *result_addr,
+int result_count, MPI_Datatype result_datatype, int target_rank, MPI_Aint target_disp, int target_count,
MPI_Datatype target_datatype, MPI_Op op, MPI_Win win){
int retval = 0;
smpi_bench_end();
retval = MPI_SUCCESS;
} else if (target_rank <0){
retval = MPI_ERR_RANK;
- } else if (win->dynamic()==0 && target_disp <0){
+ } else if (win->dynamic()==0 && target_disp <0){
//in case of dynamic window, target_disp can be mistakenly seen as negative, as it is an address
retval = MPI_ERR_ARG;
} else if ((origin_count < 0 || target_count < 0 || result_count <0) ||
(origin_addr==nullptr && origin_count > 0 && op != MPI_NO_OP) ||
(result_addr==nullptr && result_count > 0)){
retval = MPI_ERR_COUNT;
- } else if ((origin_datatype!=MPI_DATATYPE_NULL && !origin_datatype->is_valid()) ||
- (!target_datatype->is_valid())||
- (!result_datatype->is_valid())) {
+ } else if ((origin_datatype != MPI_DATATYPE_NULL && not origin_datatype->is_valid()) ||
+ (not target_datatype->is_valid()) || (not result_datatype->is_valid())) {
retval = MPI_ERR_TYPE;
} else if (op == MPI_OP_NULL) {
retval = MPI_ERR_OP;
int src_traced = group->index(target_rank);
TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__, nullptr);
- retval = win->get_accumulate( origin_addr, origin_count, origin_datatype, result_addr,
- result_count, result_datatype, target_rank, target_disp,
+ retval = win->get_accumulate( origin_addr, origin_count, origin_datatype, result_addr,
+ result_count, result_datatype, target_rank, target_disp,
target_count, target_datatype, op);
TRACE_smpi_ptp_out(rank, src_traced, rank, __FUNCTION__);
}
-int PMPI_Rget_accumulate(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, void *result_addr,
-int result_count, MPI_Datatype result_datatype, int target_rank, MPI_Aint target_disp, int target_count,
+int PMPI_Rget_accumulate(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, void *result_addr,
+int result_count, MPI_Datatype result_datatype, int target_rank, MPI_Aint target_disp, int target_count,
MPI_Datatype target_datatype, MPI_Op op, MPI_Win win, MPI_Request* request){
int retval = 0;
smpi_bench_end();
retval = MPI_SUCCESS;
} else if (target_rank <0){
retval = MPI_ERR_RANK;
- } else if (win->dynamic()==0 && target_disp <0){
+ } else if (win->dynamic()==0 && target_disp <0){
//in case of dynamic window, target_disp can be mistakenly seen as negative, as it is an address
retval = MPI_ERR_ARG;
} else if ((origin_count < 0 || target_count < 0 || result_count <0) ||
(origin_addr==nullptr && origin_count > 0 && op != MPI_NO_OP) ||
(result_addr==nullptr && result_count > 0)){
retval = MPI_ERR_COUNT;
- } else if ((origin_datatype!=MPI_DATATYPE_NULL && !origin_datatype->is_valid()) ||
- (!target_datatype->is_valid())||
- (!result_datatype->is_valid())) {
+ } else if ((origin_datatype != MPI_DATATYPE_NULL && not origin_datatype->is_valid()) ||
+ (not target_datatype->is_valid()) || (not result_datatype->is_valid())) {
retval = MPI_ERR_TYPE;
} else if (op == MPI_OP_NULL) {
retval = MPI_ERR_OP;
int src_traced = group->index(target_rank);
TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__, nullptr);
- retval = win->get_accumulate( origin_addr, origin_count, origin_datatype, result_addr,
- result_count, result_datatype, target_rank, target_disp,
+ retval = win->get_accumulate( origin_addr, origin_count, origin_datatype, result_addr,
+ result_count, result_datatype, target_rank, target_disp,
target_count, target_datatype, op, request);
TRACE_smpi_ptp_out(rank, src_traced, rank, __FUNCTION__);
retval = MPI_SUCCESS;
} else if (target_rank <0){
retval = MPI_ERR_RANK;
- } else if (win->dynamic()==0 && target_disp <0){
+ } else if (win->dynamic()==0 && target_disp <0){
//in case of dynamic window, target_disp can be mistakenly seen as negative, as it is an address
retval = MPI_ERR_ARG;
} else if (origin_addr==nullptr || result_addr==nullptr || compare_addr==nullptr){
retval = MPI_ERR_COUNT;
- } else if (!datatype->is_valid()) {
+ } else if (not datatype->is_valid()) {
retval = MPI_ERR_TYPE;
} else {
int rank = smpi_process()->index();
int src_traced = group->index(target_rank);
TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__, nullptr);
- retval = win->compare_and_swap( origin_addr, compare_addr, result_addr, datatype,
+ retval = win->compare_and_swap( origin_addr, compare_addr, result_addr, datatype,
target_rank, target_disp);
TRACE_smpi_ptp_out(rank, src_traced, rank, __FUNCTION__);
smpi_bench_end();
if (win == MPI_WIN_NULL) {
retval = MPI_ERR_WIN;
- } else if (lock_type != MPI_LOCK_EXCLUSIVE &&
+ } else if (lock_type != MPI_LOCK_EXCLUSIVE &&
lock_type != MPI_LOCK_SHARED) {
retval = MPI_ERR_LOCKTYPE;
- } else if (rank == MPI_PROC_NULL){
+ } else if (rank == MPI_PROC_NULL){
retval = MPI_SUCCESS;
} else {
int myrank = smpi_process()->index();
smpi_bench_end();
if (win == MPI_WIN_NULL) {
retval = MPI_ERR_WIN;
- } else if (rank == MPI_PROC_NULL){
+ } else if (rank == MPI_PROC_NULL){
retval = MPI_SUCCESS;
} else {
int myrank = smpi_process()->index();
smpi_bench_end();
if (win == MPI_WIN_NULL) {
retval = MPI_ERR_WIN;
- } else if (rank == MPI_PROC_NULL){
+ } else if (rank == MPI_PROC_NULL){
retval = MPI_SUCCESS;
} else {
int myrank = smpi_process()->index();
smpi_bench_end();
if (win == MPI_WIN_NULL) {
retval = MPI_ERR_WIN;
- } else if (rank == MPI_PROC_NULL){
+ } else if (rank == MPI_PROC_NULL){
retval = MPI_SUCCESS;
} else {
int myrank = smpi_process()->index();
int PMPI_Unpack(void* inbuf, int incount, int* position, void* outbuf, int outcount, MPI_Datatype type, MPI_Comm comm) {
if(incount<0 || outcount < 0 || inbuf==nullptr || outbuf==nullptr)
return MPI_ERR_ARG;
- if(!type->is_valid())
+ if (not type->is_valid())
return MPI_ERR_TYPE;
if(comm==MPI_COMM_NULL)
return MPI_ERR_COMM;
int PMPI_Pack(void* inbuf, int incount, MPI_Datatype type, void* outbuf, int outcount, int* position, MPI_Comm comm) {
if(incount<0 || outcount < 0|| inbuf==nullptr || outbuf==nullptr)
return MPI_ERR_ARG;
- if(!type->is_valid())
+ if (not type->is_valid())
return MPI_ERR_TYPE;
if(comm==MPI_COMM_NULL)
return MPI_ERR_COMM;
int PMPI_Pack_size(int incount, MPI_Datatype datatype, MPI_Comm comm, int* size) {
if(incount<0)
return MPI_ERR_ARG;
- if(!datatype->is_valid())
+ if (not datatype->is_valid())
return MPI_ERR_TYPE;
if(comm==MPI_COMM_NULL)
return MPI_ERR_COMM;