Ask Your Question

multiple cores - adventage - How enable it?

asked 2013-08-03 03:42:17 -0500

mresimulator gravatar image

updated 2015-01-14 07:35:51 -0500

FrédéricC gravatar image

Hi experts!

I have a TOSHIBA laptop with next specifications:

4x Intel core i3 CPU M350 2.27GHz 3gb RAM

I write a script of Monte Carlo simulation that work fine, but i would speed up it.

How can I take advantage of the multiple core proccesor in sage-execution of my script?

For example: in my script, a extesed algorithm is executed for 20 different values in a list N (N=[N1,...,N20]), 100 times for each N-element. It is possible taht each CPU-core execute the algorithm for only one N-element? In this case, i will reduce the execution time in a factor of: 20 (N-element)/ 4 (CPU-cores) = 5

Please explain step by step (im a totaly newby...)

Waiting for your answers.

Thanks a lot.

edit retag flag offensive close merge delete

3 answers

Sort by » oldest newest most voted

answered 2013-08-03 05:11:27 -0500

Jesustc gravatar image

It is possible: just check the nice answer by @niles to a similar question: There you have a clear example.

edit flag offensive delete link more

answered 2013-08-03 07:48:15 -0500

mresimulator gravatar image

Thanks for your help.

The tutorial is a little complicated for my. I hope you can help me more.

The general structure of the algorithm is:


for j in N: algorithm execution

How can i incorparate the paralled execution in this script?

Waiting for your responses.

Thanks a lot.

edit flag offensive delete link more

answered 2013-08-03 05:16:29 -0500

tmonteil gravatar image

In your case, the computations are independent, so it is possible to do them in parallel with Sage. You can have a look to the documentation and this tutorial.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2013-08-03 03:42:17 -0500

Seen: 161 times

Last updated: Aug 03 '13