Example #1
0
 def test_edge_preferred(self):
     assert calc_block_sizes3(
         max_block_size=10000, num_devices=2, num_rows=3068) == [1534, 1534]
     assert calc_block_sizes3(
         max_block_size=10000, num_devices=1, num_rows=7000) == [7000]
     assert calc_block_sizes3(
         max_block_size=10000, num_devices=1, num_rows=7001) == [3501, 3500]
Example #2
0
 def test_max_block_size(self):
     assert calc_block_sizes3(
         max_block_size=50, num_devices=1, num_rows=101) == [34, 34, 33]
     assert calc_block_sizes3(
         max_block_size=50, num_devices=2, num_rows=101) == [26, 25, 25, 25]
     assert calc_block_sizes3(
         max_block_size=10000, num_devices=1, num_rows=10000) == [5000, 5000]
Example #3
0
 def test_small(self):
     assert calc_block_sizes3(
         max_block_size=10000, num_devices=2, num_rows=100) == [100]
     assert calc_block_sizes3(
         max_block_size=5, num_devices=2, num_rows=10) == [5, 5]
     assert calc_block_sizes3(
         max_block_size=6, num_devices=3, num_rows=10) == [4, 3, 3]
Example #4
0
 def test_large(self):
     assert calc_block_sizes3(
         max_block_size=50000, num_devices=1, num_rows=50000) == [6250, 6250, 6250, 6250, 6250,
                                                                  6250, 6250, 6250]
     assert calc_block_sizes3(
         max_block_size=50000, num_devices=6, num_rows=50000) == [4167, 4167, 4167, 4167, 4167,
                                                                  4167, 4167, 4167, 4166, 4166,
                                                                  4166, 4166]
Example #5
0
 def test_small_edge(self):
     assert calc_block_sizes3(max_block_size=1, num_devices=4,
                              num_rows=3) == [1, 1, 1]
     assert calc_block_sizes3(max_block_size=1, num_devices=5,
                              num_rows=1) == [1]