tlds
Transactional Operations for Linked Data Structures
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
bmconfig.hpp
Go to the documentation of this file.
1 /**
2  * Copyright (C) 2011
3  * University of Rochester Department of Computer Science
4  * and
5  * Lehigh University Department of Computer Science and Engineering
6  *
7  * License: Modified BSD
8  * Please see the file LICENSE.RSTM for licensing information
9  */
10 
11 #ifndef BMCONFIG_HPP__
12 #define BMCONFIG_HPP__
13 
14 #include <stm/config.h>
15 #include <stdint.h>
16 #include <iostream>
17 
18 /**
19  * Standard benchmark configuration globals
20  */
21 struct Config
22 {
23  /*** THESE GET WRITTEN EARLY ***/
24  std::string bmname;
25  uint32_t duration; // in seconds
26  uint32_t execute; // in transactions
27  uint32_t threads; // number of threads
28  uint32_t nops_after_tx; // self-explanatory
29  uint32_t elements; // elements in data structure
30  uint32_t lookpct; // lookup percent
31  uint32_t inspct; // insert percent
32  uint32_t sets; // number of sets to create
33  uint32_t ops; // operations per transaction
34 
35  /*** THESE GET UPDATED LATER ***/
36  volatile uint64_t time;
37  volatile bool running;
38  volatile uint32_t txcount;
39 
40  Config();
41 };
42 
43 extern Config CFG TM_ALIGN(64);
44 
45 /** BENCHMARKS IMPLEMENT THE FOLLOWING FUNCTIONS */
46 
47 /*** Initialize the counter */
48 void bench_init();
49 
50 /*** Run a bunch of increment transactions */
51 void bench_test(uintptr_t, uint32_t*);
52 
53 /*** Ensure the final state of the benchmark satisfies all invariants */
54 bool bench_verify();
55 
56 /*** arg reparser */
57 void bench_reparse();
58 
59 #endif // BMCONFIG_HPP__
Config()
Definition: bmharness.cpp:26
uint32_t nops_after_tx
Definition: bmconfig.hpp:28
uint32_t elements
Definition: bmconfig.hpp:29
bool bench_verify()
Definition: CounterBench.cpp:74
void bench_init()
Definition: CounterBench.cpp:57
uint32_t ops
Definition: bmconfig.hpp:33
uint32_t duration
Definition: bmconfig.hpp:25
uint32_t execute
Definition: bmconfig.hpp:26
uint32_t sets
Definition: bmconfig.hpp:32
void bench_test(uintptr_t, uint32_t *)
Definition: CounterBench.cpp:64
uint32_t inspct
Definition: bmconfig.hpp:31
uint32_t threads
Definition: bmconfig.hpp:27
std::string bmname
Definition: bmconfig.hpp:24
volatile bool running
Definition: bmconfig.hpp:37
volatile uint64_t time
Definition: bmconfig.hpp:36
Definition: bmconfig.hpp:21
void bench_reparse()
Definition: CounterBench.cpp:89
Config CFG TM_ALIGN(64)
uint32_t lookpct
Definition: bmconfig.hpp:30
volatile uint32_t txcount
Definition: bmconfig.hpp:38