Commit 3aee3853 authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Merge branch 'runner_cleanup' into 'master'

Cleaned-up runner.h to avoid include problems in the standalone tests.



See merge request !65
parents 3be87eb5 16cb8b14
......@@ -51,16 +51,7 @@
#endif
#include "runner_iact_grav.h"
/* Convert cell location to ID. */
#define cell_getid(cdim, i, j, k) \
((int)(k) + (cdim)[2] * ((int)(j) + (cdim)[1] * (int)(i)))
/* Histograms bins. */
long long int runner_hist_bins[runner_hist_N];
/* The counters. */
int runner_counter[runner_counter_count];
/* Orientation of the cell pairs */
const float runner_shift[13 * 3] = {
5.773502691896258e-01, 5.773502691896258e-01, 5.773502691896258e-01,
7.071067811865475e-01, 7.071067811865475e-01, 0.0,
......@@ -75,6 +66,8 @@ const float runner_shift[13 * 3] = {
0.0, 1.0, 0.0,
0.0, 7.071067811865475e-01, -7.071067811865475e-01,
0.0, 0.0, 1.0, };
/* Does the axis need flipping ? */
const char runner_flip[27] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
......
......@@ -19,53 +19,12 @@
#ifndef SWIFT_RUNNER_H
#define SWIFT_RUNNER_H
/* Some standard headers. */
#include <pthread.h>
/* Includes. */
#include "cell.h"
#include "inline.h"
/* Forward-declare the engine type to avoid cyclic header dependencies. */
struct engine;
/* Some constants/flags. */
#define runner_prefetch 0
/* SID stuff. */
extern const char runner_flip[];
/* Counters. */
enum runner_counters {
runner_counter_swap = 0,
runner_counter_stall,
runner_counter_steal_stall,
runner_counter_steal_empty,
runner_counter_keep,
runner_counter_iact,
runner_counter_count,
};
extern int runner_counter[runner_counter_count];
/* Counter macros. */
#ifdef COUNTER
#define COUNT(c) (__sync_add_and_fetch(&runner_counter[c], 1))
#else
#define COUNT(c)
#endif
/* Histogram functions. */
#define runner_hist_a 1.0
#define runner_hist_b 100.0
#define runner_hist_N 99
extern long long int runner_hist_bins[runner_hist_N];
#define runner_hist_hit(x) \
__sync_add_and_fetch( \
&runner_hist_bins[(int)fmax( \
0.0, fmin(runner_hist_N - 1, ((x) - runner_hist_a) / \
(runner_hist_b - runner_hist_a) * \
runner_hist_N))], \
1)
extern const float runner_shift[13 * 3];
extern const char runner_flip[27];
/* A struct representing a runner's thread and its data. */
struct runner {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment