yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #03934
Re: How to use a plugin
> I ran with yade -j3, and got the following:
>
> Yade [1]: O.numThreads
> -> [1]: 2
> Yade [2]: os.environ['OMP_NUM_THREADS']
> -> [2]: '3'
> And C displays omp_get_max_threads() as 1.
Hi Boon, this is very unusual. O.numThreads just calls
omp_get_max_threads()... and -j3 only sets OMP_NUM_THREADS before
initializing openMP, which then should use this value for
omp_get_max_threads() (see OpenMP documentation).
Oh, for your mutex problem: IIRC there is something like #pragma omp
critical-section (or something similar) which prevents multiple threads
being in the same part of the code simultaneously. You could use that
instead of explicit mutex, it would be just 1 line of code. See OpemMP
documentation for details (there is something at wikipedia as well, I
think...
> Which should I trust?
Tough question as they should be the same...
You are not using gcc < 4.4, right? (the OpenMP implementation was
probably not as good before as it is now)
v
Follow ups
References
-
How to use a plugin
From: boon chiaweng, 2010-04-01
-
Re: How to use a plugin
From: boon chiaweng, 2010-04-05
-
Re: How to use a plugin
From: Václav Šmilauer, 2010-04-05
-
Re: How to use a plugin
From: boon chiaweng, 2010-04-05
-
Re: How to use a plugin
From: boon chiaweng, 2010-04-07
-
Re: How to use a plugin
From: Václav Šmilauer, 2010-04-08
-
Re: How to use a plugin
From: boon chiaweng, 2010-04-08
-
Re: How to use a plugin
From: Václav Šmilauer, 2010-04-08
-
Re: How to use a plugin
From: boon chiaweng, 2010-04-08
-
Re: How to use a plugin
From: Václav Šmilauer, 2010-04-08
-
Re: How to use a plugin
From: Anton Gladky, 2010-04-08
-
Re: How to use a plugin
From: boon chiaweng, 2010-04-08
-
Re: How to use a plugin
From: boon chiaweng, 2010-04-08
-
Re: How to use a plugin
From: boon chiaweng, 2010-04-09
-
Re: How to use a plugin
From: boon chiaweng, 2010-04-09
-
Re: How to use a plugin
From: Václav Šmilauer, 2010-04-09
-
Re: How to use a plugin
From: boon chiaweng, 2010-04-09
-
Re: How to use a plugin
From: Václav Šmilauer, 2010-04-09
-
Re: How to use a plugin
From: boon chiaweng, 2010-04-09
-
Re: How to use a plugin
From: Václav Šmilauer, 2010-04-09
-
Re: How to use a plugin
From: boon chiaweng, 2010-04-09