From: Arnaud Giersch Date: Wed, 24 Apr 2019 19:55:10 +0000 (+0200) Subject: [sonar] Unused function parameters. X-Git-Tag: v3.22.2~50 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/2b2677ab2f08298e2517f5ee3f56dfb9916234b6 [sonar] Unused function parameters. --- diff --git a/src/smpi/bindings/smpi_pmpi.cpp b/src/smpi/bindings/smpi_pmpi.cpp index 6b831d51df..1f3ec5815d 100644 --- a/src/smpi/bindings/smpi_pmpi.cpp +++ b/src/smpi/bindings/smpi_pmpi.cpp @@ -31,7 +31,7 @@ void TRACE_smpi_set_category(const char *category) /* PMPI User level calls */ -int PMPI_Init(int *argc, char ***argv) +int PMPI_Init(int*, char***) { xbt_assert(simgrid::s4u::Engine::is_initialized(), "Your MPI program was not properly initialized. The easiest is to use smpirun to start it."); diff --git a/src/smpi/internals/smpi_global.cpp b/src/smpi/internals/smpi_global.cpp index 085ca5fa60..53a59d3c60 100644 --- a/src/smpi/internals/smpi_global.cpp +++ b/src/smpi/internals/smpi_global.cpp @@ -133,7 +133,8 @@ MPI_Info smpi_process_info_env(){ return smpi_process()->info_env(); } -void smpi_process_init(int *argc, char ***argv){ +void smpi_process_init(int*, char***) +{ simgrid::smpi::ActorExt::init(); } @@ -469,7 +470,7 @@ static smpi_entry_point_type smpi_resolve_function(void* handle) { smpi_fortran_entry_point_type entry_point_fortran = (smpi_fortran_entry_point_type)dlsym(handle, "user_main_"); if (entry_point_fortran != nullptr) { - return [entry_point_fortran](int argc, char** argv) { + return [entry_point_fortran](int, char**) { entry_point_fortran(); return 0; }; diff --git a/src/smpi/mpi/smpi_comm.cpp b/src/smpi/mpi/smpi_comm.cpp index 7722473d21..f3cec23338 100644 --- a/src/smpi/mpi/smpi_comm.cpp +++ b/src/smpi/mpi/smpi_comm.cpp @@ -517,7 +517,7 @@ void Comm::set_info(MPI_Info info){ info_=info; } -MPI_Comm Comm::split_type(int type, int key, MPI_Info info) +MPI_Comm Comm::split_type(int type, int /*key*/, MPI_Info) { if(type != MPI_COMM_TYPE_SHARED){ return MPI_COMM_NULL; diff --git a/src/smpi/mpi/smpi_datatype.cpp b/src/smpi/mpi/smpi_datatype.cpp index 1aa590876f..70002725bb 100644 --- a/src/smpi/mpi/smpi_datatype.cpp +++ b/src/smpi/mpi/smpi_datatype.cpp @@ -250,7 +250,8 @@ void Datatype::set_name(char* name){ name_ = xbt_strdup(name); } -int Datatype::pack(void* inbuf, int incount, void* outbuf, int outcount, int* position,MPI_Comm comm){ +int Datatype::pack(void* inbuf, int incount, void* outbuf, int outcount, int* position, MPI_Comm) +{ if (outcount - *position < incount*static_cast(size_)) return MPI_ERR_OTHER; Datatype::copy(inbuf, incount, this, static_cast(outbuf) + *position, outcount, MPI_CHAR); @@ -258,7 +259,8 @@ int Datatype::pack(void* inbuf, int incount, void* outbuf, int outcount, int* po return MPI_SUCCESS; } -int Datatype::unpack(void* inbuf, int insize, int* position, void* outbuf, int outcount,MPI_Comm comm){ +int Datatype::unpack(void* inbuf, int insize, int* position, void* outbuf, int outcount, MPI_Comm) +{ if (outcount*static_cast(size_)> insize) return MPI_ERR_OTHER; Datatype::copy(static_cast(inbuf) + *position, insize, MPI_CHAR, outbuf, outcount, this); diff --git a/src/smpi/mpi/smpi_file.cpp b/src/smpi/mpi/smpi_file.cpp index 79d8bcb625..80526840bb 100644 --- a/src/smpi/mpi/smpi_file.cpp +++ b/src/smpi/mpi/smpi_file.cpp @@ -60,7 +60,8 @@ namespace smpi{ return MPI_SUCCESS; } - int File::del(char *filename, MPI_Info info){ + int File::del(char* filename, MPI_Info) + { //get the file with MPI_MODE_DELETE_ON_CLOSE and then close it File* f = new File(MPI_COMM_SELF,filename,MPI_MODE_DELETE_ON_CLOSE|MPI_MODE_RDWR, nullptr); close(&f); @@ -107,7 +108,8 @@ namespace smpi{ return MPI_SUCCESS; } - int File::read(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status){ + int File::read(MPI_File fh, void* /*buf*/, int count, MPI_Datatype datatype, MPI_Status* status) + { //get position first as we may be doing non contiguous reads and it will probably be updated badly MPI_Offset position = fh->file_->tell(); MPI_Offset movesize = datatype->get_extent()*count; @@ -165,7 +167,8 @@ namespace smpi{ return ret; } - int File::write(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status){ + int File::write(MPI_File fh, void* /*buf*/, int count, MPI_Datatype datatype, MPI_Status* status) + { //get position first as we may be doing non contiguous reads and it will probably be updated badly MPI_Offset position = fh->file_->tell(); MPI_Offset movesize = datatype->get_extent()*count; diff --git a/src/smpi/mpi/smpi_keyvals.cpp b/src/smpi/mpi/smpi_keyvals.cpp index 219c555a47..d22bbf205c 100644 --- a/src/smpi/mpi/smpi_keyvals.cpp +++ b/src/smpi/mpi/smpi_keyvals.cpp @@ -14,8 +14,8 @@ std::unordered_map* Keyval::attributes(){ return &attributes_; }; - -template <> int Keyval::call_deleter(Comm* obj, smpi_key_elem elem, int keyval, void * value, int* flag){ +template <> int Keyval::call_deleter(Comm* obj, smpi_key_elem elem, int keyval, void* value, int* /*flag*/) +{ int ret = MPI_SUCCESS; if(elem->delete_fn.comm_delete_fn!=MPI_NULL_DELETE_FN) ret = elem->delete_fn.comm_delete_fn(obj, keyval, value, elem->extra_state); @@ -24,7 +24,8 @@ template <> int Keyval::call_deleter(Comm* obj, smpi_key_elem elem, int ke return ret; } -template <> int Keyval::call_deleter(Win* obj, smpi_key_elem elem, int keyval, void * value, int* flag){ +template <> int Keyval::call_deleter(Win* obj, smpi_key_elem elem, int keyval, void* value, int* /*flag*/) +{ int ret = MPI_SUCCESS; if(elem->delete_fn.win_delete_fn!=MPI_NULL_DELETE_FN) ret = elem->delete_fn.win_delete_fn(obj, keyval, value, elem->extra_state); @@ -33,7 +34,9 @@ template <> int Keyval::call_deleter(Win* obj, smpi_key_elem elem, int keyv return ret; } -template <> int Keyval::call_deleter(Datatype* obj, smpi_key_elem elem, int keyval, void * value, int* flag){ +template <> +int Keyval::call_deleter(Datatype* obj, smpi_key_elem elem, int keyval, void* value, int* /*flag*/) +{ int ret = MPI_SUCCESS; if(elem->delete_fn.type_delete_fn!=MPI_NULL_DELETE_FN) ret = elem->delete_fn.type_delete_fn(obj, keyval, value, elem->extra_state); diff --git a/src/smpi/mpi/smpi_topo.cpp b/src/smpi/mpi/smpi_topo.cpp index 82bfd74f33..7ce25d4763 100644 --- a/src/smpi/mpi/smpi_topo.cpp +++ b/src/smpi/mpi/smpi_topo.cpp @@ -29,7 +29,9 @@ Topo_Cart::Topo_Cart(int ndims) : ndims_(ndims), dims_(ndims), periodic_(ndims), /* reorder is ignored, don't know what would be the consequences of a dumb reordering but neither do I see the point of * reordering*/ -Topo_Cart::Topo_Cart(MPI_Comm comm_old, int ndims, int dims[], int periods[], int reorder, MPI_Comm *comm_cart) : Topo_Cart(ndims) { +Topo_Cart::Topo_Cart(MPI_Comm comm_old, int ndims, int dims[], int periods[], int /*reorder*/, MPI_Comm* comm_cart) + : Topo_Cart(ndims) +{ MPI_Group newGroup; MPI_Group oldGroup; @@ -108,7 +110,8 @@ Topo_Cart* Topo_Cart::sub(const int remain_dims[], MPI_Comm *newcomm) { return res; } -int Topo_Cart::coords(int rank, int maxdims, int coords[]) { +int Topo_Cart::coords(int rank, int /*maxdims*/, int coords[]) +{ int nnodes = nnodes_; for (int i = 0; i< ndims_; i++ ) { nnodes = nnodes /dims_[i]; diff --git a/src/smpi/mpi/smpi_win.cpp b/src/smpi/mpi/smpi_win.cpp index 84d748ac51..e9641dd1a8 100644 --- a/src/smpi/mpi/smpi_win.cpp +++ b/src/smpi/mpi/smpi_win.cpp @@ -84,7 +84,8 @@ Win::~Win(){ cleanup_attr(); } -int Win::attach (void *base, MPI_Aint size){ +int Win::attach(void* /*base*/, MPI_Aint size) +{ if (not(base_ == MPI_BOTTOM || base_ == 0)) return MPI_ERR_ARG; base_=0;//actually the address will be given in the RMA calls, as being the disp. @@ -92,7 +93,8 @@ int Win::attach (void *base, MPI_Aint size){ return MPI_SUCCESS; } -int Win::detach (void *base){ +int Win::detach(void* /*base*/) +{ base_=MPI_BOTTOM; size_=-1; return MPI_SUCCESS; @@ -364,10 +366,10 @@ int Win::accumulate( void *origin_addr, int origin_count, MPI_Datatype origin_da return MPI_SUCCESS; } -int Win::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_Request* request){ - +int Win::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_Request*) +{ //get sender pointer MPI_Win send_win = connected_wins_[target_rank]; @@ -433,7 +435,8 @@ int Win::compare_and_swap(void *origin_addr, void *compare_addr, return MPI_SUCCESS; } -int Win::start(MPI_Group group, int assert){ +int Win::start(MPI_Group group, int /*assert*/) +{ /* From MPI forum advices The call to MPI_WIN_COMPLETE does not return until the put call has completed at the origin; and the target window will be accessed by the put operation only after the call to MPI_WIN_START has matched a call to MPI_WIN_POST by @@ -475,7 +478,8 @@ int Win::start(MPI_Group group, int assert){ return MPI_SUCCESS; } -int Win::post(MPI_Group group, int assert){ +int Win::post(MPI_Group group, int /*assert*/) +{ //let's make a synchronous send here int i = 0; int j = 0; @@ -574,7 +578,8 @@ int Win::wait(){ return MPI_SUCCESS; } -int Win::lock(int lock_type, int rank, int assert){ +int Win::lock(int lock_type, int rank, int /*assert*/) +{ MPI_Win target_win = connected_wins_[rank]; if ((lock_type == MPI_LOCK_EXCLUSIVE && target_win->mode_ != MPI_LOCK_SHARED)|| target_win->mode_ == MPI_LOCK_EXCLUSIVE){