From: Martin Quinson Date: Mon, 17 Apr 2017 07:25:10 +0000 (+0200) Subject: small sonar-inspired cleanups X-Git-Tag: v3.16~343 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/f78bb9df687c6cf26ca6f2b9e5f86fd687c5dcf1 small sonar-inspired cleanups --- diff --git a/src/smpi/smpi_global.cpp b/src/smpi/smpi_global.cpp index f7df869945..a47b7e976a 100644 --- a/src/smpi/smpi_global.cpp +++ b/src/smpi/smpi_global.cpp @@ -440,7 +440,7 @@ static void smpi_init_logs(){ static void smpi_init_options(){ //return if already called - if(smpi_cpu_threshold!=-1) + if (smpi_cpu_threshold > -1) return; simgrid::smpi::Colls::set_collectives(); simgrid::smpi::Colls::smpi_coll_cleanup_callback=nullptr; diff --git a/src/smpi/smpi_request.cpp b/src/smpi/smpi_request.cpp index 29661e8902..40ae6cde98 100644 --- a/src/smpi/smpi_request.cpp +++ b/src/smpi/smpi_request.cpp @@ -33,7 +33,7 @@ Request::Request(void *buf, int count, MPI_Datatype datatype, int src, int dst, { void *old_buf = nullptr; // FIXME Handle the case of a partial shared malloc. - if(((((flags & RECV) != 0) && ((flags & ACCUMULATE) !=0)) || (datatype->flags() & DT_FLAG_DERIVED))) { // && (!smpi_is_shared(buf_))){ + if ((((flags & RECV) != 0) && ((flags & ACCUMULATE) != 0)) || (datatype->flags() & DT_FLAG_DERIVED)) { // This part handles the problem of non-contiguous memory old_buf = buf; if (count==0){ @@ -691,7 +691,8 @@ void Request::finish_wait(MPI_Request* request, MPI_Status * status) MPI_Datatype datatype = req->old_type_; // FIXME Handle the case of a partial shared malloc. - if((((req->flags_ & ACCUMULATE) != 0) || (datatype->flags() & DT_FLAG_DERIVED))){// && (!smpi_is_shared(req->old_buf_))){ + if (((req->flags_ & ACCUMULATE) != 0) || + (datatype->flags() & DT_FLAG_DERIVED)) { // && (!smpi_is_shared(req->old_buf_))){ if (!smpi_process()->replaying()){ if( smpi_privatize_global_variables != 0 && (static_cast(req->old_buf_) >= smpi_start_data_exe)