From 6fa562e299868195a6a06879f76b3b8da563a533 Mon Sep 17 00:00:00 2001 From: Christian Heinrich Date: Fri, 3 Jun 2016 12:28:26 +0200 Subject: [PATCH] [SMPI] PMPI_Send: Cosmetics --- src/smpi/smpi_pmpi.cpp | 44 ++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/src/smpi/smpi_pmpi.cpp b/src/smpi/smpi_pmpi.cpp index a4ee282097..3d9c6566f6 100644 --- a/src/smpi/smpi_pmpi.cpp +++ b/src/smpi/smpi_pmpi.cpp @@ -1173,43 +1173,41 @@ int PMPI_Send(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI retval = MPI_SUCCESS; } else if (dst >= smpi_group_size(smpi_comm_group(comm)) || dst <0){ retval = MPI_ERR_RANK; - } else if ((count < 0) || (buf==NULL && count > 0)) { + } else if ((count < 0) || (buf == nullptr && count > 0)) { retval = MPI_ERR_COUNT; } else if (!is_datatype_valid(datatype)) { - retval = MPI_ERR_TYPE; - } else if(tag<0 && tag != MPI_ANY_TAG){ + retval = MPI_ERR_TYPE; + } else if(tag < 0 && tag != MPI_ANY_TAG){ retval = MPI_ERR_TAG; } else { - - int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1; - int dst_traced = smpi_group_index(smpi_comm_group(comm), dst); - instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1); - extra->type = TRACING_SEND; - extra->src = rank; - extra->dst = dst_traced; - int known=0; - extra->datatype1 = encode_datatype(datatype, &known); - int dt_size_send = 1; - if(known==0) - dt_size_send = smpi_datatype_size(datatype); - extra->send_size = count*dt_size_send; - TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, extra); - if (!TRACE_smpi_view_internals()) { - TRACE_smpi_send(rank, rank, dst_traced,count*smpi_datatype_size(datatype)); - } + int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1; + int dst_traced = smpi_group_index(smpi_comm_group(comm), dst); + instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1); + extra->type = TRACING_SEND; + extra->src = rank; + extra->dst = dst_traced; + int known = 0; + extra->datatype1 = encode_datatype(datatype, &known); + int dt_size_send = 1; + if (known == 0) { + dt_size_send = smpi_datatype_size(datatype); + } + extra->send_size = count*dt_size_send; + TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, extra); + if (!TRACE_smpi_view_internals()) { + TRACE_smpi_send(rank, rank, dst_traced,count*smpi_datatype_size(datatype)); + } smpi_mpi_send(buf, count, datatype, dst, tag, comm); retval = MPI_SUCCESS; - TRACE_smpi_ptp_out(rank, rank, dst_traced, __FUNCTION__); + TRACE_smpi_ptp_out(rank, rank, dst_traced, __FUNCTION__); } smpi_bench_begin(); return retval; } - - int PMPI_Ssend(void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm) { int retval = 0; -- 2.20.1