Types and functions for the tasks.
More...
#include <pthread.h>
#include <semaphore.h>
#include <hwloc.h>
#include "error.h"
Go to the source code of this file.
|
enum | ghost_task_flags {
GHOST_TASK_DEFAULT = 0,
GHOST_TASK_PRIO_HIGH = 1,
GHOST_TASK_LD_STRICT = 2,
GHOST_TASK_NOT_ALLOW_CHILD = 4,
GHOST_TASK_NOT_PIN = 8,
GHOST_TASK_ONLY_HYPERTHREADS = 16,
GHOST_TASK_NO_HYPERTHREADS = 32
} |
|
enum | ghost_task_state {
GHOST_TASK_INVALID,
GHOST_TASK_CREATED,
GHOST_TASK_ENQUEUED,
GHOST_TASK_RUNNING,
GHOST_TASK_FINISHED
} |
|
Types and functions for the tasks.
@{
- Author
- Moritz Kreutzer morit.nosp@m.z.kr.nosp@m.eutze.nosp@m.r@fa.nosp@m.u.de
#define GHOST_TASK_FILL_ALL -2 |
Use all available processing units.
#define GHOST_TASK_FILL_LD -1 |
Use all processing units in the given NUMA domain.
#define GHOST_TASK_LD_UNDEFINED -2 |
Enumerator |
---|
GHOST_TASK_DEFAULT |
The default task.
|
GHOST_TASK_PRIO_HIGH |
The task will be treated as high-priority.
|
GHOST_TASK_LD_STRICT |
The task must be executed in the given NUMA node.
|
GHOST_TASK_NOT_ALLOW_CHILD |
A child task must not use this task's resources.
|
GHOST_TASK_NOT_PIN |
|
GHOST_TASK_ONLY_HYPERTHREADS |
|
GHOST_TASK_NO_HYPERTHREADS |
|
Enumerator |
---|
GHOST_TASK_INVALID |
Task is invalid (e.g., not yet created).
|
GHOST_TASK_CREATED |
Task has been created.
|
GHOST_TASK_ENQUEUED |
Task has been enqueued.
|
GHOST_TASK_RUNNING |
Task is running.
|
GHOST_TASK_FINISHED |
Task has finished.
|
Create a task.
- Parameters
-
task | Where to store the task |
nThreads | The number of threads which are reserved for the task |
LD | The index of the task queue this task should be added to |
func | The function the task should execute |
arg | The arguments to the task's function |
flags | The task's flags |
depends | List of ghost_task * on which this task depends |
ndepends | Length of the depends argument |
- Returns
- GHOST_SUCCESS on success or an error indicator.
Destroy a task.
- Parameters
-
[in,out] | t | The task to be destroyed |
Enqueue a task.
- Parameters
-
- Returns
- GHOST_SUCCESS on success or an error indicator.
Unpin a task's threads.
- Parameters
-
- Returns
- GHOST_SUCCESS on success or an error indicator.
Wait for a task to finish.
- Parameters
-
- Returns
- GHOST_SUCCESS on success or an error indicator.
Test the task's current state.
- Parameters
-
- Returns
- The state of the task
bool ghost_tasking_enabled |
( |
| ) |
|
Check whether tasking is globally enabled.
- Returns
- false if the GHOST_TASK environment variable is set to "disable", true otherwise.