blob: b6a2bf5a58397eb1c7608ae7c1a779a0650f0f19 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
/*******************************************************************************
* Copyright (c) 2006 International Business Machines Corporation. *
* All rights reserved. This program and the accompanying materials *
* are made available under the terms of the Common Public License v1.0 *
* which accompanies this distribution, and is available at *
* http://www.opensource.org/licenses/cpl1.0.php *
* *
* Contributors: *
* Douglas M. Pase - initial API and implementation *
*******************************************************************************/
//
// Configuration
//
// Include guard
#if !defined(Experiment_h)
#define Experiment_h
// Local includes
#include "Chain.h"
#include "Types.h"
//
// Class definition
//
class Experiment {
public:
Experiment();
~Experiment();
int parse_args(int argc, char* argv[]);
int64 parse_number(const char* s);
float parse_real(const char* s);
const char* placement();
const char* access();
// fundamental parameters
int64 pointer_size; // number of bytes in a pointer
int64 bytes_per_line; // working set cache line size (bytes)
int64 links_per_line; // working set cache line size (links)
int64 bytes_per_page; // working set page size (in bytes)
int64 lines_per_page; // working set page size (in lines)
int64 links_per_page; // working set page size (in links)
int64 bytes_per_chain; // working set chain size (bytes)
int64 lines_per_chain; // working set chain size (lines)
int64 links_per_chain; // working set chain size (links)
int64 pages_per_chain; // working set chain size (pages)
int64 bytes_per_thread; // thread working set size (bytes)
int64 chains_per_thread;// memory loading per thread
int64 num_threads; // number of threads in the experiment
int64 bytes_per_test; // test working set size (bytes)
int64 busy_cycles; // processing cycles
bool prefetch; // use of prefetching
float seconds; // number of seconds per experiment
int64 iterations; // number of iterations per experiment
int64 experiments; // number of experiments per test
enum { CSV, BOTH, HEADER, TABLE }
output_mode; // results output mode
enum { RANDOM, STRIDED, STREAM }
access_pattern; // memory access pattern
int64 stride;
enum { LOCAL, XOR, ADD, MAP }
numa_placement; // memory allocation mode
int64 offset_or_mask;
char* placement_map;
// maps threads and chains to numa domains
int32* thread_domain; // thread_domain[thread]
int32** chain_domain; // chain_domain[thread][chain]
int32 numa_max_domain; // highest numa domain id
int32 num_numa_domains; // number of numa domains
char** random_state; // random state for each thread
int strict; // strictly adhere to user input, or fail
const static int32 DEFAULT_POINTER_SIZE = sizeof(Chain);
const static int32 DEFAULT_BYTES_PER_LINE = 64;
const static int32 DEFAULT_LINKS_PER_LINE = DEFAULT_BYTES_PER_LINE / DEFAULT_POINTER_SIZE;
const static int32 DEFAULT_BYTES_PER_PAGE = 4096;
const static int32 DEFAULT_LINES_PER_PAGE = DEFAULT_BYTES_PER_PAGE / DEFAULT_BYTES_PER_LINE;
const static int32 DEFAULT_LINKS_PER_PAGE = DEFAULT_LINES_PER_PAGE * DEFAULT_LINKS_PER_LINE;
const static int32 DEFAULT_PAGES_PER_CHAIN = 4096;
const static int32 DEFAULT_BYTES_PER_CHAIN = DEFAULT_BYTES_PER_PAGE * DEFAULT_PAGES_PER_CHAIN;
const static int32 DEFAULT_LINES_PER_CHAIN = DEFAULT_LINES_PER_PAGE * DEFAULT_PAGES_PER_CHAIN;
const static int32 DEFAULT_LINKS_PER_CHAIN = DEFAULT_LINES_PER_CHAIN * DEFAULT_BYTES_PER_LINE / DEFAULT_POINTER_SIZE;
const static int32 DEFAULT_CHAINS_PER_THREAD = 1;
const static int32 DEFAULT_BYTES_PER_THREAD = DEFAULT_BYTES_PER_CHAIN * DEFAULT_CHAINS_PER_THREAD;
const static int32 DEFAULT_THREADS = 1;
const static int32 DEFAULT_BYTES_PER_TEST = DEFAULT_BYTES_PER_THREAD * DEFAULT_THREADS;
const static int32 DEFAULT_BUSY_CYCLES = 0;
const static int32 DEFAULT_SECONDS = 1;
const static int32 DEFAULT_ITERATIONS = 0;
const static int32 DEFAULT_EXPERIMENTS = 1;
const static int32 DEFAULT_OUTPUT_MODE = 1;
const static bool DEFAULT_PREFETCH = false;
void alloc_local();
void alloc_xor();
void alloc_add();
void alloc_map();
void print();
private:
};
#endif
|