resources_t Derived Type

type, public :: resources_t

Container for calculation resources

This type bundles all resources needed by calculation methods. Currently holds MPI communicators, but can be extended to include BLAS providers, basis readers, and other shared resources.


Inherits

type~~resources_t~~InheritsGraph type~resources_t resources_t type~mpi_comms_t mpi_comms_t type~resources_t->type~mpi_comms_t mpi_comms comm_t comm_t type~mpi_comms_t->comm_t world_comm, node_comm

Inherited by

type~~resources_t~~InheritedByGraph type~resources_t resources_t type~many_body_expansion_t many_body_expansion_t type~many_body_expansion_t->type~resources_t resources type~gmbe_context_t gmbe_context_t type~gmbe_context_t->type~many_body_expansion_t type~mbe_context_t mbe_context_t type~mbe_context_t->type~many_body_expansion_t

Components

Type Visibility Attributes Name Initial
type(mpi_comms_t), public :: mpi_comms

MPI communicators

integer, public :: num_gpus = 0

Available GPUs

integer, public :: num_threads = 1

OpenMP threads

logical, public :: use_gpu = .false.

GPU acceleration flag


Type-Bound Procedures

procedure, public :: finalize => resources_finalize

  • private subroutine resources_finalize(this)

    Clean up resources

    Arguments

    Type IntentOptional Attributes Name
    class(resources_t), intent(inout) :: this

procedure, public :: init => resources_init

  • private subroutine resources_init(this)

    Initialize resources with default values

    Arguments

    Type IntentOptional Attributes Name
    class(resources_t), intent(inout) :: this

Source Code

   type :: resources_t
      !! Container for calculation resources
      !!
      !! This type bundles all resources needed by calculation methods.
      !! Currently holds MPI communicators, but can be extended to include
      !! BLAS providers, basis readers, and other shared resources.
      type(mpi_comms_t) :: mpi_comms   !! MPI communicators

      ! Hardware info
      integer :: num_threads = 1       !! OpenMP threads
      integer :: num_gpus = 0          !! Available GPUs
      logical :: use_gpu = .false.     !! GPU acceleration flag

      ! Future extensions:
      ! type(blas_provider_t), pointer :: blas => null()
      ! type(basis_reader_t), pointer :: basis_reader => null()
      ! type(memory_pool_t), pointer :: memory => null()
   contains
      procedure :: init => resources_init
      procedure :: finalize => resources_finalize
   end type resources_t