runner.h 2.35 KB
Newer Older
1
/*******************************************************************************
2
 * This file is part of SWIFT.
3
 * Copyright (c) 2012 Pedro Gonnet (pedro.gonnet@durham.ac.uk)
4
5
6
7
 *                    Matthieu Schaller (matthieu.schaller@durham.ac.uk)
 *               2015 Peter W. Draper (p.w.draper@durham.ac.uk)
 *               2016 John A. Regan (john.a.regan@durham.ac.uk)
 *                    Tom Theuns (tom.theuns@durham.ac.uk)
8
 *
9
10
11
12
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
13
 *
14
15
16
17
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
18
 *
19
20
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
 *
22
 ******************************************************************************/
23
24
#ifndef SWIFT_RUNNER_H
#define SWIFT_RUNNER_H
25

James Willis's avatar
James Willis committed
26
27
#include "cache.h"

28
extern const double runner_shift[13][3];
29
extern const char runner_flip[27];
Pedro Gonnet's avatar
Pedro Gonnet committed
30

31
32
33
struct cell;
struct engine;

34
35
36
/**
 * @brief A struct representing a runner's thread and its data.
 */
Pedro Gonnet's avatar
Pedro Gonnet committed
37
struct runner {
Pedro Gonnet's avatar
Pedro Gonnet committed
38

39
  /*! The id of this thread. */
40
  int id;
Pedro Gonnet's avatar
Pedro Gonnet committed
41

42
  /*! The actual thread which it is running. */
43
  pthread_t thread;
44

45
  /*! The queue to use to get tasks. */
46
  int cpuid, qid;
Pedro Gonnet's avatar
Pedro Gonnet committed
47

48
  /*! The engine owing this runner. */
49
  struct engine *e;
James Willis's avatar
James Willis committed
50
51
52
  
  /*! The particle cache of this runner. */
  struct cache par_cache;
53
};
Pedro Gonnet's avatar
Pedro Gonnet committed
54
55

/* Function prototypes. */
56
57
void runner_do_ghost(struct runner *r, struct cell *c, int timer);
void runner_do_extra_ghost(struct runner *r, struct cell *c, int timer);
58
59
60
void runner_do_sort(struct runner *r, struct cell *c, int flag, int clock);
void runner_do_kick(struct runner *r, struct cell *c, int timer);
void runner_do_init(struct runner *r, struct cell *c, int timer);
61
void runner_do_cooling(struct runner *r, struct cell *c, int timer);
62
void runner_do_grav_external(struct runner *r, struct cell *c, int timer);
63
void *runner_main(void *data);
Pedro Gonnet's avatar
Pedro Gonnet committed
64
void runner_do_drift_mapper(void *map_data, int num_elements, void *extra_data);
65
66

#endif /* SWIFT_RUNNER_H */