View previous topic :: View next topic |
Author |
Message |
mym1450
Joined: 08 May 2014 Posts: 3
|
Posted: Thu May 08, 2014 8:43 am Post subject: how to use full cpu power in plato IDE ( fortran 95)? |
|
|
hello every body
when i run my program, plato only uses 20% of my cpu. how can i use 100% of my cpu to run fortran programes faster?
my notebook: pavilion dv6 cpu: core i7 2670
thank you |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Thu May 08, 2014 10:19 am Post subject: |
|
|
You would not want to use 100% of the cpu. This would mean that your machine would not be able to do anything else whilst your program is running. It would be completely locked.
In theory you can increase the priority of a thread but there is no direct way, that I know of, to do this.
You might be able to do this by calling the API function AvSetMmMaxThreadCharacteristics (see "Multimedia Class Scheduler Service" in the Microsoft Developer Network) but I suspect that this will make little or no difference.
Basically, it not a good idea to change from the default priority but increase in speed can often be obtained by optimising the code, for example by using /opt and by not using /checkmate etc. |
|
Back to top |
|
|
mym1450
Joined: 08 May 2014 Posts: 3
|
Posted: Fri May 09, 2014 8:05 am Post subject: |
|
|
thanks, but i dont think so
i set the priority to high but no change is seen
pleas see this pic:
[/img] |
|
Back to top |
|
|
jalih
Joined: 30 Jul 2012 Posts: 196
|
Posted: Fri May 09, 2014 8:06 pm Post subject: Re: |
|
|
mym1450 wrote: | thanks, but i dont think so
i set the priority to high but no change is seen
pleas see this pic: ...
|
Picture looks as expected to me. Your processor got four cores and one core is hard at work running your program. You need to use multiple threads in your code to get higher processor utilization. |
|
Back to top |
|
|
mym1450
Joined: 08 May 2014 Posts: 3
|
Posted: Sat May 10, 2014 8:52 am Post subject: |
|
|
thanks but how can i do this? my english is not good, can you say it simply for me please? |
|
Back to top |
|
|
davidb
Joined: 17 Jul 2009 Posts: 560 Location: UK
|
Posted: Sat May 10, 2014 6:22 pm Post subject: |
|
|
I must be doing things all wrong. I spent a couple of hours rearranging my program so it used less of my CPU.
If you want to use more cores, you will need to identify what parts of your program can be parallelized, then use a suitable API to spread the work across your processor cores. You can use OpenMP for this but it isn't supported with this compiler.
It looks like your processor has 4 cores and hyperthreading so you could run your program with 8 threads. However, this will slow down the other programs and processes on your machine, so isn't really a good idea, even if you can parallelise part of your program. _________________ Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl |
|
Back to top |
|
|
|