IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 25, 2010, 12:50:29 PM (16 years ago)
Author:
eugene
Message:

merge changes from eam_branches/ipp-20100823

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/pcontrol/job.c

    r23586 r29540  
    66  int i, N, Mode, targc, Timeout;
    77  IDtype JobID;
     8  char **xhosts;
     9  int Nxhosts, NXHOSTS;
    810
    911  if (get_argument (argc, argv, "-host") && get_argument (argc, argv, "+host")) {
     
    3941  }
    4042
     43  xhosts = NULL;
     44  Nxhosts = 0;
     45  NXHOSTS = 10;
     46  while ((N = get_argument (argc, argv, "-xhost"))) {
     47    if (xhosts == NULL) {
     48      ALLOCATE (xhosts, char *, NXHOSTS);
     49    }
     50    remove_argument (N, &argc, argv);
     51    xhosts[Nxhosts] = strcreate (argv[N]);
     52    remove_argument (N, &argc, argv);
     53    Nxhosts ++;
     54    if (Nxhosts == NXHOSTS) {
     55      NXHOSTS += 10;
     56      REALLOCATE (xhosts, char *, NXHOSTS);
     57    }
     58  }
     59
    4160  if (argc < 2) {
    4261    FREE (Host);
     
    5170
    5271  // a JobID < 0 mean the job was not accepted
    53   JobID = AddJob (Host, Mode, Timeout, targc, targv);
     72  JobID = AddJob (Host, Mode, Timeout, targc, targv, Nxhosts, xhosts);
    5473  gprint (GP_LOG, "JobID: %d\n", (int) JobID);
    5574  return (TRUE);
     
    5776 usage:
    5877    gprint (GP_ERR, "USAGE: job [options] (arg0) (arg1) ... (argN)\n");
    59     gprint (GP_ERR, "  options: -host, +host, -timeout\n");
     78    gprint (GP_ERR, "  options: -host, +host, -timeout, -xhost (host)\n");
    6079    gprint (GP_ERR, "  arguments of the form @MAX_THREADS@ will be replaced when the job is launched\n");
     80
     81    FREE (Host);
     82    for (i = 0; i < Nxhosts; i++) {
     83      FREE (xhosts[i]);
     84    }
     85    FREE (xhosts);
    6186    return (FALSE);
    6287}
Note: See TracChangeset for help on using the changeset viewer.