Git Product home page Git Product logo

Comments (2)

cjlin1 avatar cjlin1 commented on August 11, 2024

We had checked approaches for this problem but haven't got a
good setting yet.. We will keep an eye on this issue

Bjarte Johansen writes:

The program would wait for a result even though all workers had quit because of
an error or a C-c. This isn't the most elegant fix, but it is the only one I
could manage in the time I had.

diff --git a/tools/grid.py b/tools/grid.py
index 40f55fb..7c5b744 100755
--- a/tools/grid.py
+++ b/tools/grid.py
@@ -390,6 +390,7 @@ def find_parameters(dataset_pathname, options=''):

job_queue._put = job_queue.queue.appendleft
  • workers = []

fire telnet workers

if telnet_workers:
@@ -400,6 +401,7 @@ def find_parameters(dataset_pathname, options=''):
worker = TelnetWorker(host,job_queue,result_queue,
host,username,password,options)
worker.start()

  •       workers.append(worker)
    

    fire ssh workers

@@ -407,12 +409,14 @@ def find_parameters(dataset_pathname, options=''):
for host in ssh_workers:
worker = SSHWorker(host,job_queue,result_queue,host,options)
worker.start()

  •       workers.append(worker)
    

    fire local workers

    for i in range(nr_local_worker):
    worker = LocalWorker('local',job_queue,result_queue,options)
    worker.start()

  •   workers.append(worker)
    

    gather results

@@ -436,7 +440,11 @@ def find_parameters(dataset_pathname, options=''):
for line in jobs:
for (c,g) in line:
while (c,g) not in done_jobs:

  •           (worker,c1,g1,rate1) = result_queue.get()
    
  •           while any(map(Thread.is_alive, workers)):
    
  •               try:
    
  •                   (worker,c1,g1,rate1) = result_queue.get(True, 1)
    
  •               except:
    
  •                   continue
            done_jobs[(c1,g1)] = rate1
            if (c1,g1) not in resumed_jobs:
                best_c,best_g,best_rate = update_param(c1,g1,rate1,best_c,best_g,best_rate,worker,False)
    
    --
    2.2.0


Reply to this email directly or view it on GitHub.*

from libsvm.

ljos avatar ljos commented on August 11, 2024

I discovered today that my quick fix was a bit too quick. I would look into using async. I think an async model or the go channel model would work well here. A model where you could wait on open channels, but drop closed ones would be ideal I think.

from libsvm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.