#include <stdio.h>#include <stdlib.h>#include <string.h>#include "WKFThreads.h"Go to the source code of this file.
|
|
Typedef to eliminate compiler warning caused by C/C++ linkage conflict. Definition at line 319 of file WKFThreads.C. Referenced by wkf_thread_create. |
|
|
signal a condition variable, waking all threads Definition at line 633 of file WKFThreads.C. References wkf_cond_t. |
|
|
destroy a condition variable Definition at line 527 of file WKFThreads.C. References wkf_cond_t. |
|
|
initialize a condition variable Definition at line 494 of file WKFThreads.C. References NULL, and wkf_cond_t. |
|
|
signal a condition variable, waking at least one thread Definition at line 604 of file WKFThreads.C. References wkf_cond_t. |
|
||||||||||||
|
wait on a condition variable Definition at line 548 of file WKFThreads.C. References wkf_cond_t, and wkf_mutex_t. |
|
|
query CPU affinity of the calling process (if allowed by host system) Definition at line 160 of file WKFThreads.C. References NULL. |
|
|
destroy a mutex Definition at line 474 of file WKFThreads.C. References wkf_mutex_t. |
|
|
initialize a mutex Definition at line 379 of file WKFThreads.C. References wkf_mutex_t. |
|
|
lock a mutex Definition at line 396 of file WKFThreads.C. References wkf_mutex_t. |
|
|
lock a mutex by spinning only Definition at line 434 of file WKFThreads.C. References wkf_mutex_t. |
|
|
try to lock a mutex Definition at line 413 of file WKFThreads.C. References wkf_mutex_t. |
|
|
unlock a mutex Definition at line 457 of file WKFThreads.C. References wkf_mutex_t. |
|
|
destroy a shared iterator Definition at line 916 of file WKFThreads.C. References wkf_shared_iterator_struct::mtx, and wkf_mutex_destroy. |
|
|
master thread calls this to query for fatal errors Definition at line 991 of file WKFThreads.C. References wkf_shared_iterator_struct::fatalerror, wkf_shared_iterator_struct::mtx, wkf_mutex_lock, and wkf_mutex_unlock. |
|
|
initialize a shared iterator Definition at line 906 of file WKFThreads.C. References wkf_shared_iterator_struct::mtx, and wkf_mutex_init. |
|
||||||||||||||||
|
iterate the shared iterator, over a requested half-open interval Definition at line 942 of file WKFThreads.C. References wkf_shared_iterator_struct::current, wkf_shared_iterator_struct::end, wkf_tasktile_struct::end, wkf_shared_iterator_struct::fatalerror, wkf_shared_iterator_struct::mtx, wkf_tasktile_struct::start, wkf_mutex_spin_lock, wkf_mutex_unlock, WKF_SCHED_CONTINUE, and WKF_SCHED_DONE. |
|
||||||||||||
|
set shared iterator parameters Definition at line 925 of file WKFThreads.C. References wkf_shared_iterator_struct::current, wkf_tasktile_struct::end, wkf_shared_iterator_struct::end, wkf_shared_iterator_struct::fatalerror, wkf_shared_iterator_struct::mtx, wkf_tasktile_struct::start, wkf_shared_iterator_struct::start, wkf_mutex_lock, and wkf_mutex_unlock. |
|
|
worker thread calls this to indicate a fatal error Definition at line 978 of file WKFThreads.C. References wkf_shared_iterator_struct::fatalerror, wkf_shared_iterator_struct::mtx, wkf_mutex_spin_lock, and wkf_mutex_unlock. |
|
||||||||||||||||
|
create a new child thread Definition at line 321 of file WKFThreads.C. References NULL, wkf_thread_t, and WKFTHREAD_START_ROUTINE. |
|
||||||||||||
|
join (wait for completion of, and merge with) a thread Definition at line 353 of file WKFThreads.C. References wkf_thread_t. |
|
|
If compiling on Linux, enable the GNU CPU affinity functions in both libc and the libpthreads Definition at line 93 of file WKFThreads.C. Referenced by wkf_thread_numprocessors. |
|
|
number of processors available, subject to user override Definition at line 128 of file WKFThreads.C. References NULL, and wkf_thread_numphysprocessors. Referenced by evaluate_grid_fast, find_next_cluster, find_within, measure_gofr, vmd_bondsearch_thr, vmd_cuda_gaussdensity_direct, vmd_cuda_vol_cpotential, vmd_gaussdensity_threaded, vmdinfo_tcl, VMDinitialize, and vol_cpotential_cpu. |
|
|
Wait until all threads reach barrier, and return the function pointer passed in by the master thread. Definition at line 696 of file WKFThreads.C. References wkf_run_barrier_struct::fctn, wkf_run_barrier_struct::lock, wkf_run_barrier_struct::n_clients, wkf_run_barrier_struct::n_waiting, NULL, wkf_run_barrier_struct::parms, wkf_run_barrier_struct::phase, wkf_run_barrier_struct::rslt, wkf_run_barrier_struct::rsltparms, wkf_run_barrier_struct::wait_cv, wkf_cond_broadcast, wkf_cond_wait, wkf_mutex_lock, and wkf_mutex_unlock. Referenced by wkf_threadpool_destroy, wkf_threadpool_launch, and wkf_threadpool_wait. |
|
|
destroy thread pool barrier Definition at line 684 of file WKFThreads.C. References wkf_run_barrier_struct::lock, wkf_run_barrier_struct::wait_cv, wkf_cond_destroy, and wkf_mutex_destroy. |
|
||||||||||||
|
initialize thread pool barrier Definition at line 668 of file WKFThreads.C. References wkf_run_barrier_struct::fctn, wkf_run_barrier_struct::lock, wkf_run_barrier_struct::n_clients, wkf_run_barrier_struct::n_waiting, NULL, wkf_run_barrier_struct::phase, wkf_run_barrier_struct::wait_cv, wkf_cond_init, and wkf_mutex_init. |
|
|
non-blocking poll to see if peers are already at the barrier Definition at line 742 of file WKFThreads.C. References wkf_run_barrier_struct::lock, wkf_run_barrier_struct::n_clients, wkf_run_barrier_struct::n_waiting, wkf_mutex_lock, and wkf_mutex_unlock. |
|
|
set the CPU affinity of the current thread (if allowed by host system) Definition at line 249 of file WKFThreads.C. |
|
|
set the concurrency level and scheduling scope for threads Definition at line 294 of file WKFThreads.C. |
|
||||||||||||||||||||
|
launch up to numprocs threads using shared iterator as a load balancer Definition at line 1291 of file WKFThreads.C. References wkf_threadlaunch_struct::clientdata, wkf_threadlaunch_struct::iter, NULL, wkf_threadlaunch_struct::threadcount, wkf_threadlaunch_struct::threadid, wkf_shared_iterator_destroy, wkf_shared_iterator_getfatalerror, wkf_shared_iterator_init, wkf_shared_iterator_set, wkf_thread_create, wkf_thread_join, and wkf_thread_t. |
|
||||||||||||
|
worker thread can call this to get its client data pointer Definition at line 1381 of file WKFThreads.C. References wkf_threadlaunch_struct::clientdata, and NULL. |
|
||||||||||||||||
|
worker thread can call this to get its ID and number of peers Definition at line 1368 of file WKFThreads.C. References NULL, wkf_threadlaunch_struct::threadcount, and wkf_threadlaunch_struct::threadid. |
|
||||||||||||||||
|
iterate the shared iterator over the requested half-open interval Definition at line 1391 of file WKFThreads.C. References wkf_threadlaunch_struct::iter, and wkf_shared_iterator_next_tile. |
|
|
worker thread calls this to indicate that an unrecoverable error occured Definition at line 1399 of file WKFThreads.C. References wkf_threadlaunch_struct::iter, and wkf_shared_iterator_setfatalerror. |
|
||||||||||||
|
|
join all worker threads and free resources Definition at line 1123 of file WKFThreads.C. References wkf_threadpool_struct::devlist, wkf_threadpool_struct::errorstack, wkf_threadpool_struct::iter, NULL, wkf_threadpool_struct::runbar, wkf_threadpool_struct::threads, wkf_shared_iterator_destroy, wkf_thread_join, wkf_thread_run_barrier, wkf_thread_run_barrier_destroy, wkf_tilestack_destroy, wkf_threadpool_struct::workercount, and wkf_threadpool_struct::workerdata. |
|
|
return the number of worker threads currently in the pool Definition at line 1157 of file WKFThreads.C. References wkf_threadpool_struct::workercount. |
|
|
master thread calls this to query for fatal errors Definition at line 1283 of file WKFThreads.C. References wkf_threadpool_workerdata_struct::iter, and wkf_shared_iterator_getfatalerror. |
|
||||||||||||||||||||
|
launch threads onto a new function, with associated parms Definition at line 1088 of file WKFThreads.C. References NULL, wkf_threadpool_workerdata_struct::parms, wkf_threadpool_struct::runbar, wkf_thread_run_barrier, and wkf_threadpool_struct::workerdata. |
|
||||||||||||||||
|
iterate the shared iterator over the requested half-open interval Definition at line 1248 of file WKFThreads.C. References wkf_threadpool_workerdata_struct::errorstack, wkf_threadpool_workerdata_struct::iter, WKF_SCHED_CONTINUE, WKF_SCHED_DONE, wkf_shared_iterator_next_tile, WKF_TILESTACK_EMPTY, and wkf_tilestack_pop. |
|
|
Definition at line 1114 of file WKFThreads.C. References wkf_threadpool_struct::runbar, and wkf_thread_run_barrier_poll. |
|
||||||||||||
|
Set shared iterator state to half-open interval defined by tile Definition at line 1240 of file WKFThreads.C. References wkf_threadpool_struct::iter, NULL, and wkf_shared_iterator_set. |
|
|
worker thread calls this to indicate that an unrecoverable error occured Definition at line 1275 of file WKFThreads.C. References wkf_threadpool_workerdata_struct::iter, and wkf_shared_iterator_setfatalerror. |
|
||||||||||||
|
worker thread calls this when a failure occurs on a tile it has already taken from the scheduler Definition at line 1268 of file WKFThreads.C. References wkf_threadpool_workerdata_struct::errorstack, and wkf_tilestack_push. |
|
|
wait for all worker threads to complete their work Definition at line 1106 of file WKFThreads.C. References NULL, wkf_threadpool_struct::runbar, and wkf_thread_run_barrier. |
|
||||||||||||
|
worker thread calls this to scale max tile size by worker speed as determined by the SM/core count and clock rate Definition at line 1214 of file WKFThreads.C. References wkf_threadpool_workerdata_struct::devspeed, and NULL. |
|
||||||||||||
|
worker thread can call this to get its client data pointer Definition at line 1230 of file WKFThreads.C. References NULL, and wkf_threadpool_workerdata_struct::parms. |
|
||||||||||||
|
worker thread can call this to get its CPU/GPU device ID Definition at line 1176 of file WKFThreads.C. References wkf_threadpool_workerdata_struct::devid, and NULL. |
|
||||||||||||
|
worker thread calls this to get relative speed of this device as determined by the SM/core count and clock rate Definition at line 1202 of file WKFThreads.C. References wkf_threadpool_workerdata_struct::devspeed, and NULL. |
|
||||||||||||||||
|
worker thread can call this to get its ID and number of peers Definition at line 1163 of file WKFThreads.C. References NULL, wkf_threadpool_workerdata_struct::threadcount, and wkf_threadpool_workerdata_struct::threadid. |
|
||||||||||||
|
worker thread calls this to set relative speed of this device as determined by the SM/core count and clock rate Note: this should only be called once, during the worker's device initialization process Definition at line 1191 of file WKFThreads.C. References wkf_threadpool_workerdata_struct::devspeed. |
|
|
shrink memory buffers associated with task tile stack if possible Definition at line 790 of file WKFThreads.C. References wkf_tilestack_t::mtx, NULL, wkf_tilestack_t::s, wkf_tilestack_t::size, wkf_tilestack_t::top, wkf_mutex_lock, and wkf_mutex_unlock. |
|
|
destroy task tile stack Definition at line 781 of file WKFThreads.C. References wkf_tilestack_t::mtx, NULL, wkf_tilestack_t::s, and wkf_mutex_destroy. |
|
|
query if the task tile stack is empty or not Definition at line 881 of file WKFThreads.C. References wkf_tilestack_t::mtx, wkf_tilestack_t::top, wkf_mutex_lock, and wkf_mutex_unlock. |
|
||||||||||||
|
initialize task tile stack (to empty) Definition at line 758 of file WKFThreads.C. References wkf_tilestack_t::growthrate, wkf_tilestack_t::mtx, NULL, wkf_tilestack_t::s, wkf_tilestack_t::size, wkf_tilestack_t::top, and wkf_mutex_init. |
|
||||||||||||
|
pop a task tile off of the stack Definition at line 843 of file WKFThreads.C. References wkf_tilestack_t::mtx, wkf_tilestack_t::s, wkf_tilestack_t::top, wkf_mutex_lock, wkf_mutex_unlock, and WKF_TILESTACK_EMPTY. |
|
|
pop all of the task tiles off of the stack Definition at line 866 of file WKFThreads.C. References wkf_tilestack_t::mtx, wkf_tilestack_t::top, wkf_mutex_lock, and wkf_mutex_unlock. |
|
||||||||||||
|
push a task tile onto the stack Definition at line 814 of file WKFThreads.C. References wkf_tilestack_t::growthrate, wkf_tilestack_t::mtx, NULL, wkf_tilestack_t::s, wkf_tilestack_t::size, wkf_tilestack_t::top, wkf_mutex_lock, and wkf_mutex_unlock. |
1.2.14 written by Dimitri van Heesch,
© 1997-2002