Thursday, January 14, 2016
My Optimization reports and source code
Intel recently organized a multi-core platform code optimization contest, I also participated in the competition; competition code delivery phase has ended, so it can open your own optimization process;
Source code and detailed optimization explanation:
http://blog.csdn.net/housisong/archive/2007/01/20/1488465.aspx
I realize a lot of versions (including many failed version, there are a lot of thought but did not spare the time to realize the programs; supplementary articles of this section has not been completed), the article only describes my submission process optimization mainline ;
Reply:
And finally to your version of the first to take a look ~ ~ ~
Reply:
Supplementary article has also been completed :)
Reply:
Question:
Compiler: Visual Studio 2005 support
#include & lt; emmintrin.h & gt;
_mm_sub_pd
some type of?
Reply:
Learn
Reply:
Optimization of the effect is very good
Unfortunately, you did not see the combination of those tools provided by Intel ah
Reply:
"Unfortunately, you did not see the combination of the tools provided by Intel ah"
My AMD CPU ah :(
Reply:
"Compiler: Visual Studio 2005 support
#include & lt; emmintrin.h & gt;
_mm_sub_pd
some type of? "
Well, vc2005 compiler support; icc supports;
You find the intel document assembly instructions they will tell you the corresponding function calls;
Reply:
Oh. intel document has a corresponding functional form I know.
But I always thought that this is the icc specific.
I did not expect vc2005 also supported.
Reply:
vc6 are supported, but you need to download the appropriate SP package only.
Reply:
Feeling housisong (HouSisong) flyingdog (flyingdog) as well as my own optimizations like ah
_mm_rsqrt_ps First iteration is a double iteration float
^ _ ^
Even I housisong (HouSisong) threads are similar assignments is
dynamically computed based on the number of CPU
Reply:
In fact, this contest is quite simple;
Optimal solution path can be a lot of people may watch out; (I walked a detour around the reading of sequential memory complexity of the code exchange, and later found that there is no sense :) But the code should be valid for flyingdog )
Still like to have some kind of problem complexity, allow yourself to design algorithms that :), but the problem can not be too complex (and time consuming can not afford)
Optimized code level seemed to fight hard labor, Oh
Reply:
Why should my code valid for?
Really like to go on manual labor. too tired.
Reply:
Conversion
double r [DIMS] [NPARTS];
double r [NPARTS] [DIMS];
They should have some effect!
I also spent a lot of time in it
Reply:
huanyun
housisong
flyingdog
Learn your code, very rewarding.
If you use icc to compile your code, I actually do not think speed is much worse at 0.0x, huh
I wonder if there used to compile your code vc8
Reply:
huanyun and housisong regarded pow compilation realized that part, but no
flyingdogUnder the icc pow automatically to quantify, is the use of SSE2, in fact achieve the same effect
I used Vtune looked flyingdog program, two thread allocation excellent! What experience ah? !
huanyun used SetPriorityClass (hProcess, REALTIME_PRIORITY_CLASS);
I used this parameter, REALTIME_PRIORITY_CLASS
The machine crashed, live with the bad very dangerous ah! Oh, but your program is very stable, you can tell us about it?
Reply:
But I think the whole array r only 20 K, the L1 cache 32K, it can be considered a good almost all the data in the L1 cache. For the L1 cache access, the Core 2 per visit 128bit, delay all three cycles, the write is 2 cycles. You can write into store buffer, so the actual strength of this writing do not take the number of cycles. Read because of the floating-point addition and multiplication spent a lot of cycles, really to use the data when they are ready. And Core 2 support six or cache 8 条 Forward (pointer increase) access prefetching.
To be completed when an r-core computing array, another nuclear use. That data in the original core L1 cache, and is rewriting state. On Core 2 cache structure, the kind of access you want to access the same memory. Require dozens of cycles.
Reply:
Deadlock is estimated that thread scheduling problem
I later found out this useless software open to slow a lot more before
I added SetPriorityClass (hProcess, REALTIME_PRIORITY_CLASS);
We have also found no crash.
Reply:
I was single core, a process run two threads,
With SetPriorityClass (hProcess, REALTIME_PRIORITY_CLASS); it crashed almost, because no response.
Your program can only run in the top of my one thread, Oh!
I do not know more than the cpu can not count the number of threads
huanyun you have to put your program into three or more to test it?
Reply:
Ah tried about four seconds, but very slow
A lot of time on the thread switching
Reply:
to zidongli
About my program parallelization instructions, see
http://blog.csdn.net/flyingdog/archive/2007/01/21/1489183.aspx
Reply:
Thank you, Oh
Reply:
mark
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment