mdcore  0.1.5
Data Structures | Defines | Functions | Variables
/home/pedro/work/mdcore/src/runner.h File Reference

Go to the source code of this file.

Data Structures

struct  runner_fifo
struct  runner

Defines

#define runner_err_ok   0
#define runner_err_null   -1
#define runner_err_malloc   -2
#define runner_err_space   -3
#define runner_err_pthread   -4
#define runner_err_engine   -5
#define runner_err_spe   -6
#define runner_err_mfc   -7
#define runner_err_unavail   -8
#define runner_err_fifo   -9
#define runner_err_verlet_overflow   -10
#define runner_minsleep   1000
#define runner_bitesize   3
#define runner_verlet_bitesize   200
#define runner_qlen   8
#define runner_dispatch_stop   0xffffffff
#define runner_dispatch_lookahead   20

Functions

int runner_dispatcher (struct engine *e)
 This is the dispatcher that passes pairs to the individual #runners.
int runner_dopair (struct runner *r, struct cell *cell_i, struct cell *cell_j, FPTYPE *shift)
int runner_dopair_unsorted (struct runner *r, struct cell *cell_i, struct cell *cell_j, FPTYPE *shift)
int runner_dopair_verlet2 (struct runner *r, struct cell *cell_i, struct cell *cell_j, FPTYPE *pshift, struct cellpair *cp)
int runner_dopair_verlet (struct runner *r, struct cell *cell_i, struct cell *cell_j, FPTYPE *pshift, struct cellpair *cp)
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.
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_run_verlet (struct runner *r)
 The runner's main routine (for Verlet lists).
void runner_sort_ascending (unsigned int *parts, int N)
 Sort the particles in ascending order using QuickSort.
void runner_sort_descending (unsigned int *parts, int N)
 Sort the particles in descending order using QuickSort.
int runner_verlet_eval (struct runner *r, struct cell *c, FPTYPE *f_out)
int runner_verlet_fill (struct runner *r, struct cell *cell_i, struct cell *cell_j, FPTYPE *pshift)

Variables

int runner_err

Define Documentation

#define runner_bitesize   3

Maximum number of cellpairs to get from space_getpair.

#define runner_dispatch_lookahead   20
#define runner_dispatch_stop   0xffffffff

Magic word to make the dispatcher stop.

#define runner_err_engine   -5
#define runner_err_fifo   -9
#define runner_err_malloc   -2
#define runner_err_mfc   -7
#define runner_err_null   -1
#define runner_err_ok   0
#define runner_err_pthread   -4
#define runner_err_space   -3
#define runner_err_spe   -6
#define runner_err_unavail   -8
#define runner_err_verlet_overflow   -10
#define runner_minsleep   1000
#define runner_qlen   8

Length of the cell pair queue between the PPU and the SPU and of the fifo-queue in dispatch mode.

#define runner_verlet_bitesize   200

Number of particles to request per call to space_getverlet.


Function Documentation

int runner_dispatcher ( struct engine e)

This is the dispatcher that passes pairs to the individual #runners.

Parameters:
rPointer to the engine in which the runners reside.
Returns:
runner_err_ok or <0 on error (see runner_err).
int runner_dopair ( struct runner r,
struct cell cell_i,
struct cell cell_j,
FPTYPE *  shift 
)
int runner_dopair_unsorted ( struct runner r,
struct cell cell_i,
struct cell cell_j,
FPTYPE *  shift 
)
int runner_dopair_verlet ( struct runner r,
struct cell cell_i,
struct cell cell_j,
FPTYPE *  pshift,
struct cellpair cp 
)
int runner_dopair_verlet2 ( struct runner r,
struct cell cell_i,
struct cell cell_j,
FPTYPE *  pshift,
struct cellpair cp 
)
int runner_init ( struct runner r,
struct engine e,
int  id 
)

Initialize the runner associated to the given engine.

Parameters:
rThe runner to be initialized.
eThe engine with which it is associated.
idThe ID of this runner.
Returns:
runner_err_ok or < 0 on error (see runner_err).
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.

Parameters:
rThe runner to be initialized.
eThe engine with which it is associated.
idThe ID of this runner.
Returns:
runner_err_ok or < 0 on error (see runner_err).

If CELL is not defined, this routine will fail!

int runner_run_pairs ( struct runner r)

The runner's main routine.

Parameters:
rPointer to the runner to run.
Returns:
runner_err_ok or <0 on error (see runner_err).

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).

Parameters:
rPointer to the runner to run.
Returns:
runner_err_ok or <0 on error (see runner_err).

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).

Parameters:
rPointer to the runner to run.
Returns:
runner_err_ok or <0 on error (see runner_err).

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.

Parameters:
partsThe particle IDs and distances in compact form
NThe 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.

Parameters:
partsThe particle IDs and distances in compact form
NThe 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_verlet_eval ( struct runner r,
struct cell c,
FPTYPE *  f_out 
)
int runner_verlet_fill ( struct runner r,
struct cell cell_i,
struct cell cell_j,
FPTYPE *  pshift 
)

Variable Documentation

The ID of the last error.

 All Data Structures Files Functions Variables Typedefs Enumerator Defines