From 1acaf1c681b3d1066bc06b8d3b8d83955f23c529 Mon Sep 17 00:00:00 2001
From: Tim O'Donnell <timodonnell@gmail.com>
Date: Fri, 9 Feb 2018 19:41:48 -0500
Subject: [PATCH] update generate

---
 downloads-generation/models_class1_unselected/GENERATE.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/downloads-generation/models_class1_unselected/GENERATE.sh b/downloads-generation/models_class1_unselected/GENERATE.sh
index 124715fa..f04e23dd 100755
--- a/downloads-generation/models_class1_unselected/GENERATE.sh
+++ b/downloads-generation/models_class1_unselected/GENERATE.sh
@@ -34,13 +34,16 @@ python $SCRIPT_DIR/generate_hyperparameters.py > hyperparameters.yaml
 GPUS=$(nvidia-smi -L 2> /dev/null | wc -l) || GPUS=0
 echo "Detected GPUS: $GPUS"
 
+PROCESSORS=$(getconf _NPROCESSORS_ONLN)
+echo "Detected processors: $PROCESSORS"
+
 time mhcflurry-class1-train-allele-specific-models \
     --data "$(mhcflurry-downloads path data_curated)/curated_training_data.no_mass_spec.csv.bz2" \
     --hyperparameters hyperparameters.yaml \
     --out-models-dir models \
     --percent-rank-calibration-num-peptides-per-length 0 \
     --min-measurements-per-allele 75 \
-    --num-jobs 32 --gpus $GPUS --max-workers-per-gpu 2
+    --num-jobs $(expr $PROCESSORS \* 2) --gpus $GPUS --max-workers-per-gpu 2
 
 cp $SCRIPT_ABSOLUTE_PATH .
 bzip2 LOG.txt
-- 
GitLab