X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=binaries%2Fsrc%2Ftcoffee%2Ft_coffee_source%2Futil_job_handling.c;h=838d911d27d964e22c9fb9e38f03b3432b68b512;hb=HEAD;hp=8f730d2e2c8c9184ea988cb1c43b3df8de699c22;hpb=535359a3d592ee41bda72e7356f0181f6cee9d07;p=jabaws.git diff --git a/binaries/src/tcoffee/t_coffee_source/util_job_handling.c b/binaries/src/tcoffee/t_coffee_source/util_job_handling.c index 8f730d2..838d911 100644 --- a/binaries/src/tcoffee/t_coffee_source/util_job_handling.c +++ b/binaries/src/tcoffee/t_coffee_source/util_job_handling.c @@ -18,8 +18,9 @@ Job_TC* print_lib_job ( Job_TC *job,char *string, ...) char **value; char **name; int a, np, n; - char bname[LONG_STRING]; - char bval[LONG_STRING]; + + char bname[100]; + char bval[100]; list=string2list2(string, " ="); n=atoi (list[0]); @@ -28,24 +29,20 @@ Job_TC* print_lib_job ( Job_TC *job,char *string, ...) name =vcalloc ( (n-1)/2, sizeof (char*)); value=vcalloc ( (n-1)/2, sizeof (char*)); - + va_start (ap, string); for (a=1, np=0; aio){job->io=vcalloc ( 1, sizeof (Job_io_TC));job->pl[job->np++]=(void*)job->io;} else if ( strstr(name[a], "param") && !job->param){job->param=vcalloc ( 1, sizeof (Job_param_TC));job->pl[job->np++]=(void*)job->param;} - if ( strm (name[a], "control")) {job->control=(struct Job_control_TC*)atoi(value[a]);string=0;} + if ( strm (name[a], "control")) {job->control=(struct Job_control_TC*)atol(value[a]);string=0;} else if ( strm (name[a], "control->submitF")) {(job->control) ->submitF=(struct Job_TC *(*)(struct Job_TC *))atol(value[a]);string=0;} else if ( strm (name[a], "control->retrieveF")) {(job->control) ->retrieveF=(struct Job_TC *(*)(struct Job_TC *))atol(value[a]);string=0;} else if ( strm (name[a], "control->mode")) {(job->control)->mode=value[a];string=1;} @@ -230,8 +227,7 @@ Job_TC*** split_job_list (Job_TC *job, int ns) if (nj==0)return NULL; else split=(nj/ns)+1; - - + n=a=u=0; jl[a][0]=job; while (job) @@ -252,6 +248,30 @@ Job_TC*** split_job_list (Job_TC *job, int ns) n++; job=job->c; } + + /*Display job details when debugging + a=0; + while (jl[a]) + { + Job_TC *start,* end; + int todo=0; + + start=job=jl[a][0]; + end=jl[a][1]; + while (job!=end){todo++;job=job->c;} + job=start; + while (job!=end) + { + HERE ("--- %d %d %s",a, job, job->param->aln_c); + job=job->c; + } + a++; + } + + a=0; + while (jl[a]){HERE ("**** %d %d ", jl [a][0], jl[a][1]);a++;} + myexit (0); + */ return jl; } @@ -288,11 +308,34 @@ Job_TC* retrieve_job ( Job_TC *job) return NULL; } } -/*********************************COPYRIGHT NOTICE**********************************/ +int **n2splits (int splits, int tot) +{ + int **l; + int a,b,delta; + + if (splits==0)return NULL; + else if ( tot==0)return NULL; + else + { + + l=declare_int (splits,2); + delta=tot/splits; + + for (a=0,b=0; a