votca 2026-dev
Loading...
Searching...
No Matches
memorybudget.h
Go to the documentation of this file.
1/*
2 * Copyright 2009-2026 The VOTCA Development Team
3 * (http://www.votca.org)
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License")
6 *
7 * You may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 */
19
20#pragma once
21#ifndef VOTCA_XTP_MEMORYBUDGET_H
22#define VOTCA_XTP_MEMORYBUDGET_H
23
24// Standard includes
25#include <string>
26
27// VOTCA includes
28#include <votca/tools/types.h>
29
30namespace votca {
31namespace xtp {
32
46 public:
48 static void Set(double total_gb, Index concurrent_jobs = 1);
49 static void SetConcurrentJobs(Index concurrent_jobs);
50 static bool Given() { return total_bytes_ > 0.0; }
51 static double DefaultAllowanceBytes() { return 4e9; }
52
54 static double JobBudgetBytes();
55
60 static double AvailableBytes();
61
63 static double ResidentBytes();
64
66 static double PeakResidentBytes();
67
70 static std::string Usage();
71
73 static std::string Describe();
74
75 private:
76 static double total_bytes_;
78};
79
80} // namespace xtp
81} // namespace votca
82
83#endif // VOTCA_XTP_MEMORYBUDGET_H
Memory the user grants the process (–memory, GB), for choices that trade memory for speed (caches,...
static std::string Usage()
static double PeakResidentBytes()
Peak resident memory of the process so far (-1 if unknown).
static std::string Describe()
e.g. "budget 400 GB, 46.1 GB in use" or "no --memory given"
static void SetConcurrentJobs(Index concurrent_jobs)
static double DefaultAllowanceBytes()
static Index concurrent_jobs_
static void Set(double total_gb, Index concurrent_jobs=1)
total_gb <= 0: no budget given
static double ResidentBytes()
Resident memory of the process (-1 if unknown on this platform).
static double AvailableBytes()
static double total_bytes_
static double JobBudgetBytes()
The share of the budget of one job (0 without a budget).
Provides a means for comparing floating point numbers.
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26