IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 12, 2015, 6:18:23 PM (11 years ago)
Author:
eugene
Message:

merge changes from EAM dev branch ohana.20150429

Location:
trunk/Ohana
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana

  • trunk/Ohana/src/dvomerge/src/dvomergeUpdate_catalogs.c

    r38062 r38441  
    142142
    143143    // skip empty input catalogs
    144     if (!incatalog.Naves_disk) {
     144    if (!incatalog.Naverage_disk) {
    145145        dvo_catalog_unlock (&incatalog);
    146146        dvo_catalog_free (&incatalog);
     
    176176
    177177      // 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;
    184187      }
    185188
     
    227230  return TRUE;
    228231}
     232
     233int dvomergeUpdate_parallel_group (HostTableGroup *group, char *absinput, char *absoutput);
    229234
    230235// launch the dvomergeUpdate_client jobs to the parallel hosts
     
    254259  }   
    255260
     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
    256265  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
     273int dvomergeUpdate_parallel_group (HostTableGroup *group, char *absinput, char *absoutput) {
     274
     275  int i;
     276  for (i = 0; i < group->Nhosts; i++) {
    258277
    259278    // 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;
    263282
    264283    // options / arguments that can affect relastro_client -update-objects:
    265284    char command[DVO_MAX_PATH];
    266285    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,
    268287              UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, RADIUS
    269288      );
     
    291310      int status = system (command);
    292311      if (status) {
    293         fprintf (stderr, "ERROR running photdbc_client\n");
     312        fprintf (stderr, "ERROR running dvomerge_client\n");
    294313        exit (2);
    295314      }
     
    297316      // launch the job on the remote machine (no handshake)
    298317      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);
    300319      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);
    302321        exit (1);
    303322      }
    304       table->hosts[i].pid = pid; // save for future reference
     323      group->hosts[i][0].pid = pid; // save for future reference
    305324    }
    306325  }
    307326
    308327  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");
    310329    getchar();
    311330  }
    312331  if (!PARALLEL_MANUAL && !PARALLEL_SERIAL) {
    313     int status = HostTableWaitJobsGetIO (table, __FILE__, __LINE__, VERBOSE);
     332    int status = HostTableGroupWaitJobsGetIO (group, __FILE__, __LINE__, VERBOSE);
    314333    if (!status) {
    315334      fprintf (stderr, "error running one of the remote clients\n");
Note: See TracChangeset for help on using the changeset viewer.