votca 2026-dev
Loading...
Searching...
No Matches
votca::xtp::MemoryBudget Class Reference

Memory the user grants the process (–memory, GB), for choices that trade memory for speed (caches, batch sizes). More...

#include <memorybudget.h>

Static Public Member Functions

static void Set (double total_gb, Index concurrent_jobs=1)
 total_gb <= 0: no budget given
static void SetConcurrentJobs (Index concurrent_jobs)
static bool Given ()
static double DefaultAllowanceBytes ()
static double JobBudgetBytes ()
 The share of the budget of one job (0 without a budget).
static double AvailableBytes ()
static double ResidentBytes ()
 Resident memory of the process (-1 if unknown on this platform).
static double PeakResidentBytes ()
 Peak resident memory of the process so far (-1 if unknown).
static std::string Usage ()
static std::string Describe ()
 e.g. "budget 400 GB, 46.1 GB in use" or "no --memory given"

Static Private Attributes

static double total_bytes_ = 0.0
static Index concurrent_jobs_ = 1

Detailed Description

Memory the user grants the process (–memory, GB), for choices that trade memory for speed (caches, batch sizes).

The budget is the total for the process; with several jobs running concurrently in one process (xtp_parallel -t) each gets an equal share. It is advisory, as mem in Gaussian or maxcore in ORCA: it steers optional allocations, it does not limit the memory a calculation needs anyway.

Without a budget a fixed allowance of DefaultAllowanceBytes() is available for optional buffers, regardless of what the process already holds.

Definition at line 45 of file memorybudget.h.

Member Function Documentation

◆ AvailableBytes()

double votca::xtp::MemoryBudget::AvailableBytes ( )
static

Bytes one job may still allocate for optional buffers: its share of the budget minus its share of the resident memory of the process, minus a margin (5% of the share, at least 1 GB); without a budget the default allowance.

Definition at line 112 of file memorybudget.cc.

◆ DefaultAllowanceBytes()

double votca::xtp::MemoryBudget::DefaultAllowanceBytes ( )
inlinestatic

Definition at line 51 of file memorybudget.h.

◆ Describe()

std::string votca::xtp::MemoryBudget::Describe ( )
static

e.g. "budget 400 GB, 46.1 GB in use" or "no --memory given"

Definition at line 122 of file memorybudget.cc.

◆ Given()

bool votca::xtp::MemoryBudget::Given ( )
inlinestatic

Definition at line 50 of file memorybudget.h.

◆ JobBudgetBytes()

double votca::xtp::MemoryBudget::JobBudgetBytes ( )
static

The share of the budget of one job (0 without a budget).

Definition at line 65 of file memorybudget.cc.

◆ PeakResidentBytes()

double votca::xtp::MemoryBudget::PeakResidentBytes ( )
static

Peak resident memory of the process so far (-1 if unknown).

Definition at line 83 of file memorybudget.cc.

◆ ResidentBytes()

double votca::xtp::MemoryBudget::ResidentBytes ( )
static

Resident memory of the process (-1 if unknown on this platform).

Definition at line 69 of file memorybudget.cc.

◆ Set()

void votca::xtp::MemoryBudget::Set ( double total_gb,
Index concurrent_jobs = 1 )
static

total_gb <= 0: no budget given

Definition at line 56 of file memorybudget.cc.

◆ SetConcurrentJobs()

void votca::xtp::MemoryBudget::SetConcurrentJobs ( Index concurrent_jobs)
static

Definition at line 61 of file memorybudget.cc.

◆ Usage()

std::string votca::xtp::MemoryBudget::Usage ( )
static

e.g. "memory in use 203 GB, peak 231 GB" (empty if unknown), for the logs of the large steps

Definition at line 97 of file memorybudget.cc.

Member Data Documentation

◆ concurrent_jobs_

Index votca::xtp::MemoryBudget::concurrent_jobs_ = 1
staticprivate

Definition at line 77 of file memorybudget.h.

◆ total_bytes_

double votca::xtp::MemoryBudget::total_bytes_ = 0.0
staticprivate

Definition at line 76 of file memorybudget.h.


The documentation for this class was generated from the following files: