From 68038dd380c2e7bce7d09105843dd4da4500b652 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Skrzy=C5=84ski?= Date: Thu, 26 Nov 2020 23:03:01 +0100 Subject: [PATCH] #1163: collective: remove redundant initialize() override --- src/vt/collective/startup.cc | 16 ++++++---------- src/vt/collective/startup.h | 7 ++++--- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/vt/collective/startup.cc b/src/vt/collective/startup.cc index 40010925f5..e0a8ed6d71 100644 --- a/src/vt/collective/startup.cc +++ b/src/vt/collective/startup.cc @@ -52,20 +52,16 @@ namespace vt { // vt::{initialize,finalize} for main ::vt namespace RuntimePtrType initialize( - int& argc, char**& argv, WorkerCountType const num_workers, - bool is_interop, MPI_Comm* comm + int argc, char** argv, WorkerCountType const num_workers, + bool is_interop /* = false */, MPI_Comm* comm /* = nullptr */ ) { return CollectiveOps::initialize(argc,argv,num_workers,is_interop,comm); } -RuntimePtrType initialize(int& argc, char**& argv, MPI_Comm* comm) { - bool const is_interop = comm != nullptr; - return CollectiveOps::initialize(argc,argv,no_workers,is_interop,comm); -} - -RuntimePtrType initialize(MPI_Comm* comm) { - int argc = 0; - char** argv = nullptr; +RuntimePtrType initialize( + int argc /* = 0 */, char** argv /* = nullptr */, + MPI_Comm* comm /* = nullptr */ +) { bool const is_interop = comm != nullptr; return CollectiveOps::initialize(argc,argv,no_workers,is_interop,comm); } diff --git a/src/vt/collective/startup.h b/src/vt/collective/startup.h index c7a05d53e8..fc5bb9a743 100644 --- a/src/vt/collective/startup.h +++ b/src/vt/collective/startup.h @@ -51,11 +51,12 @@ namespace vt { RuntimePtrType initialize( - int& argc, char**& argv, WorkerCountType const num_workers, + int argc, char** argv, WorkerCountType const num_workers, bool is_interop = false, MPI_Comm* comm = nullptr ); -RuntimePtrType initialize(int& argc, char**& argv, MPI_Comm* comm = nullptr); -RuntimePtrType initialize(MPI_Comm* comm = nullptr); +RuntimePtrType initialize( + int argc = 0, char** argv = nullptr, MPI_Comm* comm = nullptr +); void finalize(RuntimePtrType in_rt); void finalize();