55
55
void specify_work_queue_task_shared_files(struct work_queue_task *t, const char *input_files, const char *output_files)
60
files = strdup(input_files);
61
f = strtok(files, " \t,");
63
char fname[WORK_QUEUE_LINE_MAX];
58
char *files = strdup(input_files);
59
char *file = strtok(files, " \t,");
62
char *p = strchr(file, '=');
70
char tmp[WORK_QUEUE_LINE_MAX];
71
getcwd(tmp, WORK_QUEUE_LINE_MAX);
74
string_collapse_path(tmp, fname, 1);
68
char *cwd = string_getcwd();
69
char *new = string_format("%s/%s", cwd, file);
80
work_queue_task_specify_file(t, f, p + 1, WORK_QUEUE_INPUT, WORK_QUEUE_CACHE|WORK_QUEUE_THIRDGET);
81
debug(D_DEBUG, "shared file %s is %s on remote system:", f, p + 1);
76
work_queue_task_specify_file(t, file, p + 1, WORK_QUEUE_INPUT, WORK_QUEUE_CACHE|WORK_QUEUE_THIRDGET);
77
debug(D_DEBUG, "shared file %s is %s on remote system:", file, p + 1);
84
work_queue_task_specify_file(t, fname, fname, WORK_QUEUE_INPUT, WORK_QUEUE_CACHE|WORK_QUEUE_THIRDGET);
80
work_queue_task_specify_file(t, file, file, WORK_QUEUE_INPUT, WORK_QUEUE_CACHE|WORK_QUEUE_THIRDGET);
86
f = strtok(0, " \t,");
83
file = strtok(0, " \t,");
92
files = strdup(output_files);
93
f = strtok(files, " \t,");
95
char fname[WORK_QUEUE_LINE_MAX];
89
char *files = strdup(output_files);
90
char *file = strtok(files, " \t,");
93
char *p = strchr(file, '=');
102
char tmp[WORK_QUEUE_LINE_MAX];
103
getcwd(tmp, WORK_QUEUE_LINE_MAX);
106
string_collapse_path(tmp, fname, 1);
99
char *cwd = string_getcwd();
100
char *new = string_format("%s/%s", cwd, file);
112
work_queue_task_specify_file(t, fname, p + 1, WORK_QUEUE_OUTPUT, WORK_QUEUE_THIRDPUT);
113
debug(D_DEBUG, "shared file %s is %s on remote system:", f, p + 1);
107
work_queue_task_specify_file(t, file, p + 1, WORK_QUEUE_OUTPUT, WORK_QUEUE_THIRDPUT);
108
debug(D_DEBUG, "shared file %s is %s on remote system:", file, p + 1);
116
work_queue_task_specify_file(t, fname, fname, WORK_QUEUE_OUTPUT, WORK_QUEUE_THIRDPUT);
111
work_queue_task_specify_file(t, file, file, WORK_QUEUE_OUTPUT, WORK_QUEUE_THIRDPUT);
118
f = strtok(0, " \t,");
114
file = strtok(0, " \t,");
124
120
batch_job_id_t batch_job_submit_work_queue(struct batch_queue *q, const char *cmd, const char *args, const char *infile, const char *outfile, const char *errfile, const char *extra_input_files, const char *extra_output_files)
126
struct work_queue_task *t;
130
full_command = (char *) malloc((strlen(cmd) + strlen(args) + strlen(infile) + 5) * sizeof(char));
132
full_command = (char *) malloc((strlen(cmd) + strlen(args) + 2) * sizeof(char));
135
debug(D_DEBUG, "couldn't create new work_queue task: out of memory\n");
122
char *command = string_format("%s %s", cmd, args);
124
char *new = string_format("%s <%s", command, infile);
140
sprintf(full_command, "%s %s < %s", cmd, args, infile);
142
sprintf(full_command, "%s %s", cmd, args);
144
t = work_queue_task_create(full_command);
129
struct work_queue_task *t = work_queue_task_create(command);
148
133
if(q->type == BATCH_QUEUE_TYPE_WORK_QUEUE_SHAREDFS) {