Index: trunk/Ohana/src/opihi/pcontrol/job.c
===================================================================
--- trunk/Ohana/src/opihi/pcontrol/job.c	(revision 23586)
+++ trunk/Ohana/src/opihi/pcontrol/job.c	(revision 29540)
@@ -6,4 +6,6 @@
   int i, N, Mode, targc, Timeout;
   IDtype JobID;
+  char **xhosts;
+  int Nxhosts, NXHOSTS;
 
   if (get_argument (argc, argv, "-host") && get_argument (argc, argv, "+host")) {
@@ -39,4 +41,21 @@
   }
 
+  xhosts = NULL;
+  Nxhosts = 0;
+  NXHOSTS = 10;
+  while ((N = get_argument (argc, argv, "-xhost"))) {
+    if (xhosts == NULL) {
+      ALLOCATE (xhosts, char *, NXHOSTS);
+    }
+    remove_argument (N, &argc, argv);
+    xhosts[Nxhosts] = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+    Nxhosts ++;
+    if (Nxhosts == NXHOSTS) {
+      NXHOSTS += 10;
+      REALLOCATE (xhosts, char *, NXHOSTS);
+    }
+  }
+
   if (argc < 2) {
     FREE (Host);
@@ -51,5 +70,5 @@
 
   // a JobID < 0 mean the job was not accepted
-  JobID = AddJob (Host, Mode, Timeout, targc, targv);
+  JobID = AddJob (Host, Mode, Timeout, targc, targv, Nxhosts, xhosts);
   gprint (GP_LOG, "JobID: %d\n", (int) JobID);
   return (TRUE);
@@ -57,6 +76,12 @@
  usage:
     gprint (GP_ERR, "USAGE: job [options] (arg0) (arg1) ... (argN)\n");
-    gprint (GP_ERR, "  options: -host, +host, -timeout\n");
+    gprint (GP_ERR, "  options: -host, +host, -timeout, -xhost (host)\n");
     gprint (GP_ERR, "  arguments of the form @MAX_THREADS@ will be replaced when the job is launched\n");
+
+    FREE (Host);
+    for (i = 0; i < Nxhosts; i++) {
+      FREE (xhosts[i]);
+    }
+    FREE (xhosts);
     return (FALSE);
 }
