- Timestamp:
- Apr 6, 2015, 10:29:16 AM (10 years ago)
- Location:
- branches/reconfiguration/platforms/tsar_generic_iob
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/reconfiguration/platforms/tsar_generic_iob/scripts/onerun.py
r957 r969 9 9 import argparse 10 10 import multiprocessing 11 import math 11 12 12 13 def run(args): … … 117 118 # OpenMP number of threads definition 118 119 ompthreads = args.threads 119 if ompthreads < 0: 120 if os.environ.get('SOCLIB_GDB') != None: 121 ompthreads = 1 122 123 elif args.debug != None: 124 ompthreads = 1 125 126 else: 127 ompthreads = (args.x * args.y) / 4 128 cpucount = multiprocessing.cpu_count() 129 if ompthreads > cpucount: ompthreads = cpucount 120 if ompthreads < 1: 121 ompthreads = math.ceil(float(args.x * args.y) / 4) 122 123 # be nice and don't use all available processors 124 maxcpu = math.ceil(float(multiprocessing.cpu_count()) * 2/3) 125 if ompthreads > maxcpu: ompthreads = maxcpu 130 126 131 127 command.extend(["-THREADS", str(ompthreads)]) … … 191 187 192 188 parser.add_argument( 193 '--threads', '-t', dest='threads', default=-1,189 '--threads', '-t', type=int, dest='threads', default=1, 194 190 help='number of OpenMP threads') 195 191 -
branches/reconfiguration/platforms/tsar_generic_iob/top.cpp
r963 r969 154 154 // Parallelisation 155 155 /////////////////////////////////////////////////// 156 #define USE_OPENMP _OPENMP 157 156 158 #if USE_OPENMP 157 159 #include <omp.h>
Note: See TracChangeset
for help on using the changeset viewer.