From c7cd859bf8e2b88114d461377f2a5a640ed32a83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A1lint=20Aradi?= Date: Tue, 20 Oct 2020 17:14:02 +0200 Subject: [PATCH 1/6] Add Unreleased section to Change Log --- CHANGELOG.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 59a5aa0..b55676b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,6 +5,10 @@ Change Log Notable project changes in various releases. +Unreleased +========== + + 1.0 === From 603faf0a252a24be70a771980835b23443d78114 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A1lint=20Aradi?= Date: Fri, 26 Feb 2021 14:12:46 +0100 Subject: [PATCH 2/6] Implement wrapper for mpi_comm_free() --- lib/mpifx_comm.fpp | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/lib/mpifx_comm.fpp b/lib/mpifx_comm.fpp index fa99e76..784419e 100644 --- a/lib/mpifx_comm.fpp +++ b/lib/mpifx_comm.fpp @@ -1,6 +1,6 @@ !> Contains the extended MPI communicator. module mpifx_comm_module - use mpi + use mpi, only : MPI_COMM_WORLD, mpi_comm_size, mpi_comm_rank, mpi_comm_split, mpi_comm_free use mpifx_helper_module implicit none private @@ -21,6 +21,9 @@ module mpifx_comm_module !> Creates a new communicator by splitting the old one. procedure :: split => mpifx_comm_split + !> Frees the communicator. The communicator should not be used after this. + procedure :: free => mpifx_comm_free + end type mpifx_comm contains @@ -52,7 +55,7 @@ contains end if self%leadrank = 0 self%lead = (self%rank == self%leadrank) - + end subroutine mpifx_comm_init @@ -73,10 +76,10 @@ contains !! program test_split !! use libmpifx_module !! implicit none - !! + !! !! type(mpifx_comm) :: allproc, groupproc !! integer :: groupsize, mygroup - !! + !! !! call mpifx_init() !! call allproc%init() !! groupsize = allproc%size / 2 @@ -85,9 +88,9 @@ contains !! write(*, "(3(A,1X,I0,1X))") "ID:", allproc%rank, "SUBGROUP", & !! & mygroup, "SUBGROUP ID", groupproc%rank !! call mpifx_finalize() - !! + !! !! end program test_split - !! + !! !! \see MPI documentation (\c MPI_COMM_SPLIT) !! subroutine mpifx_comm_split(self, splitkey, rankkey, newcomm, error) @@ -97,7 +100,7 @@ contains integer, intent(out), optional :: error integer :: error0, newcommid - + call mpi_comm_split(self%id, splitkey, rankkey, newcommid, error0) call handle_errorflag(error0, "mpi_comm_split() in mpifx_comm_split()", error) if (error0 /= 0) then @@ -106,6 +109,22 @@ contains call newcomm%init(newcommid, error) end subroutine mpifx_comm_split - - + + + !> Frees the MPI communicator. + !> + !> After this call, the communicator should not be used any more. + !> + !> \param self Communicator instance. + !> + subroutine mpifx_comm_free(self) + class(mpifx_comm), intent(inout) :: self + + integer :: error + + call mpi_comm_free(self%id, error) + + end subroutine mpifx_comm_free + + end module mpifx_comm_module From 3c38f2442bf077f1e3a770fcca3e20155d4f5397 Mon Sep 17 00:00:00 2001 From: Ben Hourahine Date: Thu, 11 Mar 2021 08:48:36 +0000 Subject: [PATCH 3/6] Spelling mistake (#28) --- lib/mpifx.fypp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mpifx.fypp b/lib/mpifx.fypp index 68e76bb..8aa702c 100644 --- a/lib/mpifx.fypp +++ b/lib/mpifx.fypp @@ -39,7 +39,7 @@ #:set MAX_RANK = getvar('MAX_RANK', 6) -#! Returns colons within paranthesis according to the RANK or empty string +#! Returns colons within parenthesis according to the RANK or empty string #! if RANK is zero. #:def RANKSUFFIX(RANK) ${'' if RANK == 0 else '(' + ':' + ',:' * (RANK - 1) +')'}$ From af0d28395abe70bfdf7f28311909f8063201ffc2 Mon Sep 17 00:00:00 2001 From: Ben Hourahine Date: Sun, 14 Mar 2021 17:00:45 +0000 Subject: [PATCH 4/6] Minor comment change in mpifx_comm.fpp --- lib/mpifx_comm.fpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mpifx_comm.fpp b/lib/mpifx_comm.fpp index 784419e..9c4b039 100644 --- a/lib/mpifx_comm.fpp +++ b/lib/mpifx_comm.fpp @@ -113,7 +113,7 @@ contains !> Frees the MPI communicator. !> - !> After this call, the communicator should not be used any more. + !> After this call, the passed communicator should not be used any more. !> !> \param self Communicator instance. !> From 79633d91e5241c57614fde33fdb6f6a1430c7e1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A1lint=20Aradi?= Date: Wed, 5 May 2021 22:20:42 +0200 Subject: [PATCH 5/6] Bump version number, update changelog --- CHANGELOG.rst | 9 +++++++-- CMakeLists.txt | 2 +- doc/doxygen/Doxyfile | 2 +- doc/sphinx/conf.py | 4 ++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b55676b..d6aaae1 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,8 +5,13 @@ Change Log Notable project changes in various releases. -Unreleased -========== +1.1 +=== + +Added +----- + +* Method 'free' implemented for the MPI-communicator 1.0 diff --git a/CMakeLists.txt b/CMakeLists.txt index a9581ff..8de8fc7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ include(MpiFxUtils) include(${CMAKE_CURRENT_SOURCE_DIR}/config.cmake) -project(MpiFx VERSION 1.0 LANGUAGES Fortran) +project(MpiFx VERSION 1.1 LANGUAGES Fortran) setup_build_type() diff --git a/doc/doxygen/Doxyfile b/doc/doxygen/Doxyfile index cf3eac9..045fac5 100644 --- a/doc/doxygen/Doxyfile +++ b/doc/doxygen/Doxyfile @@ -32,7 +32,7 @@ PROJECT_NAME = "MpiFx" # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = "1.0" +PROJECT_NUMBER = "1.1" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer diff --git a/doc/sphinx/conf.py b/doc/sphinx/conf.py index e73f6ff..35addeb 100644 --- a/doc/sphinx/conf.py +++ b/doc/sphinx/conf.py @@ -45,10 +45,10 @@ # built documents. # # The short X.Y version. -version = '1.0' +version = '1.1' # The full version, including alpha/beta/rc tags. -release = '1.0' +release = '1.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. From c3acfd2d9e893073d445b5047dbc75eeab260176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A1lint=20Aradi?= Date: Fri, 7 May 2021 09:27:26 +0200 Subject: [PATCH 6/6] Update CHANGELOG.rst Co-authored-by: Ben Hourahine --- CHANGELOG.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d6aaae1..9c00206 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -11,7 +11,7 @@ Notable project changes in various releases. Added ----- -* Method 'free' implemented for the MPI-communicator +* Method 'free' implemented to release the MPI-communicator 1.0