482 |
|
i = sscanf(vval(RESOLUTION), "%d %d %f", &xres, &yres, &pa); |
483 |
|
mult = vflt(OVERSAMP); |
484 |
|
if (i == 3) { |
485 |
< |
sprintf(rresopt, "-x %d -y %d -pa %f", (int)(mult*xres), |
485 |
> |
sprintf(rresopt, "-x %d -y %d -pa %.3f", (int)(mult*xres), |
486 |
|
(int)(mult*yres), pa); |
487 |
< |
sprintf(fresopt, "-x %d -y %d -pa %f", xres, yres, pa); |
487 |
> |
sprintf(fresopt, "-x %d -y %d -pa %.3f", xres, yres, pa); |
488 |
|
} else if (i) { |
489 |
|
if (i == 1) yres = xres; |
490 |
|
sprintf(rresopt, "-x %d -y %d", (int)(mult*xres), |
1200 |
|
{ |
1201 |
|
int retstatus = 0; |
1202 |
|
int hostcopies; |
1203 |
< |
char com1buf[10240], *com1, *endcom1; |
1203 |
> |
char buf[10240], *com1; |
1204 |
> |
PSERVER *mps[64]; |
1205 |
> |
int nmps = 0; |
1206 |
|
int status; |
1207 |
+ |
int pfd; |
1208 |
+ |
register int n; |
1209 |
|
register PSERVER *ps; |
1210 |
|
|
1211 |
|
if (!silent) |
1217 |
|
for (ps = pslist; ps != NULL; ps = ps->next) { |
1218 |
|
hostcopies = 0; |
1219 |
|
if (maxcopies > 1 && ps->nprocs > 1 && ppins != NULL) { |
1220 |
< |
strcpy(com1=com1buf, com); /* build -PP command */ |
1220 |
> |
strcpy(com1=buf, com); /* build -PP command */ |
1221 |
|
sprintf(com1+(ppins-com), " -PP %s/%s.persist", |
1222 |
|
vval(DIRECTORY), phostname(ps)); |
1223 |
|
strcat(com1, ppins); |
1224 |
< |
endcom1 = com1 + strlen(com1); |
1225 |
< |
sprintf(endcom1, "; kill `sed -n '1s/^[^ ]* //p' %s/%s.persist`", |
1222 |
< |
vval(DIRECTORY), phostname(ps)); |
1223 |
< |
} else { |
1224 |
> |
mps[nmps++] = ps; |
1225 |
> |
} else |
1226 |
|
com1 = com; |
1225 |
– |
endcom1 = NULL; |
1226 |
– |
} |
1227 |
|
while (maxcopies > 0 && |
1228 |
|
startjob(ps, savestr(com1), donecom) != -1) { |
1229 |
< |
sleep(10); |
1229 |
> |
sleep(60); |
1230 |
|
hostcopies++; |
1231 |
|
maxcopies--; |
1232 |
– |
if (endcom1 != NULL) |
1233 |
– |
*endcom1 = '\0'; |
1232 |
|
} |
1233 |
|
if (!silent && hostcopies) { |
1234 |
|
if (hostcopies > 1) |
1243 |
|
while ((status = wait4job(NULL, -1)) != -1) |
1244 |
|
if (status) |
1245 |
|
retstatus += !serverdown(); /* check server */ |
1246 |
+ |
/* terminate parallel rpict's */ |
1247 |
+ |
while (nmps--) { |
1248 |
+ |
sprintf(buf, "%s/%s.persist", |
1249 |
+ |
vval(DIRECTORY), phostname(mps[nmps])); |
1250 |
+ |
if ((pfd = open(buf, O_RDONLY)) >= 0) { |
1251 |
+ |
n = read(pfd, buf, sizeof(buf)-1); /* get PID */ |
1252 |
+ |
buf[n] = '\0'; |
1253 |
+ |
close(pfd); |
1254 |
+ |
for (n = 0; buf[n] && !isspace(buf[n]); n++) |
1255 |
+ |
; |
1256 |
+ |
/* terminate */ |
1257 |
+ |
sprintf(buf, "kill -ALRM %d", atoi(buf+n)); |
1258 |
+ |
wait4job(mps[nmps], startjob(mps[nmps], buf, NULL)); |
1259 |
+ |
} |
1260 |
+ |
} |
1261 |
|
return(retstatus); |
1262 |
|
} |
1263 |
|
|