コード例 #1
0
 def test_rpc(self):
     p = Project("rpc", rpc=True, lib=True)
     p.build_main()
     p.start_server()
     try:
         p.run_main("2000 31 31 9000 29700\n", repeat=3)
     finally:
         p.stop_server()
コード例 #2
0
ファイル: tests_mpi.py プロジェクト: elieux/kaira
 def test_rpc(self):
     p = Project("rpc", mpi=True,rpc=True, lib=True)
     p.build_main()
     p.start_server()
     try:
         p.run_main("2000 31 31 9000 29700\n", repeat=3)
     finally:
         p.stop_server()
コード例 #3
0
 def test_bcastgather(self):
     result = "0: 110.3 110.3 110.3 110.3\n" \
              "1: MyC: { 3 3 3 3 3 3 3 } MyC: { 3 3 3 3 3 3 3 } MyC: { 3 3 3 3 3 3 3 } MyC: { 3 3 3 3 3 3 3 }\n" \
              "2: abcdefg abcdefg abcdefg abcdefg\n"
     Project("bcastgather").quick_test(result,
                                       processes=4,
                                       params={"SIZE": 7})
コード例 #4
0
 def test_parameters(self):
     Project("parameters").quick_test("7 10 123\n",
                                      processes=10,
                                      params={
                                          "first": 10,
                                          "second": 7
                                      })
コード例 #5
0
 def test_scattergather(self):
     result = "0: 110.3 220.3 330.3 340.3 350.3\n" \
              "1: MyC: { 1 1 1 1 1 } MyC: { 2 2 2 2 2 } MyC: { 3 3 3 3 3 } MyC: { 4 4 4 4 4 } MyC: { 5 5 5 5 5 }\n" \
              "2: aaaaaaaaaaaaaaaaaaaaaaaa bb ccccccccccccccccccc  mmmmmmmmm\n"
     Project("scattergather").quick_test(result,
                                         processes=5,
                                         params={"SIZE": 5})
コード例 #6
0
 def test_lib_parameters(self):
     result = "1 1 1 1 \n2 1 1 1 \n4 4 1 1 \n8 8 8 1 \n16 16 16 16 \n"
     Project("parameters", "lib_parameters",
             lib=True).quick_test_main(result,
                                       processes=5,
                                       params={
                                           "Size": 4,
                                           "EXP": 4
                                       })
コード例 #7
0
    def test_workers(self):
        def check_output(output):
            self.assertEquals(
                76127,
                sum([int(x) for x in output.split("\n") if x.strip() != ""]))

        params = {"LIMIT": "1000", "SIZE": "20"}
        p = Project("workers")
        p.build()
        p.run(result_fn=check_output, processes=2, params=params)
        p.run(result_fn=check_output, processes=6, params=params, repeat=70)
コード例 #8
0
ファイル: tests.py プロジェクト: elieux/kaira
 def test_workers(self):
     def check_output(output):
         self.assertEquals(76127, sum([ int(x) for x in output.split("\n")
                                               if x.strip() != "" ]))
     params = { "LIMIT" : "1000", "SIZE" : "20" }
     p = Project("workers")
     p.build()
     p.run(result_fn=check_output, processes=2, params=params)
     p.run(result_fn=check_output, processes=6, params=params, repeat=70)
コード例 #9
0
 def test_alloc(self):
     result = ("NEW a\n"
               "CPY a\n"
               "DEL a\n"
               "NEW DEFAULT\n"
               "FIRE 1\n"
               "CPY a\n"
               "FIRE 2\n"
               "NEW c\n"
               "OP= a c\n"
               "DEL c\n"
               "DEL c\n"
               "NEW DEFAULT\n"
               "FIRE 3\n"
               "CPY c\n"
               "DEL c\n"
               "FIRE 4\n"
               "DEL c\n"
               "DEL -\n"
               "DEL a\n")
     Project("alloc").quick_test(result, processes=2)
コード例 #10
0
 def test_alloc2(self):
     result = ("NEW a\n"
               "CPY a\n"
               "DEL a\n"
               "NEW b\n"
               "CPY b\n"
               "DEL b\n"
               "FIRE 1\n"
               "NEW y\n"
               "CPY y\n"
               "DEL y\n"
               "FIRE 2\n"
               "DEL a\n"
               "DEL b\n"
               "NEW DEFAULT\n"
               "NEW DEFAULT\n"
               "FIRE 3\n"
               "FIRE 4\n"
               "DEL a\n"
               "DEL b\n"
               "DEL y\n")
     Project("alloc2").quick_test(result, processes=2)
コード例 #11
0
 def test_origin(self):
     Project("origin").quick_test("Ok\n", processes=3)
コード例 #12
0
 def test_priorities(self):
     Project("priorities").quick_test("C\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\n")
コード例 #13
0
 def test_filter(self):
     Project("filter").quick_test("Ok\n", processes=3)
コード例 #14
0
 def test_bidirection(self):
     Project("bidirection").quick_test("11\n12\n13\n")
コード例 #15
0
 def test_matmult_cc(self):
     result = " 441 462 483 504 525 546\n 1017 1074 1131 1188 1245 1302\n 1593 1686 1779 1872 1965 2058\n 2169 2298 2427 2556 2685 2814\n 2745 2910 3075 3240 3405 3570\n 3321 3522 3723 3924 4125 4326\n"
     Project("matmult_cc").quick_test(result, processes=4)
コード例 #16
0
 def test_broken_edges(self):
     Project("broken_edges", "broken").fail_ptp("*102", prefix=True)
コード例 #17
0
 def test_multicast(self):
     Project("multicast").quick_test("1800\n", processes=6)
コード例 #18
0
 def test_sendvar(self):
     Project("sendvar").quick_test(processes=2)
コード例 #19
0
 def test_build(self):
     Project("build").quick_test("1: 10\n2: 20\n")
コード例 #20
0
 def test_edgeif(self):
     Project("edgeif").quick_test("3 2\n")
コード例 #21
0
 def test_helloworld(self):
     Project("helloworld", "helloworlds").quick_test("Hello world 12\n")
コード例 #22
0
 def test_from(self):
     Project("from").quick_test("Ok\n", processes=4)
コード例 #23
0
 def test_libhelloworld(self):
     result = "40 10 Hello world\n80 10 Hello world\n"\
         "160 10 Hello world\n320 10 Hello world\n640 10 Hello world\n"
     Project("libhelloworld", lib=True).quick_test_main(result)
コード例 #24
0
 def test_doubles(self):
     Project("doubles").quick_test("Ok\n")
コード例 #25
0
 def test_bulk(self):
     output = "1\n2\n3\n4\na\nb\nc\n"
     Project("bulk").quick_test(output, processes=3)
コード例 #26
0
 def test_edgeif2(self):
     Project("edgeif2").quick_test("Ok\n")
コード例 #27
0
 def test_bulk2(self):
     Project("bulk2").quick_test("3 3\n")
コード例 #28
0
 def test_broken_externtype(self):
     Project("broken_externtype", "broken").fail_ptp("*102/type:",
                                                     prefix=True)
コード例 #29
0
 def test_broken1(self):
     Project("broken1",
             "broken").fail_ptp("*104/inscription: Missing expression\n")
コード例 #30
0
 def test_bigtoken(self):
     Project("bigtoken").quick_test("18000000\n", processes=5)
コード例 #31
0
 def test_broken2(self):
     Project("broken2", "broken").fail_ptp("*102/type: Missing type\n")
コード例 #32
0
 def test_broken_tracefn(self):
     Project("broken_tracefn", "broken", trace=True).fail_ptp(
         "*102/type: Invalid trace function 'int_as_string'\n")
コード例 #33
0
ファイル: tests.py プロジェクト: elieux/kaira
 def test_tracelog(self):
     p = Project("tracelog", trace=True)
     p.quick_test(processes=2, extra_args=["-T100K"])
     p.check_tracelog("14\n")