← Back to team overview

yade-users team mailing list archive

Re: [Question #271679]: Want to know how to call parallel within a python script

 

Question #271679 on Yade changed:
https://answers.launchpad.net/yade/+question/271679

    Status: Open => Answered

Jan Stránský proposed the following answer:
Hi Yang,

if you run Yade from pure Python like in [1], please try the (untested)
following piece of code and let us know if it helped or not. I personally
am very curious..

import sys
sys.argv.extend(['-j','4']) # should be before "import yadeimport"
import yadeimport # or another file name

cheers
Jan

[1]
https://yade-dem.org/doc/user.html#importing-yade-in-other-python-applications


2015-09-22 18:43 GMT+02:00 MikeZhao <question271679@xxxxxxxxxxxxxxxxxxxxx>:

> New question #271679 on Yade:
> https://answers.launchpad.net/yade/+question/271679
>
> Nowadays I am trying to make the calculation faster , and I want to use
> its parallel function.
>
> We usually use the command ‘ yade -j4 file.py' to call more cores when we
> do simulations via Yade alone. (file.py is the python script) However, I am
> now trying to couple Yade and FEM, so I can not use that command to call
> multiple cores. I wonder if I can add some commands into the file to call
> more cores?
>
>
>
> --
> You received this question notification because your team yade-users is
> an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to     : yade-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-users
> More help   : https://help.launchpad.net/ListHelp
>

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.