예제 #1
0
 def phc_kill(self, Uid, msg, poly_id = ''):
    if poly_id == '':
       poly_id = 'current'
    print 'Before kill:\n'
    print processes()
    file_id = get_file_id(Uid, poly_id)
    pid = self.get_pid(Uid, poly_id, file_id)
    if pid !='':
       PHC_Kill(pid, file_id)
       print 'After kill:\n'
       print processes()
    else:
       print "No process to kill. The process has not started."
예제 #2
0
 def phc_kill(self, Uid, msg, poly_id=''):
     if poly_id == '':
         poly_id = 'current'
     print 'Before kill:\n'
     print processes()
     file_id = get_file_id(Uid, poly_id)
     pid = self.get_pid(Uid, poly_id, file_id)
     if pid != '':
         PHC_Kill(pid, file_id)
         print 'After kill:\n'
         print processes()
     else:
         print "No process to kill. The process has not started."
예제 #3
0
def main():
   # change directory

   open_solver_folder()
   
   while True:
      full = 0
      Procs = processes()
      print "Procs"
      comps = len(Procs)-1
      for i in xrange(comps):
         print Procs[i]
      if comps >= cores:
         full = 1
         Uid = 0
         print "No more Cores to use"
      else: # XXX to check the status, check by proccess Uid but not 
         if comps < len(Userproc): # some poly has been solved
            for Jid in Userproc:
               if PHC_Status(Jid):
                  del Userproc[Jid]
                  Uid = Jid
                  print "$$$$ Job done: " + Jid 
                  break
         else:
            Uid = 0
      solver_sleep = solver(full, Uid)
      if solver_sleep:
         # No polynomial to solve and no request
         print "No request"
         sleep(sleeptime)
      print "###########################################"