Multithreading activated by ENABLE_OPENMP, or -j option ?

Asked by Jérôme Duriez

Hi,

The title explains it already a little. If I want to avoid multithreading, is it enough to not use -j option (whatever the way yade was compiled), or do I have moreover to use an executable compiled with ENABLE_OPENMP = OFF ?
I found contradictory answers in mailing list archive..

And, completely related, when this YADE_OPENMP flag appearing in the sources is defined ? (regarding the #ifdef YADE_OPENMP blocks)
According to ENABLE_OPENMP compilation option, or -j option ?

Thanks !

Jérôme

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jérôme Duriez
Solved:
Last query:
Last reply:
Revision history for this message
Jérôme Duriez (jduriez) said :
#1

Ok, for the 2d part of the question, I found after some tests, that ifdef YADE_OPENMP is true if and only if -DENABLE_OPENMP was ON during the compilation. (whatever the use of -j option)

Revision history for this message
Jan Stránský (honzik) said :
#2

Hi Jerome,

AFAIK not to use -j option is enough to use exactly one core (i.e. avoiding
multithreading). Try
yade-trunk -h
and see the help for -j option
HTH
Jan

2013/11/25 jduriez <email address hidden>

> Question #239778 on Yade changed:
> https://answers.launchpad.net/yade/+question/239778
>
> jduriez gave more information on the question:
> Ok, for the 2d part of the question, I found after some tests, that
> ifdef YADE_OPENMP is true if and only if -DENABLE_OPENMP was ON during
> the compilation. (whatever the use of -j option)
>
> --
> You received this question notification because you are a member of
> yade-users, which is an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Jérôme Duriez (jduriez) said :
#3

Thanks Jan ! I have now at least confirmation of http://<email address hidden>/msg05567.html ;-)

I'm still a bit confused because of this (older) opinion : http://<email address hidden>/msg01245.html

Revision history for this message
Jan Stránský (honzik) said :
#4

Hi Jerome,
In older versions, Yade used to use by default as many cores as possible.
Now the default behavior is opposite, Yade uses one core by default.
cheers
Jan

2013/11/25 jduriez <email address hidden>

> Question #239778 on Yade changed:
> https://answers.launchpad.net/yade/+question/239778
>
> Status: Answered => Open
>
> jduriez is still having a problem:
> Thanks Jan ! I have now at least confirmation of http://www.mail-
> <email address hidden>/msg05567.html ;-)
>
> I'm still a bit confused because of this (older) opinion : http://www
> .<email address hidden>/msg01245.html
>
> --
> You received this question notification because you are a member of
> yade-users, which is an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Anton Gladky (gladky-anton) said :
#5

2013/11/25 jduriez <email address hidden>:
> I'm still a bit confused because of this (older) opinion : http://www
> .<email address hidden>/msg01245.html

it has been fixed 3 years ago [1]. By default Yade is using only 1
thread (job) now.

Hyperthreading can really slow down your simulation. IMHO, it is
better to switch it off for DEM-simulation and use the real number
of cores.

[1] https://github.com/yade/trunk/commit/231b0d6a7246f2043d1cc6b82a58ad04a5c1a23d

Anton

Revision history for this message
Jérôme Duriez (jduriez) said :
#6

Waouah.. Probably I did not notice this change (or at least I have forgotten it). Thanks !!