Scioto API
(→Task Collection Types) |
(→Creation and Destruction) |
||
Line 18: | Line 18: | ||
=== Creation and Destruction === | === Creation and Destruction === | ||
− | gtc_t gtc_create(int max_body_size, int chunk_size, int shrb_size, MPI_Comm comm) | + | <div class="dashbox">''Create a new task collection.'' '''(collective)''' |
+ | gtc_t '''gtc_create'''(int max_body_size, int chunk_size, int shrb_size, MPI_Comm comm) | ||
− | + | * ''max_body_size'' - Maximum body size for any task in this collection. Tasks with a larger body size cannot be added to the collection. | |
+ | * ''chunk_size'' - Chunk size for work stealing '''(deprecated)''' | ||
+ | * ''shrb_size'' - Size of the work queue in number of tasks for this process | ||
+ | * ''comm'' - MPI Communicator that this collection should run on (usually MPI_COMM_WORLD)</div> | ||
− | + | <div class="dashbox">''Destroy a task collection.'' '''(collective)''' | |
+ | void gtc_destroy(gtc_t gtc) | ||
+ | * ''gtc'' - Reference to the task collection</div> | ||
+ | |||
+ | <div class="dashbox">''Reset a task collection so that it can be used again.'' '''(collective)''' | ||
+ | void gtc_reset(gtc_t gtc) | ||
+ | * ''gtc'' - Reference to the task collection</div> | ||
=== Populating and Execution === | === Populating and Execution === |
Revision as of 18:39, 24 February 2010
This page provides documentation on the Scioto Global Task Collection (GTC) API intended for use at the application level.
Contents |
Task Collection Types
These are the types that can be used by an application programmer. A portable type can be transferred over the network and is valid on all processes. It can also be embedded in a task descriptor and copied via simple assignment.
- gtc_t
- Portable reference to a task collection
- task_t
- Local buffer containing a task descriptor
- task_class_t
- Portable reference to a task class
- clod_key_t
- Portable reference to a common local object
Task Collection API
Creation and Destruction
gtc_t gtc_create(int max_body_size, int chunk_size, int shrb_size, MPI_Comm comm)
- max_body_size - Maximum body size for any task in this collection. Tasks with a larger body size cannot be added to the collection.
- chunk_size - Chunk size for work stealing (deprecated)
- shrb_size - Size of the work queue in number of tasks for this process
- comm - MPI Communicator that this collection should run on (usually MPI_COMM_WORLD)
void gtc_destroy(gtc_t gtc)
- gtc - Reference to the task collection
void gtc_reset(gtc_t gtc)
- gtc - Reference to the task collection
Populating and Execution
int gtc_add(gtc_t gtc, task_t *task, int master); void gtc_process(gtc_t gtc);
Diagnostic/Performance Functions
void gtc_print_stats(gtc_t gtc);
void gtc_print_config(gtc_t gtc);
void gtc_set_chunk_size(gtc_t gtc, int cs);
void gtc_enable_stealing(gtc_t gtc);
void gtc_disable_stealing(gtc_t gtc);
Task Object API
A task collection contains a set of task objects. Every task object has a class associated with it that defines the properties of that task, including the size of the task object's body and how the task should be executed. A task class is required when creating a task, so the programmer must register task classes before creating tasks.
Task Classes
Task classes live outside of any particular task collection and persist throughout the entire computation. Thus, for a given program, a task class need only be created once.
task_class_t gtc_task_class_register(int body_size, void (*cb_execute)(gtc_t gtc, task_t *descriptor))
- body_size - The size of the task's body
- cb_execute - The function that should be invoked to execute this task. This function gets a reference to the task collection as well as a pointer to a local copy of the task descriptor.
Task Object Management
task_t *gtc_task_create(task_class_t tclass);
void gtc_task_destroy(task_t *task);
void gtc_task_reuse(task_t *task);
void gtc_task_set_affinity(task_t *task, int affinity);
task_class_t gtc_task_get_class(task_t *task);
int gtc_task_body_size(task_t *task);
void *gtc_task_body(task_t *task);
Common Local Object (CLO) Database API
clod_key_t gtc_clo_associate(gtc_t gtc, void *ptr);
void *gtc_clo_lookup(gtc_t gtc, clod_key_t id);
void gtc_clo_assign(gtc_t gtc, clod_key_t id, void *ptr);
void gtc_clo_reset(gtc_t gtc);