def run_baseline_rd(test_data_id, Ns, num_procs):
    '\n    Run get_baseline_rd on all networks in test_data_id whose size is in the list Ns.\n    Multiprocessing is used to run on multiple networks in parallel.\n    num_procs is the number of processors to use.\n    '
    cpu_count = mp.cpu_count()
    print(('%d cpus, using %d' % (cpu_count, num_procs)))
    pool_args = []
    (network_sizes, num_samples, _) = fe.load_test_data(('%s.npz' % test_data_id))
    for (N, S) in zip(network_sizes, num_samples):
        if (N not in Ns):
            continue
        cap = 20000
        for s in range(S):
            logfilename = ('logs/baseline_rd_%s_N_%d_s_%d.log' % (test_data_id, N, s))
            pool_args.append((test_data_id, N, s, cap, logfilename))
    start_time = time.time()
    test_fun = pool_get_baseline_rd
    if (num_procs < 1):
        for args in pool_args:
            test_fun(args)
    else:
        pool = mp.Pool(processes=num_procs)
        pool.map(test_fun, pool_args)
        pool.close()
        pool.join()
    print(('total time: %f' % (time.time() - start_time)))
Run get_baseline_rd on all networks in test_data_id whose size is in the list Ns.
Multiprocessing is used to run on multiple networks in parallel.
num_procs is the number of processors to use.
def run_baseline_rd(test_data_id, Ns, num_procs):
    '\n    Run get_baseline_rd on all networks in test_data_id whose size is in the list Ns.\n    Multiprocessing is used to run on multiple networks in parallel.\n    num_procs is the number of processors to use.\n    '
    cpu_count = mp.cpu_count()
    print(('%d cpus, using %d' % (cpu_count, num_procs)))
    pool_args = []
    (network_sizes, num_samples, _) = fe.load_test_data(('%s.npz' % test_data_id))
    for (N, S) in zip(network_sizes, num_samples):
        if (N not in Ns):
            continue
        cap = 20000
        for s in range(S):
            logfilename = ('logs/baseline_rd_%s_N_%d_s_%d.log' % (test_data_id, N, s))
            pool_args.append((test_data_id, N, s, cap, logfilename))
    start_time = time.time()
    test_fun = pool_get_baseline_rd
    if (num_procs < 1):
        for args in pool_args:
            test_fun(args)
    else:
        pool = mp.Pool(processes=num_procs)
        pool.map(test_fun, pool_args)
        pool.close()
        pool.join()
    print(('total time: %f' % (time.time() - start_time)))