#include <sys/mman.h>
#include <unistd.h>
Go to the source code of this file.
#define DIRTY_THRESHOLD_GB 70 |
template<typename Vector >
void advise_vector_rand |
( |
Vector & |
vec | ) |
|
Definition at line 76 of file cache_utilities.hpp.
80 int t = madvise(addr, length, MADV_RANDOM);
size_t get_length(Vector &vec)
char * get_address(Vector &vec)
bool check_dirty_pages |
( |
| ) |
|
Definition at line 209 of file cache_utilities.hpp.
212 return (dirty_kb > dirty_threshold_kb);
uint32_t get_dirty_pages()
#define DIRTY_THRESHOLD_GB
template<typename Vector >
void flush_advise_vector |
( |
Vector & |
vec | ) |
|
Definition at line 111 of file cache_utilities.hpp.
115 int t = msync(addr, length, MS_SYNC);
117 int t2 = madvise(addr, length, MADV_DONTNEED);
119 t2 = madvise(addr, length, MADV_RANDOM);
size_t get_length(Vector &vec)
char * get_address(Vector &vec)
template<typename Vector >
void flush_advise_vector_dont_need |
( |
Vector & |
vec | ) |
|
Definition at line 86 of file cache_utilities.hpp.
90 int t = msync(addr, length, MS_SYNC);
92 int t2 = madvise(addr, length, MADV_DONTNEED);
size_t get_length(Vector &vec)
char * get_address(Vector &vec)
template<typename Vector >
void flush_vector |
( |
Vector & |
vec | ) |
|
Definition at line 102 of file cache_utilities.hpp.
106 int t = msync(addr, length, MS_SYNC);
size_t get_length(Vector &vec)
char * get_address(Vector &vec)
template<typename Vector >
char* get_address |
( |
Vector & |
vec | ) |
|
Definition at line 60 of file cache_utilities.hpp.
61 uintptr_t temp =
reinterpret_cast<uintptr_t
>(&(vec[0]));
63 return reinterpret_cast<char *
>(temp);
uint32_t get_dirty_pages |
( |
| ) |
|
uint32_t get_disk_utilization |
( |
| ) |
|
void get_io_stat_info |
( |
int & |
r, |
|
|
int & |
w |
|
) |
| |
template<typename Vector >
size_t get_length |
( |
Vector & |
vec | ) |
|
Definition at line 68 of file cache_utilities.hpp.
69 size_t length = vec.size() *
sizeof(vec[0]);
70 length += (4096 - length%4096);
Definition at line 188 of file cache_utilities.hpp.
189 printf(
"\n-----------------------------------------------------------------\n");
191 printf(
"-----------------------------------------------------------------\n");
void print_system_info |
( |
bool |
print_dimmap | ) |
|
Definition at line 141 of file cache_utilities.hpp.
142 printf(
"#################################################################\n");
143 printf(
"System Information\n");
144 printf(
"#################################################################\n");
147 printf(
"\n-----------------------------------------------------------------\n");
148 system(
"echo \"SLURM_NODELIST = $SLURM_NODELIST \"");
149 printf(
"-----------------------------------------------------------------\n");
151 printf(
"\n-----------------------------------------------------------------\n");
152 printf(
"Tuned Info:\n");
153 printf(
"-----------------------------------------------------------------\n");
154 system(
"echo \"/proc/sys/vm/dirty_ratio = $(cat /proc/sys/vm/dirty_ratio)\"");
155 system(
"echo \"/proc/sys/vm/dirty_background_ratio = $(cat /proc/sys/vm/dirty_background_ratio)\"");
156 system(
"echo \"/proc/sys/vm/dirty_expire_centisecs = $(cat /proc/sys/vm/dirty_expire_centisecs)\"");
158 printf(
"\n-----------------------------------------------------------------\n");
159 printf(
"df -h /l/ssd\n");
160 printf(
"-----------------------------------------------------------------\n");
161 system(
"df -h /l/ssd");
163 printf(
"\n-----------------------------------------------------------------\n");
164 printf(
"ls /l/ssd\n");
165 printf(
"-----------------------------------------------------------------\n");
169 printf(
"\n-----------------------------------------------------------------\n");
170 printf(
"io-stat -m | grep md0 2>&1\n");
171 printf(
"-----------------------------------------------------------------\n");
172 system(
"iostat -m | grep Device 2>&1");
173 system(
"iostat -m | grep md0 2>&1");
177 printf(
"\n-----------------------------------------------------------------\n");
178 system(
"echo \"/proc/di-mmap-runtimeA-stats = $(cat /proc/di-mmap-runtimeA-stats)\"");
179 printf(
"-----------------------------------------------------------------\n");