source: doc/theses/mike_brooks_MMath/benchmarks/list/fx-cfa-GENERAL.h@ ac9c0ee8

Last change on this file since ac9c0ee8 was 9d3dc40, checked in by Michael Brooks <mlbrooks@…>, 3 months ago

Various changes motivated by improving CFA score on len-1 queues.

No such CFA score improvement achieved. Each change helped only on stripped-down, "try to isolate an important factor" tests. Generally, the changes are benign refactorings. (Results substantiating "don't hurt" are forthcoming.)

Libcfa changes are

  • move a read action from between the memory breaks to before them
  • make the memory breaks conditionally excluded (default included, as before)

Harness changes are

  • add width, a compiled-in number of lists to use in round-robin order; defaults to 1, which is what was happening all along
  • make the analysis scripts tolerate (so far, ignore) the width column
  • rename CLI arg NumNodes to Length (now NumNodes is Length * Width)
  • factor core testing loops into helper function runtest
  • switch to signal-based termination (and add uC++ work-around)
  • put "iterator threading" into ITERS_SAVE, joining preexisting "save iter into elem's self ref"; make iterator threading conditional on iterators-active
  • disable insertion loop counter and obs_*-variable declarations (and thus writes) when observation disabled
  • generalize observation to work on multiple lists
  • make observation and assertion-check-enabled mode work on stripped CFA list implementations like tagging-disabled
  • through this observation, ensure correctness of multi-list versions
  • Property mode set to 100644
File size: 2.7 KB
Line 
1// #define BFX_INTRUSION(S) inline dlink(S);
2// #define BFX_EXTRUSION_DECL(S)
3// #define BFX_EXTRUSION_FOLLOWUP(S) P9_EMBEDDED( S, dlink(S) )
4// #define BFX_LIST_HEAD_T(S) dlist(S)
5// #define BFX_LISTED_ELEM_T(S) S*
6
7// #define BFX_INSERT_FIRST(S, lst, item) (insert_first (lst, item), (S*)&(item))
8// #define BFX_INSERT_LAST(S, lst, item) (insert_last (lst, item), (S*)&(item))
9// #define BFX_INSERT_BEFORE(S, lst, item, refIter) (insert_before(*refIter, item), (S*)&(item))
10// #define BFX_INSERT_AFTER(S, lst, item, refIter) (insert_after (*refIter, item), (S*)&(item))
11// #define BFX_REMOVE_FIRST(S, lst) pop_front(lst)
12// #define BFX_REMOVE_LAST(S, lst) pop_back(lst)
13// #define BFX_REMOVE_HERE(S, lst, refIter) remove(*refIter)
14// #define BFX_INIT(S, lst)
15
16// #define BFX_GET_AFTER(S, lst, iter) (&(*iter)`next)
17// #define BFX_GET_BEFORE(S, lst, iter) (&(*iter)`prev)
18// #define BFX_IS_VALID_POS(S, lst, iter) ((iter)!=NULL)
19// #define BFX_DEREF_POS(S, lst, iter) (iter)
20
21#define BFX_INTRUSION(S) inline dlink(S);
22#define BFX_EXTRUSION_DECL(S)
23#define BFX_EXTRUSION_FOLLOWUP(S) P9_EMBEDDED( S, dlink(S) )
24#define BFX_LIST_HEAD_T(S) dlist(S)
25#define BFX_LISTED_ELEM_T(S) S*
26
27#define BFX_INSERT_FIRST(S, lst, item) (insert_first (lst, item), (S*)&(item))
28#define BFX_INSERT_LAST(S, lst, item) (insert_last (lst, item), (S*)&(item))
29#define BFX_INSERT_BEFORE(S, lst, item, refIter) (insert_before(*refIter, item), (S*)&(item))
30#define BFX_INSERT_AFTER(S, lst, item, refIter) (insert_after (*refIter, item), (S*)&(item))
31#define BFX_REMOVE_FIRST(S, lst) remove_first(lst)
32#define BFX_REMOVE_LAST(S, lst) remove_last(lst)
33#define BFX_REMOVE_HERE(S, lst, refIter) remove(*refIter)
34#define BFX_INIT(S, lst)
35
36#define BFX_GET_FIRST(S, lst) ( & first(lst) )
37#define BFX_GET_AFTER(S, lst, iter) ( & next( * (iter) ) )
38#define BFX_GET_BEFORE(S, lst, iter) ( & prev( * (iter) ) )
39#define BFX_DEREF_POS(S, lst, iter) (iter)
40
41#ifdef __EXPERIMENTAL_DISABLE_OTAG__
42// alt list impl, no tagging: next/prev accessors don't known when "no more elems"
43// so hack around it in harness: look for leaked abstraction of list head being reported as a regular neighbour
44#define BFX_IS_VALID_POS(S, lst, iter) ((void*)(iter)!=(void*)(&lst))
45#else
46// normal list impl: next/prev accessors return *0p on "no more elems"
47#define BFX_IS_VALID_POS(S, lst, iter) ((iter)!=NULL)
48#endif
Note: See TracBrowser for help on using the repository browser.