Reference documentation for deal.II version 9.4.1
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
Classes | Functions
Utilities::System Namespace Reference

Classes

struct  MemoryStats
 

Functions

double get_cpu_load ()
 
const std::string get_current_vectorization_level ()
 
void get_memory_stats (MemoryStats &stats)
 
std::string get_hostname ()
 
std::string get_time ()
 
std::string get_date ()
 
void posix_memalign (void **memptr, std::size_t alignment, std::size_t size)
 
bool job_supports_mpi ()
 

Detailed Description

A namespace for utility functions that probe system properties.

Function Documentation

◆ get_cpu_load()

double Utilities::System::get_cpu_load ( )

Return the CPU load as returned by "uptime". Note that the interpretation of this number depends on the actual number of processors in the machine. This is presently only implemented on Linux, using the /proc/loadavg pseudo-file, on other systems we simply return zero.

Definition at line 933 of file utilities.cc.

◆ get_current_vectorization_level()

const std::string Utilities::System::get_current_vectorization_level ( )

Return the instruction set extension for vectorization as described by DEAL_II_VECTORIZATION_WIDTH_IN_BITS in vectorization.h as a string. The list of possible return values is:

VECTORIZATION_LEVEL Return Value Width in bits
0 disabled 64
1 SSE2/AltiVec 128
2 AVX 256
3 AVX512 512

Definition at line 941 of file utilities.cc.

◆ get_memory_stats()

void Utilities::System::get_memory_stats ( MemoryStats stats)

Fill the stats structure with information about the memory consumption of this process. This is only implemented on Linux.

Definition at line 967 of file utilities.cc.

◆ get_hostname()

std::string Utilities::System::get_hostname ( )

Return the name of the host this process runs on.

Definition at line 1001 of file utilities.cc.

◆ get_time()

std::string Utilities::System::get_time ( )

Return the present time as HH:MM:SS.

Definition at line 1016 of file utilities.cc.

◆ get_date()

std::string Utilities::System::get_date ( )

Return the present date as YYYY/MM/DD. MM and DD may be either one or two digits.

Definition at line 1032 of file utilities.cc.

◆ posix_memalign()

void Utilities::System::posix_memalign ( void **  memptr,
std::size_t  alignment,
std::size_t  size 
)

Call the system function posix_memalign, or a replacement function if not available, to allocate memory with a certain minimal alignment. The first argument will then return a pointer to this memory block that can be released later on through a standard free call.

Parameters
memptrThe address of a pointer variable that will after this call point to the allocated memory.
alignmentThe minimal alignment of the memory block, in bytes.
sizeThe size of the memory block to be allocated, in bytes.
Note
This function checks internally for error codes, rather than leaving this task to the calling site.

Definition at line 1047 of file utilities.cc.

◆ job_supports_mpi()

bool Utilities::System::job_supports_mpi ( )

Definition at line 1066 of file utilities.cc.