ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 06 Aug 2013 19:13:55 +0200parallel multiple cores - algorithmhttps://ask.sagemath.org/question/10409/parallel-multiple-cores-algorithm/Hi experts!
I have a intel core i3 (x4). I wanna take adventage of multiple cores CPU.
My Monte Carlo algorithm can be summarized like that:
N=[N1, N2, ..., N20]
for n in N:
execute 100 times the algorithm related with 'n'
append some value (mean of the 100 times executed algorithm) in a output-numpy array LALALA (LALALA(n)))
So input is N, and output is an np.array LALALA (with 20 elements, each one related with one element in N)
How can I do for apply multicore proccesing?
Please explaing this to me in detail. Im a newby user and the sage-web-tutorials doesnt work.
Waiting for your answers.
Thanks a lotSat, 03 Aug 2013 17:44:06 +0200https://ask.sagemath.org/question/10409/parallel-multiple-cores-algorithm/Comment by mresimulator for <p>Hi experts!</p>
<p>I have a intel core i3 (x4). I wanna take adventage of multiple cores CPU.</p>
<p>My Monte Carlo algorithm can be summarized like that:</p>
<pre><code> N=[N1, N2, ..., N20]
for n in N:
execute 100 times the algorithm related with 'n'
append some value (mean of the 100 times executed algorithm) in a output-numpy array LALALA (LALALA(n)))
</code></pre>
<p>So input is N, and output is an np.array LALALA (with 20 elements, each one related with one element in N)</p>
<p>How can I do for apply multicore proccesing?</p>
<p>Please explaing this to me in detail. Im a newby user and the sage-web-tutorials doesnt work.</p>
<p>Waiting for your answers.</p>
<p>Thanks a lot</p>
https://ask.sagemath.org/question/10409/parallel-multiple-cores-algorithm/?comment=17189#post-id-17189Hi ppurka. I misspoke. I tried to say that i donk know how to apply the tutorial to my particular problem. Waiting for your help. Thanks a lotSun, 04 Aug 2013 04:56:29 +0200https://ask.sagemath.org/question/10409/parallel-multiple-cores-algorithm/?comment=17189#post-id-17189Comment by ppurka for <p>Hi experts!</p>
<p>I have a intel core i3 (x4). I wanna take adventage of multiple cores CPU.</p>
<p>My Monte Carlo algorithm can be summarized like that:</p>
<pre><code> N=[N1, N2, ..., N20]
for n in N:
execute 100 times the algorithm related with 'n'
append some value (mean of the 100 times executed algorithm) in a output-numpy array LALALA (LALALA(n)))
</code></pre>
<p>So input is N, and output is an np.array LALALA (with 20 elements, each one related with one element in N)</p>
<p>How can I do for apply multicore proccesing?</p>
<p>Please explaing this to me in detail. Im a newby user and the sage-web-tutorials doesnt work.</p>
<p>Waiting for your answers.</p>
<p>Thanks a lot</p>
https://ask.sagemath.org/question/10409/parallel-multiple-cores-algorithm/?comment=17190#post-id-17190What doesn't work in the sage tutorial? Did you try the examples given there? They work for me - for instance two separate examples from the documentation and the tutorial are [here](http://aleph.sagemath.org/?z=eJxVjdEKwjAMRd_7FfcxkVDYJoh78j_GkLFmWizdaKvf7zZENC-B3HtO8nDTFpdlSEMIGoy1Fk4njHcdH9f1TF4Qud2DbZKWZ4qIc4G3zr-800yRjcn_Jqr5K5vWQvslD9GYJflYEHwu9PMKHaiWqmIBNYLzto9yYvRg8AfKcyrqaGcn6iqppemZ-Q01yjr2&lang=sage)Sun, 04 Aug 2013 02:44:33 +0200https://ask.sagemath.org/question/10409/parallel-multiple-cores-algorithm/?comment=17190#post-id-17190Answer by Volker Braun for <p>Hi experts!</p>
<p>I have a intel core i3 (x4). I wanna take adventage of multiple cores CPU.</p>
<p>My Monte Carlo algorithm can be summarized like that:</p>
<pre><code> N=[N1, N2, ..., N20]
for n in N:
execute 100 times the algorithm related with 'n'
append some value (mean of the 100 times executed algorithm) in a output-numpy array LALALA (LALALA(n)))
</code></pre>
<p>So input is N, and output is an np.array LALALA (with 20 elements, each one related with one element in N)</p>
<p>How can I do for apply multicore proccesing?</p>
<p>Please explaing this to me in detail. Im a newby user and the sage-web-tutorials doesnt work.</p>
<p>Waiting for your answers.</p>
<p>Thanks a lot</p>
https://ask.sagemath.org/question/10409/parallel-multiple-cores-algorithm/?answer=15312#post-id-15312Use the `@parallel` decorator, see http://www.sagemath.org/doc/reference/parallel/sage/parallel/decorate.html#sage.parallel.decorate.parallelMon, 05 Aug 2013 09:56:14 +0200https://ask.sagemath.org/question/10409/parallel-multiple-cores-algorithm/?answer=15312#post-id-15312Answer by mresimulator for <p>Hi experts!</p>
<p>I have a intel core i3 (x4). I wanna take adventage of multiple cores CPU.</p>
<p>My Monte Carlo algorithm can be summarized like that:</p>
<pre><code> N=[N1, N2, ..., N20]
for n in N:
execute 100 times the algorithm related with 'n'
append some value (mean of the 100 times executed algorithm) in a output-numpy array LALALA (LALALA(n)))
</code></pre>
<p>So input is N, and output is an np.array LALALA (with 20 elements, each one related with one element in N)</p>
<p>How can I do for apply multicore proccesing?</p>
<p>Please explaing this to me in detail. Im a newby user and the sage-web-tutorials doesnt work.</p>
<p>Waiting for your answers.</p>
<p>Thanks a lot</p>
https://ask.sagemath.org/question/10409/parallel-multiple-cores-algorithm/?answer=15316#post-id-15316Thanks Volker Braun.
Im a really newby user and i wanna know how to integrate @parallel decoretor in my script:
N=[N1, N2, ..., N20]
for n in N:
execute 100 times the algorithm related with 'n'
append some value (mean of the 100 times executed algorithm) in a output-numpy array LALALA (LALALA(n)))
Waiting for your answers.
Thanks a lotMon, 05 Aug 2013 18:00:08 +0200https://ask.sagemath.org/question/10409/parallel-multiple-cores-algorithm/?answer=15316#post-id-15316Answer by mresimulator for <p>Hi experts!</p>
<p>I have a intel core i3 (x4). I wanna take adventage of multiple cores CPU.</p>
<p>My Monte Carlo algorithm can be summarized like that:</p>
<pre><code> N=[N1, N2, ..., N20]
for n in N:
execute 100 times the algorithm related with 'n'
append some value (mean of the 100 times executed algorithm) in a output-numpy array LALALA (LALALA(n)))
</code></pre>
<p>So input is N, and output is an np.array LALALA (with 20 elements, each one related with one element in N)</p>
<p>How can I do for apply multicore proccesing?</p>
<p>Please explaing this to me in detail. Im a newby user and the sage-web-tutorials doesnt work.</p>
<p>Waiting for your answers.</p>
<p>Thanks a lot</p>
https://ask.sagemath.org/question/10409/parallel-multiple-cores-algorithm/?answer=15324#post-id-15324I created a new question
http://ask.sagemath.org/question/2881/run-differents-scripts-in-different-cpu-cores
Case closed hereTue, 06 Aug 2013 19:13:55 +0200https://ask.sagemath.org/question/10409/parallel-multiple-cores-algorithm/?answer=15324#post-id-15324