Ask Your Question
1

multiple cores - adventage - How enable it?

asked 2013-08-03 10:42:17 +0100

mresimulator gravatar image

updated 2015-01-14 14:35:51 +0100

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
1

answered 2013-08-03 12:11:27 +0100

Jesustc gravatar image

It is possible: just check the nice answer by @niles to a similar question: http://ask.sagemath.org/question/702/whenhow-to-use-parallel. There you have a clear example.

edit flag offensive delete link more
0

answered 2013-08-03 12:16:29 +0100

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
0

answered 2013-08-03 14:48:15 +0100

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:

N=[N1,.....,N20]

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

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

Stats

Asked: 2013-08-03 10:42:17 +0100

Seen: 974 times

Last updated: Aug 03 '13