b133abb82e128bb091ffd1c299b427f3b3958cb3,examples/pytorch/dis_kvstore/server.py,,start_server,#Any#,25

Before Change


        ndata={"ndata":DATA[args.id]},
        edata={"edata":DATA[args.id]},
        ndata_g2l=ndata_g2l[args.id],
        edata_g2l=edata_g2l[args.id])


if __name__ == "__main__":

After Change


def start_server(args):
    Start kvstore service
    
    server_namebook = dgl.contrib.read_ip_config(filename=args.ip_config)

    my_server = KVServer(server_id=args.server_id, server_namebook=server_namebook, num_client=args.num_client)

    if my_server.get_id() % my_server.get_group_count() == 0: // master server
        my_server.set_global2local(name="entity_embed", global2local=g2l[my_server.get_machine_id()])
        my_server.init_data(name="entity_embed", data_tensor=data[my_server.get_machine_id()])
    else:
        time.sleep(3)
        my_server.set_global2local(name="entity_embed")
        my_server.init_data(name="entity_embed")

    my_server.print()

    my_server.start()
    

if __name__ == "__main__":
    args = ArgParser().parse_args()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: dmlc/dgl
Commit Name: b133abb82e128bb091ffd1c299b427f3b3958cb3
Time: 2020-02-16
Author: mctt90@gmail.com
File Name: examples/pytorch/dis_kvstore/server.py
Class Name:
Method Name: start_server


Project Name: deepchem/deepchem
Commit Name: 86328d567ff862262e0da70d0ebc9d90b407e03a
Time: 2017-11-29
Author: peastman@stanford.edu
File Name: deepchem/models/tensorgraph/tensor_graph.py
Class Name: TensorGraph
Method Name: predict_on_generator


Project Name: dmlc/dgl
Commit Name: b133abb82e128bb091ffd1c299b427f3b3958cb3
Time: 2020-02-16
Author: mctt90@gmail.com
File Name: examples/mxnet/dis_kvstore/server.py
Class Name:
Method Name: start_server