engine.h 19.1 KB
Newer Older
Pedro Gonnet's avatar
Pedro Gonnet committed
1
/*******************************************************************************
2
 * This file is part of SWIFT.
3
 * Copyright (c) 2012 Pedro Gonnet (pedro.gonnet@durham.ac.uk)
4
5
6
7
8
 *                    Matthieu Schaller (matthieu.schaller@durham.ac.uk)
 *               2015 Peter W. Draper (p.w.draper@durham.ac.uk)
 *                    Angus Lepper (angus.lepper@ed.ac.uk)
 *               2016 John A. Regan (john.a.regan@durham.ac.uk)
 *                    Tom Theuns (tom.theuns@durham.ac.uk)
9
 *
Pedro Gonnet's avatar
Pedro Gonnet committed
10
11
12
13
 * 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.
14
 *
Pedro Gonnet's avatar
Pedro Gonnet committed
15
16
17
18
 * 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.
19
 *
Pedro Gonnet's avatar
Pedro Gonnet committed
20
21
 * 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/>.
22
 *
Pedro Gonnet's avatar
Pedro Gonnet committed
23
 ******************************************************************************/
24
25
#ifndef SWIFT_ENGINE_H
#define SWIFT_ENGINE_H
Pedro Gonnet's avatar
Pedro Gonnet committed
26

27
28
29
30
31
32
33
34
/* Config parameters. */
#include "../config.h"

/* MPI headers. */
#ifdef WITH_MPI
#include <mpi.h>
#endif

Pedro Gonnet's avatar
Pedro Gonnet committed
35
/* Includes. */
36
#include "barrier.h"
37
#include "clocks.h"
38
#include "collectgroup.h"
Loikki's avatar
Loikki committed
39
#include "dump.h"
40
#include "mesh_gravity.h"
41
#include "output_options.h"
Matthieu Schaller's avatar
Matthieu Schaller committed
42
#include "parser.h"
43
#include "partition.h"
44
#include "potential.h"
Matthieu Schaller's avatar
Matthieu Schaller committed
45
#include "runner.h"
46
#include "scheduler.h"
Matthieu Schaller's avatar
Matthieu Schaller committed
47
48
49
#include "space.h"
#include "task.h"
#include "units.h"
50
#include "velociraptor_interface.h"
Pedro Gonnet's avatar
Pedro Gonnet committed
51

52
53
struct black_holes_properties;

54
55
56
/**
 * @brief The different policies the #engine can follow.
 */
57
58
enum engine_policy {
  engine_policy_none = 0,
59
60
61
62
  engine_policy_rand = (1 << 0),
  engine_policy_steal = (1 << 1),
  engine_policy_keep = (1 << 2),
  engine_policy_block = (1 << 3),
63
64
65
66
67
68
69
70
  engine_policy_cputight = (1 << 4),
  engine_policy_mpi = (1 << 5),
  engine_policy_setaffinity = (1 << 6),
  engine_policy_hydro = (1 << 7),
  engine_policy_self_gravity = (1 << 8),
  engine_policy_external_gravity = (1 << 9),
  engine_policy_cosmology = (1 << 10),
  engine_policy_drift_all = (1 << 11),
71
  engine_policy_reconstruct_mpoles = (1 << 12),
72
73
  engine_policy_temperature = (1 << 13),
  engine_policy_cooling = (1 << 14),
74
  engine_policy_stars = (1 << 15),
75
  engine_policy_structure_finding = (1 << 16),
Matthieu Schaller's avatar
Matthieu Schaller committed
76
  engine_policy_star_formation = (1 << 17),
James Willis's avatar
James Willis committed
77
  engine_policy_feedback = (1 << 18),
78
  engine_policy_black_holes = (1 << 19),
79
  engine_policy_fof = (1 << 20),
80
  engine_policy_timestep_limiter = (1 << 21),
Loic Hausammann's avatar
Loic Hausammann committed
81
82
  engine_policy_timestep_sync = (1 << 22),
  engine_policy_logger = (1 << 23),
83
  engine_policy_line_of_sight = (1 << 24),
84
};
85
#define engine_maxpolicy 25
Loic Hausammann's avatar
Loic Hausammann committed
86
extern const char *engine_policy_names[engine_maxpolicy + 1];
Pedro Gonnet's avatar
Pedro Gonnet committed
87

88
89
90
91
92
93
94
95
96
/**
 * @brief The different unusual events that can take place in a time-step.
 */
enum engine_step_properties {
  engine_step_prop_none = 0,
  engine_step_prop_rebuild = (1 << 0),
  engine_step_prop_redistribute = (1 << 1),
  engine_step_prop_repartition = (1 << 2),
  engine_step_prop_statistics = (1 << 3),
97
  engine_step_prop_snapshot = (1 << 4),
98
  engine_step_prop_restarts = (1 << 5),
99
  engine_step_prop_stf = (1 << 6),
100
101
102
  engine_step_prop_fof = (1 << 7),
  engine_step_prop_logger_index = (1 << 8),
  engine_step_prop_done = (1 << 9)
103
104
105
};

/* Some constants */
106
#define engine_maxproxies 64
107
#define engine_tasksreweight 1
108
#define engine_parts_size_grow 1.05
109
#define engine_max_proxy_centre_frac 0.2
110
#define engine_redistribute_alloc_margin 1.2
111
#define engine_rebuild_link_alloc_margin 1.2
112
#define engine_foreign_alloc_margin 1.05
113
114
#define engine_default_energy_file_name "energy"
#define engine_default_timesteps_file_name "timesteps"
115
116
#define engine_max_parts_per_ghost_default 1000
#define engine_max_sparts_per_ghost_default 1000
117
#define engine_max_parts_per_cooling_default 200
118
#define engine_star_resort_task_depth_default 2
119
#define engine_tasks_per_cell_margin 1.2
120
121
#define engine_default_stf_subdir_per_output "."
#define engine_default_snapshot_subdir "."
Pedro Gonnet's avatar
Pedro Gonnet committed
122

123
124
125
/**
 * @brief The rank of the engine as a global variable (for messages).
 */
126
127
extern int engine_rank;

128
129
130
/**
 * @brief The current step as a global variable (for messages).
 */
131
extern int engine_current_step;
132

Pedro Gonnet's avatar
Pedro Gonnet committed
133
134
135
/* Data structure for the engine. */
struct engine {

136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
  /* Number of threads on which to run. */
  int nr_threads;

  /* The space with which the runner is associated. */
  struct space *s;

  /* The runner's threads. */
  struct runner *runners;

  /* The running policy. */
  int policy;

  /* The task scheduler. */
  struct scheduler sched;

151
152
153
  /* Common threadpool for all the engine's tasks. */
  struct threadpool threadpool;

154
  /* The minimum and maximum allowed dt */
155
  double dt_min, dt_max;
156

157
158
159
160
161
162
  /* Maximum time-step allowed by the RMS condition in cosmology runs. */
  double dt_max_RMS_displacement;

  /* Dimensionless factor for the RMS time-step condition. */
  double max_RMS_displacement_factor;

163
  /* Time of the simulation beginning */
164
  double time_begin;
165
166

  /* Time of the simulation end */
167
  double time_end;
168
169

  /* The previous system time. */
170
  double time_old;
171
  integertime_t ti_old;
172
173

  /* The current system time. */
174
  double time;
175
  integertime_t ti_current;
176

177
178
179
  /* The highest active bin at this time */
  timebin_t max_active_bin;

180
181
182
  /* The lowest active bin at this time */
  timebin_t min_active_bin;

183
  /* Time step */
184
  double time_step;
185

186
  /* Time base */
187
188
  double time_base;
  double time_base_inv;
189

190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
  /* Minimal hydro ti_end for the next time-step */
  integertime_t ti_hydro_end_min;

  /* Maximal hydro ti_end for the next time-step */
  integertime_t ti_hydro_end_max;

  /* Maximal hydro ti_beg for the next time-step */
  integertime_t ti_hydro_beg_max;

  /* Minimal gravity ti_end for the next time-step */
  integertime_t ti_gravity_end_min;

  /* Maximal gravity ti_end for the next time-step */
  integertime_t ti_gravity_end_max;

  /* Maximal gravity ti_beg for the next time-step */
  integertime_t ti_gravity_beg_max;

208
209
210
211
212
213
214
215
216
  /* Minimal stars ti_end for the next time-step */
  integertime_t ti_stars_end_min;

  /* Maximal stars ti_end for the next time-step */
  integertime_t ti_stars_end_max;

  /* Maximal stars ti_beg for the next time-step */
  integertime_t ti_stars_beg_max;

217
218
219
220
221
222
223
224
  /* Minimal black holes ti_end for the next time-step */
  integertime_t ti_black_holes_end_min;

  /* Maximal black holes ti_end for the next time-step */
  integertime_t ti_black_holes_end_max;

  /* Maximal black holes ti_beg for the next time-step */
  integertime_t ti_black_holes_beg_max;
225

226
  /* Minimal overall ti_end for the next time-step */
227
  integertime_t ti_end_min;
228

229
  /* Maximal overall ti_end for the next time-step */
Matthieu Schaller's avatar
Matthieu Schaller committed
230
231
  integertime_t ti_end_max;

232
  /* Maximal overall ti_beg for the next time-step */
Matthieu Schaller's avatar
Matthieu Schaller committed
233
234
  integertime_t ti_beg_max;

235
  /* Number of particles updated in the previous step */
236
  long long updates, g_updates, s_updates, b_updates;
237

238
  /* Number of updates since the last rebuild */
239
240
241
  long long updates_since_rebuild;
  long long g_updates_since_rebuild;
  long long s_updates_since_rebuild;
242
  long long b_updates_since_rebuild;
243

244
  /* Star formation logger information */
245
  struct star_formation_history_accumulator sfh;
246

247
  /* Properties of the previous step */
248
  int step_props;
249

250
  /* Total numbers of particles in the system. */
251
252
253
254
  long long total_nr_parts;
  long long total_nr_gparts;
  long long total_nr_sparts;
  long long total_nr_bparts;
255
  long long total_nr_DM_background_gparts;
256

257
258
259
260
261
262
263
  /* Total numbers of cells (top-level and sub-cells) in the system. */
  long long total_nr_cells;

  /* Total numbers of tasks in the system. */
  long long total_nr_tasks;

  /* The total number of inhibited particles in the system. */
264
265
266
267
  long long nr_inhibited_parts;
  long long nr_inhibited_gparts;
  long long nr_inhibited_sparts;
  long long nr_inhibited_bparts;
268

Matthieu Schaller's avatar
Matthieu Schaller committed
269
270
#ifdef SWIFT_DEBUG_CHECKS
  /* Total number of particles removed from the system since the last rebuild */
271
272
273
274
  long long count_inhibited_parts;
  long long count_inhibited_gparts;
  long long count_inhibited_sparts;
  long long count_inhibited_bparts;
Matthieu Schaller's avatar
Matthieu Schaller committed
275
276
#endif

277
278
279
  /* Total mass in the simulation */
  double total_mass;

280
  /* The internal system of units */
281
  const struct unit_system *internal_units;
Matthieu Schaller's avatar
Matthieu Schaller committed
282

283
  /* Snapshot information */
284
285
286
  double a_first_snapshot;
  double time_first_snapshot;
  double delta_time_snapshot;
Loic Hausammann's avatar
Loic Hausammann committed
287

288
289
  /* Output_List for the snapshots */
  struct output_list *output_list_snapshots;
290
291
292
293

  /* Integer time of the next snapshot */
  integertime_t ti_next_snapshot;

294
  char snapshot_base_name[PARSER_MAX_LINE_SIZE];
295
  char snapshot_subdir[PARSER_MAX_LINE_SIZE];
296
  int snapshot_distributed;
297
  int snapshot_compression;
298
  int snapshot_int_time_label_on;
299
  int snapshot_invoke_stf;
300
301
  struct unit_system *snapshot_units;
  int snapshot_output_count;
302

303
  /* Structure finding information */
304
305
306
  double a_first_stf_output;
  double time_first_stf_output;
  double delta_time_stf;
Matthieu Schaller's avatar
Matthieu Schaller committed
307

308
309
  /* Output_List for the structure finding */
  struct output_list *output_list_stf;
Loic Hausammann's avatar
Loic Hausammann committed
310

311
  /* Integer time of the next stf output */
312
  integertime_t ti_next_stf;
Matthieu Schaller's avatar
Matthieu Schaller committed
313

314
  char stf_config_file_name[PARSER_MAX_LINE_SIZE];
315
  char stf_base_name[PARSER_MAX_LINE_SIZE];
316
  char stf_subdir_per_output[PARSER_MAX_LINE_SIZE];
317
  int stf_output_count;
318

319
320
321
322
323
324
325
326
  /* FoF black holes seeding information */
  double a_first_fof_call;
  double time_first_fof_call;
  double delta_time_fof;

  /* Integer time of the next FoF black holes seeding call */
  integertime_t ti_next_fof;

327
328
  /* FOF information */
  int run_fof;
329

330
  /* Statistics information */
331
332
333
334
  double a_first_statistics;
  double time_first_statistics;
  double delta_time_statistics;

335
336
  /* Output_List for the stats */
  struct output_list *output_list_stats;
Loic Hausammann's avatar
Format    
Loic Hausammann committed
337

338
339
340
341
  /* Integer time of the next statistics dump */
  integertime_t ti_next_stats;

  /* File handle for the statistics */
342
  FILE *file_stats;
Pedro Gonnet's avatar
Pedro Gonnet committed
343

344
  /* File handle for the timesteps information */
Matthieu Schaller's avatar
Matthieu Schaller committed
345
346
  FILE *file_timesteps;

347
348
349
  /* File handle for the SFH logger file */
  FILE *sfh_logger;

350
  /* The current step number. */
351
  int step;
352
353

  /* Data for the threads' barrier. */
354
355
  swift_barrier_t wait_barrier;
  swift_barrier_t run_barrier;
356
357
358
359
360
361
362
363

  /* ID of the node this engine lives on. */
  int nr_nodes, nodeID;

  /* Proxies for the other nodes in this simulation. */
  struct proxy *proxies;
  int nr_proxies, *proxy_ind;

364
365
  /* Tic/toc at the start/end of a step. */
  ticks tic_step, toc_step;
366

367
#ifdef WITH_MPI
368
369
370
  /* CPU times that the tasks used in the last step. */
  double usertime_last_step;
  double systime_last_step;
371

372
373
  /* Step of last repartition. */
  int last_repartition;
374
375
376
377

  /* Use synchronous redistributes. */
  int syncredist;

378
379
#endif

380
381
  /* Wallclock time of the last time-step */
  float wallclock_time;
382

383
384
385
  /* Are we in the process of restaring a simulation? */
  int restarting;

386
  /* Force the engine to rebuild? */
387
  int forcerebuild;
388
389
390

  /* Force the engine to repartition ? */
  int forcerepart;
391
  struct repartition *reparttype;
392

Loic Hausammann's avatar
Loic Hausammann committed
393
  /* The particle logger */
Loic Hausammann's avatar
Loic Hausammann committed
394
  struct logger_writer *logger;
lhausamm's avatar
lhausamm committed
395

396
397
398
399
400
  /* How many steps have we done with the same set of tasks? */
  int tasks_age;

  /* Linked list for cell-task association. */
  struct link *links;
401
  size_t nr_links, size_links;
402

403
  /* Average number of tasks per cell. Used to estimate the sizes
404
   * of the various task arrays. Also the maximum from all ranks. */
405
  float tasks_per_cell;
406
  float tasks_per_cell_max;
407

408
  /* Average number of links per tasks. This number is used before
409
     the creation of communication tasks so needs to be large enough. */
410
  float links_per_tasks;
411

412
413
  /* Are we talkative ? */
  int verbose;
414
415

  /* Physical constants definition */
Matthieu Schaller's avatar
Matthieu Schaller committed
416
  const struct phys_const *physical_constants;
417

418
419
420
  /* The cosmological model */
  struct cosmology *cosmology;

421
  /* Properties of the hydro scheme */
422
  struct hydro_props *hydro_properties;
423

424
425
  /* Properties of the entropy floor */
  const struct entropy_floor_properties *entropy_floor;
426

Loic Hausammann's avatar
Loic Hausammann committed
427
428
429
  /* Properties of the star model */
  const struct stars_props *stars_properties;

430
431
432
  /* Properties of the black hole model */
  const struct black_holes_props *black_holes_properties;

433
  /* Properties of the self-gravity scheme */
434
  struct gravity_props *gravity_properties;
435

436
437
438
  /* The mesh used for long-range gravity forces */
  struct pm_mesh *mesh;

439
  /* Properties of external gravitational potential */
Matthieu Schaller's avatar
Matthieu Schaller committed
440
  const struct external_potential *external_potential;
441

442
  /* Properties of the cooling scheme */
Alexei Borissov's avatar
Alexei Borissov committed
443
  struct cooling_function_data *cooling_func;
444

445
446
  /* Properties of the starformation law */
  const struct star_formation *star_formation;
447

448
  /* Properties of the sellar feedback model */
449
  struct feedback_props *feedback_props;
450

451
  /* Properties of the chemistry model */
452
  const struct chemistry_global_data *chemistry;
453

454
455
456
  /*! The FOF properties data. */
  struct fof_props *fof_properties;

457
  /* The (parsed) parameter file */
lhausamm's avatar
lhausamm committed
458
  struct swift_params *parameter_file;
459

460
461
  /* The output selection options */
  struct output_options *output_options;
462

463
464
465
  /* Temporary struct to hold a group of deferable properties (in MPI mode
   * these are reduced together, but may not be required just yet). */
  struct collectgroup1 collect_group1;
Peter W. Draper's avatar
Peter W. Draper committed
466

467
468
469
  /* Whether to dump restart files. */
  int restart_dump;

470
471
472
  /* Whether to save previous generation of restart files. */
  int restart_save;

473
474
475
  /* Whether to dump restart files after the last step. */
  int restart_onexit;

Peter W. Draper's avatar
Peter W. Draper committed
476
  /* Name of the restart file. */
477
  const char *restart_file;
478
479
480
481
482
483

  /* Ticks between restart dumps. */
  ticks restart_dt;

  /* Time after which next dump will occur. */
  ticks restart_next;
484
485
486

  /* Maximum number of tasks needed for restarting. */
  int restart_max_tasks;
487

488
489
490
  /* The globally agreed runtime, in hours. */
  float runtime;

491
492
  /* Label of the run */
  char run_name[PARSER_MAX_LINE_SIZE];
493
494

  /* Has there been an stf this timestep? */
495
  char stf_this_timestep;
496

497
  /* Line of sight properties. */
498
  struct los_props *los_properties;
499
500
501
502
503
504
505
506
507

  /* Line of sight outputs information. */
  struct output_list *output_list_los;
  double a_first_los;
  double time_first_los;
  double delta_time_los;
  integertime_t ti_next_los;
  int los_output_count;

508
509
510
#ifdef SWIFT_GRAVITY_FORCE_CHECKS
  /* Run brute force checks only on steps when all gparts active? */
  int force_checks_only_all_active;
511
512
513
514
515
516
517

  /* Run brute force checks only during snapshot timesteps? */
  int force_checks_only_at_snapshots;

  /* Are all gparts active this timestep? */
  int all_gparts_active;

518
519
  /* Flag to tell brute force checks a snapshot was recently written. */
  int force_checks_snapshot_flag;
520
#endif
521
};
Pedro Gonnet's avatar
Pedro Gonnet committed
522

523
/* Function prototypes, engine.c. */
524
void engine_addlink(struct engine *e, struct link **l, struct task *t);
Pedro Gonnet's avatar
Pedro Gonnet committed
525
void engine_barrier(struct engine *e);
526
void engine_compute_next_snapshot_time(struct engine *e);
527
void engine_compute_next_stf_time(struct engine *e);
528
void engine_compute_next_fof_time(struct engine *e);
529
void engine_compute_next_statistics_time(struct engine *e);
530
void engine_compute_next_los_time(struct engine *e);
531
void engine_recompute_displacement_constraint(struct engine *e);
532
void engine_unskip(struct engine *e);
533
void engine_unskip_timestep_communications(struct engine *e);
534
void engine_drift_all(struct engine *e, const int drift_mpoles);
535
void engine_drift_top_multipoles(struct engine *e);
536
void engine_reconstruct_multipoles(struct engine *e);
537
void engine_allocate_foreign_particles(struct engine *e);
538
void engine_print_stats(struct engine *e);
539
void engine_check_for_dumps(struct engine *e);
Loic Hausammann's avatar
Loic Hausammann committed
540
void engine_check_for_index_dump(struct engine *e);
541
void engine_collect_end_of_step(struct engine *e, int apply);
542
void engine_dump_snapshot(struct engine *e);
543
void engine_init_output_lists(struct engine *e, struct swift_params *params);
544
545
546
547
548
void engine_init(struct engine *e, struct space *s, struct swift_params *params,
                 struct output_options *output_options, long long Ngas,
                 long long Ngparts, long long Nstars, long long Nblackholes,
                 long long Nbackground_gparts, int policy, int verbose,
                 struct repartition *reparttype,
Matthieu Schaller's avatar
Matthieu Schaller committed
549
550
                 const struct unit_system *internal_units,
                 const struct phys_const *physical_constants,
551
                 struct cosmology *cosmo, struct hydro_props *hydro,
552
                 const struct entropy_floor_properties *entropy_floor,
Loic Hausammann's avatar
Loic Hausammann committed
553
                 struct gravity_props *gravity, const struct stars_props *stars,
554
                 const struct black_holes_props *black_holes,
555
                 struct feedback_props *feedback, struct pm_mesh *mesh,
Matthieu Schaller's avatar
Matthieu Schaller committed
556
                 const struct external_potential *potential,
Alexei Borissov's avatar
Alexei Borissov committed
557
                 struct cooling_function_data *cooling_func,
558
                 const struct star_formation *starform,
559
                 const struct chemistry_global_data *chemistry,
560
561
                 struct fof_props *fof_properties,
                 struct los_props *los_properties);
562
563
564
565
void engine_config(int restart, int fof, struct engine *e,
                   struct swift_params *params, int nr_nodes, int nodeID,
                   int nr_threads, int with_aff, int verbose,
                   const char *restart_file);
Loikki's avatar
Loikki committed
566
void engine_dump_index(struct engine *e);
567
void engine_launch(struct engine *e, const char *call);
568
void engine_prepare(struct engine *e);
569
void engine_init_particles(struct engine *e, int flag_entropy_ICs,
570
                           int clean_h_values);
571
void engine_step(struct engine *e);
572
void engine_split(struct engine *e, struct partition *initial_partition);
573
574
575
576
void engine_exchange_strays(struct engine *e, const size_t offset_parts,
                            const int *ind_part, size_t *Npart,
                            const size_t offset_gparts, const int *ind_gpart,
                            size_t *Ngpart, const size_t offset_sparts,
577
578
579
                            const int *ind_spart, size_t *Nspart,
                            const size_t offset_bparts, const int *ind_bpart,
                            size_t *Nbpart);
580
void engine_rebuild(struct engine *e, int redistributed, int clean_h_values);
581
void engine_repartition(struct engine *e);
582
void engine_repartition_trigger(struct engine *e);
583
584
void engine_makeproxies(struct engine *e);
void engine_redistribute(struct engine *e);
Matthieu Schaller's avatar
Matthieu Schaller committed
585
void engine_print_policy(struct engine *e);
586
int engine_is_done(struct engine *e);
587
588
void engine_pin(void);
void engine_unpin(void);
Matthieu Schaller's avatar
Matthieu Schaller committed
589
void engine_clean(struct engine *e, const int fof, const int restart);
590
int engine_estimate_nr_tasks(const struct engine *e);
591
void engine_print_task_counts(const struct engine *e);
592
593
void engine_fof(struct engine *e, const int dump_results,
                const int seed_black_holes);
594
void engine_activate_gpart_comms(struct engine *e);
595

Pedro Gonnet's avatar
Pedro Gonnet committed
596
/* Function prototypes, engine_maketasks.c. */
597
598
void engine_maketasks(struct engine *e);

599
600
601
/* Function prototypes, engine_maketasks.c. */
void engine_make_fof_tasks(struct engine *e);

Pedro Gonnet's avatar
Pedro Gonnet committed
602
603
604
/* Function prototypes, engine_marktasks.c. */
int engine_marktasks(struct engine *e);

605
606
607
/* Function prototypes, engine_split_particles.c. */
void engine_split_gas_particles(struct engine *e);

608
#ifdef HAVE_SETAFFINITY
609
cpu_set_t *engine_entry_affinity(void);
610
611
#endif

612
613
614
/* Struct dump/restore support. */
void engine_struct_dump(struct engine *e, FILE *stream);
void engine_struct_restore(struct engine *e, FILE *stream);
615
void engine_dump_restarts(struct engine *e, int drifted_all, int final_step);
616

617
#endif /* SWIFT_ENGINE_H */