Ask Your Question
1

How to maximize computing time

asked 2017-11-26 05:25:40 -0600

Gianni Petrella gravatar image

Hello everyone, I am running a short bruteforce program, and python is not using more than 40% of my CPU power, although there is no other software running and the RAM is at 20%... Since my software is quite heavy, I would like to force sage to use more CPU power. How can I do so? I am using Sagemath 8.0 for Windows

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-11-29 09:40:09 -0600

Richard_L gravatar image

Windows reports the total percentage of the CPU, that is, over all cores taken together. So, if your program runs one thread and it saturates one core of a four core machine, Windows will report 25%.

If your task is parallelizable, you can try adding

Parallelism().set(nproc=NN)

somewhere above the calculation. For "NN" substitute the number of threads you want to use.

Note that not all algorithms can be parallelized, so the directive might or might not help.

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

Stats

Asked: 2017-11-26 05:25:40 -0600

Seen: 48 times

Last updated: Nov 29