Skip to content

Commit

Permalink
update tests and README for removal of thread default
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Fulton-Howard authored and mbhall88 committed Apr 16, 2022
1 parent fac4e93 commit e5077f5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 38 deletions.
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,16 +187,6 @@ without `mem_mb` set under `resources`.
See [below](#standard-rule-specific-cluster-resource-settings) for how to overwrite this
in a `rule`.

#### `default_threads`

**Default**: `1`

This sets the default number of threads for a `rule` being submitted to the cluster
without the `threads` variable set.

See [below](#standard-rule-specific-cluster-resource-settings) for how to overwrite this
in a `rule`.

#### `default_cluster_logdir`

**Default**: `"logs/cluster"`
Expand Down
29 changes: 1 addition & 28 deletions tests/test_lsf_submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ class TestSubmitter(unittest.TestCase):
@patch.object(
CookieCutter, CookieCutter.get_default_mem_mb.__name__, return_value=1000
)
@patch.object(
CookieCutter, CookieCutter.get_default_threads.__name__, return_value=8
)
@patch.object(OSLayer, OSLayer.get_uuid4_string.__name__, return_value="random")
def test___several_trivial_getter_methods(self, *mocks):
argv = [
Expand Down Expand Up @@ -96,9 +93,6 @@ def test___several_trivial_getter_methods(self, *mocks):
@patch.object(
CookieCutter, CookieCutter.get_default_mem_mb.__name__, return_value=1000
)
@patch.object(
CookieCutter, CookieCutter.get_default_threads.__name__, return_value=8
)
@patch.object(OSLayer, OSLayer.get_uuid4_string.__name__, return_value="random")
def test____submit_cmd_and_get_external_job_id___real_output_stream_from_submission(
self, *mocks
Expand All @@ -124,9 +118,6 @@ def test____submit_cmd_and_get_external_job_id___real_output_stream_from_submiss
@patch.object(
CookieCutter, CookieCutter.get_default_mem_mb.__name__, return_value=1000
)
@patch.object(
CookieCutter, CookieCutter.get_default_threads.__name__, return_value=8
)
@patch.object(OSLayer, OSLayer.get_uuid4_string.__name__, return_value="random")
def test____submit_cmd_and_get_external_job_id___output_stream_has_no_jobid(
self, *mocks
Expand All @@ -149,9 +140,6 @@ def test____submit_cmd_and_get_external_job_id___output_stream_has_no_jobid(
@patch.object(
CookieCutter, CookieCutter.get_default_mem_mb.__name__, return_value=1000
)
@patch.object(
CookieCutter, CookieCutter.get_default_threads.__name__, return_value=8
)
@patch.object(OSLayer, OSLayer.get_uuid4_string.__name__, return_value="random")
@patch.object(OSLayer, OSLayer.mkdir.__name__)
@patch.object(OSLayer, OSLayer.remove_file.__name__)
Expand Down Expand Up @@ -216,9 +204,6 @@ def test___submit___successfull_submit(
@patch.object(
CookieCutter, CookieCutter.get_default_mem_mb.__name__, return_value=1000
)
@patch.object(
CookieCutter, CookieCutter.get_default_threads.__name__, return_value=8
)
@patch.object(OSLayer, OSLayer.get_uuid4_string.__name__, return_value="random")
@patch.object(OSLayer, OSLayer.mkdir.__name__)
@patch.object(OSLayer, OSLayer.remove_file.__name__)
Expand Down Expand Up @@ -297,9 +282,6 @@ def test_get_queue_cmd_returns_cookiecutter_default_if_no_cluster_config(
@patch.object(
CookieCutter, CookieCutter.get_default_mem_mb.__name__, return_value=1000
)
@patch.object(
CookieCutter, CookieCutter.get_default_threads.__name__, return_value=8
)
@patch.object(OSLayer, OSLayer.get_uuid4_string.__name__, return_value="random")
def test_rule_specific_params_are_submitted(self, *mocks):
argv = [
Expand Down Expand Up @@ -353,9 +335,6 @@ def test_rule_specific_params_are_submitted(self, *mocks):
@patch.object(
CookieCutter, CookieCutter.get_default_mem_mb.__name__, return_value=1000
)
@patch.object(
CookieCutter, CookieCutter.get_default_threads.__name__, return_value=8
)
@patch.object(OSLayer, OSLayer.get_uuid4_string.__name__, return_value="random")
def test_lsf_mem_unit_is_kb_and_mem_mb_is_converted_accordingly(self, *mocks):
argv = [
Expand Down Expand Up @@ -407,9 +386,6 @@ def test_lsf_mem_unit_is_kb_and_mem_mb_is_converted_accordingly(self, *mocks):
@patch.object(
CookieCutter, CookieCutter.get_default_mem_mb.__name__, return_value=1000
)
@patch.object(
CookieCutter, CookieCutter.get_default_threads.__name__, return_value=8
)
@patch.object(OSLayer, OSLayer.get_uuid4_string.__name__, return_value="random")
def test_lsf_mem_unit_is_tb_and_mem_mb_is_converted_and_rounded_up_to_int(
self, *mocks
Expand Down Expand Up @@ -585,9 +561,6 @@ def test_jobname_for_group(self):
@patch.object(
CookieCutter, CookieCutter.get_default_mem_mb.__name__, return_value=1000
)
@patch.object(
CookieCutter, CookieCutter.get_default_threads.__name__, return_value=8
)
def test_time_resource_for_group(self, *mocks):
for time_str in ("time", "runtime", "walltime", "time_min"):
jobscript = Path(
Expand All @@ -602,7 +575,7 @@ def test_time_resource_for_group(self, *mocks):

actual = lsf_submit.resources_cmd
expected = (
"-M 1000 -n 8 -R 'select[mem>1000] rusage[mem=1000] "
"-M 1000 -n 1 -R 'select[mem>1000] rusage[mem=1000] "
"span[hosts=1]' -W 1"
)

Expand Down

0 comments on commit e5077f5

Please sign in to comment.