An MPI implementation of Work Queue. More...
#include "timestamp.h"
Go to the source code of this file.
Data Structures | |
struct | mpi_queue_task |
A task description. More... | |
Functions | |
struct mpi_queue_task * | mpi_queue_task_create (const char *full_command) |
Create a new task specification. | |
void | mpi_queue_task_specify_file (struct mpi_queue_task *t, const char *name, int type) |
Add a file to a task. | |
void | mpi_queue_task_specify_tag (struct mpi_queue_task *t, const char *tag) |
Attach a user defined logical name to the task. | |
void | mpi_queue_task_delete (struct mpi_queue_task *t) |
Delete a task specification. | |
struct mpi_queue * | mpi_queue_create (int port) |
Create a new work queue. | |
int | mpi_queue_submit (struct mpi_queue *q, struct mpi_queue_task *t) |
Submit a job to a work queue. | |
struct mpi_queue_task * | mpi_queue_wait (struct mpi_queue *q, int timeout) |
Wait for tasks to complete. | |
int | mpi_queue_empty (struct mpi_queue *q) |
Determine whether there are any known tasks queued, running, or waiting to be collected. | |
int | mpi_queue_port (struct mpi_queue *q) |
Get the listening port of the queue. | |
void | mpi_queue_delete (struct mpi_queue *q) |
Delete a work queue. |
An MPI implementation of Work Queue.
struct mpi_queue_task* mpi_queue_task_create | ( | const char * | full_command | ) | [read] |
Create a new task specification.
Once created, the task may be passed to mpi_queue_submit.
full_command | The shell command line to be executed by the task. |
void mpi_queue_task_specify_file | ( | struct mpi_queue_task * | t, | |
const char * | name, | |||
int | type | |||
) |
Add a file to a task.
t | The task to which to add a file. | |
name | The name of the file on local disk or shared filesystem. | |
type | Must be one of the following values:
|
void mpi_queue_task_specify_tag | ( | struct mpi_queue_task * | t, | |
const char * | tag | |||
) |
Attach a user defined logical name to the task.
This field is not interpreted by the work queue, but simply maintained to help the user track tasks.
t | The task to which to add parameters | |
tag | The tag to attach to task t. |
void mpi_queue_task_delete | ( | struct mpi_queue_task * | t | ) |
Delete a task specification.
This may be called on tasks after they are returned from mpi_queue_wait.
t | The task specification to delete. |
struct mpi_queue* mpi_queue_create | ( | int | port | ) | [read] |
Create a new work queue.
Users may modify the behavior of mpi_queue_create by setting the following environmental variables before calling the function:
If the queue has a project name, then queue statistics and information will be reported to a catalog server. To specify the catalog server, the user may set the CATALOG_HOST and CATALOG_PORT environmental variables as described in catalog_query_create.
port | The port number to listen on. If zero is specified, then the default is chosen, and if -1 is specified, a random port is chosen. |
int mpi_queue_submit | ( | struct mpi_queue * | q, | |
struct mpi_queue_task * | t | |||
) |
Submit a job to a work queue.
It is safe to re-submit a task returned by mpi_queue_wait.
q | A work queue returned from mpi_queue_create. | |
t | A task description returned from mpi_queue_task_create. |
struct mpi_queue_task* mpi_queue_wait | ( | struct mpi_queue * | q, | |
int | timeout | |||
) | [read] |
Wait for tasks to complete.
This call will block until the timeout has elapsed.
q | The work queue to wait on. | |
timeout | The number of seconds to wait for a completed task before returning. Use an integer time to set the timeout or the constant WAITFORTASK to block until a task has completed. |
int mpi_queue_empty | ( | struct mpi_queue * | q | ) |
Determine whether there are any known tasks queued, running, or waiting to be collected.
Returns 0 if there are tasks remaining in the system, 1 if the system is "empty".
q | A pointer to the queue to query. |
int mpi_queue_port | ( | struct mpi_queue * | q | ) |
Get the listening port of the queue.
q | The work queue of interest. |
void mpi_queue_delete | ( | struct mpi_queue * | q | ) |
Delete a work queue.
q | The work queue to delete. |