Changeset 38438
- Timestamp:
- Jun 12, 2015, 3:32:16 PM (11 years ago)
- Location:
- branches/eam_branches/ohana.20150429/src
- Files:
-
- 7 edited
-
dvomerge/include/dvomerge.h (modified) (1 diff)
-
dvomerge/src/args.c (modified) (1 diff)
-
dvomerge/src/dvomergeUpdate_catalogs.c (modified) (4 diffs)
-
libdvo/include/dvo.h (modified) (1 diff)
-
libdvo/src/HostTable.c (modified) (2 diffs)
-
relastro/src/UpdateObjectOffsets.c (modified) (1 diff)
-
relphot/src/reload_catalogs.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ohana.20150429/src/dvomerge/include/dvomerge.h
r38421 r38438 41 41 int REPLACE_BY_PHOTCODE; 42 42 int FORCE_MERGE; 43 int MAX_CLIENTS; 43 44 char *UPDATE_CATFORMAT; 44 45 char *UPDATE_CATCOMPRESS; -
branches/eam_branches/ohana.20150429/src/dvomerge/src/args.c
r38421 r38438 41 41 if ((N = get_argument (*argc, argv, "-matched-tables"))) { 42 42 MATCHED_TABLES = TRUE; 43 remove_argument (N, argc, argv); 44 } 45 46 /* limit the impact of a dvomerge -parallel */ 47 MAX_CLIENTS = 10; 48 if ((N = get_argument (*argc, argv, "-max-clients"))) { 49 remove_argument (N, argc, argv); 50 MAX_CLIENTS = atoi(argv[N]); 43 51 remove_argument (N, argc, argv); 44 52 } -
branches/eam_branches/ohana.20150429/src/dvomerge/src/dvomergeUpdate_catalogs.c
r38427 r38438 231 231 } 232 232 233 int dvomergeUpdate_parallel_group (HostTableGroup *group, char *absinput, char *absoutput); 234 233 235 // launch the dvomergeUpdate_client jobs to the parallel hosts 234 236 int dvomergeUpdate_parallel (char *input, char *output, SkyTable *outsky, IDmapType *IDmap) { … … 257 259 } 258 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 259 265 int i; 260 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++) { 261 277 262 278 // ensure that the paths are absolute path names 263 char *tmppath = abspath ( table->hosts[i].pathname, DVO_MAX_PATH);264 free ( table->hosts[i].pathname);265 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; 266 282 267 283 // options / arguments that can affect relastro_client -update-objects: 268 284 char command[DVO_MAX_PATH]; 269 285 snprintf (command, DVO_MAX_PATH, "dvomerge_client %s into %s -hostID %d -hostdir %s -region %f %f %f %f -D ADDSTAR_RADIUS %f", 270 absinput, absoutput, table->hosts[i].hostID, table->hosts[i].pathname,286 absinput, absoutput, group->hosts[i][0].hostID, group->hosts[i][0].pathname, 271 287 UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, RADIUS 272 288 ); … … 294 310 int status = system (command); 295 311 if (status) { 296 fprintf (stderr, "ERROR running photdbc_client\n");312 fprintf (stderr, "ERROR running dvomerge_client\n"); 297 313 exit (2); 298 314 } … … 300 316 // launch the job on the remote machine (no handshake) 301 317 int errorInfo = 0; 302 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); 303 319 if (!pid) { 304 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); 305 321 exit (1); 306 322 } 307 table->hosts[i].pid = pid; // save for future reference323 group->hosts[i][0].pid = pid; // save for future reference 308 324 } 309 325 } 310 326 311 327 if (PARALLEL_MANUAL) { 312 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"); 313 329 getchar(); 314 330 } 315 331 if (!PARALLEL_MANUAL && !PARALLEL_SERIAL) { 316 int status = HostTable WaitJobsGetIO (table, __FILE__, __LINE__, VERBOSE);332 int status = HostTableGroupWaitJobsGetIO (group, __FILE__, __LINE__, VERBOSE); 317 333 if (!status) { 318 334 fprintf (stderr, "error running one of the remote clients\n"); -
branches/eam_branches/ohana.20150429/src/libdvo/include/dvo.h
r38419 r38438 1091 1091 void InitHost (HostInfo *host); 1092 1092 1093 HostTableGroup *HostTableGroups (HostTable *table, int *ngroups); 1093 HostTableGroup *HostTableGroupsUniqueMachines (HostTable *table, int *ngroups); 1094 HostTableGroup *HostTableGroupsMaxNumber (HostTable *table, int *ngroups, int Nmax); 1095 1094 1096 int HostTableGroupWaitJobsGetIO (HostTableGroup *table, char *file, int lineno, int VERBOSE); 1095 1097 -
branches/eam_branches/ohana.20150429/src/libdvo/src/HostTable.c
r37807 r38438 155 155 156 156 // split a host table into Ngroups, each with a unique set of hosts 157 HostTableGroup *HostTableGroups (HostTable *table, int *ngroups) {157 HostTableGroup *HostTableGroupsUniqueMachines (HostTable *table, int *ngroups) { 158 158 159 159 // identify the unique host names and the number of times they each exist … … 210 210 foundHost[k] = TRUE; 211 211 } 212 } 213 } 214 *ngroups = Ngroups; 215 return groups; 216 } 217 218 // split a host table into Ngroups, each with a unique set of hosts 219 HostTableGroup *HostTableGroupsMaxNumber (HostTable *table, int *ngroups, int Nmax) { 220 221 int i, j; 222 223 int Ngroups = (table->Nhosts % Nmax) ? (int)(table->Nhosts / Nmax + 1) : table->Nhosts / Nmax; 224 225 HostTableGroup *groups = NULL; 226 ALLOCATE (groups, HostTableGroup, Ngroups); 227 228 // in each group, attempt to add one of each unique host 229 int k = 0; 230 for (i = 0; i < Ngroups; i++) { 231 groups[i].Nhosts = 0; 232 ALLOCATE (groups[i].hosts, HostInfo *, Nmax); 233 for (j = 0; j < Nmax; j++) { 234 groups[i].hosts[groups[i].Nhosts] = &table->hosts[k]; 235 groups[i].Nhosts ++; 236 k++; 212 237 } 213 238 } -
branches/eam_branches/ohana.20150429/src/relastro/src/UpdateObjectOffsets.c
r38382 r38438 102 102 103 103 int Ngroups; 104 HostTableGroup *groups = HostTableGroups (table, &Ngroups);104 HostTableGroup *groups = HostTableGroupsUniqueMachines (table, &Ngroups); 105 105 // split the table into Ngroups, each with a unique set of machines (this avoids overloading the remote host machines) 106 106 -
branches/eam_branches/ohana.20150429/src/relphot/src/reload_catalogs.c
r38379 r38438 171 171 172 172 int Ngroups; 173 HostTableGroup *groups = HostTableGroups (table, &Ngroups);173 HostTableGroup *groups = HostTableGroupsUniqueMachines (table, &Ngroups); 174 174 // split the table into Ngroups, each with a unique set of machines (this avoids overloading the remote host machines) 175 175
Note:
See TracChangeset
for help on using the changeset viewer.
