4f02bb751b312aec02eab82737382f1f94829a4a,tests/pytorch/test_kvstore.py,,,#,96

Before Change



    client.shut_down()

if __name__ == "__main__":
    server_embed = th.tensor([2., 2., 2., 2., 2.])
    // use pytorch shared memory
    server_embed.share_memory_()

    pid = os.fork()
    if pid == 0:
        start_server(server_embed)
    else:
        time.sleep(2) // wait server start
        start_client(server_embed)

    assert th.equal(server_embed, th.tensor([ 4., 4., 14., 4., 24.])) == True

After Change


    // server process
    p0 = Process(target=start_server, args=(0, 4))
    p1 = Process(target=start_server, args=(1, 4))
    p2 = Process(target=start_server, args=(2, 4))
    p3 = Process(target=start_server, args=(3, 4))

    // client process
    p4 = Process(target=start_client, args=(True,))
    p5 = Process(target=start_client, args=(True,))
    p6 = Process(target=start_client, args=(False,))
    p7 = Process(target=start_client, args=(False,))


    // start server process
    p0.start()
    p1.start()
    p2.start()
    p3.start()

    // start client process
    p4.start()
    p5.start()
    p6.start()
    p7.start()


    p0.join()
    p1.join()
    p2.join()
    p3.join()

    p4.join()
    p5.join()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: dmlc/dgl
Commit Name: 4f02bb751b312aec02eab82737382f1f94829a4a
Time: 2019-12-29
Author: mctt90@gmail.com
File Name: tests/pytorch/test_kvstore.py
Class Name:
Method Name:


Project Name: okfn-brasil/serenata-de-amor
Commit Name: 67fa4171fffad014ef7f072ef56426e52080fcb5
Time: 2016-11-10
Author: cuducos@gmail.com
File Name: src/fetch_suspicious_places.py
Class Name:
Method Name: search_suspicious_around_companies


Project Name: keras-team/keras
Commit Name: 9a50d7bece2e09093f7eec251fc2be5736b131da
Time: 2018-01-09
Author: myutwo150@users.noreply.github.com
File Name: tests/keras/applications/applications_test.py
Class Name:
Method Name: test_densenet_variable_input_channels