-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
154 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,31 @@ | ||
# Compile-time Options | ||
# Compile-Time Options | ||
|
||
There are some compile-time options (C/C++ macro) as follows to configure the behavior of Metall: | ||
|
||
- METALL_DEFAULT_CAPACITY=*bytes* | ||
- The default capacity of a segment/datastore. | ||
- This value is used when a user does not specify the capacity of a datastore when creating it. | ||
|
||
|
||
- METALL_SEGMENT_BLOCK_SIZE=*bytes* | ||
- The segment block size used by the default segment storage manager. | ||
- Metall allocates a backing file with this size. | ||
|
||
|
||
- METALL_DISABLE_FREE_FILE_SPACE | ||
- If defined, Metall does not free file space | ||
- If defined, Metall does not free file space. | ||
|
||
|
||
- METALL_DEFAULT_VM_RESERVE_SIZE=*bytes* | ||
- The default virtual memory reserve size | ||
- An internally defined value is used if 0 is specified | ||
- Wll be rounded up to a multiple of the system page size (e.g., 4 KB) internally | ||
- METALL_VERBOSE_SYSTEM_SUPPORT_WARNING | ||
- If defined, Metall shows warning messages at compile time if the system does not support important features. | ||
|
||
|
||
- METALL_INITIAL_SEGMENT_SIZE=*bytes* | ||
- The initial segment size | ||
- Use the internally defined value if 0 is specified | ||
- Wll be rounded up to a multiple of the system page size internally | ||
- METALL_DISABLE_CONCURRENCY | ||
- Disable concurrency support in Metall. This option is useful when Metall is used in a single-threaded application. | ||
- If this macro is defined, applications must not call Metall concurrently from multiple threads. | ||
- Even if this option is enabled, Metall still uses multiple threads for background tasks, such as synchronizing segment files. | ||
|
||
|
||
- METALL_FREE_SMALL_OBJECT_SIZE_HINT=*bytes* | ||
- Experimental option | ||
- If defined, Metall tries to free space when an object equal or larger than specified bytes is deallocated | ||
- Wll be rounded up to a multiple of the page size internally | ||
|
||
- If defined, Metall tries to free space when an object equal to or larger than the specified bytes is deallocated. | ||
- Wll be rounded up to a multiple of the page size internally. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// Copyright 2023 Lawrence Livermore National Security, LLC and other Metall | ||
// Project Developers. See the top-level COPYRIGHT file for details. | ||
// | ||
// SPDX-License-Identifier: (Apache-2.0 OR MIT) | ||
|
||
/// \file defs.hpp | ||
/// \brief Common definitions for Metall | ||
|
||
#ifndef METALL_DEFS_HPP | ||
#define METALL_DEFS_HPP | ||
|
||
/// \def METALL_MAX_CAPACITY | ||
/// The max capacity, i.e., the maximum total memory size a single Metall | ||
/// datastore can allocate. This value is a theoretical limit, and the actual | ||
/// limit is smaller than this value. | ||
#ifndef METALL_MAX_CAPACITY | ||
#define METALL_MAX_CAPACITY (1ULL << 48ULL) | ||
#endif | ||
|
||
#ifdef METALL_MAX_SEGMENT_SIZE | ||
#warning \ | ||
"METALL_MAX_SEGMENT_SIZE is deprecated. Use METALL_MAX_CAPACITY instead." | ||
#endif | ||
|
||
/// \def METALL_DEFAULT_CAPACITY | ||
/// The default Metall store capacity, i.e., the default maximum total memory | ||
/// size a single Metall datastore can allocate. This value is used when a new | ||
/// Metall datastore is created without the capacity parameter. This value is a | ||
/// theoretical limit, and the actual limit is smaller than this value. This | ||
/// value must be less than or equal to METALL_MAX_CAPACITY. | ||
#ifndef METALL_DEFAULT_CAPACITY | ||
#if defined(__linux__) | ||
#define METALL_DEFAULT_CAPACITY (1ULL << 43ULL) | ||
#else | ||
#define METALL_DEFAULT_CAPACITY (1ULL << 42ULL) | ||
#endif | ||
#endif | ||
|
||
#ifdef METALL_DEFAULT_VM_RESERVE_SIZE | ||
#warning \ | ||
"METALL_DEFAULT_VM_RESERVE_SIZE is deprecated. Use METALL_DEFAULT_CAPACITY instead." | ||
#endif | ||
|
||
/// \def METALL_SEGMENT_BLOCK_SIZE | ||
/// The segment block size the default segment storage use. | ||
#ifndef METALL_SEGMENT_BLOCK_SIZE | ||
#define METALL_SEGMENT_BLOCK_SIZE (1ULL << 28ULL) | ||
#endif | ||
|
||
#ifdef METALL_INITIAL_SEGMENT_SIZE | ||
#warning \ | ||
"METALL_INITIAL_SEGMENT_SIZE is deprecated. Use METALL_SEGMENT_BLOCK_SIZE instead." | ||
#endif | ||
|
||
/// \def METALL_DISABLE_CONCURRENCY | ||
/// Disable concurrency support in Metall. If this macro is defined, | ||
/// applications must not call Metall concurrently from multiple threads. This | ||
/// option is useful when Metall is used in a single-threaded application. Even | ||
/// if this option is enabled, Metall still uses multiple threads for background | ||
/// tasks, such as synchronizing segment files. | ||
#ifdef DOXYGEN_SKIP | ||
#define METALL_DISABLE_CONCURRENCY | ||
#endif | ||
|
||
#endif // METALL_DEFS_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.