Changeset 38441 for trunk/Ohana/src/dvomerge/src/dvomergeUpdate_catalogs.c
- Timestamp:
- Jun 12, 2015, 6:18:23 PM (11 years ago)
- Location:
- trunk/Ohana
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/dvomerge/src/dvomergeUpdate_catalogs.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana
-
Property svn:mergeinfo
set to
/branches/eam_branches/ohana.20150429 merged eligible
-
Property svn:mergeinfo
set to
-
trunk/Ohana/src/dvomerge/src/dvomergeUpdate_catalogs.c
r38062 r38441 142 142 143 143 // skip empty input catalogs 144 if (!incatalog.Nave s_disk) {144 if (!incatalog.Naverage_disk) { 145 145 dvo_catalog_unlock (&incatalog); 146 146 dvo_catalog_free (&incatalog); … … 176 176 177 177 // if no catalog already exists, use the input catalog to define the format or the specified format 178 if (outcatalog.Naves_disk == 0) { 179 if (UPDATE_CATFORMAT) { 180 outcatalog.catformat = dvo_catalog_catformat (UPDATE_CATFORMAT); 181 } else { 182 outcatalog.catformat = incatalog.catformat; 183 } 178 if (UPDATE_CATFORMAT) { 179 outcatalog.catformat = dvo_catalog_catformat (UPDATE_CATFORMAT); 180 } else { 181 outcatalog.catformat = incatalog.catformat; 182 } 183 if (UPDATE_CATCOMPRESS) { 184 outcatalog.catcompress = dvo_catalog_catcompress (UPDATE_CATCOMPRESS); 185 } else { 186 outcatalog.catcompress = incatalog.catcompress; 184 187 } 185 188 … … 227 230 return TRUE; 228 231 } 232 233 int dvomergeUpdate_parallel_group (HostTableGroup *group, char *absinput, char *absoutput); 229 234 230 235 // launch the dvomergeUpdate_client jobs to the parallel hosts … … 254 259 } 255 260 261 int Ngroups; 262 HostTableGroup *groups = HostTableGroupsMaxNumber (table, &Ngroups, MAX_CLIENTS); 263 // split the table into Ngroups, each with a unique set of machines (this avoids overloading the remote host machines) 264 256 265 int i; 257 for (i = 0; i < table->Nhosts; i++) { 266 for (i = 0; i < Ngroups; i++) { 267 // update only a max of MaxClient machines at a time 268 dvomergeUpdate_parallel_group (&groups[i], absinput, absoutput); 269 } 270 return TRUE; 271 } 272 273 int dvomergeUpdate_parallel_group (HostTableGroup *group, char *absinput, char *absoutput) { 274 275 int i; 276 for (i = 0; i < group->Nhosts; i++) { 258 277 259 278 // ensure that the paths are absolute path names 260 char *tmppath = abspath ( table->hosts[i].pathname, DVO_MAX_PATH);261 free ( table->hosts[i].pathname);262 table->hosts[i].pathname = tmppath;279 char *tmppath = abspath (group->hosts[i][0].pathname, DVO_MAX_PATH); 280 free (group->hosts[i][0].pathname); 281 group->hosts[i][0].pathname = tmppath; 263 282 264 283 // options / arguments that can affect relastro_client -update-objects: 265 284 char command[DVO_MAX_PATH]; 266 285 snprintf (command, DVO_MAX_PATH, "dvomerge_client %s into %s -hostID %d -hostdir %s -region %f %f %f %f -D ADDSTAR_RADIUS %f", 267 absinput, absoutput, table->hosts[i].hostID, table->hosts[i].pathname,286 absinput, absoutput, group->hosts[i][0].hostID, group->hosts[i][0].pathname, 268 287 UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, RADIUS 269 288 ); … … 291 310 int status = system (command); 292 311 if (status) { 293 fprintf (stderr, "ERROR running photdbc_client\n");312 fprintf (stderr, "ERROR running dvomerge_client\n"); 294 313 exit (2); 295 314 } … … 297 316 // launch the job on the remote machine (no handshake) 298 317 int errorInfo = 0; 299 int pid = rconnect ("ssh", table->hosts[i].hostname, command, table->hosts[i].stdio, &errorInfo, FALSE);318 int pid = rconnect ("ssh", group->hosts[i][0].hostname, command, group->hosts[i][0].stdio, &errorInfo, FALSE); 300 319 if (!pid) { 301 if (DEBUG) fprintf (stderr, "failure to start %s (error %d)\n", table->hosts[i].hostname, errorInfo);320 if (DEBUG) fprintf (stderr, "failure to start %s (error %d)\n", group->hosts[i][0].hostname, errorInfo); 302 321 exit (1); 303 322 } 304 table->hosts[i].pid = pid; // save for future reference323 group->hosts[i][0].pid = pid; // save for future reference 305 324 } 306 325 } 307 326 308 327 if (PARALLEL_MANUAL) { 309 fprintf (stderr, "run the photdbc_client commands above. when these are done, hit return\n");328 fprintf (stderr, "run the dvomerge_client commands above. when these are done, hit return\n"); 310 329 getchar(); 311 330 } 312 331 if (!PARALLEL_MANUAL && !PARALLEL_SERIAL) { 313 int status = HostTable WaitJobsGetIO (table, __FILE__, __LINE__, VERBOSE);332 int status = HostTableGroupWaitJobsGetIO (group, __FILE__, __LINE__, VERBOSE); 314 333 if (!status) { 315 334 fprintf (stderr, "error running one of the remote clients\n");
Note:
See TracChangeset
for help on using the changeset viewer.
