Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ install:

script:
- if [[ $TEST_TARGET == 'default' ]]; then
python -m iris.tests.runner --default-tests --system-tests --print-failed-images --num-processors=8;
python -m iris.tests.runner --default-tests --system-tests --print-failed-images --num-processors=3;
fi
- if [[ $TEST_TARGET == 'example' ]]; then
python -m iris.tests.runner --example-tests --print-failed-images --num-processors=8;
python -m iris.tests.runner --example-tests --print-failed-images --num-processors=3;
fi

# Capture install-dir: As a test command must be last for get Travis to check
Expand Down
6 changes: 4 additions & 2 deletions lib/iris/tests/runner/_runner.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) British Crown Copyright 2010 - 2016, Met Office
# (C) British Crown Copyright 2010 - 2017, Met Office
#
# This file is part of Iris.
#
Expand Down Expand Up @@ -127,7 +127,9 @@ def finalize_options(self):
if self.stop:
print('Stopping tests after the first error or failure')
if self.num_processors is None:
self.num_processors = multiprocessing.cpu_count() - 1
# Choose a magic number that works reasonably well for the default
# number of processes.
self.num_processors = (multiprocessing.cpu_count() + 1) // 4 + 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pelson What's the logic behind this lovely piece of maths?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a magic number... there is no solid/defensible logic other than:

  • It should be at least one
  • It shouldn't fill all CPUs if there are lots of them

😄

else:
self.num_processors = int(self.num_processors)

Expand Down