home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / hp / 14557 < prev    next >
Encoding:
Text File  |  1993-01-06  |  3.1 KB  |  90 lines

  1. Newsgroups: comp.sys.hp
  2. Path: sparky!uunet!usc!cs.utexas.edu!torn!watserv2.uwaterloo.ca!madmax.uwaterloo.ca!gordon
  3. From: gordon@madmax.uwaterloo.ca (Gordon R. Strachan)
  4. Subject: Re: Batchjob que for hp700
  5. Message-ID: <C0Fst8.EBz@watserv2.uwaterloo.ca>
  6. Sender: news@watserv2.uwaterloo.ca
  7. Organization: University of Waterloo
  8. References: <1ickjuINNl1f@transfer.stratus.com> <1993Jan5.203704.12846@alchemy.chem.utoronto.ca>
  9. Date: Wed, 6 Jan 1993 14:41:31 GMT
  10. Lines: 78
  11.  
  12. In article <1993Jan5.203704.12846@alchemy.chem.utoronto.ca> system@alchemy.chem.utoronto.ca (System Admin (Mike Peterson)) writes:
  13. >In article <1ickjuINNl1f@transfer.stratus.com> dean@nassau.hw.stratus.com (Dean Markarian) writes:
  14. >I am been running:
  15. >
  16. >batch (ftp.cs.utoronto.ca in /pub/batch.tar.Z) - works on Sun, SGI,
  17. >   Ultrix, Apollo Domain/OS, Stardent, MIPS. This is the one I use.
  18. >   Does not work across a network. Users can get mail when job finishes.
  19. >   Starts/suspends jobs based on load average, time of day, etc.
  20. >   I have disabled the job time limits since it causes the daemon
  21. >   to hang/die, but otherwise it works fine.
  22. >   This is also available from iworks.ecn.uiowa.edu, or I will
  23. >   post my version with the time limits disabled if there is enough
  24. >   demand.
  25. >
  26.  
  27. Mike, if this is the code I ported over and sent to you then I think I have
  28. finally found the bug in the time limit code.  I have been meaning to send this
  29. off to you for about a month now.  Anyway, the problem I found was in the
  30. list walking code in the PruneProcs function and is only hit on systems which
  31. have more programs running than the hash table size (probably why I never
  32. caught it for so long).  Anyway, sorry it took me so long to get back to
  33. you but my to do list has been extremely long recently.  Here is the new
  34. PruneProcs function.  Could you please try it and let me know if it fixes
  35. the bug you found.
  36.  
  37. PruneProcs()
  38.  
  39. {
  40.  struct ProcessTime *current;
  41.  struct ProcessTime *previous;
  42.  int i;
  43.  
  44.  for(i = 0; i <HASHSIZE; i++)
  45.   {
  46.    current = previous = HashTable[i];
  47.    while(current != NULL)
  48.     {
  49.      if(current->LastSeen != Round)
  50.       {
  51.        mdebug1("Removing process %d\n",current->Pid);
  52.        RemoveFromParent(current->PPid,current->DataSize + current->ChildDSize);
  53.        if(current == HashTable[i])
  54.     {
  55.      HashTable[i] = current->next;
  56.      free(current);
  57.      current = previous = HashTable[i];
  58.     }
  59.        else
  60.     {
  61.      previous->next = current->next;
  62.      free(current);
  63.      current = previous->next;
  64.     }
  65.       }
  66.      else
  67.       {
  68.        previous = current;
  69.        current = previous->next;
  70.       }
  71.     }
  72.   }
  73. }
  74.  
  75.  
  76. There is also another bug I found in the code which "program" statement in
  77. the batch profile.  The batchd program uses the system call to execute the
  78. command.  But, at least on HP-UX, this causes a sigchld to be generated.  The
  79. batch daemon then reaps it but doesn't recognize the pid of the child so
  80. assumes a major error occures and drains the queue.  Right now my work around
  81. is to disable sigchld prior to the system call but this doesn't always work.
  82.  
  83. Anyway, please let me know if this fixes the bug in the resource limit code.
  84.  
  85. Gordon
  86.  
  87. PS
  88. Once again sorry I took so long.
  89.  
  90.