← Back to team overview

yade-users team mailing list archive

Re: [Question #665054]: Parallel run when i call a yade script from another file

 

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

    Status: Open => Answered

Deepak proposed the following answer:
Hi John,

Before you execute your python script, you can set the number of threads
:

export OMP_NUM_THREADS=4

and then you could run your simulation like this:

python yourscipt.py -j4

Could you check if this works?


On Wed, Feb 28, 2018 at 10:42 AM, JOHN <question665054@xxxxxxxxxxxxxxxxxxxxx
> wrote:

> New question #665054 on Yade:
> https://answers.launchpad.net/yade/+question/665054
>
> Good evening,
> I am currently calling a yade python script from another python script.
> something like this
>
> import Yadesimulation
>
>         from Yadesimulation import *
>
> where Yadesimulation is the yade script.
> My question is, how can i run I speed it up?  I tried running it on
> parallel, using [1]. However, although when i try similar examples with
> pure jade and yade -j4 it gives me a good speedup, the script approach
> produces no speedup at all. Am i missing something?
>
>
> For the record i put
>
> import sys
> import os
> sys.argv.extend(['-j','4'])
> os.system("ln -s /usr/bin/yade yadeimport.py")
> from yadeimport import yade
>
>
> in my yade script and i have 4 cores in my linux machine, so there should
> be a lot more than enough threads.
>
>
>
> [1]https://answers.launchpad.net/yade/+question/271679
>
>
>
> --
> 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.