![]() |
MAOS
Multithreaded Adaptive Optics Simulator
|
Data Structures | |
| struct | thread_t |
Macros | |
| #define | DO_PRAGMA(A...) |
| #define | PRINT_MACRO(x) |
| #define | STR(x) |
| #define | LOCK(A) |
| #define | TRYLOCK(A) |
| #define | UNLOCK(A) |
| #define | PINIT(A) |
| #define | PDEINIT(A) |
| #define | PNEW(A) |
| #define | PNEW2(A) |
| #define | LOCK_FFT LOCK(mutex_fftw) |
| #define | UNLOCK_FFT UNLOCK(mutex_fftw) |
| #define | MEM_ORDER __ATOMIC_SEQ_CST |
| #define | atomic_compare_exchange_n(ptr, pexpected, desired) |
| #define | atomic_compare_exchange(ptr, pexpected, pdesired) |
| #define | OMPTASK_SINGLE |
| #define | OMP_IN_PARALLEL 0 |
| #define | OMP_FOR(n) |
| #define | OMP_FOR_COLLAPSE(n, nthread) |
| #define | OMP(A) |
| #define | OMP_TASK_FOR(ntask) |
| #define | OMP_TASK_FOR_COLLAPSE(n, ntask) |
| #define | OMP_CRITICAL |
| #define | THREAD_POOL_INIT(A) |
| #define | QUEUE(counter, fun, arg, njob, urgent) |
| Queue jobs to counter. Do not wait. | |
| #define | QUEUE_THREAD(counter, A, urgent) |
| #define | WAIT(counter, urgent) |
| #define | CALL(fun, arg, nthread, urgent) |
| Queue jobs to a temp counter, Then wait for it to complete. | |
| #define | CALL_THREAD(A, urgent) |
| #define | CALL_THREAD_ARR(A, nA, urgent) |
Typedefs | |
| typedef void *(* | thread_fun) (void *) |
| typedef void *(* | thread_wrapfun) (thread_t *) |
Functions | |
| long | thread_id (void) |
| thread_t * | thread_prep (long start, long end, long nthread, thread_wrapfun fun, void *data) |
| pthread_t | thread_new (thread_fun fun, void *arg) |
| void | thread_block_signal () |
Functions regarding to threading.
Openmp version: 3.0 (200805): Introduced task 4.0 (201307): Introduced taskgroup. 4.5 (201511): Introduced taskloop and priority. Taskloop has implicit taskgroup.
| struct thread_t |
| #define DO_PRAGMA | ( | A... | ) |
| #define PRINT_MACRO | ( | x | ) |
| #define STR | ( | x | ) |
| #define LOCK | ( | A | ) |
| #define TRYLOCK | ( | A | ) |
| #define UNLOCK | ( | A | ) |
| #define PINIT | ( | A | ) |
| #define PDEINIT | ( | A | ) |
| #define PNEW | ( | A | ) |
| #define PNEW2 | ( | A | ) |
| #define atomic_compare_exchange_n | ( | ptr, | |
| pexpected, | |||
| desired ) |
| #define atomic_compare_exchange | ( | ptr, | |
| pexpected, | |||
| pdesired ) |
| #define THREAD_POOL_INIT | ( | A | ) |
| #define QUEUE | ( | counter, | |
| fun, | |||
| arg, | |||
| njob, | |||
| urgent ) |
Queue jobs to counter. Do not wait.
| #define QUEUE_THREAD | ( | counter, | |
| A, | |||
| urgent ) |
| #define WAIT | ( | counter, | |
| urgent ) |
| long thread_id | ( | void | ) |
Return the pthread id of the calling thread.
Break out the job to be executed by multiple threads. The index range is split evenly; threads beyond the range get empty ranges and NULL fun. thd[0].nthread is set to the number of active threads.
| [in] | start | Start index (inclusive). |
| [in] | end | End index (exclusive). |
| [in] | nthread | Number of threads. |
| [in] | fun | Function to be called by each thread. |
| [in] | data | Data shared by all threads. |
| pthread_t thread_new | ( | thread_fun | fun, |
| void * | arg ) |
Create a new detached thread and forget.
| [in] | fun | Thread function. |
| [in] | arg | Argument passed to fun. |
| void thread_block_signal | ( | ) |
After calling this routine, this thread will nolonger receive signals