<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>The Windows HPC Team Blog</title><link>http://blogs.technet.com/b/windowshpc/</link><description>&amp;quot;Your guide to all things Windows HPC&amp;quot;</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>HPC Pack SOA Tutorial V: Diagnose a SOA Service</title><link>http://blogs.technet.com/b/windowshpc/archive/2013/03/14/hpc-pack-soa-tutorial-v-diagnose-a-soa-service.aspx</link><pubDate>Thu, 14 Mar 2013 09:00:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3558599</guid><dc:creator>Yumin Guo[MSFT]</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/windowshpc/rsscomments.aspx?WeblogPostID=3558599</wfw:commentRss><comments>http://blogs.technet.com/b/windowshpc/archive/2013/03/14/hpc-pack-soa-tutorial-v-diagnose-a-soa-service.aspx#comments</comments><description>&lt;p&gt;It&amp;rsquo;s not an easy job to write an HPC application with complex algorithms, but it&amp;rsquo;s even more difficult to troubleshoot the application. This tutorial is to introduce how to diagnose the SOA application.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Get SOA logs&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In HPC Pack 2012, it is much easier to get the SOA-related logs from HPC Cluster Manager. To enable SOA logging, in &lt;strong&gt;Configuration -&amp;gt; Services&lt;/strong&gt;, click &lt;strong&gt;Set Event Logging Level&lt;/strong&gt; to set the log level. See the following figure.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-36-metablogapi/4774.clip_5F00_image002_5F00_72930C20.jpg"&gt;&lt;img style="display: inline;" title="clip_image002" src="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-36-metablogapi/8446.clip_5F00_image002_5F00_thumb_5F00_15079ADC.jpg" alt="clip_image002" width="533" height="160" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Then you can try to call the service. After the SOA job finishes, you can right-click on the last job executed, then click &lt;strong&gt;Export SOA Trace&lt;/strong&gt; to export all the SOA-related logs. Note that these actions are only applicable to SOA jobs.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-36-metablogapi/6747.clip_5F00_image003_5F00_7A5AFEC2.png"&gt;&lt;img style="display: inline;" title="clip_image003" src="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-36-metablogapi/4578.clip_5F00_image003_5F00_thumb_5F00_5FAE62A9.png" alt="clip_image003" width="542" height="342" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Export SOA Trace&lt;/strong&gt; exports a zip file which contains several .csv files and .evtx files. The .csv files have all the SOA-related logs of all the compute nodes which ran the SOA tasks. Each .csv file corresponds to one compute node. The .evtx files have more log information generated by HPC Pack to help further diagnostics.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Writing to a log&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The next question is how to write logs in your own SOA service. HPC Pack 2012 provides a logging framework. See the &lt;a href="http://code.msdn.microsoft.com/HPC-Pack-2012-SOA-Tutorial-fb73c187"&gt;accompanying code sample&lt;/a&gt; to follow these steps to use the framework.&lt;/p&gt;
&lt;p&gt;In a SOA service you can use code like the following to add your own log, and the log can then be accessed from HPC Cluster Manager.&lt;/p&gt;
&lt;table style="width: 565px;" border="1" cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="563"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; ; mso-layout-grid-align: none;"&gt;&lt;span style="color: #2b91af; font-family: 新宋体; font-size: 9.5pt; mso-bidi-font-family: 新宋体; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin;"&gt;ServiceContext&lt;/span&gt;&lt;span style="font-family: 新宋体; font-size: 9.5pt; mso-bidi-font-family: 新宋体; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin;"&gt;.Logger.TraceInformation(&lt;span style="color: #a31515;"&gt;"Get a request to factorize {0}"&lt;/span&gt;, n);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;In above sample, the log level is &lt;em&gt;Information&lt;/em&gt;. So you need to make sure the log level of the service is set to information or verbose. You can use HPC Cluster Manager to set the level, as we did previously, or you can change the service configuration file to set the log level.&lt;/p&gt;
&lt;table style="width: 562px;" border="1" cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="560"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; ; mso-layout-grid-align: none;"&gt;&lt;span style="color: blue; font-family: 新宋体; font-size: 9.5pt; mso-bidi-font-family: 新宋体; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: 新宋体; font-size: 9.5pt; mso-bidi-font-family: 新宋体; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin;"&gt;microsoft.Hpc.Session.ServiceRegistration&lt;/span&gt;&lt;span style="color: blue; font-family: 新宋体; font-size: 9.5pt; mso-bidi-font-family: 新宋体; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; ; mso-layout-grid-align: none;"&gt;&lt;span style="color: blue; font-family: 新宋体; font-size: 9.5pt; mso-bidi-font-family: 新宋体; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: 新宋体; font-size: 9.5pt; mso-bidi-font-family: 新宋体; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin;"&gt;service&lt;/span&gt;&lt;span style="color: red; font-family: 新宋体; font-size: 9.5pt; mso-bidi-font-family: 新宋体; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin;"&gt;assembly&lt;/span&gt;&lt;span style="color: blue; font-family: 新宋体; font-size: 9.5pt; mso-bidi-font-family: 新宋体; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin;"&gt;=&lt;/span&gt;&lt;span style="font-family: 新宋体; font-size: 9.5pt; mso-bidi-font-family: 新宋体; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin;"&gt;"&lt;span style="color: blue;"&gt;\\head.contoso\SOAServices\Diagnostic.PrimeFactorization.dll&lt;/span&gt;"&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: blue; font-family: 新宋体; font-size: 9.5pt; mso-bidi-font-family: 新宋体; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin;"&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red; font-family: 新宋体; font-size: 9.5pt; mso-bidi-font-family: 新宋体; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin;"&gt;stdError&lt;/span&gt;&lt;span style="color: blue; font-family: 新宋体; font-size: 9.5pt; mso-bidi-font-family: 新宋体; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin;"&gt;=&lt;/span&gt;&lt;span style="font-family: 新宋体; font-size: 9.5pt; mso-bidi-font-family: 新宋体; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin;"&gt;""&lt;span style="color: red;"&gt;soaDiagTraceLevel&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;Information, ActivityTracing&lt;/span&gt;"&lt;span style="color: blue;"&gt; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: blue; font-family: 新宋体; font-size: 9.5pt; mso-bidi-font-family: 新宋体; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin;"&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515; font-family: 新宋体; font-size: 9.5pt; mso-bidi-font-family: 新宋体; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin;"&gt;microsoft.Hpc.Session.ServiceRegistration&lt;/span&gt;&lt;span style="color: blue; font-family: 新宋体; font-size: 9.5pt; mso-bidi-font-family: 新宋体; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Now invoke the service again. To view the log, click &lt;strong&gt;View &lt;/strong&gt;&lt;strong&gt;Message Details&lt;/strong&gt; dialog for the job.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-36-metablogapi/2388.clip_5F00_image006_5F00_15CFDAF9.png"&gt;&lt;img style="display: inline;" title="clip_image006" src="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-36-metablogapi/2656.clip_5F00_image006_5F00_thumb_5F00_016A156E.png" alt="clip_image006" width="567" height="194" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In the dialog box that appears you can see all the requests. Click one of the requests, and you can see your log information.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-36-metablogapi/8420.clip_5F00_image008_5F00_5812CD6F.jpg"&gt;&lt;img style="display: inline;" title="clip_image008" src="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-36-metablogapi/0383.clip_5F00_image008_5F00_thumb_5F00_18A4F412.jpg" alt="clip_image008" width="575" height="435" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you want to export the log files, as was shown previously, the .csv files will contain all your service log data.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Debug&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;HPC Pack provides a Visual Studio plug-in to help debug the service. With that you can attach to all the compute nodes for debugging. For more information, see &lt;a href="http://msdn.microsoft.com/en-us/library/ee945373.aspx"&gt;Microsoft HPC Debugger Add-ins for Visual Studio&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3558599" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/b/windowshpc/archive/tags/SOA/">SOA</category></item><item><title>HPC Pack SOA Tutorial IV – Common Data</title><link>http://blogs.technet.com/b/windowshpc/archive/2013/03/14/hpc-pack-soa-tutorial-iv-common-data.aspx</link><pubDate>Thu, 14 Mar 2013 08:39:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3558598</guid><dc:creator>Yumin Guo[MSFT]</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/windowshpc/rsscomments.aspx?WeblogPostID=3558598</wfw:commentRss><comments>http://blogs.technet.com/b/windowshpc/archive/2013/03/14/hpc-pack-soa-tutorial-iv-common-data.aspx#comments</comments><description>&lt;p&gt;With multiple tasks running on an HPC cluster, often, many tasks work with a shared data set. For example, a stock risk analysis program can run a large number of simulations against a set of historical stock market data. In this example, each SOA request can have different parameters, but all analyses use the same historical data. In HPC, the shared data set is called &lt;em&gt;common data&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Common data must be transferred to services running on compute nodes. Since the data is static, it will be inefficient to transfer the data within each SOA request. A good solution is to send the data set to the cluster and store it in a centralized place, where all services have access to. In this blog post, we&amp;rsquo;ll see how to do it. (Note: You could also store this data in a database that that HPC cluster has access to.)&lt;/p&gt;
&lt;p&gt;We will still be using our prime factorization example (see &lt;a href="http://blogs.technet.com/b/windowshpc/archive/2013/03/14/hpc-pack-soa-tutorial-iii-interactive-mode.aspx"&gt;this blog&lt;/a&gt; post for details). To accelerate the algorithm, we want to employ a prime number table, so that we can look up the table for prime factors instead of traversing all numbers. Obviously, a prime number table should be common data among all factorization requests. We&amp;rsquo;ll follow these steps to handle it:&lt;/p&gt;
&lt;p&gt;1. Implement a data manager&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;a. Send common data&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;b. Release common data&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;2. Implement the service and get common data into the service&lt;/p&gt;
&lt;p&gt;3. Implement the client&lt;/p&gt;
&lt;p&gt;4. Test the common data service&lt;/p&gt;
&lt;p&gt;We also discuss how to configure common data storage.&lt;/p&gt;
&lt;p&gt;See the &lt;a href="http://code.msdn.microsoft.com/HPC-Pack-2012-SOA-Tutorial-c46b16c3"&gt;accompanying code sample&lt;/a&gt; to follow the steps in this article.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1. &lt;/strong&gt;&lt;strong&gt;Implement a data manager&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;First, we create a data manager to handle the common data&amp;rsquo;s lifecycle.&lt;/p&gt;
&lt;p&gt;First, generate a prime number table as our common data. The implementation of CreatePrimeNumberTable is not relevant to our topic, so we won&amp;rsquo;t go into detail here.&lt;/p&gt;
&lt;table style="width: 465px;" border="1" cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="463"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; ; mso-layout-grid-align: none;"&gt;&lt;span style="background: white; color: green; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"&gt;//create prime number table of 200000 prime numbers&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="background: white; color: #2b91af; line-height: 106%; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"&gt;List&lt;/span&gt;&lt;span style="background: white; color: black; line-height: 106%; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="background: white; color: blue; line-height: 106%; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"&gt;int&lt;/span&gt;&lt;span style="background: white; color: black; line-height: 106%; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"&gt;&amp;gt; PrimeNumberTable = CreatePrimeNumberTable(200000);&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Common data is managed by the DataClient type in HPC. To create a data client, we should prepare the following information.&lt;/p&gt;
&lt;table style="width: 442px;" border="1" cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="440"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; ; mso-layout-grid-align: none;"&gt;&lt;span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"&gt;const&lt;/span&gt;&lt;span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"&gt;string&lt;/span&gt;&lt;span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"&gt; headnode = &lt;/span&gt;&lt;span style="background: white; color: #a31515; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"&gt;"head.contoso.com"&lt;/span&gt;&lt;span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"&gt;string&lt;/span&gt;&lt;span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"&gt; dataId = &lt;/span&gt;&lt;span style="background: white; color: #a31515; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"&gt;"PRIME_NUMBER_TABLE"&lt;/span&gt;&lt;span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The data ID is used to identity each data client, so it must be a unique value.&lt;/p&gt;
&lt;p&gt;Create a data client:&lt;/p&gt;
&lt;table style="width: 444px;" border="1" cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="442"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; ; mso-layout-grid-align: none;"&gt;&lt;span style="background: white; color: green; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"&gt;//create DataClient to send data&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; ; mso-layout-grid-align: none;"&gt;&lt;span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"&gt;DataClient dataClient = DataClient.Create(headnode, dataId);&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If a data client with same ID already exists, an exception will be thrown. In this case, if the existing common data is still needed, we&amp;rsquo;ll have to change our data ID; otherwise, just delete it as follows:&lt;/p&gt;
&lt;table style="width: 447px;" border="1" cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="445"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; ; mso-layout-grid-align: none;"&gt;&lt;span style="color: green; font-family: consolas; font-size: 9.5pt;"&gt;//delete the data client&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; ; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&lt;span style="color: #2b91af;"&gt;DataClient&lt;/span&gt;.Delete(headnode, dataId);&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Send the common data to the service by simply invoking WriteAll method.&lt;/p&gt;
&lt;table style="width: 450px;" border="1" cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="448"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; ; mso-layout-grid-align: none;"&gt;&lt;span style="background: white; color: green; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"&gt;//Send data to service.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; ; mso-layout-grid-align: none;"&gt;&lt;span style="background: white; color: green; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"&gt;//WriteAll() can only be called once on a DataClient object&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; ; mso-layout-grid-align: none;"&gt;&lt;span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"&gt;dataClient.WriteAll&amp;lt;&lt;/span&gt;&lt;span style="background: white; color: #2b91af; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"&gt;List&lt;/span&gt;&lt;span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"&gt;int&lt;/span&gt;&lt;span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"&gt;&amp;gt;&amp;gt;(PrimeNumberTable);&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We use WriteAll to send structured data to the cluster. Any serializable data can be sent this way.&lt;/p&gt;
&lt;p&gt;Also, raw data can be sent by invoking WriteRawBytesAll method. For example, if we get prime numbers directly from a file &lt;em&gt;PrimeNumbers&lt;/em&gt;, we can send data like this:&lt;/p&gt;
&lt;table style="width: 450px;" border="1" cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="448"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; ; mso-layout-grid-align: none;"&gt;&lt;span style="color: green; font-family: 新宋体; font-size: 9.5pt; mso-bidi-font-family: 新宋体; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin;"&gt;//&lt;/span&gt;&lt;span style="color: green; font-family: consolas; font-size: 9.5pt; mso-fareast-font-family: 新宋体;"&gt;WriteAllRawBytesAll can be called only once per data client.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; ; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; mso-fareast-font-family: 新宋体;"&gt;dataClient.WriteRawBytesAll(&lt;span style="color: #2b91af;"&gt;File&lt;/span&gt;.ReadAllBytes(&lt;span style="color: #a31515;"&gt;"PrimeNumbers"&lt;/span&gt;));&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;However, WriteAll or WriteRawBytesAll can be called only once per data client. On each data client, only one &amp;ldquo;write&amp;rdquo; operation is allowed, but multiple &amp;ldquo;read&amp;rdquo; operations can be performed.&lt;/p&gt;
&lt;p&gt;Typically, we send common data in the client and read them in the services. In this scenario, the common data is read-only to services.&lt;/p&gt;
&lt;p&gt;By now, the prime number table has been sent to the HPC cluster, and all the service requests can access it by providing the correct data ID. The data will remain in the cluster until it is explicitly deleted.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2. &lt;/strong&gt;&lt;strong&gt;Implement the service and get common data into the service&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;When implementing our service, the service contract remains the same.&lt;/p&gt;
&lt;p&gt;As mentioned before, we can get the data client through the data ID, and get common data by invoking the ReadAll method.&lt;/p&gt;
&lt;table style="width: 474px;" border="1" cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="472"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; ; mso-layout-grid-align: none;"&gt;&lt;span style="color: #2b91af; font-family: consolas; font-size: 9.5pt;"&gt;List&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;lt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&amp;gt;PrimeNumberTable;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; (&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;DataClient&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; dataClient = &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;ServiceContext&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;.GetDataClient(&lt;/span&gt;&lt;span style="color: #a31515;"&gt;"PRIME_NUMBER_TABLE"&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;))&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;nbsp; PrimeNumberTable = dataClient.ReadAll&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;List&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt;&amp;gt;();&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Or use the &lt;strong&gt;ReadRawBytesAll&lt;/strong&gt; method to send raw data.&lt;/p&gt;
&lt;table style="width: 478px;" border="1" cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="476"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; ; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; mso-fareast-font-family: 新宋体;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;byte&lt;/span&gt;[] PrimeNumberTableRaw;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;(DataClient dataClient =&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;ServiceContext&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;.GetDataClient(&lt;/span&gt;&lt;span style="color: #a31515;"&gt;"PRIME_NUMBER_TABLE"&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;))&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;PrimeNumberTableRaw = dataClient.ReadRawBytesAll();&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; line-height: 106%;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;To avoid reading common data into memory every time a new service object is created, reading it in a static constructor is a good practice.&lt;/p&gt;
&lt;p&gt;With the prime number table, factorization can be implemented in a quicker way like this.&lt;/p&gt;
&lt;table style="width: 469px;" border="1" cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="467"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; ; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; mso-fareast-font-family: 新宋体;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&amp;gt;Factorize(&lt;span style="color: blue;"&gt;int&lt;/span&gt;n)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;List&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt; factors = &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;List&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt;();&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: green;"&gt;//When factors are in PrimeNumberTable&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;for&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; (&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;i = 0; i &amp;lt; PrimeNumberTable.Count; )&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;if&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;(n % i == 0)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;factors.Add(i);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;n /= i;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;else&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;i++;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: green;"&gt;//When factors are not in PrimeNumberTable&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;for&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; (&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;i = PrimeNumberTable.Max() + 1; i &amp;lt;= n; )&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;if&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;(n % i == 0)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;factors.Add(i);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;n /= i;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;else&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;i++;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;return&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;factors;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;3. &lt;/strong&gt;&lt;strong&gt;Implement the client&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;We&amp;rsquo;ll create a simple client just to test the service.&lt;/p&gt;
&lt;table style="width: 568px;" border="1" cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="566"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; ; mso-layout-grid-align: none;"&gt;&lt;span style="color: green; font-family: consolas; font-size: 9.5pt; mso-fareast-font-family: 新宋体;"&gt;//Change headnode here&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; ; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; mso-fareast-font-family: 新宋体;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;const&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; headnode = &lt;span style="color: #a31515;"&gt;"head.contoso.com"&lt;/span&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;const&lt;/span&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; serviceName = &lt;/span&gt;&lt;span style="color: #a31515;"&gt;"PrimeFactorizationWithCommonData"&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;SessionStartInfo&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; info = &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;SessionStartInfo&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;(headnode, serviceName);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Random&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; random = &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Random&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;();&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;try&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: green;"&gt;//create an interactive session&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; (&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Session&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; session = &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Session&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;.CreateSession(info))&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;.WriteLine(&lt;/span&gt;&lt;span style="color: #a31515;"&gt;"Session {0} has been created"&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;, session.Id);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; (&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;BrokerClient&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;IPrimeFactorization&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt;client = &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;BrokerClient&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;IPrimeFactorization&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt;(session))&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;//send request&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; num = random.Next(1, &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Int32&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;.MaxValue);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;FactorizeRequest&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; request = &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;FactorizeRequest&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;(num);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;client.SendRequest&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;FactorizeRequest&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt;(request, num);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;client.EndRequests();&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; ; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; mso-fareast-font-family: 新宋体;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;//get response&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;foreach&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; (&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;BrokerResponse&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;FactorizeResponse&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt;response &lt;/span&gt;&lt;span style="color: blue;"&gt;in&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; client.GetResponses&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;FactorizeResponse&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt;())&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; number = response.GetUserData&amp;lt;&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt;();&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;[] factors = response.Result.FactorizeResult;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;.WriteLine(&lt;/span&gt;&lt;span style="color: #a31515;"&gt;"{0} = {1}"&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;, number,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;.Join&amp;lt;&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt;(&lt;/span&gt;&lt;span style="color: #a31515;"&gt;" * "&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;, factors));&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;session.Close();&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;.WriteLine(&lt;/span&gt;&lt;span style="color: #a31515;"&gt;"done"&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;.WriteLine(&lt;/span&gt;&lt;span style="color: #a31515;"&gt;"Press any key to exit"&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;.ReadKey();&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;catch&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; (System.&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Exception&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;ex)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;.WriteLine(ex.Message);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;4. &lt;/strong&gt;&lt;strong&gt;Test the common data service&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Run DataManager.exe to send common data to the cluster.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-36-metablogapi/2021.clip_5F00_image012_5F00_21192302.jpg"&gt;&lt;img style="display: inline;" title="clip_image012" src="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-36-metablogapi/0871.clip_5F00_image012_5F00_thumb_5F00_717B0475.jpg" alt="clip_image012" width="471" height="309" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Now start Client.exe. We can see that the service runs correctly.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-36-metablogapi/0830.clip_5F00_image014_5F00_170481D7.jpg"&gt;&lt;img style="display: inline;" title="clip_image014" src="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-36-metablogapi/8780.clip_5F00_image014_5F00_thumb_5F00_7C57E5BD.jpg" alt="clip_image014" width="476" height="313" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;5. &lt;/strong&gt;&lt;strong&gt;Configure common data storage&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Common data is stored in a shared folder which can be accessed by all compute nodes. This path is determined by the environment variable HPC_RUNTIMESHARE. You can check it by using HPC Pack command line tool &lt;strong&gt;&lt;a href="http://technet.microsoft.com/en-us/library/cc947705(v=WS.10).aspx"&gt;cluscfg&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Type cluscfg listenvs in a command window, and you&amp;rsquo;ll see a list of environment variables. By default, the value of HPC_RUNTIMESHARE is \\COMPUTE_NAME\Runtime$. This is a shared path, which is mapped to C:\HPCRuntimeDirectory on the head node.&lt;/p&gt;
&lt;p&gt;If you need to, you can change the value of HPC_RUNTIMESHARE by using cluscfg setenvs. Ensure that all compute nodes have read access to this path, and clients should have write access if they need to send common data.&lt;/p&gt;
&lt;p&gt;For more information, see &lt;a href="http://technet.microsoft.com/en-us/library/hh339097.aspx"&gt;Configuring the Runtime Data Share&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3558598" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/b/windowshpc/archive/tags/SOA/">SOA</category></item><item><title>HPC Pack SOA Tutorial III – Interactive mode</title><link>http://blogs.technet.com/b/windowshpc/archive/2013/03/14/hpc-pack-soa-tutorial-iii-interactive-mode.aspx</link><pubDate>Thu, 14 Mar 2013 08:11:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3558593</guid><dc:creator>Yumin Guo[MSFT]</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/windowshpc/rsscomments.aspx?WeblogPostID=3558593</wfw:commentRss><comments>http://blogs.technet.com/b/windowshpc/archive/2013/03/14/hpc-pack-soa-tutorial-iii-interactive-mode.aspx#comments</comments><description>&lt;p&gt;In &lt;a href="http://blogs.technet.com/b/windowshpc/archive/2013/03/14/hpc-pack-soa-tutorial-ii-batch-mode-.aspx"&gt;tutorial II&lt;/a&gt; we discussed how to deal with a time-consuming service by employing a durable session. However, batch mode is not the only computation mode in the HPC world. Some computations can be finished within a few seconds to a few minutes. The end user may expect almost real-time response.&lt;/p&gt;
&lt;p&gt;That mode brings different challenges when compared to batch mode. Response time is more critical. Therefore the session startup overhead cannot be ignored. In a typical HPC cluster, it takes a few seconds to start a new session. If there are other jobs running on the cluster ,the newly created session must wait until the resources are available, which makes the startup time much longer. Fortunately, HPC Pack provides a way to deal with this situation and cut down the unnecessary cost.&lt;/p&gt;
&lt;p&gt;See the &lt;a href="http://code.msdn.microsoft.com/HPC-Pack-2012-SOA-Tutorial-261cc657"&gt;accompanying code sample&lt;/a&gt; to follow the steps in this article.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Implement the service&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;We use the same service as in &lt;a href="http://blogs.technet.com/b/windowshpc/archive/2013/03/14/hpc-pack-soa-tutorial-ii-batch-mode-.aspx"&gt;tutorial II&lt;/a&gt; &amp;ndash; the prime factorization service. To satisfy the real-time requirements, we&amp;rsquo;ll just pass small numbers to the service.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s the service contract:&lt;/p&gt;
&lt;table style="width: 400px;" border="1" cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="400"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; ; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;[&lt;span style="color: #2b91af;"&gt;ServiceContract&lt;/span&gt;]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: blue;"&gt;interface&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;IPrimeFactorization&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;[&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;OperationContract&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;List&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt;Factorize(&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;n);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;And here&amp;rsquo;s the service implementation:&lt;/p&gt;
&lt;table style="width: 400px;" border="1" cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="400"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; ; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; mso-fareast-font-family: 新宋体;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&amp;gt;Factorize(&lt;span style="color: blue;"&gt;int&lt;/span&gt;n)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;List&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt; factors = &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;List&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt;();&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;for&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; (&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;i = 2; n &amp;gt; 1; )&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;if&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;(n % i == 0)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;factors.Add(i);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;n /= i;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;else&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;i++;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;return&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;factors;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; line-height: 107%;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;Implement the client&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To save the time of starting new job, the client must reuse the existing session instead of creating a new one, because creating a new session means starting a new job. To reuse the existing session, we need to create the session as follows:&lt;/p&gt;
&lt;table style="width: 535px;" border="1" cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="533"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; ; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;const&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; headnode = &lt;span style="color: #a31515;"&gt;"head.contoso.com"&lt;/span&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;const&lt;/span&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; serviceName = &lt;/span&gt;&lt;span style="color: #a31515;"&gt;"PrimeFactorizationService"&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;SessionStartInfo&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; info = &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;SessionStartInfo&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;(headnode, serviceName);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: green;"&gt;//Enable session pool&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;info.ShareSession = &lt;/span&gt;&lt;span style="color: blue;"&gt;true&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;info.UseSessionPool = &lt;/span&gt;&lt;span style="color: blue;"&gt;true&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;You may notice that there are two new properties of SessionStartInfo being assigned here.&lt;/p&gt;
&lt;p&gt;Setting ShareSession to true means that any user can send requests to the broker, not just the one that creates the session.&lt;/p&gt;
&lt;p&gt;Setting UseSessionPool to true ensures that the every new client uses the existing session instead of creating another one. The session pool is maintained on the server side - it guarantees that when a client connects to the same service with the flag set to true, it always returns the same session as long as it&amp;rsquo;s still alive.&lt;/p&gt;
&lt;p&gt;Now we can create the session. We don&amp;rsquo;t want to use a durable session because it may affect the performance.&lt;/p&gt;
&lt;table style="width: 537px;" border="1" cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="535"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; ; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;//create an interactive session&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; (&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Session&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; session = &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Session&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;.CreateSession(info))&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;.WriteLine(&lt;/span&gt;&lt;span style="color: #a31515;"&gt;"Session {0} has been created"&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;, session.Id);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-tab-count: 1;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;hellip;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Create a broker client to send requests and get responses.&lt;/strong&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;In the case of the previous code, we now have a situation where there can be many broker clients in a single session. In this case, we should assign a unique ID to the client.&lt;/p&gt;
&lt;table style="width: 545px;" border="1" cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="543"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; ; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;//in one session, each broker client should have a unique id&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; ClientId = &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Guid&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;.NewGuid().ToString();&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; (&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;BrokerClient&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;IPrimeFactorization&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt; client = &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;BrokerClient&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;IPrimeFactorization&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt;(ClientId, session))&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;.WriteLine(&lt;/span&gt;&lt;span style="color: #a31515;"&gt;"BrokerClient {0} has been created"&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;, ClientId);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: green; font-family: consolas; font-size: 9.5pt;"&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #2b91af; font-family: consolas; font-size: 9.5pt; mso-fareast-font-family: 新宋体;"&gt;Random&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; mso-fareast-font-family: 新宋体;"&gt; random = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Random&lt;/span&gt;();&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt; num = &lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; mso-fareast-font-family: 新宋体;"&gt;random.Next(1, &lt;span style="color: #2b91af;"&gt;Int32&lt;/span&gt;.MaxValue);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: green;"&gt;//Send request&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;FactorizeRequest&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; request = &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;FactorizeRequest&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;(num);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;client.SendRequest&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;FactorizeRequest&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt;(request, num);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;client.EndRequests();&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: green;"&gt;//Get response&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;foreach&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; (&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;BrokerResponse&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;FactorizeResponse&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt; response &lt;/span&gt;&lt;span style="color: blue;"&gt;in&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; client.GetResponses&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;FactorizeResponse&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt;())&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; number = response.GetUserData&amp;lt;&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt;();&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;[] factors = response.Result.FactorizeResult;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;.WriteLine(&lt;/span&gt;&lt;span style="color: #a31515;"&gt;"{0} = {1}"&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;, number,&lt;/span&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;.Join&amp;lt;&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt;(&lt;/span&gt;&lt;span style="color: #a31515;"&gt;" * "&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;, factors));&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Now run the client twice. You&amp;rsquo;ll see that the clients share the same session ID, as a result of the enabled session pool. Also, the first client runs much longer than then second one, which indicates that the new client reuses the created session.&lt;/p&gt;
&lt;p&gt;Since GetResponses is a synchronous function, the client will be blocked and kept waiting for the results. This is not a welcome situation in a real-time system, so let&amp;rsquo;s try another way to get responses.&lt;/p&gt;
&lt;p&gt;We can set an &lt;strong&gt;asynchronous callback&lt;/strong&gt; for the client by using SetResponseHandler as follows:&lt;/p&gt;
&lt;table style="width: 550px;" border="1" cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="548"&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin-bottom: 0pt; ; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;//use this event sync main thread and callback&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;AutoResetEvent&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; done = &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;AutoResetEvent&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;(&lt;/span&gt;&lt;span style="color: blue;"&gt;false&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: green;"&gt;//set callback function. this handler will be invoke before service replies.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;client.SetResponseHandler&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;FactorizeResponse&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt;((response) =&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; number = response.GetUserData&amp;lt;&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt;();&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;[] factors = response.Result.FactorizeResult;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;.WriteLine(&lt;/span&gt;&lt;span style="color: #a31515;"&gt;"{0} = {1}"&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;, number,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;.Join&amp;lt;&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt;(&lt;/span&gt;&lt;span style="color: #a31515;"&gt;" * "&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;, factors));&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: green;"&gt;//release the lock&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;done.Set();&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;});&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Thus after normally sending requests, the client can continue with other work. When the responses are ready, the response handler will be called to display the results.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Deploy and test the service&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You may follow &lt;a href="http://blogs.technet.com/b/windowshpc/archive/2013/03/14/soa-based-application-tutorial-i-write-your-first-soa-service-and-client-hpc-pack-.aspx"&gt;this blog&lt;/a&gt; post to deploy and test the case step by step.&lt;/p&gt;
&lt;p&gt;You can run multiple clients. The output will be like this:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-36-metablogapi/0624.clip_5F00_image008_5F00_51125C34.jpg"&gt;&lt;img style="display: inline;" title="clip_image008" src="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-36-metablogapi/1050.clip_5F00_image008_5F00_thumb_5F00_4F619060.jpg" alt="clip_image008" width="554" height="281" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Notice that all the clients share the same session ID.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cluster autogrow and autoshrink&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A common situation of the interactive mode is to run a long-running service serving multiple clients. To respond to each request as quickly as possible, we should keep the session alive. But, on the other hand, having a SOA job occupy a large number of resources during off-peak times is wasteful.&lt;/p&gt;
&lt;p&gt;HPC Pack has a feature to grow and shrink resources based on the number of requests. If there are no requests it will shirnk the number of resources to the minimum number specified by the job. When receiving requests, it will autogrow the resources to handle them.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: A session will time out if there&amp;rsquo;s no client connecting to it for a period of time. To make a session a long running service, you can change the &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.hpc.scheduler.session.sessionstartinfo.brokersettingsinfo.sessionidletimeout%28v=vs.85%29.aspx"&gt;SessionIdleTimeout&lt;/a&gt; when starting the session.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3558593" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/b/windowshpc/archive/tags/SOA/">SOA</category></item><item><title>HPC Pack SOA Tutorial II – Batch mode</title><link>http://blogs.technet.com/b/windowshpc/archive/2013/03/14/hpc-pack-soa-tutorial-ii-batch-mode-.aspx</link><pubDate>Thu, 14 Mar 2013 07:34:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3558587</guid><dc:creator>Yumin Guo[MSFT]</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/windowshpc/rsscomments.aspx?WeblogPostID=3558587</wfw:commentRss><comments>http://blogs.technet.com/b/windowshpc/archive/2013/03/14/hpc-pack-soa-tutorial-ii-batch-mode-.aspx#comments</comments><description>&lt;p&gt;In the &lt;a href="http://blogs.technet.com/b/windowshpc/archive/2013/03/14/soa-based-application-tutorial-i-write-your-first-soa-service-and-client-hpc-pack-.aspx"&gt;last blog post&lt;/a&gt;, we implemented a simple SOA client and service. However in most cases, the HPC algorithm is not as simple as adding two numbers. Some services are more complex and run for hours. For such services, the end user normally submits all the requests, then retrieves the responses in a couple of hours. This represents a challenge for the developers. For example, can we close the client application after sending all the requests, and then start another client to get the responses the next day? This blog post is to guide you to design the application to handle such scenarios.&lt;/p&gt;
&lt;p&gt;The key requirement of the batch mode is to make sure the requests won&amp;rsquo;t be lost after being successfully sent, and the result generated by the service won&amp;rsquo;t be lost either.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s create a new service to explain how to create such reliable computations. We create a service which can do prime factorization. Then, we will write a client application to submit 100 big numbers to the service, and then start another client application to retrieve the results.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Implement the service&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Download the &lt;a href="http://code.msdn.microsoft.com/HPC-Pack-2012-SOA-Tutorial-f109db12"&gt;accompanying code sample&lt;/a&gt; to build the service.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s as simple as the first example.&lt;/p&gt;
&lt;p&gt;Here is the service contract:&lt;/p&gt;
&lt;table style="width: 400px;" border="1" cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="400"&gt;
&lt;p class="MsoNormal" style="text-align: left; ; mso-pagination: widow-orphan; mso-layout-grid-align: none;" align="left"&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;[&lt;span style="color: #2b91af;"&gt;ServiceContract&lt;/span&gt;]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: blue;"&gt;interface&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;IPrimeFactorization&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;[&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;OperationContract&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;List&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt; Factorize(&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;n);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Here is the service implementation:&lt;/p&gt;
&lt;table style="width: 400px;" border="1" cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="400"&gt;
&lt;p class="MsoNormal" style="text-align: left; ; mso-pagination: widow-orphan; mso-layout-grid-align: none;" align="left"&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt; mso-fareast-font-family: 新宋体;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&amp;gt;Factorize(&lt;span style="color: blue;"&gt;int&amp;nbsp;&lt;/span&gt;n)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;List&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt; factors = &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;List&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt;();&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;for&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; (&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;i = 2; n &amp;gt; 1; )&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;if&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;(n % i == 0)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;factors.Add(i);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;n /= i;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;else&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;i++;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;factors;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Implement the client to send requests&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;HPC Pack provides a feature called DurableSession. It makes sure all the requests and the responses are persisted.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s write a client application to send the requests.&lt;/p&gt;
&lt;p&gt;a. First we need to prepare the session info. This is the same as in the previous tutorial.&lt;/p&gt;
&lt;table style="width: 511px;" border="1" cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="509"&gt;
&lt;p class="MsoNormal" style="text-align: left; ; mso-pagination: widow-orphan; mso-layout-grid-align: none;" align="left"&gt;&lt;span style="color: #2b91af; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;SessionStartInfo&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt; info = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SessionStartInfo&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;"head.contoso.com"&lt;/span&gt;, &lt;span style="color: #a31515;"&gt;"PrimeFactorizationService"&lt;/span&gt;);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;b. Now we need to create a DurableSession object, like the following code.&lt;/p&gt;
&lt;table style="width: 510px;" border="1" cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="508"&gt;
&lt;p class="MsoNormal" style="text-align: left; ; mso-pagination: widow-orphan; mso-layout-grid-align: none;" align="left"&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;//Create a durable session&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="text-align: left; text-indent: 0.25in; ; mso-pagination: widow-orphan; mso-layout-grid-align: none;" align="left"&gt;&lt;span style="color: #2b91af; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;DurableSession&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt; session = &lt;span style="color: #2b91af;"&gt;DurableSession&lt;/span&gt;.CreateSession(info);&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="text-align: left; text-indent: 0.25in; ; mso-pagination: widow-orphan; mso-layout-grid-align: none;" align="left"&gt;&lt;span style="color: #2b91af; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt; mso-fareast-font-family: 新宋体;"&gt;Console&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt; mso-fareast-font-family: 新宋体;"&gt;.WriteLine(&lt;span style="color: #a31515;"&gt;"Session {0} has been created"&lt;/span&gt;, session.Id);&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;c. Create a BrokerClient object to send requests.&lt;/p&gt;
&lt;table style="width: 511px;" border="1" cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="509"&gt;
&lt;p class="MsoNormal" style="text-align: left; ; mso-pagination: widow-orphan; mso-layout-grid-align: none;" align="left"&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt; mso-fareast-font-family: 新宋体;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;//Send batch request&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Random&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; random = &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Random&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;();&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;const&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;numRequests = 100;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; (&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;BrokerClient&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;IPrimeFactorization&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt;client = &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;BrokerClient&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;IPrimeFactorization&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt;(session))&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;.WriteLine(&lt;/span&gt;&lt;span style="color: #a31515;"&gt;"Sending {0} requests..."&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;, numRequests);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;for&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; (&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;i = 0; i &amp;lt; numRequests; i++)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; number = random.Next(1, &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Int32&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;.MaxValue);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;FactorizeRequest&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; request = &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;FactorizeRequest&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;(number);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: green;"&gt;//The second param is used to identify each request.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: green;"&gt;//It can be retrieved from the response.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;client.SendRequest&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;FactorizeRequest&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt;(request, number);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;client.EndRequests();&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;.WriteLine(&lt;/span&gt;&lt;span style="color: #a31515;"&gt;"All the {0} requests have been sent"&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;, numRequests);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Here we call EndRequests() to indicate that we have submitted all the requests. After calling EndRequests() you cannot use this client object to send more requests.&lt;/p&gt;
&lt;p&gt;Now we can finish this application. Because we used a durable session, it&amp;rsquo;s fine to close the client. All the requests are still on service side and will be calculated by the compute nodes in the cluster.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Monitor the progress&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In HPC Cluster Manager, we can monitor the progress of the requests we just submitted. Go to &lt;strong&gt;Job Management&lt;/strong&gt; to find your job, and click &lt;strong&gt;View Job.&lt;/strong&gt; You can see how many requests have been processed.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-36-metablogapi/5040.clip_5F00_image00711_5F00_73744F52.jpg"&gt;&lt;img style="display: inline;" title="clip_image007[11]" src="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-36-metablogapi/5008.clip_5F00_image00711_5F00_thumb_5F00_43D630C6.jpg" alt="clip_image007[11]" width="580" height="201" border="0" /&gt;&lt;/a&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Implement the client to retrieve responses&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;After a couple of hours, the user can come back and retrieve the results. (In our case you don&amp;rsquo;t have to wait that long.)&lt;/p&gt;
&lt;p&gt;a. Prepare the session info. Note that you need the session ID of the previous session to help the client to attach the session.&lt;/p&gt;
&lt;table style="width: 550px;" border="1" cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="width: 580px;" valign="top"&gt;
&lt;p class="MsoNormal" style="text-align: left; ; mso-pagination: widow-orphan; mso-layout-grid-align: none;" align="left"&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;//Input sessionId here&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;sessionId;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;.Write(&lt;/span&gt;&lt;span style="color: #a31515;"&gt;"Input the session id : "&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;sessionId = &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Int32&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;.Parse(&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;.ReadLine());&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: green;"&gt;//Change the headnode name here&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;SessionAttachInfo&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; info = &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;SessionAttachInfo&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;(&lt;/span&gt;&lt;span style="color: #a31515;"&gt;"head.contoso.com"&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;, sessionId);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;b. Instead of creating a new session, attach to the existing session.&lt;/p&gt;
&lt;table style="width: 502px;" border="1" cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="500"&gt;
&lt;p class="MsoNormal" style="text-align: left; ; mso-pagination: widow-orphan; mso-layout-grid-align: none;" align="left"&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;//Attach to session&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;DurableSession&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; session = &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;DurableSession&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;.AttachSession(info);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;c. Get responses from the session.&lt;/p&gt;
&lt;table style="width: 550px;" border="1" cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="width: 550px;" valign="top"&gt;
&lt;p class="MsoNormal" style="text-align: left; ; mso-pagination: widow-orphan; mso-layout-grid-align: none;" align="left"&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;//Get responses&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; (&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;BrokerClient&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;IPrimeFactorization&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt; client = &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;BrokerClient&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;IPrimeFactorization&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt;(session))&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;foreach&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; (&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;BrokerResponse&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;FactorizeResponse&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt;response &lt;/span&gt;&lt;span style="color: blue;"&gt;in&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; client.GetResponses&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;FactorizeResponse&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt;())&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; number = response.GetUserData&amp;lt;&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt;();&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;[] factors = response.Result.FactorizeResult;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515;"&gt;"{0} = {1}"&lt;/span&gt;, number, &lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;.Join&amp;lt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&amp;gt;(&lt;span style="color: #a31515;"&gt;" * "&lt;/span&gt;, factors));&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;d. Close the session.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Tips:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;- Because of persistence of requests and responses, the performance of the durable session is slightly slower than that of the interactive session.&lt;/p&gt;
&lt;p&gt;- session.Close(true) purges all the persisted data related to this session. It should only be called when the session and its data are not needed any more. If the session will be used going forward, you should call session.close(false).&lt;/p&gt;
&lt;p&gt;- If EndRequests() is not called, the service will keep waiting for the upcoming request. After a period of time (by default, 5 mins), it will remove the client if it does not receive more requests. All the requests sent by this client will be removed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3558587" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/b/windowshpc/archive/tags/SOA/">SOA</category></item><item><title>HPC Pack SOA Tutorial I – Write your first SOA service and client</title><link>http://blogs.technet.com/b/windowshpc/archive/2013/03/14/soa-based-application-tutorial-i-write-your-first-soa-service-and-client-hpc-pack-.aspx</link><pubDate>Thu, 14 Mar 2013 07:03:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3558583</guid><dc:creator>Yumin Guo[MSFT]</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/windowshpc/rsscomments.aspx?WeblogPostID=3558583</wfw:commentRss><comments>http://blogs.technet.com/b/windowshpc/archive/2013/03/14/soa-based-application-tutorial-i-write-your-first-soa-service-and-client-hpc-pack-.aspx#comments</comments><description>&lt;p&gt;This series of blog posts introduces the SOA programming model for Microsoft HPC Pack 2012. This is the first blog post of the series and provides guidance to write your first SOA service and client. See the &lt;a href="http://code.msdn.microsoft.com/HPC-Pack-2012-SOA-Tutorial-c953d8c9#content"&gt;accompanying code sample&lt;/a&gt; to follow the steps in this article.&lt;/p&gt;
&lt;p&gt;Note: Most of the general considerations for SOA for HPC Pack 2012 also apply to earlier versions of HPC Pack.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What is a SOA service?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Service-oriented architecture (SOA) is an approach to building distributed, loosely coupled systems.&lt;/p&gt;
&lt;p&gt;With SOA, distinct computational functions are packaged as software modules called services. Unlike traditional HPC applications, an HPC SOA service exposes its functionality through a well-defined service interface which allows any application or process on the network to access the functionality of the service. Developers can implement service functionality by using any programming language, and can write original services or package existing dynamic-link libraries (DLLs) and IT investments as services.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why SOA services?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;HPC applications are typically classified as &amp;ldquo;message intensive&amp;rdquo; or &amp;ldquo;embarrassingly parallel.&amp;rdquo; Message-intensive applications comprise sequential tasks. Embarrassingly parallel applications can be easily divided into large numbers of parallel tasks, with no dependency or communication between them.&lt;/p&gt;
&lt;p&gt;SOA services are designed to solve the embarrassingly parallel problem. Compared with traditional HPC computation models, SOA services provide the following advantages:&lt;/p&gt;
&lt;p&gt;- Easier programming model: The interface of the SOA service is just a remote method. It makes the client application able to easily access the service.&lt;/p&gt;
&lt;p&gt;- Easier message exchange: Traditional HPC jobs require dealing with input and output files. SOA services allow client applications to easily transfer data between the client application and service.&lt;/p&gt;
&lt;p&gt;See &lt;a href="http://www.microsoft.com/en-us/download/details.aspx?id=11540"&gt;http://www.microsoft.com/en-us/download/details.aspx?id=11540&lt;/a&gt; for a technical overview of cluster-enabled SOA application development.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Getting started &lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To write a SOA program to run on an HPC Pack 2012 cluster, you need the following software:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.microsoft.com/en-us/download/details.aspx?id=36044"&gt;&lt;strong&gt;HPC Pack 2012 Client Utilities&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.microsoft.com/en-us/download/details.aspx?id=36043"&gt;&lt;strong&gt;HPC Pack 2012 SDK&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkId=181011"&gt;&lt;strong&gt;.NET 4.0&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt; or later&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To test your service you need to set up an HPC Pack Cluster to run your service. You can download the HPC Pack 2012 from &lt;a href="http://go.microsoft.com/fwlink/?LinkID=260642"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Now we can start writing the SOA application. Let&amp;rsquo;s say we need a service running on the HPC cluster to do math calculations. Then we need a client program for end users, because they cannot directly access the cluster. The client program submits the calculation request to the service and returns the result to the end users. To simplify the code, let&amp;rsquo;s just use a simple addition calculation as an example.&lt;/p&gt;
&lt;p&gt;Here are the steps to write a SOA application:&lt;/p&gt;
&lt;p&gt;- Step 1: Implement the service&lt;/p&gt;
&lt;p&gt;- Step 2: Deploy the service&lt;/p&gt;
&lt;p&gt;- Step 3: Implement the client&lt;/p&gt;
&lt;p&gt;- Step 4: Test the service&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 1: Implement the service&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Following code can be found in the CalculatorService project in the &lt;a href="http://code.msdn.microsoft.com/HPC-Pack-2012-SOA-Tutorial-c953d8c9#content"&gt;sample code&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;A SOA service is a &lt;a href="http://go.microsoft.com/fwlink/?linkid=122573"&gt;Windows Communication Foundation&lt;/a&gt; (WCF) service running on the HPC cluster. The SOA service is ideal for writing interactive, embarrassingly parallel applications, especially for calculation of complex algorithms.&lt;/p&gt;
&lt;p&gt;A SOA service does not require too much extra effort beyond your algorithm. It&amp;rsquo;s just a standard WCF service. The first step is to define the service contract, like the following code:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;table style="width: 400px;" border="1" cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="398"&gt;
&lt;p class="MsoNormal" style="text-align: left; ; mso-pagination: widow-orphan; mso-layout-grid-align: none;" align="left"&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;[&lt;span style="color: #2b91af;"&gt;ServiceContract&lt;/span&gt;]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: blue;"&gt;interface&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;ICalculator&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;[&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;OperationContract&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;double&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; Add(&lt;/span&gt;&lt;span style="color: blue;"&gt;double&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; a, &lt;/span&gt;&lt;span style="color: blue;"&gt;double&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;b);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The only extra code is to add the attribute, which can be recognized by WCF, of the interface and its methods. With the service contract the client can understand how to invoke the method and what parameters are required.&lt;/p&gt;
&lt;p&gt;The next step is to implement the algorithm of the service:&lt;/p&gt;
&lt;table style="width: 400px;" border="1" cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="400"&gt;
&lt;p class="MsoNormal" style="text-align: left; ; mso-pagination: widow-orphan; mso-layout-grid-align: none;" align="left"&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;CalculatorService&lt;/span&gt; : &lt;span style="color: #2b91af;"&gt;ICalculator&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: blue;"&gt;double&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; Add(&lt;/span&gt;&lt;span style="color: blue;"&gt;double&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; a, &lt;/span&gt;&lt;span style="color: blue;"&gt;double&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;b)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;a + b;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;Step 2: Deploy the service&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;We need to deploy the service we just created to the HPC cluster. Before we deploy the service, we need one more step which is creating the SOA service configuration file. Create an XML file like the following:&lt;/p&gt;
&lt;table style="width: 400px;" border="1" cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="400"&gt;
&lt;p class="MsoNormal" style="text-align: left; ; mso-pagination: widow-orphan; mso-layout-grid-align: none;" align="left"&gt;&lt;span style="color: blue; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: #a31515; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;xml&lt;/span&gt;&lt;span style="color: red; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;version&lt;/span&gt;&lt;span style="color: blue; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;=&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;"&lt;span style="color: blue;"&gt;1.0&lt;/span&gt;"&lt;span style="color: red;"&gt;encoding&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;utf-8&lt;/span&gt;"&lt;span style="color: blue;"&gt; ?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="color: blue; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;configuration&lt;/span&gt;&lt;span style="color: blue; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: gray; font-family: consolas; font-size: 9.5pt;"&gt;&amp;lt;configSections&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: gray; font-family: consolas; font-size: 9.5pt;"&gt;&amp;lt;sectionGroup name="microsoft.Hpc.Session.ServiceRegistration"&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: gray; font-family: consolas; font-size: 9.5pt;"&gt;type="Microsoft.Hpc.Scheduler.Session.Configuration.ServiceRegistration, Microsoft.Hpc.Scheduler.Session, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: gray; font-family: consolas; font-size: 9.5pt;"&gt;&amp;lt;section name="service"&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: gray; font-family: consolas; font-size: 9.5pt;"&gt;type="Microsoft.Hpc.Scheduler.Session.Configuration.ServiceConfiguration, Microsoft.Hpc.Scheduler.Session, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: gray; font-family: consolas; font-size: 9.5pt;"&gt;allowDefinition="Everywhere"&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: gray; font-family: consolas; font-size: 9.5pt;"&gt;allowExeDefinition="MachineToApplication"&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-tab-count: 1;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: gray; font-family: consolas; font-size: 9.5pt;"&gt;/&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: gray; font-family: consolas; font-size: 9.5pt;"&gt;&amp;lt;/sectionGroup&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: gray; font-family: consolas; font-size: 9.5pt;"&gt;&amp;lt;/configSections&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="color: blue; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;microsoft.Hpc.Session.ServiceRegistration&lt;/span&gt;&lt;span style="color: blue; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="text-align: left; ; mso-pagination: widow-orphan; mso-layout-grid-align: none;" align="left"&gt;&lt;span style="color: blue; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;!--&lt;/span&gt;&lt;span style="color: green; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;Change assembly path below&lt;/span&gt;&lt;span style="color: blue; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;--&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="text-align: left; text-indent: 21pt; ; mso-pagination: widow-orphan; mso-layout-grid-align: none;" align="left"&gt;&lt;span style="color: blue; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;service&lt;/span&gt;&lt;span style="color: red; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;assembly&lt;/span&gt;&lt;span style="color: blue; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;=&amp;rdquo;&lt;/span&gt;&lt;a href="file:///\\fileshare\SOAServices\CalculatorService.dll"&gt;&lt;span style="background: yellow; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt; mso-highlight: yellow;"&gt;\\fileshare\SOAServices\CalculatorService.dll&lt;/span&gt;&lt;/a&gt;&lt;span style="color: blue; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;&amp;rdquo;/&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="text-align: left; ; mso-pagination: widow-orphan; mso-layout-grid-align: none;" align="left"&gt;&lt;span style="color: blue; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;microsoft.Hpc.Session.ServiceRegistration&lt;/span&gt;&lt;span style="color: blue; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="color: blue; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;configuration&lt;/span&gt;&lt;span style="color: blue; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Note that the name of the XML file must be as same as the service name. In this case, name it CalculatorService.config.&lt;/p&gt;
&lt;p&gt;The only configurable part of the above configuration file is the path of the assembly. Change the highlighted part to the path of the DLL file in your cluster. It is recommended to put the DLL file in a shared folder which can be accessed by all compute nodes. This will save you time manually copying the DLL to all the computer nodes.&lt;/p&gt;
&lt;p&gt;Now copy the service configuration file to the configuration file folder, which is under &lt;strong&gt;%CCP_HOME%\ServiceRegistration&lt;/strong&gt; on the head node of the cluster. After copying the file, go to HPC Cluster Manager and navigate to &lt;strong&gt;Configuration&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Services&lt;/strong&gt; to confirm that the CalculatorService is there. Notice that the service name is as same as the file name of the configuration file.&lt;/p&gt;
&lt;p&gt;Now the next step is to enable HPC Pack to locate the dll file. Copy the DLL file to the folder you specified in the configuration file. (Note: If you specified a local path, you need to copy the DLL file to the corresponding path on all the compute nodes.)&lt;/p&gt;
&lt;p&gt;Now you have successfully deployed the service. To verify that the deployment is successful, you can use a diagnostic tool in HPC Cluster Manager console to test the service. Right click CalculatorService, and then select &lt;strong&gt;Run SOA Service Loading Diagnostic Test&lt;/strong&gt;. You can check the diagnostic result. Click &lt;strong&gt;Diagnostics&lt;/strong&gt;, select the test result, and you can see the test result and the detailed information.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-36-metablogapi/2746.clip_5F00_image0049_5F00_05047787.png"&gt;&lt;img style="display: inline;" title="clip_image004[9]" src="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-36-metablogapi/4861.clip_5F00_image0049_5F00_thumb_5F00_0EE968F2.png" alt="clip_image004[9]" width="552" height="241" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;A successful diagnostic result looks like this:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-36-metablogapi/1665.clip_5F00_image0068_5F00_743CCCD8.jpg"&gt;&lt;img style="display: inline;" title="clip_image006[8]" src="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-36-metablogapi/3771.clip_5F00_image0068_5F00_thumb_5F00_00CA79F5.jpg" alt="clip_image006[8]" width="553" height="262" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 3: Implement the client&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Following code can be found in the Clientproject in the &lt;a href="http://code.msdn.microsoft.com/HPC-Pack-2012-SOA-Tutorial-c953d8c9#content"&gt;sample code&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Now we need a client program to submit the calculation request. The client needs to invoke the service we just created remotely, so we need to leverage WCF to generate the proxy class for us. Visual Studio can simplify the whole process by using its service references functionality.&lt;/p&gt;
&lt;p&gt;The suggested project organization in Visual Studio is to create different projects for the service and client programs, as shown in the following figure:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-36-metablogapi/1641.clip_5F00_image0077_5F00_7F19AE20.png"&gt;&lt;img style="display: inline;" title="clip_image007[7]" src="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-36-metablogapi/5314.clip_5F00_image0077_5F00_thumb_5F00_24A32B82.png" alt="clip_image007[7]" width="257" height="337" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;We need to generate the proxy class for the client program based on the CalculatorService. Make sure the service project has been successfully built then click &lt;strong&gt;Add Service Reference&lt;/strong&gt;, click &lt;strong&gt;Discover&lt;/strong&gt;, and you should see the service you just created. Select the service and click &lt;strong&gt;Advanced&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-36-metablogapi/7737.clip_5F00_image0097_5F00_4717BA3D.jpg"&gt;&lt;img style="display: inline;" title="clip_image009[7]" src="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-36-metablogapi/6204.clip_5F00_image0097_5F00_thumb_5F00_6C3504A9.jpg" alt="clip_image009[7]" width="595" height="484" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Important&lt;/strong&gt;: In the advanced &lt;strong&gt;Service Reference Settings&lt;/strong&gt; dialog box, ensure that &lt;strong&gt;Always generate message contracts&lt;/strong&gt; is selected.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-36-metablogapi/1460.clip_5F00_image0117_5F00_3F3FA1CE.jpg"&gt;&lt;img style="display: inline;" title="clip_image011[7]" src="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-36-metablogapi/8203.clip_5F00_image0117_5F00_thumb_5F00_7D58BC7F.jpg" alt="clip_image011[7]" width="599" height="559" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Now we can write the HPC client code:&lt;/p&gt;
&lt;p&gt;a. Prepare the session info, which includes the head node address and the service name. Let&amp;rsquo;s assume the head node host name is head.contoso.com and we are using the CalculatorService.&lt;/p&gt;
&lt;table style="width: 400px;" border="1" cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="400"&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color: #2b91af; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;SessionStartInfo&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt; info = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SessionStartInfo&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;&amp;ldquo;head.contoso.com&amp;rdquo;&lt;/span&gt;, &lt;span style="color: #a31515;"&gt;&amp;ldquo;CalculatorService&amp;rdquo;&lt;/span&gt;);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;b. With the SessionStartInfo object we can create a session to connect to the head node.&lt;/p&gt;
&lt;table style="width: 400px;" border="1" cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="400"&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color: blue; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;using&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt; (&lt;span style="color: #2b91af;"&gt;Session&lt;/span&gt; session = &lt;span style="color: #2b91af;"&gt;Session&lt;/span&gt;.CreateSession(info))&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;hellip;&amp;hellip;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;c. To be able to send requests and receive responses, you need to create a BrokerClient object.&lt;/p&gt;
&lt;table style="width: 400px;" border="1" cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="400"&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color: blue; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;using&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt; (&lt;span style="color: #2b91af;"&gt;Session&lt;/span&gt; session = &lt;span style="color: #2b91af;"&gt;Session&lt;/span&gt;.CreateSession(info))&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="color: blue; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;using&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt; (&lt;span style="color: #2b91af;"&gt;BrokerClient&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;ICalculator&lt;/span&gt;&amp;gt;client = &lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;BrokerClient&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;ICalculator&lt;/span&gt;&amp;gt;(session))&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-tab-count: 1;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;hellip;&amp;hellip;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;}&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;d.With the BrokerClient, you can send requests and receive responses.&lt;/p&gt;
&lt;table style="width: 400px;" border="1" cellspacing="0" cellpadding="2"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="400"&gt;
&lt;p class="MsoNormal" style="text-align: left; ; mso-pagination: widow-orphan; mso-layout-grid-align: none;" align="left"&gt;&lt;span style="color: blue; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;using&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt; (&lt;span style="color: #2b91af;"&gt;BrokerClient&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;ICalculator&lt;/span&gt;&amp;gt;client = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;BrokerClient&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;ICalculator&lt;/span&gt;&amp;gt;(session))&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: green;"&gt;//send request&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;AddRequest&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt; request = &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;AddRequest&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;(1, 2);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;client.SendRequest&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;AddRequest&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;&amp;gt;(request);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;client.EndRequests();&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: green;"&gt;//get response&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="color: blue; font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt;foreach&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; mso-font-kerning: 0pt;"&gt; (&lt;span style="color: #2b91af;"&gt;BrokerResponse&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;AddResponse&lt;/span&gt;&amp;gt;response &lt;span style="color: blue;"&gt;in&lt;/span&gt; client.GetResponses&amp;lt;&lt;span style="color: #2b91af;"&gt;AddResponse&lt;/span&gt;&amp;gt;())&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;double&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;result = response.Result.AddResult;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;.WriteLine(&lt;/span&gt;&lt;span style="color: #a31515;"&gt;"Add 1 and 2, and we get {0}"&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;, result);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="font-family: consolas; font-size: 9.5pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;Step 4: Test the service&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Now you can test your service using your client program.&lt;/p&gt;
&lt;p&gt;Run the client in the Visual Studio. If everything is working fine, you should see output like the following:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-36-metablogapi/7462.clip_5F00_image0156_5F00_7ACF8AC1.jpg"&gt;&lt;img style="display: inline;" title="clip_image015[6]" src="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-68-36-metablogapi/3617.clip_5F00_image0156_5F00_thumb_5F00_1D44197D.jpg" alt="clip_image015[6]" width="467" height="237" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Open HPC Cluster Manager, navigate to &lt;strong&gt;Job Management&lt;/strong&gt;, and you can see the corresponding job.&lt;/p&gt;
&lt;p&gt;Congratulations! You have successfully created and run your fisrt SOA service. In our next blog post, we will introduce way of writing a service to handle a batch of client requests.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3558583" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/b/windowshpc/archive/tags/SOA/">SOA</category></item><item><title>Updating SOA service for HPC Pack 2012</title><link>http://blogs.technet.com/b/windowshpc/archive/2013/02/11/updating-soa-service-for-hpc-pack-2012.aspx</link><pubDate>Mon, 11 Feb 2013 19:15:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3551755</guid><dc:creator>Don Pattee</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;If you are running service oriented architecture (SOA) services on an HPC Pack 2008 R2 cluster, the 2012 release of HPC Pack requires the SOA services to be compiled with .NET Framework 4 or a later version. If you have any SOA services compiled with a version of .NET Framework earlier than 4, it may not be able to run on HPC Pack 2012.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There are two ways to solve the issue:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Recompile the service binary using .NET Framework 4 or a later version.&lt;/li&gt;
&lt;li&gt;Change the configuration file of HPCServiceHost to make it support a previous version of .NET Framework. Here are the detailed steps:&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;a. Find the HPCServiceHost.exe file (for 64-bit services) and HPCServiceHost32.exe file (for 32-bit services) on each compute node. Both reside under %CCP_HOME%\bin on each compute node.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;b. Create a file, and name it &amp;ldquo;HPCServiceHost.exe.config&amp;rdquo; or &amp;ldquo;HPCServiceHost32.exe.config&amp;rdquo;. You only need to create one file, depending on whether your compute node is 64-bit or 32-bit.&lt;/li&gt;
&lt;li&gt;c. In the new created config file, add the following xml:&lt;/li&gt;
&lt;/ol&gt;&lt;/ol&gt;
&lt;p style="padding-left: 90px;"&gt;&amp;nbsp;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;&lt;/p&gt;
&lt;p style="padding-left: 90px;"&gt;&amp;lt;configuration&amp;gt;&lt;/p&gt;
&lt;p style="padding-left: 90px;"&gt;&amp;nbsp; &amp;lt;startup useLegacyV2RuntimeActivationPolicy="true"&amp;gt;&lt;/p&gt;
&lt;p style="padding-left: 90px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/&amp;gt;&lt;/p&gt;
&lt;p style="padding-left: 90px;"&gt;&amp;nbsp; &amp;lt;/startup&amp;gt;&lt;/p&gt;
&lt;p style="padding-left: 90px;"&gt;&amp;lt;/configuration&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;With the change, the legacy SOA services should run on HPC Pack 2012. If you&amp;nbsp;have any questions,&amp;nbsp;head over to the &lt;a href="http://social.microsoft.com/Forums/en-US/category/windowshpc" target="_blank"&gt;Windows HPC Discussion forums&lt;/a&gt; and let us know.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3551755" width="1" height="1"&gt;</description></item><item><title>Announcing the release of HPC Pack 2012</title><link>http://blogs.technet.com/b/windowshpc/archive/2012/12/14/announcing-the-release-of-hpc-pack-2012.aspx</link><pubDate>Fri, 14 Dec 2012 08:04:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3540522</guid><dc:creator>Don Pattee</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Announcing the immediate availability of the next major version of Windows HPC software: &lt;a href="http://go.microsoft.com/fwlink/?LinkID=260642" target="_blank"&gt;HPC Pack 2012&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The fourth 'major version' of the HPC software brings improved performance and reliability to the HPC platform, simplifies the installation experience, and adds some great new features such as:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;support for Windows Server 2012 (head nodes, compute nodes, broker nodes, and unmanaged server nodes) and Windows 8 (as clients and workstation nodes)&lt;/li&gt;
&lt;li&gt;the ability to customize the tuning of MPI operations for improved performance on your hardware&lt;/li&gt;
&lt;li&gt;the ability to increase cluster robustness by adding more than 2 head nodes in a failover cluster group&lt;/li&gt;
&lt;li&gt;the ability to install a head node on a Windows Azure VM, so an entire cluster can run 'in the cloud'&lt;/li&gt;
&lt;li&gt;all features previously split between the 'Express,' 'Enterprise,' and 'Workstation' or 'Cycle Harvesting' editions now available through a single installation&lt;/li&gt;
&lt;li&gt;additional features are described in the &lt;a href="http://go.microsoft.com/fwlink/?LinkID=263697"&gt;What&amp;rsquo;s New in HPC Pack 2012&lt;/a&gt;&amp;nbsp;document&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you are using the Windows Azure HPC Scheduler SDK, this update comes with the same reliability and performance improvements that the HPC Pack is getting, and also adds compatability with the Windows Azure SDK October 2012 / v1.8 release.&lt;/p&gt;
&lt;p&gt;Before installing either, take a look at the&amp;nbsp;&lt;a href="http://technet.microsoft.com/en-us/library/jj899598.aspx"&gt;What&amp;rsquo;s New in HPC Pack 2012&lt;/a&gt; document and &lt;a href="http://technet.microsoft.com/en-us/library/jj899588.aspx"&gt;Release Notes&lt;/a&gt; over on our &lt;a href="http://go.microsoft.com/fwlink/?LinkID=263697"&gt;Windows HPC Technical Library&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;More details and additional documentation will arrive in January, in the mean time head over to the &lt;a href="http://social.microsoft.com/Forums/en-US/category/windowshpc" target="_blank"&gt;Windows HPC Discussion forums&lt;/a&gt; if you have any questions or comments. We'll be happy to hear from you!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: x-small;"&gt;Note: The single HPC Pack 2012 download contains all the features previously seperated in the&amp;nbsp;Express, Workstation, Cycle Harvesting, and Enterprise editions. Standalone &lt;a href="http://go.microsoft.com/fwlink/?LinkID=274917"&gt;'Client Utilities'&lt;/a&gt; and &lt;a href="http://go.microsoft.com/fwlink/?LinkID=274918"&gt;'MS-MPI'&lt;/a&gt; packages have also been updated for HPC Pack 2012.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3540522" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/b/windowshpc/archive/tags/Product+Release/">Product Release</category></item><item><title>Congrats to our Visual Studio buddies!</title><link>http://blogs.technet.com/b/windowshpc/archive/2012/09/12/congrats-to-our-visual-studio-buddies.aspx</link><pubDate>Wed, 12 Sep 2012 20:49:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3519776</guid><dc:creator>Don Pattee</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Visual Studio 2012 and .NET 4.5 have launched. The live keynote videos are over, but will be available for on-demand viewing tomorrow on &lt;a href="http://www.visualstudiolaunch.com/vs2012vle/Home"&gt;http://www.visualstudiolaunch.com/vs2012vle/Home&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You can read about Visual Studio Express 2012 over on the VS team's blog &lt;a href="http://blogs.msdn.com/b/visualstudio/archive/2012/09/12/visual-studio-express-2012-for-windows-desktop-is-here.aspx"&gt;http://blogs.msdn.com/b/visualstudio/archive/2012/09/12/visual-studio-express-2012-for-windows-desktop-is-here.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And you can download Express or trial versions of the other editions from &lt;a href="http://www.microsoft.com/visualstudio/eng/downloads"&gt;http://www.microsoft.com/visualstudio/eng/downloads&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3519776" width="1" height="1"&gt;</description></item><item><title>Announcing the HPC Pack 2012 Beta Program</title><link>http://blogs.technet.com/b/windowshpc/archive/2012/09/06/announcing-the-hpc-pack-2012-beta-program.aspx</link><pubDate>Thu, 06 Sep 2012 17:45:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3518581</guid><dc:creator>Don Pattee</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/windowshpc/rsscomments.aspx?WeblogPostID=3518581</wfw:commentRss><comments>http://blogs.technet.com/b/windowshpc/archive/2012/09/06/announcing-the-hpc-pack-2012-beta-program.aspx#comments</comments><description>&lt;p&gt;I am pleased to announce the start of the HPC Pack 2012 Beta Program!&lt;/p&gt;
&lt;p&gt;The 4th major version of our HPC software line following the Compute Cluster Pack, HPC Pack 2008, and HPC Pack 2008 R2 releases, the HPC Pack 2012 release brings a batch of new functionality and support for new software.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Windows Server 2012 (including 'Server Core'), the Microsoft .NET Framework 4, Microsoft SQL Server 2012, and Windows 8 are all now supported&lt;/li&gt;
&lt;li&gt;A single version of HPC Pack 2012 now includes all the functionality that used to be split across the HPC Pack 2008 Express,&amp;nbsp;Enteprise, Workstations and Cycle Harvesting&amp;nbsp;editions&lt;/li&gt;
&lt;li&gt;HPC Pack now supports extending your enterprise network to Windows Azure via 'Project Brooklyn'&lt;/li&gt;
&lt;li&gt;MS-MPI has a new 'message compression' feature to reduce the time spent waiting on communications to complete&lt;/li&gt;
&lt;li&gt;The job scheduler now allows for dependencies between jobs (in addition to the task dependencies that already existed) to better integrate with your work flow&lt;/li&gt;
&lt;li&gt;Windows Azure nodes can be set to automatically mount a VHD, which could contain some static data or application code, to make using HPC Pack's 'burst' functionality even easier&lt;/li&gt;
&lt;li&gt;and more... A more complete list of new functionality is available once you join the beta :)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sign up for the beta program by going to the &lt;a href="https://connect.microsoft.com/HPC/InvitationUse.aspx?ProgramID=7829&amp;amp;InvitationID=hv4b-BX4P-CQFB"&gt;Microsoft HPC Connect beta site&lt;/a&gt;,&amp;nbsp;logging in with your Windows Live ID and filling out a quick survey. (If this is your first Connect-based beta program you'll also need to complete a short set of 'profile' questions.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3518581" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/b/windowshpc/archive/tags/Beta+Program/">Beta Program</category></item><item><title>Announcing the HPC Pack 2008 R2 Service Pack 4 and Windows Azure HPC Scheduler updates!</title><link>http://blogs.technet.com/b/windowshpc/archive/2012/06/12/announcing-the-hpc-pack-2008-r2-service-pack-4-and-windows-azure-hpc-scheduler-updates.aspx</link><pubDate>Tue, 12 Jun 2012 21:32:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3503527</guid><dc:creator>Don Pattee</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;As part of the spring WIndows Azure release, I'm pleased to announce that the HPC team has also released a set of updates:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=231891"&gt;Service Pack 4&lt;/a&gt; for the &lt;strong&gt;&lt;a href="http://www.microsoft.com/HPC"&gt;HPC Pack 2008 R2&lt;/a&gt;&lt;/strong&gt; family of software&lt;/li&gt;
&lt;li&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkId=231893"&gt;Our first update&lt;/a&gt; to the &lt;strong&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=230449"&gt;Windows Azure HPC Scheduler&lt;/a&gt;&lt;/strong&gt; development kit&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In addition to rolling up the existing HPC Pack 2008 R2 Service Pack 3-based updates (aka 'patches' or 'qfes'), we have made a number of robustness fixes to the product. Everyone using the HPC Pack should &lt;a href="http://go.microsoft.com/fwlink/?LinkID=231891"&gt;update to SP4&lt;/a&gt;, and if you are using our 'Windows Azure Burst' capabilities, you should definitely upgrade to take advantage of the improved reliability.&lt;/p&gt;
&lt;p&gt;If you are using the Windows Azure HPC Scheduler SDK, this update comes with the same reliability fixes that the HPC Pack is getting, and also adds compatability with the updated Windows Azure SDK.&lt;/p&gt;
&lt;p&gt;Before installing either, take a look at the &lt;a href="http://go.microsoft.com/fwlink/?LinkId=254443"&gt;What&amp;rsquo;s New in SP4&lt;/a&gt;&amp;nbsp;document and &lt;a href="http://go.microsoft.com/fwlink/?LinkId=254442"&gt;Release Notes&lt;/a&gt;&amp;nbsp;over on our &lt;a href="http://technet.microsoft.com/en-us/library/ee783547(v=ws.10)"&gt;Windows HPC Server 2008 R2 Technical Library&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you haven't already taken a look at the Windows Azure spring release update, hop over to &lt;a href="http://blogs.msdn.com/b/windowsazure/archive/2012/06/06/announcing-new-windows-azure-services-to-deliver-hybrid-cloud.aspx"&gt;the Windows Azure blog&lt;/a&gt;&amp;nbsp;and the video at &lt;a href="http://www.meetwindowsazure.com/Conversations#SatyaNadellaLearn"&gt;the Meet Windows Azure site&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;And as always, head over to the&amp;nbsp;&lt;a href="http://social.microsoft.com/Forums/en-US/category/windowshpc" target="_blank"&gt;Windows HPC Discussion forums&lt;/a&gt;&amp;nbsp;if you have any questions or comments. We'll be happy to hear from you!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: x-small;"&gt;Note: The single SP4 installer applies to all installations - Express, Workstation, Cycle Harvesting, and Enterprise, as well as the standalone 'Client Utilities' and 'MS-MPI' packages. You can download it from the &lt;/span&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=231891" style="font-size: x-small;"&gt;Microsoft Download Center&lt;/a&gt;&lt;span style="font-size: x-small;"&gt;. Installers for the standalone &lt;/span&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=231888&amp;amp;clcid=0x409" style="font-size: x-small;"&gt;Client Utilities&lt;/a&gt;&lt;span style="font-size: x-small;"&gt; and &lt;/span&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=231890&amp;amp;clcid=0x409" style="font-size: x-small;"&gt;MS-MPI&lt;/a&gt;&lt;span style="font-size: x-small;"&gt; packages with the service pack already integrated are also available.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: x-small;"&gt;&lt;/span&gt;&lt;span style="font-size: x-small;"&gt;If you do not have an HPC Pack 2008 R2 cluster, you can download a free &lt;/span&gt;&lt;a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=15368" style="font-size: x-small;"&gt;Windows HPC Server 2008 R2 Suite evaluation version&lt;/a&gt;&lt;span style="font-size: x-small;"&gt;. Before you install, you can try out the new &lt;/span&gt;&lt;a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=8433" style="font-size: x-small;"&gt;Installation Preparation Wizard&lt;/a&gt;&lt;span style="font-size: x-small;"&gt; which can help analyze your environment for common issues and provide some best practice guidance to help ensure an easy HPC cluster setup.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3503527" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/b/windowshpc/archive/tags/Product+Release/">Product Release</category></item></channel></rss>