IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 38438


Ignore:
Timestamp:
Jun 12, 2015, 3:32:16 PM (11 years ago)
Author:
eugene
Message:

update dvomerge to limit the number of simultaneous clients; api update to relastro, relphot

Location:
branches/eam_branches/ohana.20150429/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ohana.20150429/src/dvomerge/include/dvomerge.h

    r38421 r38438  
    4141int    REPLACE_BY_PHOTCODE;
    4242int    FORCE_MERGE;
     43int    MAX_CLIENTS;
    4344char  *UPDATE_CATFORMAT;
    4445char  *UPDATE_CATCOMPRESS;
  • branches/eam_branches/ohana.20150429/src/dvomerge/src/args.c

    r38421 r38438  
    4141  if ((N = get_argument (*argc, argv, "-matched-tables"))) {
    4242    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]);
    4351    remove_argument (N, argc, argv);
    4452  }
  • branches/eam_branches/ohana.20150429/src/dvomerge/src/dvomergeUpdate_catalogs.c

    r38427 r38438  
    231231}
    232232
     233int dvomergeUpdate_parallel_group (HostTableGroup *group, char *absinput, char *absoutput);
     234
    233235// launch the dvomergeUpdate_client jobs to the parallel hosts
    234236int dvomergeUpdate_parallel (char *input, char *output, SkyTable *outsky, IDmapType *IDmap) {
     
    257259  }   
    258260
     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
    259265  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
     273int dvomergeUpdate_parallel_group (HostTableGroup *group, char *absinput, char *absoutput) {
     274
     275  int i;
     276  for (i = 0; i < group->Nhosts; i++) {
    261277
    262278    // 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;
    266282
    267283    // options / arguments that can affect relastro_client -update-objects:
    268284    char command[DVO_MAX_PATH];
    269285    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,
    271287              UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, RADIUS
    272288      );
     
    294310      int status = system (command);
    295311      if (status) {
    296         fprintf (stderr, "ERROR running photdbc_client\n");
     312        fprintf (stderr, "ERROR running dvomerge_client\n");
    297313        exit (2);
    298314      }
     
    300316      // launch the job on the remote machine (no handshake)
    301317      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);
    303319      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);
    305321        exit (1);
    306322      }
    307       table->hosts[i].pid = pid; // save for future reference
     323      group->hosts[i][0].pid = pid; // save for future reference
    308324    }
    309325  }
    310326
    311327  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");
    313329    getchar();
    314330  }
    315331  if (!PARALLEL_MANUAL && !PARALLEL_SERIAL) {
    316     int status = HostTableWaitJobsGetIO (table, __FILE__, __LINE__, VERBOSE);
     332    int status = HostTableGroupWaitJobsGetIO (group, __FILE__, __LINE__, VERBOSE);
    317333    if (!status) {
    318334      fprintf (stderr, "error running one of the remote clients\n");
  • branches/eam_branches/ohana.20150429/src/libdvo/include/dvo.h

    r38419 r38438  
    10911091void InitHost (HostInfo *host);
    10921092
    1093 HostTableGroup *HostTableGroups (HostTable *table, int *ngroups);
     1093HostTableGroup *HostTableGroupsUniqueMachines (HostTable *table, int *ngroups);
     1094HostTableGroup *HostTableGroupsMaxNumber (HostTable *table, int *ngroups, int Nmax);
     1095
    10941096int HostTableGroupWaitJobsGetIO (HostTableGroup *table, char *file, int lineno, int VERBOSE);
    10951097
  • branches/eam_branches/ohana.20150429/src/libdvo/src/HostTable.c

    r37807 r38438  
    155155
    156156// split a host table into Ngroups, each with a unique set of hosts
    157 HostTableGroup *HostTableGroups (HostTable *table, int *ngroups) {
     157HostTableGroup *HostTableGroupsUniqueMachines (HostTable *table, int *ngroups) {
    158158
    159159  // identify the unique host names and the number of times they each exist
     
    210210        foundHost[k] = TRUE;
    211211      }
     212    }
     213  }
     214  *ngroups = Ngroups;
     215  return groups;
     216}
     217
     218// split a host table into Ngroups, each with a unique set of hosts
     219HostTableGroup *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++;
    212237    }
    213238  }
  • branches/eam_branches/ohana.20150429/src/relastro/src/UpdateObjectOffsets.c

    r38382 r38438  
    102102
    103103  int Ngroups;
    104   HostTableGroup *groups = HostTableGroups (table, &Ngroups);
     104  HostTableGroup *groups = HostTableGroupsUniqueMachines (table, &Ngroups);
    105105  // split the table into Ngroups, each with a unique set of machines (this avoids overloading the remote host machines)
    106106
  • branches/eam_branches/ohana.20150429/src/relphot/src/reload_catalogs.c

    r38379 r38438  
    171171
    172172  int Ngroups;
    173   HostTableGroup *groups = HostTableGroups (table, &Ngroups);
     173  HostTableGroup *groups = HostTableGroupsUniqueMachines (table, &Ngroups);
    174174  // split the table into Ngroups, each with a unique set of machines (this avoids overloading the remote host machines)
    175175
Note: See TracChangeset for help on using the changeset viewer.