Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

WKFThreads.h File Reference

Go to the source code of this file.

Compounds

struct  wkf_run_barrier_struct
struct  wkf_shared_iterator_struct
struct  wkf_tasktile_stack_struct
struct  wkf_tasktile_struct
struct  wkf_threadlaunch_struct
struct  wkf_threadpool_struct
struct  wkf_threadpool_workerdata_struct

Defines

#define WKF_THREADS_INC   1
#define WKF_TILESTACK_EMPTY   -1
#define WKF_SCHED_DONE   -1
#define WKF_SCHED_CONTINUE   0
#define WKF_THREADPOOL_DEVLIST_CPUSONLY   NULL
#define WKF_THREADPOOL_DEVID_CPU   -1

Typedefs

typedef int wkf_thread_t
typedef int wkf_mutex_t
typedef int wkf_cond_t
typedef wkf_run_barrier_struct wkf_run_barrier_t
typedef wkf_tasktile_struct wkf_tasktile_t
typedef wkf_tasktile_stack_struct wkf_tilestack_t
typedef wkf_shared_iterator_struct wkf_shared_iterator_t
typedef wkf_threadpool_workerdata_struct wkf_threadpool_workerdata_t
typedef wkf_threadpool_struct wkf_threadpool_t
typedef wkf_threadlaunch_struct wkf_threadlaunch_t

Functions

int wkf_thread_numphysprocessors (void)
int wkf_thread_numprocessors (void)
int * wkf_cpu_affinitylist (int *cpuaffinitycount)
int wkf_thread_set_self_cpuaffinity (int cpu)
int wkf_thread_setconcurrency (int)
int wkf_thread_create (wkf_thread_t *, void *fctn(void *), void *)
int wkf_thread_join (wkf_thread_t, void **)
int wkf_mutex_init (wkf_mutex_t *)
int wkf_mutex_lock (wkf_mutex_t *)
int wkf_mutex_trylock (wkf_mutex_t *)
int wkf_mutex_spin_lock (wkf_mutex_t *)
int wkf_mutex_unlock (wkf_mutex_t *)
int wkf_mutex_destroy (wkf_mutex_t *)
int wkf_cond_init (wkf_cond_t *)
int wkf_cond_destroy (wkf_cond_t *)
int wkf_cond_wait (wkf_cond_t *, wkf_mutex_t *)
int wkf_cond_signal (wkf_cond_t *)
int wkf_cond_broadcast (wkf_cond_t *)
int wkf_thread_run_barrier_init (wkf_run_barrier_t *barrier, int n_clients)
void wkf_thread_run_barrier_destroy (wkf_run_barrier_t *barrier)
int wkf_thread_run_barrier_poll (wkf_run_barrier_t *barrier)
int wkf_tilestack_init (wkf_tilestack_t *s, int size)
void wkf_tilestack_destroy (wkf_tilestack_t *)
int wkf_tilestack_compact (wkf_tilestack_t *)
int wkf_tilestack_push (wkf_tilestack_t *, const wkf_tasktile_t *)
int wkf_tilestack_pop (wkf_tilestack_t *, wkf_tasktile_t *)
int wkf_tilestack_popall (wkf_tilestack_t *)
int wkf_tilestack_empty (wkf_tilestack_t *)
int wkf_shared_iterator_init (wkf_shared_iterator_t *it)
int wkf_shared_iterator_destroy (wkf_shared_iterator_t *it)
int wkf_shared_iterator_set (wkf_shared_iterator_t *it, wkf_tasktile_t *tile)
int wkf_shared_iterator_next_tile (wkf_shared_iterator_t *it, int reqsize, wkf_tasktile_t *tile)
int wkf_shared_iterator_setfatalerror (wkf_shared_iterator_t *it)
int wkf_shared_iterator_getfatalerror (wkf_shared_iterator_t *it)
wkf_threadpool_twkf_threadpool_create (int workercount, int *devlist)
int wkf_threadpool_launch (wkf_threadpool_t *thrpool, void *fctn(void *), void *parms, int blocking)
int wkf_threadpool_wait (wkf_threadpool_t *thrpool)
int wkf_threadpool_destroy (wkf_threadpool_t *thrpool)
int wkf_threadpool_worker_getid (void *voiddata, int *threadid, int *threadcount)
int wkf_threadpool_worker_getdevid (void *voiddata, int *devid)
int wkf_threadpool_worker_setdevspeed (void *voiddata, float speed)
int wkf_threadpool_worker_getdevspeed (void *voiddata, float *speed)
int wkf_threadpool_worker_devscaletile (void *voiddata, int *tilesize)
int wkf_threadpool_worker_getdata (void *voiddata, void **clientdata)
int wkf_threadpool_sched_dynamic (wkf_threadpool_t *thrpool, wkf_tasktile_t *tile)
int wkf_threadpool_next_tile (void *thrpool, int reqsize, wkf_tasktile_t *tile)
int wkf_threadpool_tile_failed (void *thrpool, wkf_tasktile_t *tile)
int wkf_threadpool_setfatalerror (void *thrparms)
int wkf_threadpool_getfatalerror (void *thrparms)
int wkf_threadlaunch (int numprocs, void *clientdata, void *fctn(void *), wkf_tasktile_t *tile)
int wkf_threadlaunch_getid (void *thrparms, int *threadid, int *threadcount)
int wkf_threadlaunch_getdata (void *thrparms, void **clientdata)
int wkf_threadlaunch_next_tile (void *voidparms, int reqsize, wkf_tasktile_t *tile)
int wkf_threadlaunch_setfatalerror (void *thrparms)

Variables

void *(*)(void *) wkf_thread_run_barrier (wkf_run_barrier_t *barrier, void *fctn(void *), void *parms, void **rsltparms)


Define Documentation

#define WKF_SCHED_CONTINUE   0
 

Definition at line 244 of file WKFThreads.h.

Referenced by wkf_shared_iterator_next_tile, and wkf_threadpool_next_tile.

#define WKF_SCHED_DONE   -1
 

Definition at line 243 of file WKFThreads.h.

Referenced by cudaenergythread, cudaorbitalthread, energythread, openclenergythread, openclorbitalthread, orbitalthread, vmddevpoolcudatilelatencythread, vmddevpooltilelatencythread, wkf_shared_iterator_next_tile, and wkf_threadpool_next_tile.

#define WKF_THREADPOOL_DEVID_CPU   -1
 

Definition at line 284 of file WKFThreads.h.

#define WKF_THREADPOOL_DEVLIST_CPUSONLY   NULL
 

Definition at line 281 of file WKFThreads.h.

#define WKF_THREADS_INC   1
 

Definition at line 43 of file WKFThreads.h.

#define WKF_TILESTACK_EMPTY   -1
 

Definition at line 218 of file WKFThreads.h.

Referenced by wkf_threadpool_next_tile, and wkf_tilestack_pop.


Typedef Documentation

typedef int wkf_cond_t
 

Definition at line 99 of file WKFThreads.h.

Referenced by wkf_cond_broadcast, wkf_cond_destroy, wkf_cond_init, wkf_cond_signal, wkf_cond_wait, and wkf_cpu_affinitylist.

typedef int wkf_mutex_t
 

Definition at line 98 of file WKFThreads.h.

Referenced by bondsearchthread, vmd_bondsearch_thr, wkf_cond_wait, wkf_cpu_affinitylist, wkf_mutex_destroy, wkf_mutex_init, wkf_mutex_lock, wkf_mutex_spin_lock, wkf_mutex_trylock, and wkf_mutex_unlock.

typedef struct wkf_run_barrier_struct wkf_run_barrier_t
 

typedef struct wkf_shared_iterator_struct wkf_shared_iterator_t
 

typedef struct wkf_tasktile_struct wkf_tasktile_t
 

typedef int wkf_thread_t
 

Definition at line 97 of file WKFThreads.h.

Referenced by find_within, measure_gofr, VMDCollab::startserver, vmd_bondsearch_thr, vmd_cuda_bus_bw, vmd_cuda_globmem_bw, vmd_cuda_madd_gflops, wkf_cpu_affinitylist, wkf_thread_create, wkf_thread_join, wkf_threadlaunch, and wkf_threadpool_create.

typedef struct wkf_threadlaunch_struct wkf_threadlaunch_t
 

typedef struct wkf_threadpool_struct wkf_threadpool_t
 

typedef struct wkf_threadpool_workerdata_struct wkf_threadpool_workerdata_t
 

thread-specific handle data for workers

typedef struct wkf_tasktile_stack_struct wkf_tilestack_t
 


Function Documentation

int wkf_cond_broadcast wkf_cond_t  
 

Definition at line 607 of file WKFThreads.C.

Referenced by wkf_thread_run_barrier.

int wkf_cond_destroy wkf_cond_t  
 

Definition at line 506 of file WKFThreads.C.

Referenced by wkf_thread_run_barrier_destroy.

int wkf_cond_init wkf_cond_t  
 

Definition at line 473 of file WKFThreads.C.

Referenced by wkf_thread_run_barrier_init.

int wkf_cond_signal wkf_cond_t  
 

Definition at line 578 of file WKFThreads.C.

int wkf_cond_wait wkf_cond_t  ,
wkf_mutex_t  
 

Definition at line 527 of file WKFThreads.C.

Referenced by wkf_thread_run_barrier.

int* wkf_cpu_affinitylist int *    cpuaffinitycount
 

Definition at line 142 of file WKFThreads.C.

References wkf_cond_t, wkf_mutex_t, and wkf_thread_t.

Referenced by vmdinfo_tcl.

int wkf_mutex_destroy wkf_mutex_t  
 

Definition at line 452 of file WKFThreads.C.

Referenced by vmd_bondsearch_thr, wkf_shared_iterator_destroy, wkf_thread_run_barrier_destroy, and wkf_tilestack_destroy.

int wkf_mutex_init wkf_mutex_t  
 

Definition at line 367 of file WKFThreads.C.

Referenced by IMDSimThread::IMDSimThread, vmd_bondsearch_thr, wkf_shared_iterator_init, wkf_thread_run_barrier_init, and wkf_tilestack_init.

int wkf_mutex_lock wkf_mutex_t  
 

Definition at line 384 of file WKFThreads.C.

Referenced by bondsearchthread, IMDSimThread::detach, IMDSimThread::get_next_ts, IMDSimThread::kill, IMDSimThread::pause, IMDSimThread::reader, IMDSimThread::send_forces, IMDSimThread::set_transrate, IMDSimThread::unpause, wkf_shared_iterator_getfatalerror, wkf_shared_iterator_set, wkf_thread_run_barrier, wkf_thread_run_barrier_poll, wkf_tilestack_compact, wkf_tilestack_empty, wkf_tilestack_pop, wkf_tilestack_popall, and wkf_tilestack_push.

int wkf_mutex_spin_lock wkf_mutex_t  
 

Definition at line 418 of file WKFThreads.C.

Referenced by wkf_shared_iterator_next_tile, and wkf_shared_iterator_setfatalerror.

int wkf_mutex_trylock wkf_mutex_t  
 

Definition at line 401 of file WKFThreads.C.

int wkf_mutex_unlock wkf_mutex_t  
 

Definition at line 435 of file WKFThreads.C.

Referenced by bondsearchthread, IMDSimThread::detach, IMDSimThread::get_next_ts, IMDSimThread::kill, IMDSimThread::pause, IMDSimThread::reader, IMDSimThread::send_forces, IMDSimThread::set_transrate, IMDSimThread::unpause, wkf_shared_iterator_getfatalerror, wkf_shared_iterator_next_tile, wkf_shared_iterator_set, wkf_shared_iterator_setfatalerror, wkf_thread_run_barrier, wkf_thread_run_barrier_poll, wkf_tilestack_compact, wkf_tilestack_empty, wkf_tilestack_pop, wkf_tilestack_popall, and wkf_tilestack_push.

int wkf_shared_iterator_destroy wkf_shared_iterator_t   it
 

Definition at line 1156 of file WKFThreads.C.

Referenced by wkf_threadlaunch, and wkf_threadpool_destroy.

int wkf_shared_iterator_getfatalerror wkf_shared_iterator_t   it
 

Definition at line 1229 of file WKFThreads.C.

Referenced by wkf_threadlaunch, and wkf_threadpool_getfatalerror.

int wkf_shared_iterator_init wkf_shared_iterator_t   it
 

Definition at line 1147 of file WKFThreads.C.

Referenced by wkf_threadlaunch, and wkf_threadpool_create.

int wkf_shared_iterator_next_tile wkf_shared_iterator_t   it,
int    reqsize,
wkf_tasktile_t   tile
 

Definition at line 1181 of file WKFThreads.C.

Referenced by wkf_threadlaunch_next_tile, and wkf_threadpool_next_tile.

int wkf_shared_iterator_set wkf_shared_iterator_t   it,
wkf_tasktile_t   tile
 

Definition at line 1164 of file WKFThreads.C.

Referenced by wkf_threadlaunch, and wkf_threadpool_sched_dynamic.

int wkf_shared_iterator_setfatalerror wkf_shared_iterator_t   it
 

Definition at line 1217 of file WKFThreads.C.

Referenced by wkf_threadlaunch_setfatalerror, and wkf_threadpool_setfatalerror.

int wkf_thread_create wkf_thread_t  ,
void *fctn(void *)   ,
void *   
 

Definition at line 310 of file WKFThreads.C.

Referenced by find_within, IMDSimThread::IMDSimThread, measure_gofr, VMDCollab::startserver, vmd_bondsearch_thr, vmd_cuda_bus_bw, vmd_cuda_globmem_bw, vmd_cuda_madd_gflops, wkf_threadlaunch, and wkf_threadpool_create.

int wkf_thread_join wkf_thread_t   ,
void **   
 

Definition at line 341 of file WKFThreads.C.

Referenced by find_within, measure_gofr, vmd_bondsearch_thr, vmd_cuda_bus_bw, vmd_cuda_globmem_bw, vmd_cuda_madd_gflops, wkf_threadlaunch, wkf_threadpool_destroy, and IMDSimThread::~IMDSimThread.

int wkf_thread_numphysprocessors void   
 

Definition at line 81 of file WKFThreads.C.

int wkf_thread_numprocessors void   
 

Definition at line 115 of file WKFThreads.C.

void wkf_thread_run_barrier_destroy wkf_run_barrier_t   barrier
 

Definition at line 658 of file WKFThreads.C.

Referenced by wkf_threadpool_destroy.

int wkf_thread_run_barrier_init wkf_run_barrier_t   barrier,
int    n_clients
 

Definition at line 642 of file WKFThreads.C.

Referenced by wkf_threadpool_create.

int wkf_thread_run_barrier_poll wkf_run_barrier_t   barrier
 

Definition at line 714 of file WKFThreads.C.

Referenced by wkf_threadpool_poll.

int wkf_thread_set_self_cpuaffinity int    cpu
 

Definition at line 231 of file WKFThreads.C.

int wkf_thread_setconcurrency int   
 

Definition at line 276 of file WKFThreads.C.

int wkf_threadlaunch int    numprocs,
void *    clientdata,
void *fctn(void *)   ,
wkf_tasktile_t   tile
 

Definition at line 1245 of file WKFThreads.C.

Referenced by evaluate_grid_fast, vmd_cuda_vol_cpotential, vmd_opencl_evaluate_orbital_grid, vmd_opencl_vol_cpotential, and vol_cpotential_cpu.

int wkf_threadlaunch_getdata void *    thrparms,
void **    clientdata
 

Definition at line 1335 of file WKFThreads.C.

Referenced by cudaenergythread, energythread, openclenergythread, openclorbitalthread, and orbitalthread.

int wkf_threadlaunch_getid void *    thrparms,
int *    threadid,
int *    threadcount
 

Definition at line 1322 of file WKFThreads.C.

Referenced by cudaenergythread, energythread, openclenergythread, and openclorbitalthread.

int wkf_threadlaunch_next_tile void *    voidparms,
int    reqsize,
wkf_tasktile_t   tile
 

Definition at line 1344 of file WKFThreads.C.

Referenced by cudaenergythread, energythread, openclenergythread, openclorbitalthread, and orbitalthread.

int wkf_threadlaunch_setfatalerror void *    thrparms
 

Definition at line 1351 of file WKFThreads.C.

wkf_threadpool_t* wkf_threadpool_create int    workercount,
int *    devlist
 

Definition at line 748 of file WKFThreads.C.

int wkf_threadpool_destroy wkf_threadpool_t   thrpool
 

Definition at line 843 of file WKFThreads.C.

int wkf_threadpool_getfatalerror void *    thrparms
 

Definition at line 989 of file WKFThreads.C.

int wkf_threadpool_launch wkf_threadpool_t   thrpool,
void *fctn(void *)   ,
void *    parms,
int    blocking
 

Definition at line 808 of file WKFThreads.C.

Referenced by CUDAAccel::devpool_launch, vmd_cuda_devpool_latency, vmd_cuda_evaluate_orbital_grid, and vmd_opencl_evaluate_orbital_grid.

int wkf_threadpool_next_tile void *    thrpool,
int    reqsize,
wkf_tasktile_t   tile
 

Definition at line 956 of file WKFThreads.C.

Referenced by cudaorbitalthread, openclorbitalthread, vmddevpoolcudatilelatencythread, and vmddevpooltilelatencythread.

int wkf_threadpool_sched_dynamic wkf_threadpool_t   thrpool,
wkf_tasktile_t   tile
 

Definition at line 948 of file WKFThreads.C.

Referenced by vmd_cuda_devpool_latency, vmd_cuda_evaluate_orbital_grid, and vmd_opencl_evaluate_orbital_grid.

int wkf_threadpool_setfatalerror void *    thrparms
 

Definition at line 981 of file WKFThreads.C.

int wkf_threadpool_tile_failed void *    thrpool,
wkf_tasktile_t   tile
 

Definition at line 974 of file WKFThreads.C.

int wkf_threadpool_wait wkf_threadpool_t   thrpool
 

Definition at line 826 of file WKFThreads.C.

Referenced by CUDAAccel::devpool_wait, and vmd_cuda_devpool_latency.

int wkf_threadpool_worker_devscaletile void *    voiddata,
int *    tilesize
 

Definition at line 922 of file WKFThreads.C.

Referenced by cudaorbitalthread, openclorbitalthread, and vmddevpoolcudatilelatencythread.

int wkf_threadpool_worker_getdata void *    voiddata,
void **    clientdata
 

Definition at line 938 of file WKFThreads.C.

Referenced by cudaorbitalthread, openclorbitalthread, vmd_cuda_devpool_setdevice, vmddevpoolcudatilelatencythread, and vmddevpooltilelatencythread.

int wkf_threadpool_worker_getdevid void *    voiddata,
int *    devid
 

Definition at line 890 of file WKFThreads.C.

Referenced by vmd_cuda_devpool_clear_device_mem, and vmd_cuda_devpool_setdevice.

int wkf_threadpool_worker_getdevspeed void *    voiddata,
float *    speed
 

Definition at line 912 of file WKFThreads.C.

int wkf_threadpool_worker_getid void *    voiddata,
int *    threadid,
int *    threadcount
 

Definition at line 877 of file WKFThreads.C.

Referenced by cudaorbitalthread, openclorbitalthread, vmd_cuda_devpool_clear_device_mem, vmd_cuda_devpool_setdevice, vmddevpoolcudatilelatencythread, and vmddevpooltilelatencythread.

int wkf_threadpool_worker_setdevspeed void *    voiddata,
float    speed
 

Definition at line 903 of file WKFThreads.C.

Referenced by vmd_cuda_devpool_setdevice.

int wkf_tilestack_compact wkf_tilestack_t  
 

Definition at line 1031 of file WKFThreads.C.

void wkf_tilestack_destroy wkf_tilestack_t  
 

Definition at line 1022 of file WKFThreads.C.

Referenced by wkf_threadpool_destroy.

int wkf_tilestack_empty wkf_tilestack_t  
 

Definition at line 1122 of file WKFThreads.C.

int wkf_tilestack_init wkf_tilestack_t   s,
int    size
 

Definition at line 999 of file WKFThreads.C.

Referenced by wkf_threadpool_create.

int wkf_tilestack_pop wkf_tilestack_t  ,
wkf_tasktile_t  
 

Definition at line 1084 of file WKFThreads.C.

Referenced by wkf_threadpool_next_tile.

int wkf_tilestack_popall wkf_tilestack_t  
 

Definition at line 1107 of file WKFThreads.C.

int wkf_tilestack_push wkf_tilestack_t  ,
const wkf_tasktile_t  
 

Definition at line 1055 of file WKFThreads.C.

Referenced by wkf_threadpool_tile_failed.


Variable Documentation

void*(*)(void *) wkf_thread_run_barrier(wkf_run_barrier_t *barrier, void * fctn(void*), void * parms, void **rsltparms)
 

Definition at line 197 of file WKFThreads.h.


Generated on Wed Nov 25 01:33:38 2009 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002