Ejemplo n.º 1
0
static int submit_worker( struct batch_queue *queue, const char *master_regex )
{
	char cmd[1024];
	char extra_input_files[1024];

	sprintf(cmd,"./work_queue_worker -M %s -t %d -C %s:%d -d all -o worker.log ",master_regex,worker_timeout,catalog_host,catalog_port);
	strcpy(extra_input_files,"work_queue_worker");

	if(password_file) {
		strcat(cmd," -P pwfile");
		strcat(extra_input_files,",pwfile");
	}

	if(resource_args) {
		strcat(cmd," ");
		strcat(cmd,resource_args);
	}

	if(extra_worker_args) {
		strcat(cmd," ");
		strcat(cmd,extra_worker_args);
	}


	debug(D_WQ,"submitting worker: %s",cmd);

	return batch_job_submit(queue,cmd,extra_input_files,"output.log",0);
}
Ejemplo n.º 2
0
int wavefront_task_submit_recursive( struct wavefront_task *n )
{
	int i,j;

	char command[PATH_MAX];
	char filename[PATH_MAX];
	char extra_output_files[PATH_MAX];
	char *extra_input_files=NULL;

	string_nformat(command, PATH_MAX, "./wavefront -M -X %d -Y %d ./%s %d %d >output.%d.%d 2>&1", n->x,n->y,function,n->width,n->height,n->x,n->y);
	string_nformat(extra_output_files, PATH_MAX, "output.%d.%d",n->x,n->y);
	extra_input_files = string_format("wavefront,%s",function);

	for(i=-1;i<n->width;i++) {
		string_nformat(filename, PATH_MAX, "R.%d.%d", n->x+i,n->y-1);
		extra_input_files=string_combine(extra_input_files, ",");
		extra_input_files=string_combine(extra_input_files, filename);
	}

	for(j=0;j<n->height;j++) {
		string_nformat(filename, PATH_MAX, "R.%d.%d",n->x-1,n->y+j);
		extra_input_files=string_combine(extra_input_files, ",");
		extra_input_files=string_combine(extra_input_files, filename);
	}

	batch_job_id_t job_id = batch_job_submit(batch_q,command,extra_input_files,extra_output_files,0);
	free(extra_input_files);

	return job_id;
}
Ejemplo n.º 3
0
static int submit_worker( struct batch_queue *queue )
{
	char *cmd;

	if(using_catalog) {
		cmd = string_format(
		"./work_queue_worker -M %s -t %d -C '%s:%d' -d all -o worker.log %s %s %s",
		submission_regex,
		worker_timeout,
		catalog_host,
		catalog_port,
		password_file ? "-P pwfile" : "",
		resource_args ? resource_args : "",
		extra_worker_args ? extra_worker_args : ""
		);
	}
	else {
		cmd = string_format(
		"./work_queue_worker %s %d -t %d -C '%s:%d' -d all -o worker.log %s %s %s",
		master_host,
		master_port,
		worker_timeout,
		catalog_host,
		catalog_port,
		password_file ? "-P pwfile" : "",
		resource_args ? resource_args : "",
		extra_worker_args ? extra_worker_args : ""
		);
	}

	if(wrapper_command) {
		// Note that we don't use string_wrap_command here,
		// because the clever quoting interferes with the $$([Target.Memory]) substitution above.
		char *newcmd = string_format("%s %s",wrapper_command,cmd);
		free(cmd);
		cmd = newcmd;
	}

	char *files = string_format("work_queue_worker");

	if(password_file) {
		char *newfiles = string_format("%s,pwfile",files);
		free(files);
		files = newfiles;
	}

	if(wrapper_input) {
		char *newfiles = string_format("%s,%s",files,wrapper_input);
		free(files);
		files = newfiles;
	}

	debug(D_WQ,"submitting worker: %s",cmd);

	return batch_job_submit(queue,cmd,files,"output.log",0,resources);
}
Ejemplo n.º 4
0
int wavefront_task_submit_single( struct wavefront_task *n )
{
	char command[PATH_MAX * 5]; //Ugly, fix, should be the value from sysconf(ARG_MAX)
	char leftfile[PATH_MAX];
	char bottomfile[PATH_MAX];
	char diagfile[PATH_MAX];
	char extra_input_files[PATH_MAX*4];

	string_nformat(leftfile,   PATH_MAX, "R.%d.%d", n->x-1, n->y);
	string_nformat(bottomfile, PATH_MAX, "R.%d.%d", n->x,   n->y-1);
	string_nformat(diagfile,   PATH_MAX, "R.%d.%d", n->x-1, n->y-1);

	string_nformat(extra_input_files, PATH_MAX*4, "%s,%s,%s,%s", function,leftfile,bottomfile,diagfile);

	string_nformat(command, PATH_MAX * 5, "./%s %s %s %s >R.%d.%d", function,leftfile,bottomfile,diagfile,n->x,n->y);

	return batch_job_submit(batch_q,command,extra_input_files,0,0);
}