mdcore
0.1.5
|
#include "../config.h"
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>
#include <math.h>
#include <float.h>
#include <string.h>
#include <limits.h>
#include <sched.h>
#include "cycle.h"
#include "errs.h"
#include "fptype.h"
#include "lock.h"
#include "part.h"
#include "fifo.h"
#include "queue.h"
#include "cell.h"
#include "space.h"
#include "potential.h"
#include "engine.h"
#include "runner.h"
Defines | |
#define | error(id) ( runner_err = errs_register( id , runner_err_msg[-(id)] , __LINE__ , __FUNCTION__ , __FILE__ ) ) |
Functions | |
void | runner_sort_descending (unsigned int *parts, int N) |
Sort the particles in descending order using QuickSort. | |
void | runner_sort_ascending (unsigned int *parts, int N) |
Sort the particles in ascending order using QuickSort. | |
int | runner_dispatcher (struct engine *e) |
This is the dispatcher that passes pairs to the individual #runners. | |
int | runner_run_dispatch (struct runner *r) |
The runner's main routine. | |
int | runner_run_cell (struct runner *r) |
The runner's main routine (for the Cell/BE SPU). | |
int | runner_run_cell_tuples (struct runner *r) |
The runner's main routine (for the Cell/BE SPU, using tuples). | |
int | runner_run_verlet (struct runner *r) |
The runner's main routine (for Verlet lists). | |
int | runner_run_pairs (struct runner *r) |
The runner's main routine. | |
int | runner_run_tuples (struct runner *r) |
The runner's main routine (celltuple model). | |
int | runner_init_SPU (struct runner *r, struct engine *e, int id) |
Initialize the runner associated to the given engine and attach it to an SPU. | |
int | runner_init (struct runner *r, struct engine *e, int id) |
Initialize the runner associated to the given engine. | |
Variables | |
int | runner_err = runner_err_ok |
unsigned int | runner_rcount = 0 |
char * | runner_err_msg [11] |
#define error | ( | id | ) | ( runner_err = errs_register( id , runner_err_msg[-(id)] , __LINE__ , __FUNCTION__ , __FILE__ ) ) |
int runner_dispatcher | ( | struct engine * | e | ) |
This is the dispatcher that passes pairs to the individual #runners.
r | Pointer to the engine in which the runners reside. |
int runner_init | ( | struct runner * | r, |
struct engine * | e, | ||
int | id | ||
) |
Initialize the runner associated to the given engine.
r | The runner to be initialized. |
e | The engine with which it is associated. |
id | The ID of this runner. |
int runner_init_SPU | ( | struct runner * | r, |
struct engine * | e, | ||
int | id | ||
) |
Initialize the runner associated to the given engine and attach it to an SPU.
r | The runner to be initialized. |
e | The engine with which it is associated. |
id | The ID of this runner. |
If CELL
is not defined, this routine will fail!
int runner_run_cell | ( | struct runner * | r | ) |
The runner's main routine (for the Cell/BE SPU).
r | Pointer to the runner to run. |
This is the main routine for the runner. When called, it enters an infinite loop in which it waits at the engine r->e
barrier and, once having paSSEd, calls space_getpair until there are no pairs available.
Note that this routine is only compiled if CELL
has been defined.
int runner_run_cell_tuples | ( | struct runner * | r | ) |
The runner's main routine (for the Cell/BE SPU, using tuples).
r | Pointer to the runner to run. |
This is the main routine for the runner. When called, it enters an infinite loop in which it waits at the engine r->e
barrier and, once having paSSEd, calls space_gettuple until there are no tuples available.
Note that this routine is only compiled if CELL
has been defined.
int runner_run_dispatch | ( | struct runner * | r | ) |
The runner's main routine.
r | Pointer to the runner to run. |
This is the main routine for the runner. When called, it enters an infinite loop in which it waits at the engine r->e
barrier and, once having passed, it picks pairs out of its "in" fifo, processes them, and passes them to the "out" fifo, until a #runner_stop is received.
int runner_run_pairs | ( | struct runner * | r | ) |
The runner's main routine.
r | Pointer to the runner to run. |
This is the main routine for the runner. When called, it enters an infinite loop in which it waits at the engine r->e
barrier and, once having paSSEd, calls space_getpair until there are no pairs available.
int runner_run_tuples | ( | struct runner * | r | ) |
The runner's main routine (celltuple model).
r | Pointer to the runner to run. |
This is the main routine for the runner. When called, it enters an infinite loop in which it waits at the engine r->e
barrier and, once having passed, calls space_gettuple until there are no tuples available.
int runner_run_verlet | ( | struct runner * | r | ) |
The runner's main routine (for Verlet lists).
r | Pointer to the runner to run. |
This is the main routine for the runner. When called, it enters an infinite loop in which it waits at the engine r->e
barrier and, once having passed, checks first if the Verlet list should be re-built and then proceeds to traverse the Verlet list cell-wise and computes its interactions.
void runner_sort_ascending | ( | unsigned int * | parts, |
int | N | ||
) |
Sort the particles in ascending order using QuickSort.
parts | The particle IDs and distances in compact form |
N | The number of particles. |
The particle data is assumed to contain the distance in the lower 16 bits and the particle ID in the upper 16 bits.
void runner_sort_descending | ( | unsigned int * | parts, |
int | N | ||
) |
Sort the particles in descending order using QuickSort.
parts | The particle IDs and distances in compact form |
N | The number of particles. |
The particle data is assumed to contain the distance in the lower 16 bits and the particle ID in the upper 16 bits.
int runner_err = runner_err_ok |
The ID of the last error.
char* runner_err_msg[11] |
{ "Nothing bad happened.", "An unexpected NULL pointer was encountered.", "A call to malloc failed, probably due to insufficient memory.", "An error occured when calling a space function.", "A call to a pthread routine failed.", "An error occured when calling an engine function.", "An error occured when calling an SPE function.", "An error occured with the memory flow controler.", "The requested functionality is not available." , "An error occured when calling an fifo function." , "Error filling Verlet list: too many neighbours." }
unsigned int runner_rcount = 0 |