Skip to content

Commit

Permalink
[cuegui] Sync with proto changes
Browse files Browse the repository at this point in the history
Co-authored-by: Lars van der Bijl <[email protected]>
  • Loading branch information
splhack and larsbijl committed Feb 22, 2021
1 parent f8dd04c commit 1f793fa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cuegui/cuegui/LayerDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def getMaxMemory(self):

def getMaxGpu(self):
"""Gets the layer max GPU."""
return max([layer.data.min_gpu // self.gpu_tick_kb for layer in self.__layers])
return max([layer.data.min_gpu_memory // self.gpu_tick_kb for layer in self.__layers])

def getMinCores(self):
"""Gets the layer min cores."""
Expand Down
14 changes: 8 additions & 6 deletions cuegui/tests/LayerDialog_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,15 @@ def setUp(self, get_stub_mock, get_layer_mock, get_limits_mock):
'layer1Id': opencue.wrappers.layer.Layer(
opencue.compiled_proto.job_pb2.Layer(
id='layer1Id', name='layer1Name', range='1-5', tags=['tag1', 'tag2'],
min_cores=1, max_cores=3, is_threadable=False, min_memory=2097152, min_gpu=1,
min_cores=1, max_cores=3, is_threadable=False,
min_memory=2097152, min_gpu_memory=1,
chunk_size=1, timeout=30, timeout_llu=1, memory_optimizer_enabled=True,
limits=['limit1Name', 'limit2Name'])),
'layer2Id': opencue.wrappers.layer.Layer(
opencue.compiled_proto.job_pb2.Layer(
id='layer2Id', name='layer2Name', range='2-22', tags=['tag2', 'tag3'],
min_cores=2, max_cores=2, is_threadable=True, min_memory=6291456, min_gpu=2,
min_cores=2, max_cores=2, is_threadable=True,
min_memory=6291456, min_gpu_memory=2,
chunk_size=5, timeout=60, timeout_llu=5, memory_optimizer_enabled=False,
limits=['limit2Name', 'limit3Name'])),
}
Expand Down Expand Up @@ -206,9 +208,9 @@ def test__should_apply_new_settings(self):
self.layer_properties_dialog._LayerPropertiesDialog__thread.parent().parent().enable(True)
self.layer_properties_dialog._LayerPropertiesDialog__thread.setChecked(new_is_threadable)

new_min_gpu = 6
new_min_gpu_memory = 6
self.layer_properties_dialog._LayerPropertiesDialog__gpu.parent().parent().enable(True)
self.layer_properties_dialog._LayerPropertiesDialog__gpu.slider.setValue(new_min_gpu)
self.layer_properties_dialog._LayerPropertiesDialog__gpu.slider.setValue(new_min_gpu_memory)

new_timeout = 20
self.layer_properties_dialog._LayerPropertiesDialog__timeout.parent().parent().enable(True)
Expand Down Expand Up @@ -240,9 +242,9 @@ def test__should_apply_new_settings(self):
layer1_mock.setThreadable.assert_called_with(new_is_threadable)
layer2_mock.setThreadable.assert_called_with(new_is_threadable)
layer1_mock.setMinGpu.assert_called_with(
new_min_gpu * self.layer_properties_dialog.gpu_tick_kb)
new_min_gpu_memory * self.layer_properties_dialog.gpu_tick_kb)
layer2_mock.setMinGpu.assert_called_with(
new_min_gpu * self.layer_properties_dialog.gpu_tick_kb)
new_min_gpu_memory * self.layer_properties_dialog.gpu_tick_kb)
layer1_mock.setTimeout.assert_called_with(new_timeout)
layer2_mock.setTimeout.assert_called_with(new_timeout)
layer1_mock.setTimeoutLLU.assert_called_with(new_timeout_llu)
Expand Down

0 comments on commit 1f793fa

Please sign in to comment.