As far as I know there are system calls that can set CPU affinity in the
Linux kernel series 2.6.x (to be exact it first appeared in 2.5.x, and maybe
it was ported back to 2.4.x series).
The system call is sys_sched_setaffinity(), where you can set masks which
describes how a given pid can be scheduled (to which processors can be
assigned). This call isn't portable to different unices, and I have no
further knowledge how other vendors get rid of this task.
On the other hand I think that hyperthreading is not a good option for HPC,
especially for floating point related applications and benchmarks like HPL.
It was discussed here before, that it has the potential to make some cache
trashing which degrades HPL performance.
Hope this helped
Andras
-----Original Message-----
From: lam-bounces_at_[hidden] [mailto:lam-bounces_at_[hidden]] On Behalf Of
Brian Barrett
Sent: Thursday, March 10, 2005 6:29 PM
To: General LAM/MPI mailing list
Subject: Re: LAM: CPU affinity
On Mar 9, 2005, at 9:09 PM, Ricky Tang Siu Hong wrote:
> Hello,
>
> Our cluster nodes has 2 SMP CPU and with hyperthreading giving 4 CPU.
> But linux scheduler always switch the CPU of LAM process, causing
> decreasing of performance (HPL result cut half).
>
> So we use "taskset" utility to start LAM process. This is done by
> using schema:
> n0 -np 1 taskset 1 ./xhpl
> n0 -np 1 taskset 8 ./xhpl
> n1 -np 1 taskset 1 ./xhpl
> n1 -np 1 taskset 8 ./xhpl
> ...
>
> This works, but have some inconvenience. To change the CPU used by
> the job, we need to change the schema file too. This goes agaist that
> when we use PBS TM startup, everything is specified through parameters
> of qsub (no need to change mpiexec line in job script).
>
> Is there a smarter way to use taskset in LAM startup? Or is there an
> option to set affinity in LAM internally?
I don't know if there is a smarter way to use taskset - I'm not at all
familiar with the command, as I don't usually deal with hyperthreading
(and tend to believe that it causes more problems than it solves right
now with Linux). Perhaps someone on the list has some useful
experience they would like to share?
I can tell you that there is no affinity setting support in LAM, and it
is unlikely such support will be added in the near future.
Brian
--
Brian Barrett
LAM/MPI developer and all around nice guy
Have an LAM/MPI day: http://www.lam-mpi.org/
_______________________________________________
This list is archived at http://www.lam-mpi.org/MailArchives/lam/
|