From ef7974897cf37b850a20fbb395e5936c92a3e64a Mon Sep 17 00:00:00 2001
From: Alexander Eulitz <alexander.eulitz@iwf.tu-berlin.de>
Date: Tue, 22 Jul 2014 11:57:31 +0200
Subject: [PATCH 5/5] fixed --cores implementation and improved arg-parse
 argument documentation.

---
 core/main/main.py.in |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/core/main/main.py.in b/core/main/main.py.in
index 6a55f65..9f78b27 100755
--- a/core/main/main.py.in
+++ b/core/main/main.py.in
@@ -48,7 +48,7 @@ par=argparse.ArgumentParser(usage='%s [options] [ simulation.xml[.bz2] | script.
   )
 par.add_argument('-v','--version',help='Print version and exit.',dest='version',action='store_true')
 par.add_argument('-j','--threads',help='Number of OpenMP threads to run; defaults to 1. Equivalent to setting OMP_NUM_THREADS environment variable.',dest='threads',type=int)
-par.add_argument('--cores',help='Set number of OpenMP threads (as \-\-threads) and in addition set affinity of threads to the cores given.',dest='cores',type=str)
+par.add_argument('--cores',help='Set number of OpenMP threads (as \-\-threads) and in addition set affinity of threads to the cores given. Please provide a string with comma-separated core-ids.',dest='cores',type=str)
 par.add_argument('--update',help='Update deprecated class names in given script(s) using text search & replace. Changed files will be backed up with ~ suffix. Exit when done without running any simulation.',dest='updateScripts',nargs='+')
 par.add_argument('--nice',help='Increase nice level (i.e. decrease priority) by given number.',dest='nice',type=int)
 par.add_argument('-x',help='Exit when the script finishes',dest='exitAfter',action='store_true')
@@ -115,7 +115,7 @@ if opts.cores:
 	except ValueError:
 		raise ValueError('Invalid --cores specification %s, should be a comma-separated list of non-negative integers'%opts.cores)
 	opts.nthreads=len(cores)
-	os.environ['GOMP_CPU_AFFINITY']=' '.join([str(cores[0])]+[str(c) for c in cores])
+	os.environ['GOMP_CPU_AFFINITY']=' '.join([str(c) for c in cores])
 	os.environ['OMP_NUM_THREADS']=str(len(cores))
 elif opts.threads: os.environ['OMP_NUM_THREADS']=str(opts.threads)
 else: os.environ['OMP_NUM_THREADS']='1'
-- 
1.7.9.5

