2 use mpi_f08,
only : mpi_comm, mpi_datatype, mpi_initialized, mpi_init_thread, &
3 mpi_init, mpi_thread_multiple, mpi_thread_serialized, mpi_comm_rank, &
4 mpi_comm_split, mpi_comm_dup, mpi_barrier, mpi_comm_free, mpi_finalize, &
5 mpi_comm_world, mpi_double_precision, mpi_real
14 bind(c, name=
'neko_comm_wrapper_init')
15 integer,
value :: fcomm
19 subroutine neko_comm_nvshmem_init() &
20 bind(c, name=
'neko_comm_nvshmem_init')
21 end subroutine neko_comm_nvshmem_init
23 subroutine neko_comm_nvshmem_finalize() &
24 bind(c, name=
'neko_comm_nvshmem_finalize')
25 end subroutine neko_comm_nvshmem_finalize
28#if defined(HAVE_NCCL) || defined(HAVE_RCCL)
29 subroutine neko_comm_nccl_init() &
30 bind(c, name=
'neko_comm_nccl_init')
31 end subroutine neko_comm_nccl_init
33 subroutine neko_comm_nccl_finalize() &
34 bind(c, name=
'neko_comm_nccl_finalize')
35 end subroutine neko_comm_nccl_finalize
46#ifdef HAVE_MPI_PARAM_DTYPE
61 logical,
public ::
nio
74 logical :: initialized
75 integer :: provided, nthrds
78 character(len=255) :: color_str
84 call mpi_initialized(initialized, ierr)
86 call get_environment_variable(
"NEKO_COMM_ID", color_str, envvar_len)
87 if (envvar_len .gt. 0)
then
88 read(color_str(1:envvar_len), *) color
100 if (.not.initialized)
then
101 if (nthrds .gt. 1)
then
102 call mpi_init_thread(mpi_thread_multiple, provided, ierr)
103 if (provided .ne. mpi_thread_multiple)
then
106 call neko_error(
'Invalid thread support provided by MPI')
108 call mpi_init_thread(mpi_thread_serialized, provided, ierr)
109 if (provided .ne. mpi_thread_serialized)
then
110 call neko_error(
'Invalid thread support provided by MPI')
119#ifndef HAVE_MPI_PARAM_DTYPE
127 call mpi_comm_rank(mpi_comm_world,
pe_rank, ierr)
136 if (envvar_len .gt. 0)
then
151 call neko_comm_nvshmem_init()
154#if defined(HAVE_NCCL) | defined(HAVE_RCCL)
156 call neko_comm_nccl_init()
169 call neko_comm_nccl_finalize()
173 call neko_comm_nvshmem_finalize()
176 call mpi_finalize(ierr)
subroutine, public comm_free
subroutine, public comm_init
logical, public nio
I/O node.
type(mpi_comm), public neko_global_comm
type(mpi_datatype), public mpi_real_precision
MPI type for working precision of REAL types.
integer, public global_pe_rank
Global MPI rank.
integer, public pe_size
MPI size of communicator.
integer, public pe_rank
MPI rank.
integer, public global_pe_size
Global MPI size of communicator.
type(mpi_comm), public neko_comm
MPI communicator.
type(mpi_datatype), public mpi_extra_precision
integer, parameter neko_bcknd_device