Skip to content

Commit

Permalink
Merge pull request #29 from aradi/stage-1.1
Browse files Browse the repository at this point in the history
Release 1.1
  • Loading branch information
aradi authored May 7, 2021
2 parents 0cb07ee + c3acfd2 commit 8c959ff
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 14 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ Change Log
Notable project changes in various releases.


1.1
===

Added
-----

* Method 'free' implemented to release the MPI-communicator


1.0
===

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion doc/doxygen/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions doc/sphinx/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion lib/mpifx.fypp
Original file line number Diff line number Diff line change
Expand Up @@ -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) +')'}$
Expand Down
37 changes: 28 additions & 9 deletions lib/mpifx_comm.fpp
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -52,7 +55,7 @@ contains
end if
self%leadrank = 0
self%lead = (self%rank == self%leadrank)

end subroutine mpifx_comm_init


Expand All @@ -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
Expand All @@ -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)
Expand All @@ -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
Expand All @@ -106,6 +109,22 @@ contains
call newcomm%init(newcommid, error)

end subroutine mpifx_comm_split




!> Frees the MPI communicator.
!>
!> After this call, the passed 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

0 comments on commit 8c959ff

Please sign in to comment.