|Re: [eigen] Re: tests taking forever when run with -j8 and OpenMP is enabled|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Re: tests taking forever when run with -j8 and OpenMP is enabled
- From: Aron Ahmadia <aja2111@xxxxxxxxxxxx>
- Date: Sat, 3 Jul 2010 18:59:21 +0300
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=JojbLcqaw8Tihp9wRMOpoFlRyzvp//20k75ZzSquCGE=; b=oYM6BlVBiuRS7ZHHYYCVz1uh5qlI08Fa7AJRq7VAiIis0NA7oA+J3iH5uo7nsXU0zn SaQIHFj0cy67DEUKn437yh350FoftuMCPogL4gEdGkYLWn2j5hcOWU2nQg7TiNh3sehr ZqwX2y4ixWNOWuIpWv1RlmO9DAGDUdTS4xo7k=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=ad05qGYKY8r9GOY79/ID5SZvBKlC/xupZ0QCZcP9NCNQFH3JrMUgMCcfzKq2hl//qz A98Md+lK91GqI+WcYjoZvaocZcWDOtk4oQ6J27p/awwyi7wTVu6EioHVwW1Qr7cbkezq ZvDGe1bSOL9iglCPbtvXeP83ujUiDGhJBzpx8=
In the world of scientific computing, your code is usually assumed to be the only process on the system, so this is normally a fairly safe assumption to make. In fact, the OpenMP library has an API which allows you to ask how many cores are on the physical CPU you are running on, which usually allows you to leverage the entire machine. I think for 99% of the users you encounter who are using Eigen and care about this sort of thing, they will want you to utilize the memory hierarchy as if you have the whole machine cache (L1-L3) at your disposal.
On Sat, Jul 3, 2010 at 6:47 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
Ah, just one thing. It remains that I only get this phenomenon when
using OpenMP. Is it really the case that with OpenMP enabled we rely
on the availability of more cache memory? That would be a bug.
> No, I'm not reporting about a bug here!
> But I just stumbled across something interesting. With OpenMP enabled,
> when I run
> ctest -j8
> that is, 8 tests run simultaneously, the tests using large matrix
> product take above of 2 minutes each to complete.
> When I run only 1 test at a time (which is the default for ctest),
> they complete very quickly.
> Of course the reason is that running 8 tests at a time on my 4-core
> Core i7 is a recipe for making them fight for the CPU's cache memory.
> This is an illustration that setting cache sizes is ultimately
> something that only the user can do; the defaults we're using can only
> rely on rather unsafe assumptions about competing processes.