SAS中文论坛

 找回密码
 立即注册

扫一扫,访问微社区

查看: 824|回复: 0
打印 上一主题 下一主题

Multi-Threaded Principle Component Analysis

[复制链接]

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
楼主
 楼主| 发表于 2012-2-1 11:39:24 | 只看该作者

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"/>
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|SAS中文论坛  

GMT+8, 2025-5-7 00:04 , Processed in 0.070741 second(s), 19 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表