ALF  dev.
A QMC Code for fermionic models
Data Types | Functions/Subroutines | Variables
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 More...
 
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 More...
 
subroutine allocate_shared_memory_2dreal (fortran_array, mpi_win_loc, myrank, arrayshape)
 specific implementation of above interface for 2D real arrays More...
 
subroutine allocate_shared_memory_3dreal (fortran_array, mpi_win_loc, myrank, arrayshape)
 specific implementation of above interface for 3D real arrays More...
 
subroutine allocate_shared_memory_4dreal (fortran_array, mpi_win_loc, myrank, arrayshape)
 specific implementation of above interface for 4D real arrays More...
 
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 More...
 
subroutine allocate_shared_memory_2dcmplx (fortran_array, mpi_win_loc, myrank, arrayshape)
 specific implementation of above interface for 2D complex arrays More...
 
subroutine allocate_shared_memory_3dcmplx (fortran_array, mpi_win_loc, myrank, arrayshape)
 specific implementation of above interface for 3D complex arrays More...
 
subroutine allocate_shared_memory_4dcmplx (fortran_array, mpi_win_loc, myrank, arrayshape)
 specific implementation of above interface for 4D complex arrays More...
 
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 427 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 193 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 470 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 236 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 514 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 279 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 558 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 323 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 99 of file mpi_shared_mem_mod_v2.F90.