00001 /* 00002 Copyright (C) 2011- The University of Notre Dame 00003 This software is distributed under the GNU General Public License. 00004 See the file COPYING for details. 00005 */ 00006 00007 #ifndef MPI_QUEUE_H 00008 #define MPI_QUEUE_H 00009 00012 #include "timestamp.h" 00013 00014 00015 #define MPI_QUEUE_LINE_MAX 256 00016 #define MPI_QUEUE_DEFAULT_PORT 9123 00017 00018 #define MPI_QUEUE_WAITFORTASK -1 00019 00020 #define MPI_QUEUE_RETURN_STATUS_UNSET -1 00021 #define MPI_QUEUE_RESULT_UNSET -1 00022 00023 #define MPI_QUEUE_INPUT 0 00024 #define MPI_QUEUE_OUTPUT 1 00025 00028 struct mpi_queue_task { 00029 char *tag; 00030 char *command_line; 00031 char *output; 00032 struct list *input_files; 00033 struct list *output_files; 00034 int taskid; 00035 int status; 00036 int return_status; 00037 int result; 00039 timestamp_t submit_time; 00040 timestamp_t start_time; 00041 timestamp_t finish_time; 00042 timestamp_t transfer_start_time; 00043 timestamp_t computation_time; 00045 INT64_T total_bytes_transferred; 00046 timestamp_t total_transfer_time; 00047 }; 00048 00049 00054 struct mpi_queue_task *mpi_queue_task_create(const char *full_command); 00055 00063 void mpi_queue_task_specify_file(struct mpi_queue_task *t, const char *name, int type); 00064 00065 00071 void mpi_queue_task_specify_tag(struct mpi_queue_task *t, const char *tag); 00072 00073 00077 void mpi_queue_task_delete(struct mpi_queue_task *t); 00078 00079 00096 struct mpi_queue *mpi_queue_create(int port); 00097 00104 int mpi_queue_submit(struct mpi_queue *q, struct mpi_queue_task *t); 00105 00111 struct mpi_queue_task *mpi_queue_wait(struct mpi_queue *q, int timeout); 00112 00116 int mpi_queue_empty(struct mpi_queue *q); 00117 00122 int mpi_queue_port(struct mpi_queue *q); 00123 00127 void mpi_queue_delete(struct mpi_queue *q); 00128 00129 #endif 00130