ioam / topographica

A general-purpose neural simulator focusing on topographic maps.
topographica.org
BSD 3-Clause "New" or "Revised" License
53 stars 32 forks source link

setting the numble of cores used by the gcal python script #659

Closed windform2015 closed 8 years ago

windform2015 commented 8 years ago

Hi I run python jobs in cluster but a single job uses more than 1 core, which may slow down other people's jobs and also may not be so fast as it running by one core. But I haven't found out how to set the limit number of cores in python scripts or by cluster job submitting. Could you provide a suggestion for solving this problem ?

philippjfr commented 8 years ago

You can set the OMP_NUM_THREADS environment variable.

jbednar commented 8 years ago

In our experience (last tested several years ago), we got very good speedups from the first few cores, up to 8 or so, and then not so much. But it depends very strongly on the memory bus architecture of the machine, and if it's a relatively recent machine there may be a point to using more threads. But in any case, you can limit the number stolen by setting e.g. OMP_NUM_THREADS=3 before launching your runs.