GHOST  1.1.2
General, Hybrid, and Optimized Sparse Toolkit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
task.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include <semaphore.h>
#include <errno.h>
#include <unistd.h>
#include <strings.h>
#include "ghost/types.h"
#include "ghost/locality.h"
#include "ghost/task.h"
#include "ghost/thpool.h"
#include "ghost/pumap.h"
#include "ghost/util.h"
#include "ghost/machine.h"
#include "ghost/log.h"
#include "ghost/taskq.h"
Include dependency graph for task.c:

Macros

#define _XOPEN_SOURCE   500
 

Functions

ghost_error ghost_task_unpin (ghost_task *task)
 Unpin a task's threads. More...
 
ghost_error ghost_task_string (char **str, ghost_task *t)
 Stringify a task. More...
 
ghost_error ghost_task_enqueue (ghost_task *t)
 Enqueue a task. More...
 
ghost_task_state ghost_taskest (ghost_task *t)
 Test the task's current state. More...
 
ghost_error ghost_task_wait (ghost_task *task)
 Wait for a task to finish. More...
 
const char * ghost_task_state_string (ghost_task_state state)
 Return a string representing the task's state. More...
 
void ghost_task_destroy (ghost_task *t)
 Destroy a task. More...
 
ghost_error ghost_task_create (ghost_task **t, int nThreads, int LD, void *(*func)(void *), void *arg, ghost_task_flags flags, ghost_task **depends, int ndepends)
 Create a task. More...
 
ghost_error ghost_task_cur (ghost_task **task)
 
bool ghost_tasking_enabled ()
 Check whether tasking is globally enabled. More...
 

Macro Definition Documentation

#define _XOPEN_SOURCE   500

Function Documentation

ghost_error ghost_task_create ( ghost_task **  task,
int  nThreads,
int  LD,
void *(*)(void *)  func,
void *  arg,
ghost_task_flags  flags,
ghost_task **  depends,
int  ndepends 
)

Create a task.

Parameters
taskWhere to store the task
nThreadsThe number of threads which are reserved for the task
LDThe index of the task queue this task should be added to
funcThe function the task should execute
argThe arguments to the task's function
flagsThe task's flags
dependsList of ghost_task * on which this task depends
ndependsLength of the depends argument
Returns
GHOST_SUCCESS on success or an error indicator.

Here is the call graph for this function:

ghost_error ghost_task_cur ( ghost_task **  task)

Here is the call graph for this function:

void ghost_task_destroy ( ghost_task t)

Destroy a task.

Parameters
[in,out]tThe task to be destroyed
ghost_error ghost_task_enqueue ( ghost_task t)

Enqueue a task.

Parameters
tThe task.
Returns
GHOST_SUCCESS on success or an error indicator.

Here is the call graph for this function:

ghost_error ghost_task_unpin ( ghost_task task)

Unpin a task's threads.

Parameters
[in,out]taskThe task.
Returns
GHOST_SUCCESS on success or an error indicator.

Here is the call graph for this function:

ghost_error ghost_task_wait ( ghost_task t)

Wait for a task to finish.

Parameters
tThe task to wait for
Returns
GHOST_SUCCESS on success or an error indicator.

Here is the call graph for this function:

ghost_task_state ghost_taskest ( ghost_task t)

Test the task's current state.

Parameters
tThe task to test
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.