<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Is the Apply function multi-threaded? in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Is-the-Apply-function-multi-threaded/m-p/146446#M1252</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The documentation for the APPLY function says&lt;/P&gt;&lt;P&gt;"Although the APPLY function is provided as a convenience, it is usually unnecessary to use it. It is often more efficient to write your functions to take vector, rather than scalar, arguments."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I agree: multithreaded or not, it is more efficient to vectorize your code. In general, well written vectorized code that uses matrix and vector computations will give you the most performance. When possible, avoid writing loops that iterate over the rows and columns of matrices.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've written several blogs (&lt;A href="https://www.sas.com/store/prodBK_63119_en.html"&gt;and a book&lt;/A&gt;) about how to vectorize SAS/IML programs. Here are two Getting Started articles:&lt;/P&gt;&lt;P&gt;&lt;A href="http://blogs.sas.com/content/iml/2013/05/15/vectorize-computations/" title="http://blogs.sas.com/content/iml/2013/05/15/vectorize-computations/"&gt; How to vectorize computations in a matrix language - The DO Loop&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://blogs.sas.com/content/iml/2013/05/22/timing-performance-vectorization/"&gt;http://blogs.sas.com/content/iml/2013/05/22/timing-performance-vectorization/&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some matrix operations in IML are multithreaded, but I don't think there is a list anywhere that documents which functions are multithreaded.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Dec 2014 16:08:14 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2014-12-11T16:08:14Z</dc:date>
    <item>
      <title>Is the Apply function multi-threaded?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Is-the-Apply-function-multi-threaded/m-p/146445#M1251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is the Apply function multi-threaded?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;More generally, what is multi-threaded in IML?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Dec 2014 15:35:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Is-the-Apply-function-multi-threaded/m-p/146445#M1251</guid>
      <dc:creator>ytz</dc:creator>
      <dc:date>2014-12-11T15:35:26Z</dc:date>
    </item>
    <item>
      <title>Re: Is the Apply function multi-threaded?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Is-the-Apply-function-multi-threaded/m-p/146446#M1252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The documentation for the APPLY function says&lt;/P&gt;&lt;P&gt;"Although the APPLY function is provided as a convenience, it is usually unnecessary to use it. It is often more efficient to write your functions to take vector, rather than scalar, arguments."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I agree: multithreaded or not, it is more efficient to vectorize your code. In general, well written vectorized code that uses matrix and vector computations will give you the most performance. When possible, avoid writing loops that iterate over the rows and columns of matrices.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've written several blogs (&lt;A href="https://www.sas.com/store/prodBK_63119_en.html"&gt;and a book&lt;/A&gt;) about how to vectorize SAS/IML programs. Here are two Getting Started articles:&lt;/P&gt;&lt;P&gt;&lt;A href="http://blogs.sas.com/content/iml/2013/05/15/vectorize-computations/" title="http://blogs.sas.com/content/iml/2013/05/15/vectorize-computations/"&gt; How to vectorize computations in a matrix language - The DO Loop&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://blogs.sas.com/content/iml/2013/05/22/timing-performance-vectorization/"&gt;http://blogs.sas.com/content/iml/2013/05/22/timing-performance-vectorization/&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some matrix operations in IML are multithreaded, but I don't think there is a list anywhere that documents which functions are multithreaded.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Dec 2014 16:08:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Is-the-Apply-function-multi-threaded/m-p/146446#M1252</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2014-12-11T16:08:14Z</dc:date>
    </item>
  </channel>
</rss>

