SAS中文论坛

标题: Multi-Threaded Principle Component Analysis [打印本页]

作者: shiyiming    时间: 2012-2-1 11:39
标题: Multi-Threaded Principle Component Analysis
From oloolo's blog on SasProgramming


<p><a href="http://feedads.g.doubleclick.net/~a/8sPIHEdqu2clcEi_NVkerajCRQQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/8sPIHEdqu2clcEi_NVkerajCRQQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/8sPIHEdqu2clcEi_NVkerajCRQQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/8sPIHEdqu2clcEi_NVkerajCRQQ/1/di" border="0" ismap="true"></img></a></p><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-cJHtENUrbws/Tyil0xyStRI/AAAAAAAAAbU/RCpoC5M-WGQ/s1600/PCA+Multithreading1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="377" src="http://4.bp.blogspot.com/-cJHtENUrbws/Tyil0xyStRI/AAAAAAAAAbU/RCpoC5M-WGQ/s640/PCA+Multithreading1.png" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-oph0w9rWk1Q/Tyil3GfeRdI/AAAAAAAAAbc/Kl11OfZgrkE/s1600/PCA+Multithreading2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="225" src="http://3.bp.blogspot.com/-oph0w9rWk1Q/Tyil3GfeRdI/AAAAAAAAAbc/Kl11OfZgrkE/s640/PCA+Multithreading2.png" width="640" /></a></div>
<br />
SAS used to not support multithreading in PCA, then I figured out that its server version supports this functionality, see <a href="http://listserv.uga.edu/cgi-bin/wa?A2=ind1009d&amp;L=sas-l&amp;D=0&amp;P=4318" target="_blank">here</a>. Today, I found this mutlithreading capability is finally available in PC SAS v9.22.<br />
<br />
The figure above indicates that all 4 threads in my PC are utilized. FYI, My PC uses an Intel 2core 4threads CPU. This multi-threading capability directly help any work relying on SVD due to the direct relationshipbetween SVD and PC, see <a href="http://www.sas-programming.com/2010/03/macro-for-svd.html" target="_blank">here</a>.<br />
<br />
Notice that in order to observe the effect of mutli-threading by comparing Real User Time and CPU Time, I/O should not be a bottleneck, that is why in the code, all outputs, either to screen or to data sets, are suppressed.<br />
<br />
<pre style="background-color: #ebebeb; border-bottom: #999999 1px dashed; border-left: #999999 1px dashed; border-right: #999999 1px dashed; border-top: #999999 1px dashed; color: #000001; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; width: 100%;"><code>

options fullstimer;
data _junky;
     length id x: 8;
  array x{800};
  do id=1 to 5E3;
     do j=1 to dim(x);
     x[j]=ranuni(0);
  end;
  drop j; output;
  end;
run;

proc princomp data=_junky noprint;
      var x:;
run;

</code></pre><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29815492-3028162046104849377?l=www.sas-programming.com' alt='' /></div><img src="http://feeds.feedburner.com/~r/SasProgramming/~4/GUoIlOc0y8U" height="1" width="1"/>




欢迎光临 SAS中文论坛 (http://www.mysas.net/forum/) Powered by Discuz! X3.2