IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 37695


Ignore:
Timestamp:
Nov 29, 2014, 5:05:08 AM (12 years ago)
Author:
eugene
Message:

only launch groups of updateobject hosts based on the hostname

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/UpdateObjectOffsets.c

    r37631 r37695  
    7878  return (TRUE);
    7979}
     80
     81int UpdateObjectOffsets_parallel_group (HostTableGroup *group, SkyList *sky);
    8082
    8183// CATDIR is supplied globally
     
    9294  }   
    9395
     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
     111int UpdateObjectOffsets_parallel_group (HostTableGroup *group, SkyList *sky) {
     112
     113  // launch the relastro_client jobs to the parallel hosts
     114
    94115  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) {
    98119      // do any of the regions want this host?
    99120      int wantThisHost = FALSE;
    100121      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)) {
    102123          wantThisHost = TRUE;
    103124          break;
     
    105126      }
    106127      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);
    108129        continue;
    109130      }
     
    111132
    112133    // 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;
    116137
    117138    // options / arguments that can affect relastro_client -load:
     
    125146    char command[1024];
    126147    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);
    128149
    129150    if (FIT_MODE == FIT_PM_ONLY)         strextend (command, "-pm");
     
    184205      // launch the job on the remote machine (no handshake)
    185206      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);
    187208      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);
    189210        exit (1);
    190211      }
    191       table->hosts[i].pid = pid; // save for future reference
     212      group->hosts[i][0].pid = pid; // save for future reference
    192213    }
    193214  }
     
    198219  }
    199220  if (!PARALLEL_MANUAL && !PARALLEL_SERIAL) {
    200     HostTableWaitJobsGetIO (table, __FILE__, __LINE__, VERBOSE);
     221    HostTableGroupWaitJobsGetIO (group, __FILE__, __LINE__, VERBOSE);
    201222  }
    202223
Note: See TracChangeset for help on using the changeset viewer.