From 69f7a3b58e2918c098af549d73003ef8c36c94c6 Mon Sep 17 00:00:00 2001
From: Tim O'Donnell <timodonnell@gmail.com>
Date: Wed, 19 Jun 2019 10:31:54 -0400
Subject: [PATCH] fix

---
 mhcflurry/parallelism.py                     | 4 ++--
 test/test_train_pan_allele_models_command.py | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/mhcflurry/parallelism.py b/mhcflurry/parallelism.py
index b21af5c6..55d7c450 100644
--- a/mhcflurry/parallelism.py
+++ b/mhcflurry/parallelism.py
@@ -21,7 +21,7 @@ def add_worker_pool_args(parser):
         type=int,
         metavar="N",
         help="Number of processes to parallelize training over. Experimental. "
-             "Set to 1 for serial run. Set to 0 to use number of cores. Default: %(default)s.")
+             "Set to 0 for serial run. Default: %(default)s.")
     group.add_argument(
         "--backend",
         choices=("tensorflow-gpu", "tensorflow-cpu", "tensorflow-default"),
@@ -67,7 +67,7 @@ def worker_pool_with_gpu_assignments(
 
     num_workers = num_jobs if num_jobs else cpu_count()
 
-    if num_workers == 1:
+    if num_workers == 0:
         if backend:
             set_keras_backend(backend)
         return None
diff --git a/test/test_train_pan_allele_models_command.py b/test/test_train_pan_allele_models_command.py
index d2c30388..f4142a1d 100644
--- a/test/test_train_pan_allele_models_command.py
+++ b/test/test_train_pan_allele_models_command.py
@@ -146,11 +146,12 @@ def run_and_check(n_jobs=0):
 
 if os.environ.get("KERAS_BACKEND") != "theano":
     def test_run_parallel():
+        run_and_check(n_jobs=1)
         run_and_check(n_jobs=2)
 
 
 def test_run_serial():
-    run_and_check(n_jobs=1)
+    run_and_check(n_jobs=0)
 
 if __name__ == "__main__":
     test_run_serial()
\ No newline at end of file
-- 
GitLab