cctools
mpi_queue.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2011- The University of Notre Dame
3 This software is distributed under the GNU General Public License.
4 See the file COPYING for details.
5 */
6 
7 #ifndef MPI_QUEUE_H
8 #define MPI_QUEUE_H
9 
12 #include "timestamp.h"
13 
14 
15 #define MPI_QUEUE_LINE_MAX 256
16 #define MPI_QUEUE_DEFAULT_PORT 9123
17 
18 #define MPI_QUEUE_WAITFORTASK -1
19 
20 #define MPI_QUEUE_RETURN_STATUS_UNSET -1
21 #define MPI_QUEUE_RESULT_UNSET -1
22 
23 #define MPI_QUEUE_INPUT 0
24 #define MPI_QUEUE_OUTPUT 1
25 
29  char *tag;
30  char *command_line;
31  char *output;
32  struct list *input_files;
33  struct list *output_files;
34  int taskid;
35  int status;
37  int result;
47 };
48 
49 
54 struct mpi_queue_task *mpi_queue_task_create(const char *full_command);
55 
63 void mpi_queue_task_specify_file(struct mpi_queue_task *t, const char *name, int type);
64 
65 
71 void mpi_queue_task_specify_tag(struct mpi_queue_task *t, const char *tag);
72 
73 
78 
79 
96 struct mpi_queue *mpi_queue_create(int port);
97 
104 int mpi_queue_submit(struct mpi_queue *q, struct mpi_queue_task *t);
105 
111 struct mpi_queue_task *mpi_queue_wait(struct mpi_queue *q, int timeout);
112 
116 int mpi_queue_empty(struct mpi_queue *q);
117 
122 int mpi_queue_port(struct mpi_queue *q);
123 
127 void mpi_queue_delete(struct mpi_queue *q);
128 
129 #endif
130