Project

General

Profile

« Previous | Next » 

Revision 1846

bin/map: Set up Parallel Python with an env-var-customizable # CPUs

View differences:

map
69 69
        opts.get_env_var('n', end_default, env_names), u''))
70 70
    if end != None: end += start
71 71
    
72
    # Optimization
73
    cpus = util.cast(int, opts.get_env_var('cpus', None, env_names))
74
    
72 75
    # Debugging
73 76
    debug = opts.env_flag('debug', False, env_names)
74 77
    sql.run_raw_query.debug = debug
......
108 111
    ex_tracker = exc.ExPercentTracker(iter_text='row')
109 112
    profiler = profiling.ItersProfiler(start_now=True, iter_text='row')
110 113
    
114
    try: import pp
115
    except ImportError: return str_
116
    else:
117
        if cpus != None: args = [cpus]
118
        else: args = []
119
        job_server = pp.Server(*args)
120
        log_start('Using '+str(job_server.get_ncpus())+' CPUs')
121
    
111 122
    doc = xml_dom.create_doc()
112 123
    root = doc.documentElement
113 124
    out_is_xml_ref = [False]

Also available in: Unified diff