IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8297


Ignore:
Timestamp:
Aug 11, 2006, 4:52:37 PM (20 years ago)
Author:
eugene
Message:

divided test macros into macros by leveltests

Location:
trunk/Ohana/src/opihi
Files:
1 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.astro/multifit.c

    r7917 r8297  
    141141    }
    142142  }
    143   gaussj (a, Ndim, b, 1);
     143  dgaussj (a, Ndim, b, 1);
    144144
    145145  Ny = 0;
  • trunk/Ohana/src/opihi/cmd.basic/cd.c

    r7917 r8297  
    33int cd (int argc, char **argv) {
    44
    5   int status;
     5  int N, VERBOSE, status;
    66  char *cwd;
     7
     8  VERBOSE = TRUE;
     9  if ((N = get_argument (argc, argv, "-q"))) {
     10    remove_argument (N, &argc, argv);
     11    VERBOSE = FALSE;
     12  }
    713
    814  if (argc != 2) {
     
    1723      return (FALSE);
    1824    }
    19     gprint (GP_LOG, "cwd: %s\n", cwd);
     25    if (VERBOSE) gprint (GP_LOG, "cwd: %s\n", cwd);
    2026    ohana_memregister (cwd);
    2127    free (cwd);
     
    3036int pwd (int argc, char **argv) {
    3137
    32   char *cwd;
     38  int N;
     39  char *cwd, *var;
     40
     41  var = NULL;
     42  if ((N = get_argument (argc, argv, "-var"))) {
     43    remove_argument (N, &argc, argv);
     44    var = strcreate (argv[N]);
     45    remove_argument (N, &argc, argv);
     46  }
    3347
    3448  if (argc != 1) {
    35     gprint (GP_ERR, "USAGE: pwd\n");
     49    gprint (GP_ERR, "USAGE: pwd [-var variable]\n");
    3650    return (FALSE);
    3751  }
     
    3953  if ((cwd = getcwd(NULL, 64)) == NULL) {
    4054    gprint (GP_ERR, "error getting cwd\n");
     55    if (var != NULL) free (var);
    4156    return (FALSE);
    4257  }
    43   gprint (GP_LOG, "cwd: %s\n", cwd);
     58  if (var == NULL) {
     59      gprint (GP_LOG, "cwd: %s\n", cwd);
     60  } else {
     61      set_str_variable (var, cwd);
     62      free (var);
     63  }
    4464  ohana_memregister (cwd);
    4565  free (cwd);
  • trunk/Ohana/src/opihi/cmd.data/fit.c

    r7917 r8297  
    118118      }
    119119    }
    120     if (!gaussj (c, nterm, b, 1)) goto escape;
     120    if (!dgaussj (c, nterm, b, 1)) goto escape;
    121121
    122122    /* generate fitted values */
  • trunk/Ohana/src/opihi/cmd.data/fit2d.c

    r7917 r8297  
    168168    }
    169169
    170     gaussj (c, wterm, b, 1);
     170    dgaussj (c, wterm, b, 1);
    171171
    172172    gprint (GP_ERR, "inverse:\n");
  • trunk/Ohana/src/opihi/cmd.data/gaussj.c

    r7917 r8297  
    3333    b[i][0] = v[i];
    3434  }
    35   gaussj (a, N, b, 1);
     35  dgaussj (a, N, b, 1);
    3636
    3737  for (i = 0; i < N; i++) {
  • trunk/Ohana/src/opihi/doc/pcontrol.txt

    r8185 r8297  
     1
     22006.08.11
     3
     4I have nearly finished the conversion of pcontrol to use a background
     5thread for monitoring the remote machines.  A few questions are still
     6outstanding: 
     7
     8- currently, we are thread-safe for interactions with the stacks.  As
     9  long as an operation is only working with a single job/host, and all
     10  jobs/hosts are selected by pulling them from the stacks, there will
     11  never be a contention between threads for the same job/host.
     12  However, are there problems for commands which require a specific
     13  job or host but are unable to find it because the job/host may be in
     14  flight from one stack to another. 
     15
     16- The CheckIdleHost command needs to join a job and a host.  In this
     17  case, it is necessary to lock the job PENDING stack while searching
     18  for a job to give to a host.  The host is pulled off of the IDLE
     19  stack before being past to CheckIdleHost.
     20
     21o CheckIdleHost currently does not have a way to send a WANTHOST job
     22  to any host other than the WANTHOST.  What should the rule be by
     23  which a job is run on an alternative machine? (partial fix)
     24
     25- we are not starting any of the job or host timers?
     26
     272006.08.09
     28
     29working on pcontrol CheckSystem background thread.  One thread runs
     30the readline interaction and performs all of the user commands.  The
     31second thread runs the CheckSystem loop and tests the hosts and jobs.
     32We need to be sure these two do not interfere with one another.  Here
     33is a list of all of the user commands and the ways in which they
     34interact with the Job / Host queues:
     35
     36
    137
    2382006.08.04
    339
    4 pcontrol get a large delay every time it tries to connect to a host.
     40pcontrol gets a large delay every time it tries to connect to a host.
    541this is because the readline interrupt has to wait for the connection
    642to complete.  I probably need to fix this by using a threaded model
  • trunk/Ohana/src/opihi/include/pcontrol.h

    r7917 r8297  
    99  PCONTROL_JOB_PENDING,
    1010  PCONTROL_JOB_BUSY, 
     11  PCONTROL_JOB_HUNG, 
     12  PCONTROL_JOB_DONE, 
     13  PCONTROL_JOB_KILL, 
    1114  PCONTROL_JOB_EXIT,
    1215  PCONTROL_JOB_CRASH,
    13   PCONTROL_JOB_HUNG, 
    14   PCONTROL_JOB_DONE, 
    1516} JobStat;
    1617
     
    9394typedef struct {
    9495  void **object;
     96  char **name;
     97  int   *id;
    9598  int    Nobject;
    9699  int    NOBJECT;
     100  // pthread_mutex_t mutex;
    97101} Stack;
    98102
     
    107111void InitPcontrol ();
    108112
    109 void *GetStack (Stack *stack, int where);
    110 int PutStack (Stack *stack, int where, void *object);
     113/*** StackOps.c ***/
    111114Stack *InitStack ();
    112 Stack *GetHostStack (int StackID);
    113 int PutHost (Host *host, int StackID, int where);
    114 Host *GetHost (int StackID, int where);
    115 int FindHost (IDtype HostID, int StackID);
    116 Host *FindHostPtr (IDtype HostID, int StackID);
    117 Host *FindHostStack (IDtype HostID);
    118 int FindNamedHostStack (char *name);
    119 Host *PullHost (IDtype HostID, int StackID);
    120 int FindNamedHost (char *name, int StackID);
    121 IDtype AddHost (char *hostname);
    122 void DownHost (Host *host);
    123 void OffHost (Host *host);
    124 void DelHost (Host *host);
     115int    PushStack (Stack *stack, int where, void *object, int id, char *name);
     116void  *PullStackByLocation (Stack *stack, int where);
     117void  *PullStackByName (Stack *stack, char *name);
     118void  *PullStackByID (Stack *stack, int id);
     119void  *FindStackByID (Stack *stack, int id);
     120void  *FindStackByName (Stack *stack, char *name);
     121void   LockStack (Stack *stack);
     122void   UnlockStack (Stack *stack);
     123
    125124int CheckSystem ();
    126125int CheckBusyJobs (float delay);
    127126int CheckDoneJobs (float delay);
     127int CheckKillJobs (float delay);
    128128int CheckDoneHosts (float delay);
    129129int CheckLiveHosts (float delay);
     
    144144int rconnect (char *command, char *hostname, char *shell, int *stdio);
    145145int CheckHost (Host *host);
    146 Stack *GetJobStack (int StackID);
    147 Stack *GetJobStackByName (char *name);
    148 int PutJob (Job *job, int StackID, int where);
    149 Job *GetJob (int StackID, int where);
    150 int FindJob (IDtype JobID, int StackID);
    151 Job *FindJobPtr (IDtype JobID, int StackID);
    152 Job *FindJobStack (IDtype JobID);
    153 Job *PullJob (IDtype JobID, int StackID);
    154 IDtype AddJob (char *hostname, JobMode mode, int timeout, int argc, char **argv);
    155 int KillJob (Job *job);
    156 void DelJob (Job *job);
    157 Host *UnlinkJobAndHost (Job *job);
    158 void LinkJobAndHost (Job *job, Host *host);
    159 int StopHost (Host *host);
    160146
    161147int PrintJobStack (int Nstack);
    162148int PrintHostStack (int Nstack);
    163 void InitJobStacks ();
    164 void InitHostStacks ();
    165 void DownHost (Host *host);
    166 void OffHost (Host *host);
    167 int DownHosts ();
    168 int VerboseMode ();
    169 int StartJob (Job *job);
    170 void gotsignal (int signum);
    171 int HarvestHost (int pid);
     149
     150int    VerboseMode ();
     151
     152void   gotsignal (int signum);
     153
     154/*** HostOps.c ***/
     155void   InitHostStacks ();
     156Stack *GetHostStack (int StackID);
     157Stack *GetHostStackByName (char *name);
     158int    PutHost (Host *host, int StackID, int where);
     159Host  *PullHostByID (IDtype HostID, int *StackID);
     160Host  *PullHostByName (char *name, int *StackID);
     161Host  *PullHostFromStackByID (int StackID, IDtype ID);
     162Host  *PullHostFromStackByName (int StackID, char *name);
     163Host  *FindHostByID (IDtype HostID, int *StackID);
     164Host  *FindHostByName (char *name, int *StackID);
     165Host  *FindHostInStackByID (int StackID, IDtype ID);
     166Host  *FindHostInStackByName (int StackID, char *name);
     167IDtype AddHost (char *hostname);
     168void   DelHost (Host *host);
     169
     170void   DownHost (Host *host);
     171void   OffHost (Host *host);
     172int    DownHosts ();
     173int    HarvestHost (int pid);
     174int    StopHost (Host *host);
     175
     176/*** JobOps.c ***/
     177void   InitJobStacks ();
     178Stack *GetJobStack (int StackID);
     179Stack *GetJobStackByName (char *name);
     180int    PutJob (Job *job, int StackID, int where);
     181int    PutJobSetState (Job *job, int StackID, int where, int state);
     182Job   *PullJobByID (IDtype JobID, int *StackID);
     183Job   *PullJobFromStackByID (int StackID, int ID);
     184Job   *FindJobByID (IDtype JobID, int *StackID);
     185Job   *FindJobInStackByID (int StackID, int ID);
     186IDtype AddJob (char *hostname, JobMode mode, int timeout, int argc, char **argv);
     187void   DelJob (Job *job);
     188Host  *UnlinkJobAndHost (Job *job);
     189void   LinkJobAndHost (Job *job, Host *host);
     190
     191int    KillJob (Job *job);
     192int    StartJob (Job *job);
  • trunk/Ohana/src/opihi/lib.data/Makefile

    r7080 r8297  
    2020$(SDIR)/sort.$(ARCH).o                  \
    2121$(SDIR)/fft.$(ARCH).o                   \
    22 $(SDIR)/gaussj.$(ARCH).o                \
    2322$(SDIR)/svdcmp.$(ARCH).o                \
    2423$(SDIR)/convert.$(ARCH).o               \
  • trunk/Ohana/src/opihi/mana/fitcontour.c

    r7917 r8297  
    5757  C[1][2] = C[2][1];
    5858   
    59   gaussj (C, NTERM, B, 1);
     59  dgaussj (C, NTERM, B, 1);
    6060 
    6161  /** this is somewhat weak: if the object is too elongated, Rmin can be < 0 **/
  • trunk/Ohana/src/opihi/test/tests.sh

    r8173 r8297  
    11
    2 $VERBOSE = 0
     2if ($?VERBOSE == 0)
     3 $VERBOSE = 0
     4end
     5
     6$failtest:n = 0
     7$failfile:n = 0
     8$faildirs:n = 0
     9$currentdir = .
    310
    411macro fulltests
     
    1623       echo "directory $testdir:$Ti"
    1724    end
    18     list testscripts -x "ls $testdir:$Ti/*.sh"
    19     for Tj 0 $testscripts:n
    20       if ($VERBOSE > 1)
    21          echo " running $testscripts:$Tj"
    22       end
    23       input $testscripts:$Tj
    24       for Tk 0 $tests:n
    25         if ($VERBOSE > 2)
    26           echo "   running $tests:$Tk"
    27         end
    28         $tests:$Tk
    29         if ($PASS == 0)
    30           echo "   ** failed test $tests:$Tk"
    31           $Nfail ++
    32           $n = $failtest:n
    33           $failtest:$n = $tests:$Tk
    34           $failfile:$n = $testscripts:$Tj
    35           $faildirs:$n = $testdir:$Ti
    36           $failtest:n ++
    37           $failfile:n ++
    38           $faildirs:n ++
    39         else
    40           $Npass ++
    41         end
    42         $Ntest ++
    43         # echo "finished $tests:$Tk"
    44       end
    45       # echo "finished $testscripts:n test scripts from $testscripts:$Tj"
    46     end
    47     # echo "finished tests from $testdir:$Ti"
     25    runtestdir $testdir:$Ti
    4826  end
    4927
     
    5432
    5533  if ($Nfail > 0)
     34    echo " ** failed tests **"
    5635    for i 0 $Nfail
    5736      echo $faildirs:$i $failfile:$i $failtest:$i
     
    6039end
    6140
     41macro runtestdir
     42  if ($0 != 2)
     43    echo "USAGE: runtestdir (testdir)"
     44    break -auto on
     45    break
     46  end
     47 
     48  pwd -var startdir
     49  cd -q $1
     50  list testscripts -x "ls *.sh"
     51
     52  $currentdir = $1
     53  for Tj 0 $testscripts:n
     54    if ($VERBOSE > 1)
     55      echo " running $testscripts:$Tj"
     56    end
     57    runtests $testscripts:$Tj     
     58  end
     59 
     60  cd -q $startdir
     61end
     62
     63macro runtests
     64  if ($0 != 2)
     65    echo "USAGE: runtests (script.sh)"
     66    break -auto on
     67    break
     68  end
     69 
     70  local Tk
     71
     72  input $1
     73  for Tk 0 $tests:n
     74    if ($VERBOSE > 2)
     75      echo "   running $tests:$Tk"
     76    end
     77    $tests:$Tk
     78    if ($PASS == 0)
     79      echo "   ** failed $tests:$Tk $1"
     80      $Nfail ++
     81      $n = $failtest:n
     82      $failtest:$n = $tests:$Tk
     83      $failfile:$n = $1
     84      $faildirs:$n = $currentdir
     85      $failtest:n ++
     86      $failfile:n ++
     87      $faildirs:n ++
     88    else
     89      $Npass ++
     90    end
     91    $Ntest ++
     92    # echo "finished $tests:$Tk"
     93  end
     94end
Note: See TracChangeset for help on using the changeset viewer.