target_list, target_index_list, target_nmr_list = new_read_database(
    target_filename)
target_outdic = {'nmr': target_nmr_list[target_index]}
target_mol = target_list[target_index]

if __name__ == "__main__":
    comm = MPI.COMM_WORLD
    size = comm.size
    rank = comm.rank
    status = MPI.Status()
    READY, START, DONE, EXIT = 0, 1, 2, 3
    val = [
        '\n', '&', 'O', 'c', '1', '(', ')', '=', 'C', 'N', '#', 'n', '2', 'o',
        '3', '-', '4'
    ]
    chem_model = loaded_model()
    graph = tf.get_default_graph()
    chemical_state = chemical()
    ts_strategy = cnf.get('param', 'ts_strategy')  #'uct', 'puct'
    search_parameter = float(
        cnf.get('param', 'search_parameter')
    )  #If ts_strategy=='uct', 0 < search_parameter < 1. If ts_strategy=='puct', default value is 5 (AlphaGo).
    num_simulations = int(cnf.get(
        'param', 'num_simulations'))  # core - 1, max: 2560 (skylake)
    gau_parallel = 1
    num_rollout = int(cnf.get('param', 'num_rollout'))
    simulation_time = 3600 * int(cnf.get(
        'param', 'simulation_time'))  # 3600*24 # max: 168h
    trie = int(cnf.get('param', 'trie'))
    random_trie = int(cnf.get('param', 'random_trie'))
    alpha = 1  # alph*mean + (1 - alpha)*max + bais
Ejemplo n.º 2
0
    all_com = []
    all_score = []
    val_score = []
    load_bal = []
    sim_time = []
    lock = Lock()
    stored_jobs = []
    coll = []
    exp_time = []
    print("check all ranks:", rank)
    """
    start distributing jobs to all ranks
    """
    graph = tf.get_default_graph()
    #graph.finalize()
    model = loaded_model()
    model._make_predict_function()
    mem = np.zeros(1024 * 10 * 1024)  #8192)
    MPI.Attach_buffer(mem)
    num_cores = 8
    #q1=Queue()
    num_job = num_cores
    random.seed(1)
    hsm = HashTable()
    #hsm=comm.bcast(hsm,root=0)
    if rank == 0:
        _, rootdest = hsm.hashing(['&'])
        #print ("rootdest:",rootdest)
        for i in range(num_job):
            comm.bsend(rootnode, dest=rootdest, tag=0)