ALF dev.
A QMC Code for fermionic models
Loading...
Searching...
No Matches
mpi_shared_memory Module Reference

This module provides an interface to allocate memory that is shared between different MPI jobs from a single communicator on the same node. More...

Data Types

interface  allocate_shared_memory
 interface to memory allocation routines. fortran array may be real or complex double; 1D to 4D; mpi_win_loc can be used for memory synchronization barrier; myrank to ensure that only one rank initializes the array More...

Functions/Subroutines

subroutine, public mpi_shared_memory_init (mpi_communicator, chunk_size)
 initializes memory manager; can be called without MPI present. Does nothing if compiled without MPI
subroutine allocate_shm_chunk_real ()
 internal helper routine that allocates chunks of shared MPI memory that can be carved out and distributed
subroutine allocate_shared_memory_1dreal (fortran_array, mpi_win_loc, myrank, arrayshape)
 specific implementation of above interface for 1D real arrays
subroutine allocate_shared_memory_2dreal (fortran_array, mpi_win_loc, myrank, arrayshape)
 specific implementation of above interface for 2D real arrays
subroutine allocate_shared_memory_3dreal (fortran_array, mpi_win_loc, myrank, arrayshape)
 specific implementation of above interface for 3D real arrays
subroutine allocate_shared_memory_4dreal (fortran_array, mpi_win_loc, myrank, arrayshape)
 specific implementation of above interface for 4D real arrays
subroutine allocate_shm_chunk_cmplx ()
 internal helper routine that allocates chunks of shared MPI complex memory that can be carved out and distributed
subroutine allocate_shared_memory_1dcmplx (fortran_array, mpi_win_loc, myrank, arrayshape)
 specific implementation of above interface for 1D complex arrays
subroutine allocate_shared_memory_2dcmplx (fortran_array, mpi_win_loc, myrank, arrayshape)
 specific implementation of above interface for 2D complex arrays
subroutine allocate_shared_memory_3dcmplx (fortran_array, mpi_win_loc, myrank, arrayshape)
 specific implementation of above interface for 3D complex arrays
subroutine allocate_shared_memory_4dcmplx (fortran_array, mpi_win_loc, myrank, arrayshape)
 specific implementation of above interface for 4D complex arrays
subroutine, public deallocate_all_shared_memory ()

Variables

complex(kind=kind(0.d0)), dimension(:), pointer, save shm_mem_chunk_cmplx
real(kind=kind(0.d0)), dimension(:), pointer, save shm_mem_chunk_real
integer, dimension(:), allocatable, save mpi_wins_real
integer, dimension(:), allocatable, save mpi_wins_cmplx
integer, save nodecomm
integer, save noderank
integer, save head_idx_cmplx
integer, save head_idx_real
real(kind=kind(0.d0)), save chunk_size_gb
integer, save num_chunks_real
integer, save num_chunks_cmplx
integer(kind=8), dimension(1), save chunk_size_real
integer(kind=8), dimension(1), save chunk_size_cmplx
logical, save initialized =.false.
logical, save, public use_mpi_shm =.false.
logical, save public
logical, save variable
logical, save to
logical, save query
logical, save if
logical, save shared
logical, save memory
logical, save module
logical, save is
logical, save active

Detailed Description

This module provides an interface to allocate memory that is shared between different MPI jobs from a single communicator on the same node.

Author
ALF-project

Function/Subroutine Documentation

◆ allocate_shared_memory_1dcmplx()

subroutine mpi_shared_memory::allocate_shared_memory_1dcmplx ( complex (kind=kind(0.d0)), dimension(:), intent(inout), pointer fortran_array,
integer, intent(out) mpi_win_loc,
integer, intent(out) myrank,
integer, dimension(1), intent(in) arrayshape )
private

specific implementation of above interface for 1D complex arrays

Parameters
[out]fortran_array
[out]mpi_win_loc
[out]myrank
[in]arrayshape

Definition at line 426 of file mpi_shared_mem_mod_v2.F90.

◆ allocate_shared_memory_1dreal()

subroutine mpi_shared_memory::allocate_shared_memory_1dreal ( real (kind=kind(0.d0)), dimension(:), intent(inout), pointer fortran_array,
integer, intent(out) mpi_win_loc,
integer, intent(out) myrank,
integer, dimension(1), intent(in) arrayshape )
private

specific implementation of above interface for 1D real arrays

Parameters
[out]fortran_array
[out]mpi_win_loc
[out]myrank
[in]arrayshape

Definition at line 192 of file mpi_shared_mem_mod_v2.F90.

◆ allocate_shared_memory_2dcmplx()

subroutine mpi_shared_memory::allocate_shared_memory_2dcmplx ( complex (kind=kind(0.d0)), dimension(:,:), intent(inout), pointer fortran_array,
integer, intent(out) mpi_win_loc,
integer, intent(out) myrank,
integer, dimension(2), intent(in) arrayshape )
private

specific implementation of above interface for 2D complex arrays

Parameters
[out]fortran_array
[out]mpi_win_loc
[out]myrank
[in]arrayshape

Definition at line 469 of file mpi_shared_mem_mod_v2.F90.

◆ allocate_shared_memory_2dreal()

subroutine mpi_shared_memory::allocate_shared_memory_2dreal ( real (kind=kind(0.d0)), dimension(:,:), intent(inout), pointer fortran_array,
integer, intent(out) mpi_win_loc,
integer, intent(out) myrank,
integer, dimension(2), intent(in) arrayshape )
private

specific implementation of above interface for 2D real arrays

Parameters
[out]fortran_array
[out]mpi_win_loc
[out]myrank
[in]arrayshape

Definition at line 235 of file mpi_shared_mem_mod_v2.F90.

◆ allocate_shared_memory_3dcmplx()

subroutine mpi_shared_memory::allocate_shared_memory_3dcmplx ( complex (kind=kind(0.d0)), dimension(:,:,:), intent(inout), pointer fortran_array,
integer, intent(out) mpi_win_loc,
integer, intent(out) myrank,
integer, dimension(3), intent(in) arrayshape )
private

specific implementation of above interface for 3D complex arrays

Parameters
[out]fortran_array
[out]mpi_win_loc
[out]myrank
[in]arrayshape

Definition at line 513 of file mpi_shared_mem_mod_v2.F90.

◆ allocate_shared_memory_3dreal()

subroutine mpi_shared_memory::allocate_shared_memory_3dreal ( real (kind=kind(0.d0)), dimension(:,:,:), intent(inout), pointer fortran_array,
integer, intent(out) mpi_win_loc,
integer, intent(out) myrank,
integer, dimension(3), intent(in) arrayshape )
private

specific implementation of above interface for 3D real arrays

Parameters
[out]fortran_array
[out]mpi_win_loc
[out]myrank
[in]arrayshape

Definition at line 278 of file mpi_shared_mem_mod_v2.F90.

◆ allocate_shared_memory_4dcmplx()

subroutine mpi_shared_memory::allocate_shared_memory_4dcmplx ( complex (kind=kind(0.d0)), dimension(:,:,:,:), intent(inout), pointer fortran_array,
integer, intent(out) mpi_win_loc,
integer, intent(out) myrank,
integer, dimension(4), intent(in) arrayshape )
private

specific implementation of above interface for 4D complex arrays

Parameters
[out]fortran_array
[out]mpi_win_loc
[out]myrank
[in]arrayshape

Definition at line 557 of file mpi_shared_mem_mod_v2.F90.

◆ allocate_shared_memory_4dreal()

subroutine mpi_shared_memory::allocate_shared_memory_4dreal ( real (kind=kind(0.d0)), dimension(:,:,:,:), intent(inout), pointer fortran_array,
integer, intent(out) mpi_win_loc,
integer, intent(out) myrank,
integer, dimension(4), intent(in) arrayshape )
private

specific implementation of above interface for 4D real arrays

Parameters
[out]fortran_array
[out]mpi_win_loc
[out]myrank
[in]arrayshape

Definition at line 322 of file mpi_shared_mem_mod_v2.F90.

◆ allocate_shm_chunk_cmplx()

subroutine mpi_shared_memory::allocate_shm_chunk_cmplx
private

internal helper routine that allocates chunks of shared MPI complex memory that can be carved out and distributed

Definition at line 364 of file mpi_shared_mem_mod_v2.F90.

◆ allocate_shm_chunk_real()

subroutine mpi_shared_memory::allocate_shm_chunk_real
private

internal helper routine that allocates chunks of shared MPI memory that can be carved out and distributed

Definition at line 131 of file mpi_shared_mem_mod_v2.F90.

◆ deallocate_all_shared_memory()

subroutine, public mpi_shared_memory::deallocate_all_shared_memory

Definition at line 593 of file mpi_shared_mem_mod_v2.F90.

◆ mpi_shared_memory_init()

subroutine, public mpi_shared_memory::mpi_shared_memory_init ( integer, intent(in) mpi_communicator,
real(kind=kind(0.d0)), intent(in) chunk_size )

initializes memory manager; can be called without MPI present. Does nothing if compiled without MPI

Parameters
[in]mpi_communicator
[in]chunk_size(in GB)

Definition at line 98 of file mpi_shared_mem_mod_v2.F90.

Variable Documentation

◆ active

logical, save mpi_shared_memory::active
private

Definition at line 67 of file mpi_shared_mem_mod_v2.F90.

◆ chunk_size_cmplx

integer(kind=8), dimension(1), save mpi_shared_memory::chunk_size_cmplx
private

Definition at line 65 of file mpi_shared_mem_mod_v2.F90.

◆ chunk_size_gb

real (kind=kind(0.d0)), save mpi_shared_memory::chunk_size_gb
private

Definition at line 63 of file mpi_shared_mem_mod_v2.F90.

◆ chunk_size_real

integer(kind=8), dimension(1), save mpi_shared_memory::chunk_size_real
private

Definition at line 65 of file mpi_shared_mem_mod_v2.F90.

◆ head_idx_cmplx

integer, save mpi_shared_memory::head_idx_cmplx
private

Definition at line 62 of file mpi_shared_mem_mod_v2.F90.

◆ head_idx_real

integer, save mpi_shared_memory::head_idx_real
private

Definition at line 62 of file mpi_shared_mem_mod_v2.F90.

◆ if

logical, save mpi_shared_memory::if
private

Definition at line 67 of file mpi_shared_mem_mod_v2.F90.

◆ initialized

logical, save mpi_shared_memory::initialized =.false.
private

Definition at line 66 of file mpi_shared_mem_mod_v2.F90.

◆ is

logical, save mpi_shared_memory::is
private

Definition at line 67 of file mpi_shared_mem_mod_v2.F90.

◆ memory

logical, save mpi_shared_memory::memory
private

Definition at line 67 of file mpi_shared_mem_mod_v2.F90.

◆ module

logical, save mpi_shared_memory::module
private

Definition at line 67 of file mpi_shared_mem_mod_v2.F90.

◆ mpi_wins_cmplx

integer, dimension(:), allocatable, save mpi_shared_memory::mpi_wins_cmplx
private

Definition at line 60 of file mpi_shared_mem_mod_v2.F90.

◆ mpi_wins_real

integer, dimension(:), allocatable, save mpi_shared_memory::mpi_wins_real
private

Definition at line 60 of file mpi_shared_mem_mod_v2.F90.

◆ nodecomm

integer, save mpi_shared_memory::nodecomm
private

Definition at line 62 of file mpi_shared_mem_mod_v2.F90.

◆ noderank

integer, save mpi_shared_memory::noderank
private

Definition at line 62 of file mpi_shared_mem_mod_v2.F90.

◆ num_chunks_cmplx

integer, save mpi_shared_memory::num_chunks_cmplx
private

Definition at line 64 of file mpi_shared_mem_mod_v2.F90.

◆ num_chunks_real

integer, save mpi_shared_memory::num_chunks_real
private

Definition at line 64 of file mpi_shared_mem_mod_v2.F90.

◆ public

logical, save mpi_shared_memory::public
private

Definition at line 67 of file mpi_shared_mem_mod_v2.F90.

◆ query

logical, save mpi_shared_memory::query
private

Definition at line 67 of file mpi_shared_mem_mod_v2.F90.

◆ shared

logical, save mpi_shared_memory::shared
private

Definition at line 67 of file mpi_shared_mem_mod_v2.F90.

◆ shm_mem_chunk_cmplx

complex (kind=kind(0.d0)), dimension(:), pointer, save mpi_shared_memory::shm_mem_chunk_cmplx
private

Definition at line 57 of file mpi_shared_mem_mod_v2.F90.

◆ shm_mem_chunk_real

real (kind=kind(0.d0)), dimension(:), pointer, save mpi_shared_memory::shm_mem_chunk_real
private

Definition at line 58 of file mpi_shared_mem_mod_v2.F90.

◆ to

logical, save mpi_shared_memory::to
private

Definition at line 67 of file mpi_shared_mem_mod_v2.F90.

◆ use_mpi_shm

logical, save, public mpi_shared_memory::use_mpi_shm =.false.

Definition at line 67 of file mpi_shared_mem_mod_v2.F90.

◆ variable

logical, save mpi_shared_memory::variable
private

Definition at line 67 of file mpi_shared_mem_mod_v2.F90.