From: John Stone (johns_at_ks.uiuc.edu)
Date: Thu Sep 05 2013 - 09:39:50 CDT

Hi,
  By default, Tachyon always uses all of the CPU cores it finds.
The only reason it would not, is if it gets "tricked" into thinking
that there are fewer CPUs available than there really are. But, if
that happens, you can add the "-numthreads" flag to force Tachyon
to use a specific number of CPUs... It is also worth mentioning
that Tachyon uses all the CPUs only for the rendering part of the
work. For the file parsing and preprocessing steps, it currently
only uses one CPU, so if most of your runtime is spent reading
a very large input file, this is something that isn't going to
benefit from multiple CPUs. The use of multiple CPU cores is
beneficial only for the actual ray tracing itself.

It seems unlikely, but if Tachyon really isn't using all of your
CPUs, I have one potential theory about why Tachyon might not be
using all of the CPUs, but this only applies if you're using VERY
recent versions of Linux and one of the latest CPUs...

Tachyon determines the number of CPU cores available by calling
sysconf(_SC_NPROCESSORS_ONLN), which returns the number of CPUs
that are "online" and running. For the last 10 years, this has
worked perfectly, however I have recently noticed that some
operating systems (up to now, just phones and tablets) have begun
to take power management much more seriously, and they are actually
turning entire CPU cores _off_ when the machine is idle. This is
good for power management of course, but the problem is that any
application that was hoping to make use of all of the CPUs then has
to ignore how many CPUs are actually "on", and instead spawn threads
for the number of CPUs that "exist", which is determined by calling
sysconf(_SC_NPROCESSORS_CONF). This is likely fine for a desktop machine,
but on a larger shared memory machine like an SGI Origin or similar,
that number is not necessarily the number of processors available to run on,
so that's part of the history of why Tachyon (and VMD) don't use that
approach. The problem we have now is that due to power management
on Android and other devices, and system configuration and maintenance
on big machines like the SGI Origin machines, neither the physical CPU
count nor the number of "online" CPUs is necessarily the right number
by itself. Worse yet, some versions of Android have a broken
implementation of sysconf() that doesn't even return the correct numbers
of either, and I already had to write a piece of code that digs through
the contents of /sys/devices/system/cpu/present and counts up the CPUs
that way since sysconf() can't be trusted there... Argh...

Cheers,
  John Stone
  vmd_at_ks.uiuc.edu

On Wed, Sep 04, 2013 at 10:05:15AM +0200, Albert wrote:
> Hello:
>
> I am using the tachyon engine for rendering in VMD-1.9.1 and I notice
> that only one core of my CPU was used for job. I am just wondering how
> can we enable multiple core for the rendering course?
>
> thank you very much
> Albert

-- 
NIH Center for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
http://www.ks.uiuc.edu/~johns/           Phone: 217-244-3349
http://www.ks.uiuc.edu/Research/vmd/