Changeset 37695
- Timestamp:
- Nov 29, 2014, 5:05:08 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/UpdateObjectOffsets.c
r37631 r37695 78 78 return (TRUE); 79 79 } 80 81 int UpdateObjectOffsets_parallel_group (HostTableGroup *group, SkyList *sky); 80 82 81 83 // CATDIR is supplied globally … … 92 94 } 93 95 96 int Ngroups; 97 HostTableGroup *groups = HostTableGroups (table, &Ngroups); 98 // split the table into Ngroups, each with a unique set of machines (this avoids overloading the remote host machines) 99 100 int i; 101 for (i = 0; i < Ngroups; i++) { 102 // update only a group of unique machines at a time 103 UpdateObjectOffsets_parallel_group (&groups[i], sky); 104 } 105 106 return TRUE; 107 } 108 109 // CATDIR is supplied globally 110 # define DEBUG 1 111 int UpdateObjectOffsets_parallel_group (HostTableGroup *group, SkyList *sky) { 112 113 // launch the relastro_client jobs to the parallel hosts 114 94 115 int i, j; 95 for (i = 0; i < table->Nhosts; i++) {96 97 if (sky->Nregions < table->Nhosts) {116 for (i = 0; i < group->Nhosts; i++) { 117 118 if (sky->Nregions < group->Nhosts) { 98 119 // do any of the regions want this host? 99 120 int wantThisHost = FALSE; 100 121 for (j = 0; j < sky->Nregions; j++) { 101 if (HostTableTestHost (sky->regions[j], table->hosts[i].hostID)) {122 if (HostTableTestHost (sky->regions[j], group->hosts[i][0].hostID)) { 102 123 wantThisHost = TRUE; 103 124 break; … … 105 126 } 106 127 if (!wantThisHost) { 107 // fprintf (stderr, "skip host %s\n", table->hosts[i].hostname);128 // fprintf (stderr, "skip host %s\n", group->hosts[i][0].hostname); 108 129 continue; 109 130 } … … 111 132 112 133 // ensure that the paths are absolute path names 113 char *tmppath = abspath ( table->hosts[i].pathname, DVO_MAX_PATH);114 free ( table->hosts[i].pathname);115 table->hosts[i].pathname = tmppath;134 char *tmppath = abspath (group->hosts[i][0].pathname, DVO_MAX_PATH); 135 free (group->hosts[i][0].pathname); 136 group->hosts[i][0].pathname = tmppath; 116 137 117 138 // options / arguments that can affect relastro_client -load: … … 125 146 char command[1024]; 126 147 snprintf (command, 1024, "relastro_client -update-offsets -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -statmode %s -minerror %f", 127 table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, STATMODE, MIN_ERROR);148 group->hosts[i][0].hostID, CATDIR, group->hosts[i][0].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, STATMODE, MIN_ERROR); 128 149 129 150 if (FIT_MODE == FIT_PM_ONLY) strextend (command, "-pm"); … … 184 205 // launch the job on the remote machine (no handshake) 185 206 int errorInfo = 0; 186 int pid = rconnect ("ssh", table->hosts[i].hostname, command, table->hosts[i].stdio, &errorInfo, FALSE);207 int pid = rconnect ("ssh", group->hosts[i][0].hostname, command, group->hosts[i][0].stdio, &errorInfo, FALSE); 187 208 if (!pid) { 188 if (DEBUG) fprintf (stderr, "failure to start %s (error %d)\n", table->hosts[i].hostname, errorInfo);209 if (DEBUG) fprintf (stderr, "failure to start %s (error %d)\n", group->hosts[i][0].hostname, errorInfo); 189 210 exit (1); 190 211 } 191 table->hosts[i].pid = pid; // save for future reference212 group->hosts[i][0].pid = pid; // save for future reference 192 213 } 193 214 } … … 198 219 } 199 220 if (!PARALLEL_MANUAL && !PARALLEL_SERIAL) { 200 HostTable WaitJobsGetIO (table, __FILE__, __LINE__, VERBOSE);221 HostTableGroupWaitJobsGetIO (group, __FILE__, __LINE__, VERBOSE); 201 222 } 202 223
Note:
See TracChangeset
for help on using the changeset viewer.
