IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 32568


Ignore:
Timestamp:
Oct 27, 2011, 9:59:21 AM (15 years ago)
Author:
eugene
Message:

adding linked list varient for pcontrol

Location:
branches/eam_branches/ipp-20110906/Ohana/src/opihi
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110906/Ohana/src/opihi/include/pcontrol.h

    r29540 r32568  
    152152} Host;
    153153
     154# if (USE_LLIST)
     155typedef struct StackItem {
     156    StackItem *next;
     157    StackItem *prev;
     158    void *object;
     159    char *name;
     160    int   id;
     161} StackItem;
     162
     163/* the Jobs and Hosts are managed in a set of Stacks which define their state */
     164typedef struct {
     165    StackItem *head;
     166    StackItem *tail; // use this?
     167    int    Nobject;
     168# ifdef THREADED   
     169  pthread_mutex_t mutex;
     170# endif
     171} Stack;
     172
     173# else
     174
    154175/* the Jobs and Hosts are managed in a set of Stacks which define their state */
    155176typedef struct {
     
    163184# endif
    164185} Stack;
     186# endif
    165187
    166188/* XXX if this is hard-wired, we can't change shell name in StartHost */
  • branches/eam_branches/ipp-20110906/Ohana/src/opihi/pcontrol/CheckIdleHost.c

    r29540 r32568  
    55// a (temporary?) work-around for the problem that the remote pclient job tends to grow
    66// too large over time.
     7
     8/****
     9     
     10     queueing strategy:
     11
     12     We have a problem when the queue contains many jobs of different processing times.  If we
     13     start with an equal number of jobs in two classes, fast and slow, eventually, we will end
     14     up with all hosts running the slow jobs and the fast jobs completely blocked.  If J1 takes
     15     T1 and J2 takes T2, and jobs have equal probability to land in a slot... ??
     16
     17     It seems like we should boost the probability of the fast jobs over the slow jobs (of
     18     course, the end result of that will be all fast jobs draining and the slow jobs hanging
     19     around). 
     20
     21     There is also a problem related to LAP, in that chip stage has a huge number of tasks in
     22     the queue (effectively infinite).  Make the probability of the job being selected
     23     proportional to something.  In any case, we need a user-controllable way to change the
     24     probability of selection
     25
     26     As things are implemented below, the selection order depends on the queue order.  The
     27     easiest way to modify the probabilities is to re-sort based on something.
     28
     29 ****/
    730
    831static float MAX_WANTHOST_WAIT = 10.0;
  • branches/eam_branches/ipp-20110906/Ohana/src/opihi/pcontrol/JobOps.c

    r29540 r32568  
    270270  FREE (job);
    271271}
     272
     273void ResortJobStack (int StackID) {
     274
     275  Stack *stack = GetJobStack (StackID);
     276  LockStack (stack);
     277
     278# define SWAPFUNC(A,B){ \
     279  void *tmpObject = stack[0].object[A]; \
     280  stack[0].object[A] = stack[0].object[B]; \
     281  stack[0].object[B] = tmpObject; \
     282  void *tmpName = stack[0].name[A]; \
     283  stack[0].name[A] = stack[0].name[B]; \
     284  stack[0].name[B] = tmpName; \
     285  void *tmpID = stack[0].id[A]; \
     286  stack[0].id[A] = stack[0].id[B]; \
     287  stack[0].id[B] = tmpID; \
     288}
     289
     290# define COMPARE(A,B)(((Job *)stack[0].object[A]).VALUE < ((Job *)stack[0].object[B]).VALUE)
     291
     292  OHANA_SORT (N, COMPARE, SWAPFUNC);
     293
     294# undef SWAPFUNC
     295# undef COMPARE
     296
     297  UnlockStack (stack);
     298}
Note: See TracChangeset for help on using the changeset viewer.