<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>faber's blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/faber/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/faber/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:20:33 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Tracking Windows Performance Counters by application</title>
      <link>https://docs.microsoft.com/archive/blogs/faber/tracking-windows-performance-counters-by-application</link>
      <pubDate>Thu, 20 Nov 2014 08:19:00 GMT</pubDate>
      <dc:creator><![CDATA[faberspot]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/faber/2014/11/20/tracking-windows-performance-counters-by-application/</guid>
      <description><![CDATA[1 Introduction
This blog describe a basic console application written in C# to track Performance...]]></description>
      <content:encoded><![CDATA[<h1 align="left"><span style="color: #000080;">1 Introduction</span></h1>
<p style="text-align: justify;"><span style="font-size: small;">This blog describe a basic console application written in C# to track Performance Counters in Windows.</span></p>
<p style="text-align: justify;"><span style="font-size: small;">Counters are used in windows OS to provide information as to how well the operating system or an application, service, or driver is performing. The counter data can help determine system bottlenecks. The operating system, network, and devices provide counter data that an application can consume to provide user with a graphical view of how well the system is performing.</span></p>
<p style="text-align: justify;"><span style="font-size: small;">The System.Diagnostics namespace provides classes that allow you to interact with performance counters. The PerformanceCounter Class has different constructors; in our code we use the constructor with the following format:</span></p>
<pre class="scroll"><code class="cplusplus"><span style="font-family: courier new,courier; font-size: medium;"><strong>public <span style="color: #000080;">PerformanceCounter</span>( </strong></span><br /><span style="font-family: courier new,courier; font-size: medium;"><strong> string <span style="color: #ff0000;">categoryName</span>, </strong></span><br /><span style="font-family: courier new,courier; font-size: medium;"><strong> string <span style="color: #ff0000;">counterName</span>, </strong></span><br /><span style="font-family: courier new,courier; font-size: medium;"><strong> string <span style="color: #ff0000;">instanceName </span></strong></span><br /><span style="font-family: courier new,courier; font-size: medium;"><strong> )</strong></span> </code></pre>
<p><span style="font-size: small;">where:</span></p>
<ul>
<li><span style="font-size: small;"><span style="color: #ff0000;"><strong>categoryName</strong></span>: it is the name of the performance counter category (performance object) with which this performance counter is associated.</span></li>
<li><span style="font-size: small;"><strong><span style="color: #ff0000;">counterName</span>:</strong> The name of the performance counter.</span></li>
<li><span style="font-size: small;"><span style="color: #ff0000;">i</span><strong><span style="color: #ff0000;">nstanceName</span>: </strong>The name of the performance counter category instance, or an empty string (""), if the category contains a single instance.</span></li>
</ul>
<p><span style="font-size: small;">This constructor initializes the performance counter and associates the instance with an existing counter on the local computer. The values that you pass in for the <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.performancecounter.categoryname%28v=vs.110%29.aspx">CategoryName</a>, <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.performancecounter.countername%28v=vs.110%29.aspx">CounterName</a>, and <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.performancecounter.instancename%28v=vs.110%29.aspx">InstanceName</a> properties must point to an existing performance counter on the local computer.</span></p>
<p><span style="font-size: small;">Below some performance counters to track processor utilization, disk I/O, Memory, and networking</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">PerformanceCounter("<strong><span style="color: #000080;">Processor</span></strong>", "% Processor Time", "_Total");</span><br /><span style="font-family: courier new,courier; font-size: small;">PerformanceCounter("<strong><span style="color: #000080;">Processor</span></strong>", "% Privileged Time", "_Total");</span><br /><span style="font-family: courier new,courier; font-size: small;">PerformanceCounter("<span style="color: #000080;"><strong>Processor</strong></span>", "% Interrupt Time", "_Total");</span><br /><span style="font-family: courier new,courier; font-size: small;">PerformanceCounter("<strong><span style="color: #000080;">Processor</span></strong>", "% DPC Time", "_Total");</span><br /><span style="font-family: courier new,courier; font-size: small;">PerformanceCounter("<span style="color: #000080;"><strong>Memor</strong></span>y", "Available MBytes", null);</span><br /><span style="font-family: courier new,courier; font-size: small;">PerformanceCounter("<strong><span style="color: #000080;">Memory</span></strong>", "Committed Bytes", null);</span><br /><span style="font-family: courier new,courier; font-size: small;">PerformanceCounter("<strong><span style="color: #000080;">Memory</span></strong>", "Commit Limit", null);</span><br /><span style="font-family: courier new,courier; font-size: small;">PerformanceCounter("<strong><span style="color: #000080;">Memory</span></strong>", "% Committed Bytes In Use", null);</span><br /><span style="font-family: courier new,courier; font-size: small;">PerformanceCounter("<strong><span style="color: #000080;">Memory</span></strong>", "Pool Paged Bytes", null);</span><br /><span style="font-family: courier new,courier; font-size: small;">PerformanceCounter("<strong><span style="color: #000080;">Memory</span></strong>", "Pool Nonpaged Bytes", null);</span><br /><span style="font-family: courier new,courier; font-size: small;">PerformanceCounter("<strong><span style="color: #000080;">Memory</span></strong>", "Cache Bytes", null);</span><br /><span style="font-family: courier new,courier; font-size: small;">PerformanceCounter("<strong><span style="color: #000080;">Paging File</span></strong>", "% Usage", "_Total");</span><br /><span style="font-family: courier new,courier; font-size: small;">PerformanceCounter("<strong><span style="color: #000080;">PhysicalDisk</span></strong>", "Avg. Disk Queue Length", "_Total");</span><br /><span style="font-family: courier new,courier; font-size: small;">PerformanceCounter("<strong><span style="color: #000080;">PhysicalDisk</span></strong>", "Disk Read Bytes/sec", "_Total");</span><br /><span style="font-family: courier new,courier; font-size: small;">PerformanceCounter("<strong><span style="color: #000080;">PhysicalDisk</span></strong>", "Disk Write Bytes/sec", "_Total");</span><br /><span style="font-family: courier new,courier; font-size: small;">PerformanceCounter("<strong><span style="color: #000080;">PhysicalDisk</span></strong>", "Avg. Disk sec/Read", "_Total");</span><br /><span style="font-family: courier new,courier; font-size: small;">PerformanceCounter("<strong><span style="color: #000080;">PhysicalDisk</span></strong>", "Avg. Disk sec/Write", "_Total");</span><br /><span style="font-family: courier new,courier; font-size: small;">PerformanceCounter("<strong><span style="color: #000080;">PhysicalDisk</span></strong>", "% Disk Time", "_Total");</span><br /><span style="font-family: courier new,courier; font-size: small;">PerformanceCounter("<strong><span style="color: #000080;">Process</span></strong>", "Handle Count", "_Total");</span><br /><span style="font-family: courier new,courier; font-size: small;">PerformanceCounter("<strong><span style="color: #000080;">Process</span></strong>", "Thread Count", "_Total");</span><br /><span style="font-family: courier new,courier; font-size: small;">PerformanceCounter("<strong><span style="color: #000080;">System</span></strong>", "Context Switches/sec", null);</span><br /><span style="font-family: courier new,courier; font-size: small;">PerformanceCounter("<strong><span style="color: #000080;">System</span></strong>", "System Calls/sec", null);</span><br /><span style="font-family: courier new,courier; font-size: small;">PerformanceCounter("<strong><span style="color: #000080;">System</span></strong>", "Processor Queue Length", null);</span></p>
<p>&nbsp;</p>
<h1><span style="color: #000080;">2 Performance counters CategoryName</span></h1>
<p><span style="font-size: small;">Here a short description of some performance counters.</span></p>
<h2><span style="color: #000080;">2.1 CategoryName: Processor</span></h2>
<p>&nbsp;</p>
<p>&nbsp;<span style="font-size: small;"><strong><span style="font-family: courier new,courier;">PerformanceCounter("<span style="color: #000080;">Processor</span>", "<span style="color: #ff0000;">% Processor Time</span>", "_Total");</span></strong></span></p>
<p style="text-align: justify;"><span style="font-size: small;">The <strong>Processor\% Processor Time</strong> counter determines the percentage of time the processor is busy by measuring the percentage of time the thread of the Idle process is running and then subtracting that from 100 percent. This measurement is the amount of processor utilization</span></p>
<p style="text-align: justify;"><span style="font-size: small;"><br /></span></p>
<p><span style="font-size: small;"><strong><span style="font-family: courier new,courier;">PerformanceCounter("<span style="color: #000080;">Processor</span>", "<span style="color: #ff0000;">% Interrupt Time</span>", "_Total");</span></strong></span></p>
<p style="text-align: justify;"><span style="font-size: small;">The rate, in average number of interrupts in incidents per second, at which the processor received and serviced hardware interrupts. It does not include deferred procedure calls, which are counted separately.</span></p>
<p><span style="font-size: small;"><br /></span></p>
<p><span style="font-size: small;"><strong><span style="font-family: courier new,courier;">PerformanceCounter("<span style="color: #000080;">Processor</span>", "<span style="color: #ff0000;">% DPC Time</span>", "_Total");</span></strong></span></p>
<p style="text-align: justify;"><span style="font-size: small;">The percentage of time that the processor spent receiving and servicing deferred procedure calls during the sample interval. Deferred procedure calls are interrupts that run at a lower priority than standard interrupts.</span></p>
<p>&nbsp;</p>
<p><span style="font-family: courier new,courier;"><strong><span style="font-size: small;">PerformanceCounter("<span style="color: #000080;">Processor</span>", "<span style="color: #ff0000;">% Privileged Time</span>", "_Total");</span></strong></span></p>
<p style="text-align: justify;"><span style="font-size: small;">The percentage of non-idle processor time spent in privileged mode. Privileged mode is a processing mode designed for operating system components and hardware-manipulating drivers. It allows direct access to hardware and all memory. The alternative, user mode, is a restricted processing mode designed for applications, environment subsystems, and integral subsystems. The operating system switches application threads to privileged mode to gain access to operating system services. This includes time spent servicing interrupts and deferred procedure calls (DPCs). A high rate of privileged time might be caused by a large number of interrupts generated by a failing device. This counter displays the average busy time as a percentage of the sample time.</span></p>
<p style="text-align: justify;">&nbsp;</p>
<h2><span style="color: #000080;">2.2 CategoryName: Memory</span></h2>
<p>&nbsp;</p>
<p><strong><span style="font-family: courier new,courier; font-size: small;">PerformanceCounter("<span style="color: #000080;">Memory</span>", "<span style="color: #ff0000;">Available MBytes</span>", null);</span></strong></p>
<p style="text-align: justify;"><span style="font-size: small;">This measures the amount of physical memory, in megabytes, available for running processes. If this value is less than 5 percent of the total physical RAM, that means there is insufficient memory, and that can increase paging activity.</span></p>
<p style="text-align: justify;">&nbsp;</p>
<p>&nbsp;<strong><span style="font-family: courier new,courier; font-size: small;">PerformanceCounter("<span style="color: #000080;">Memory</span>", "<span style="color: #ff0000;">Committed Bytes</span>", null);</span></strong></p>
<p style="text-align: justify;"><span style="font-size: small;">it&nbsp;shows the amount of virtual memory, in bytes, that can be committed without having to extend the paging file(s). Committed memory is physical memory which has space reserved on the disk paging files. There can be one or more paging files on each physical drive. If the paging file(s) are expanded, this limit increases accordingly.</span></p>
<p>&nbsp;</p>
<p><strong><span style="font-family: courier new,courier; font-size: small;">PerformanceCounter("<span style="color: #000080;">Memory</span>", "<span style="color: #ff0000;">Commit Limit</span>", null);</span></strong></p>
<p style="text-align: justify;"><span style="font-size: small;">it shows the amount of virtual memory, in bytes, that can be committed without having to extend the paging file(s). Committed memory is physical memory which has space reserved on the disk paging files. There can be one or more paging files on each physical drive. If the paging file(s) are expanded, this limit increases accordingly.</span></p>
<p>&nbsp;</p>
<p><strong><span style="font-family: courier new,courier; font-size: small;">PerformanceCounter("<span style="color: #000080;">Memory</span>", "<span style="color: #ff0000;">% Committed Bytes In Use</span>", null);</span></strong></p>
<p style="text-align: justify;"><span style="font-size: small;">it shows the ratio of Memory\ Committed Bytes to the Memory\&nbsp;Commit Limit. Committed memory is physical memory in use for which space has been reserved in the paging file so that it can be written to disk. The commit limit is determined by the size of the paging file. If the paging file is enlarged, the commit limit increases, and the ratio is reduced.</span></p>
<p>&nbsp;</p>
<p><strong><span style="font-family: courier new,courier; font-size: small;">PerformanceCounter("<span style="color: #000080;">Memory</span>", "<span style="color: #ff0000;">Pool Paged Bytes</span>", null);</span></strong></p>
<p style="text-align: justify;"><span style="font-size: small;">it shows the size, in bytes, of the paged pool. Memory\ Pool Paged Bytes is calculated differently than Process\ Pool Paged Bytes, so it might not equal Process(_Total )\ Pool Paged Bytes.</span></p>
<p>&nbsp;</p>
<p><span style="font-size: small; font-family: courier new,courier;"><strong>PerformanceCounter("<span style="color: #000080;">Memory</span>", "<span style="color: #ff0000;">Pool Nonpaged Bytes</span>", null);</strong></span></p>
<p style="text-align: justify;"><span style="font-size: small;">it shows the size, in bytes, of the nonpaged pool. Memory\ Pool Nonpaged Bytes is calculated differently than Process\ Pool Nonpaged Bytes, so it might not equal Process(_Total )\ Pool Nonpaged Bytes.</span></p>
<p>&nbsp;</p>
<p><span style="font-size: small;"><strong><span style="font-family: courier new,courier;">PerformanceCounter("<span style="color: #000080;">Memory</span>", "<span style="color: #ff0000;">Cache Bytes</span>", null);</span></strong></span></p>
<p style="text-align: justify;"><span style="font-size: small;">it shows the sum of the values of System Cache Resident Bytes, System Driver Resident Bytes, System Code Resident Bytes, and Pool Paged Resident Bytes.</span></p>
<p style="text-align: justify;">&nbsp;</p>
<h2><span style="color: #000080;">2.3 CateroryName: PhysicalDisk</span></h2>
<p>&nbsp;</p>
<p><span style="font-family: courier new,courier; font-size: small;"><strong>PerformanceCounter("<span style="color: #000080;">PhysicalDisk</span>", "<span style="color: #ff0000;">Disk Read Bytes/sec</span>", "_Total");</strong></span></p>
<p><span style="font-family: courier new,courier; font-size: small;"><strong>PerformanceCounter("<span style="color: #000080;">PhysicalDisk</span>", "<span style="color: #ff0000;">Disk Write Bytes/sec</span>", "_Total");</strong></span></p>
<p style="text-align: justify;"><span style="text-align: justify; font-size: small;">it captures the total number of bytes sent to the disk (write) and retrieved from the disk (read) during write or read operations.</span></p>
<p>&nbsp;</p>
<p><strong><span style="font-size: small; font-family: courier new,courier;">PerformanceCounter("<span style="color: #000080;">PhysicalDisk</span>", "<span style="color: #ff0000;">Avg. Disk sec/Read</span>", "_Total");</span></strong></p>
<p><strong><span style="font-size: small; font-family: courier new,courier;">PerformanceCounter("<span style="color: #000080;">PhysicalDisk</span>", "<span style="color: #ff0000;">Avg. Disk sec/Write</span>", "_Total");</span></strong></p>
<p style="text-align: justify;"><span style="font-size: small;"> it captures the average time, in seconds, of a read/write of data from/to the disk.</span></p>
<p>&nbsp;</p>
<p><span style="font-family: courier new,courier; font-size: small;"><strong>PerformanceCounter("<span style="color: #000080;">System</span>", "<span style="color: #ff0000;">Context Switches/sec</span>", null);</strong></span></p>
<p style="text-align: justify;"><span style="font-size: small;">A context switch occurs when the kernel switches the processor from one thread to another&mdash;for example, when a thread with a higher priority than the running thread becomes ready. Context switching activity is important for several reasons. A program that monopolizes the processor lowers the rate of context switches because it does not allow much processor time for the other processes' threads. A high rate of context switching means that the processor is being shared repeatedly&mdash;for example, by many threads of equal priority. A high context-switch rate often indicates that there are too many threads competing for the processors on the system. The System\Context Switches/sec counter reports systemwide context switches.</span></p>
<p style="text-align: justify;">&nbsp;</p>
<h2><span style="color: #000080;">2.4 CategoryName: Process</span></h2>
<p style="text-align: justify;"><span style="font-size: small;"> Each process provides the resources needed to execute a program. A process has a virtual address space, executable code, open handles to system objects, a security context, a unique process identifier, environment variables, a priority class, minimum and maximum working set sizes, and at least one thread of execution. Each process is started with a single thread, often called the primary thread, but can create additional threads from any of its threads.</span></p>
<p style="text-align: justify;"><span style="font-size: small;">A thread is the entity within a process that can be scheduled for execution. All threads of a process share its virtual address space and system resources. In addition, each thread maintains exception handlers, a scheduling priority, thread local storage, a unique thread identifier, and a set of structures the system will use to save the thread context until it is scheduled. The thread context includes the thread's set of machine registers, the kernel stack, a thread environment block, and a user stack in the address space of the thread's process. Threads can also have their own security context, which can be used for impersonating clients. (for more information&nbsp;<span style="font-size: small;"> see "About Processes and Thread" http://msdn.microsoft.com/en-us/library/windows/desktop/ms681917%28v=vs.85%29.aspx)</span></span></p>
<p style="text-align: justify;">&nbsp;</p>
<p><span style="font-size: small;"><strong><span style="font-family: courier new,courier;">PerformanceCounter("<span style="color: #000080;">Process</span>", "<span style="color: #ff0000;">Thread Count</span>", "_Total");</span></strong></span></p>
<p style="text-align: justify;"><span style="font-size: small;">The number of threads created by the process. This counter does not indicate which threads are busy and which are idle. It displays the last observed value, not an average.</span></p>
<p>&nbsp;</p>
<p><span style="font-size: small;"><strong><span style="font-family: courier new,courier;">PerformanceCounter("<span style="color: #000080;">Process</span>", "<span style="color: #ff0000;">Handle Count</span>", "_Total");</span></strong></span></p>
<p style="text-align: justify;"><span style="font-size: small;">the value&nbsp;reports the number of handles that processes opened for objects they create. Handles are used by programs to identify resources that they must access. The value of this counter tends to rise during a memory leak.</span></p>
<p>&nbsp;</p>
<p style="text-align: justify;"><span style="font-family: courier new,courier; font-size: small;"><strong>PerformanceCounter("<span style="color: #000080;">Process</span>", "<span style="color: #ff0000;">Thread Count</span>", "_Total");</strong></span></p>
<p style="text-align: justify;"><span style="font-size: small;">the value reports over time how many threads the processes create.</span></p>
<p style="text-align: justify;">&nbsp;</p>
<h2><span style="color: #000080;">2.5 CategoryName: System</span></h2>
<p>&nbsp;</p>
<p><strong><span style="font-size: small; font-family: courier new,courier;">PerformanceCounter("<span style="color: #000080;">System</span>", "<span style="color: #ff0000;">Context Switches/sec</span>", null);</span></strong></p>
<p><span style="font-size: small;">A context switch occurs when the kernel switches the processor from one thread to another. A context switch might also occur when a thread with a higher priority than the running thread becomes ready or when a running thread must wait for some reason (such as an I/O operation). The Thread\Context Switches/sec counter value increases when the thread gets or loses the time of the processor.</span></p>
<p>&nbsp;</p>
<p><span style="font-family: courier new,courier;"><strong><span style="font-size: small;">PerformanceCounter("<span style="color: #000080;">System</span>", "<span style="color: #ff0000;">System Calls/sec</span>", null);</span></strong></span></p>
<p><span style="font-size: small;">This is the number of system calls being serviced by the CPU per second. By comparing the Processor's Interrupts/sec with the System Calls/sec we can get a picture of how much effort the system requires to respond to attached hardware. On a healthy system, the Interrupts per second should be negligible in comparison to the number of System Calls per second. When the system has to repeatedly call interrupts for service, it's indicative of a hardware failure.</span></p>
<p>&nbsp;</p>
<p><span style="font-family: courier new,courier;"><strong><span style="font-size: small;">PerformanceCounter("<span style="color: #000080;">System</span>", "<span style="color: #ff0000;">Processor Queue Length</span>", null);</span></strong></span></p>
<p><span style="font-size: small;">The System\Processor Queue Length counter is a rough indicator of the number of threads each processor is servicing.</span><strong></strong></p>
<p><strong>&nbsp;</strong></p>
<h1><span style="color: #000080;">3 Structure of the application to track Performance Counters</span></h1>
<p><span style="font-size: small;">The basic structure of the application to track a set of <strong><span style="color: #000080;"><span style="font-family: courier new,courier;">PerfomanceCounter() </span></span></strong>is reported in figure:</span></p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinPerfCounterApp/8446.01.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinPerfCounterApp/8446.01.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinPerfCounterApp/8446.01.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinPerfCounterApp/8446.01.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 1: main structure of application</span></p>
<p style="text-align: justify;"><span style="font-size: small;">The main purpose of application is catch a specific sample interval a list of Performance Counters.</span></p>
<p style="text-align: justify;"><span style="font-size: small;">When the main program starts, the first action is to read two XML files: <span style="color: #000080;"><strong>SysField.XML</strong></span> file and <span style="color: #000080;"><strong>app.config</strong> file</span>. Behavior of application depends on parameter values stored in these two files.</span></p>
<p style="text-align: justify;"><span style="font-size: small;">Structured of <span style="color: #000080;"><strong>SysField.XML</strong></span> is shown below:</span></p>
<p style="text-align: justify;"><span style="font-family: courier new,courier; font-size: small;">&lt;?xml version="1.0" encoding="utf-8" ?&gt; </span><br /><span style="font-family: courier new,courier; font-size: small; color: #800000;">&nbsp;&lt;AppValues&gt; </span><br /><span style="font-family: courier new,courier; font-size: small;"><span style="color: #800000;">&nbsp;&nbsp; &lt;FolderPath&gt;</span>C:\SysParamsLog2\<span style="color: #800000;">&lt;/FolderPath&gt; </span></span><br /><span style="font-family: courier new,courier; font-size: small;"><span style="color: #800000;">&nbsp;&nbsp; &lt;FileName&gt;</span>Log.txt<span style="color: #800000;">&lt;/FileName&gt;</span></span><br /><span style="font-family: courier new,courier; font-size: small;"><span style="color: #800000;">&nbsp;&nbsp; &lt;WriteToLogFile&gt;</span>true&lt;<span style="color: #800000;">/WriteToLogFile&gt;</span></span><br /><span style="font-family: courier new,courier; font-size: small;"><span style="color: #800000;">&nbsp;&nbsp; &lt;MaxNumberRecordsInLogFile&gt;</span>30<span style="color: #800000;">&lt;/MaxNumberRecordsInLogFile&gt;</span></span><br /><span style="font-family: courier new,courier; font-size: small;"><span style="color: #800000;">&nbsp;&nbsp; &lt;PollingSysParamsInterval&gt;</span>1<span style="color: #800000;">&lt;/PollingSysParamsInterval&gt;</span></span><br /><span style="font-family: courier new,courier; font-size: small; color: #800000;">&nbsp;&lt;/AppValues&gt;</span></p>
<p style="text-align: justify;">&nbsp;</p>
<p><span style="font-size: small;"><span style="color: #000080;"><strong>SysField.XML</strong></span> file specifies all the parameters required to store the <span style="color: #000080;"><strong><span style="font-family: courier new,courier;">PerformanceCounter()</span></strong></span> values in a log file and the sampling time of performance counters. In particular:</span></p>
<p>&nbsp;&nbsp; <span style="font-family: courier new,courier;"><strong><span style="color: #800000;">&lt;FolderPath&gt;</span></strong>&nbsp;&nbsp;&nbsp;&nbsp; : it is the folder where the application store the log file</span><br /><span style="font-family: courier new,courier;"><strong><span style="color: #800000;">&nbsp;&lt;FileName&gt;</span></strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : it is the filename fo the log file</span><br /><span style="font-family: courier new,courier;"><strong><span style="color: #800000;">&nbsp;&lt;WriteToLogFile&gt;</span></strong> : it is a Boolean value that specify</span><br /><span style="font-family: courier new,courier;"><strong><span style="color: #800000;">&nbsp;&lt;MaxNumberRecordsInLogFile&gt; </span></strong>: it is the max number of records stored in a single log file</span><br /><span style="font-family: courier new,courier;"><strong><span style="color: #800000;">&nbsp;&lt;PollingSysParamsInterval&gt;</span></strong>&nbsp; : it is the sampling interval of PerformanceCounter()</span></p>
<p><span style="font-size: small;">To generate a log file per day, we need to set the MaxNumberRecordsInLogFile equal to:</span></p>
<p><span style="font-family: comic sans ms,sans-serif;"><strong><span style="font-size: small;">MaxNumberRecordsInLogFile =(Second in a day)/ PollingSysParamsInterval</span></strong></span></p>
<p><span style="font-size: small;">i.e. </span></p>
<p><span style="font-size: small;">if we sample every 1 second (PollingSysParamsInterval =1),&nbsp; </span><span style="font-size: small;">MaxNumberRecordsInLogFile =86400secondi/ (1 second)=86400</span></p>
<p>&nbsp;</p>
<p><span style="font-size: small;">Using the parameters stored in app.config is possible to define which counters parameters we want to be include in the sampling and the structure of the performance counters (order).</span></p>
<p><span style="font-size: small;">The full structure of <span style="font-family: courier new,courier; color: #000080;"><strong>app.config</strong></span> is reported below:</span></p>
<p>&nbsp;<strong><span style="font-family: courier new,courier; font-size: small;">&lt;?xml version="1.0"?&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&lt;configuration&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp; &lt;startup&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;supportedRuntime version="<span style="color: #0000ff;">v4.0</span>" sku="<span style="color: #0000ff;">.NETFramework,Version=v4.5</span>"/&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp; &lt;/startup&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp; &lt;appSettings&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">SamplingTime</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">NodeName</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">false</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">CPUProcessorTime</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">CPUPrivilegedTime</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">CPUInterruptTime</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">CPUDPCTime</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">MEMAvailable</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">MEMCommited</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">MEMCommitLimit</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">MEMCommitedPerc</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">MEMPoolPaged</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">MEMPoolNonPaged</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">MEMCached</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">PageFile</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">ProcessorQueueLengh</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">DISCQueueLengh</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">DISKRead</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">DISKWrite</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">DISKAverageTimeRead</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">DISKAverageTimeWrite</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">DISKTime</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">HANDLECountCounter</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">THREADCount</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">CONTENTSwitches</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">SYSTEMCalls</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">NumProcess</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">NetTrafficSend</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">NetTrafficReceive</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;&nbsp; &nbsp;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp; &lt;/appSettings&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&lt;/configuration&gt;</span></strong></p>
<p style="text-align: justify;"><span style="font-size: small;">The meaning of key value is self-explanatory, and the value associated to every key is boolean:</span></p>
<ul>
<li style="text-align: justify;"><span style="font-size: small;">the value equal to &ldquo;<span style="color: #0000ff;"><strong>true</strong></span>&rdquo; means that value of the performance counter is tracked</span></li>
<li style="text-align: justify;"><span style="font-size: small;">the value equal to &ldquo;<strong><span style="color: #0000ff;">false</span></strong>&rdquo; means that value of the performance counter can be skipped&nbsp;&nbsp;&nbsp;</span></li>
</ul>
<p style="text-align: justify;"><span style="font-size: small;">When you compile your application, Visual Studio will automatically create a file called <em>&lt;your application name&gt;.exe.config</em> in your <em>bin\debug</em> folder. The contents of the <em>app.config</em> will be automatically copied to this new config file when you compile the application. When you deliver the application to the end user, you have to deliver the exe and this new config file called <em>&lt;your application name&gt;.exe.config</em> and NOT the <em>app.config</em>. Users can modify the data in <em>&lt;your application name&gt;.exe.config</em> file and application will read the data from the config file, when restarted. Change the order of (key,value) in app.config determines a different order of performance counter print out to the console and in log file.</span></p>
<p><span style="font-size: small;">The project use a public class named<span style="color: #000080;"><strong> SysParams</strong></span> to store all the Performance counters.</span></p>
<p><span style="font-family: courier new,courier;"><span style="color: #0000ff;">public </span><span style="color: #0000ff;"><span style="color: #0000ff;">class </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">SysParams</span></span></span></p>
<p><span style="font-family: courier new,courier;">{</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">string</span></span> NodeName { <span style="color: #0000ff;"><span style="color: #0000ff;">get</span></span>; <span style="color: #0000ff;"><span style="color: #0000ff;">set</span></span>; }</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> CPUProcessorTime { <span style="color: #0000ff;"><span style="color: #0000ff;">get</span></span>; <span style="color: #0000ff;"><span style="color: #0000ff;">set</span></span>; }</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> CPUPrivilegedTime { <span style="color: #0000ff;"><span style="color: #0000ff;">get</span></span>; <span style="color: #0000ff;"><span style="color: #0000ff;">set</span></span>; }</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> CPUInterruptTime { <span style="color: #0000ff;"><span style="color: #0000ff;">get</span></span>; <span style="color: #0000ff;"><span style="color: #0000ff;">set</span></span>; }</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> CPUDPCTime { <span style="color: #0000ff;"><span style="color: #0000ff;">get</span></span>; <span style="color: #0000ff;"><span style="color: #0000ff;">set</span></span>; }</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> MEMAvailable { <span style="color: #0000ff;"><span style="color: #0000ff;">get</span></span>; <span style="color: #0000ff;"><span style="color: #0000ff;">set</span></span>; }</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> MEMCommited { <span style="color: #0000ff;"><span style="color: #0000ff;">get</span></span>; <span style="color: #0000ff;"><span style="color: #0000ff;">set</span></span>; }</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> MEMCommitLimit { <span style="color: #0000ff;"><span style="color: #0000ff;">get</span></span>; <span style="color: #0000ff;"><span style="color: #0000ff;">set</span></span>; }</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> MEMCommitedPerc { <span style="color: #0000ff;"><span style="color: #0000ff;">get</span></span>; <span style="color: #0000ff;"><span style="color: #0000ff;">set</span></span>; }</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> MEMPoolPaged { <span style="color: #0000ff;"><span style="color: #0000ff;">get</span></span>; <span style="color: #0000ff;"><span style="color: #0000ff;">set</span></span>; }</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> MEMPoolNonPaged { <span style="color: #0000ff;"><span style="color: #0000ff;">get</span></span>; <span style="color: #0000ff;"><span style="color: #0000ff;">set</span></span>; }</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> MEMCached { <span style="color: #0000ff;"><span style="color: #0000ff;">get</span></span>; <span style="color: #0000ff;"><span style="color: #0000ff;">set</span></span>; }</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> PageFile { <span style="color: #0000ff;"><span style="color: #0000ff;">get</span></span>; <span style="color: #0000ff;"><span style="color: #0000ff;">set</span></span>; }</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> ProcessorQueueLengh { <span style="color: #0000ff;"><span style="color: #0000ff;">get</span></span>; <span style="color: #0000ff;"><span style="color: #0000ff;">set</span></span>; }</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> DISCQueueLengh { <span style="color: #0000ff;"><span style="color: #0000ff;">get</span></span>; <span style="color: #0000ff;"><span style="color: #0000ff;">set</span></span>; }</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> DISKRead {<span style="color: #0000ff;"><span style="color: #0000ff;">get</span></span>; <span style="color: #0000ff;"><span style="color: #0000ff;">set</span></span>;}</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> DISKWrite { <span style="color: #0000ff;"><span style="color: #0000ff;">get</span></span>; <span style="color: #0000ff;"><span style="color: #0000ff;">set</span></span>; }</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> DISKAverageTimeRead { <span style="color: #0000ff;"><span style="color: #0000ff;">get</span></span>; <span style="color: #0000ff;"><span style="color: #0000ff;">set</span></span>; }</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> DISKAverageTimeWrite { <span style="color: #0000ff;"><span style="color: #0000ff;">get</span></span>; <span style="color: #0000ff;"><span style="color: #0000ff;">set</span></span>; }</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> DISKTime { <span style="color: #0000ff;"><span style="color: #0000ff;">get</span></span>; <span style="color: #0000ff;"><span style="color: #0000ff;">set</span></span>; }</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> HANDLECountCounter { <span style="color: #0000ff;"><span style="color: #0000ff;">get</span></span>; <span style="color: #0000ff;"><span style="color: #0000ff;">set</span></span>; }</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> THREADCount { <span style="color: #0000ff;"><span style="color: #0000ff;">get</span></span>; <span style="color: #0000ff;"><span style="color: #0000ff;">set</span></span>; }</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">int</span></span> CONTENTSwitches { <span style="color: #0000ff;"><span style="color: #0000ff;">get</span></span>; <span style="color: #0000ff;"><span style="color: #0000ff;">set</span></span>; }</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">int</span></span> SYSTEMCalls { <span style="color: #0000ff;"><span style="color: #0000ff;">get</span></span>; <span style="color: #0000ff;"><span style="color: #0000ff;">set</span></span>; }</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> NetTrafficSend { <span style="color: #0000ff;"><span style="color: #0000ff;">get</span></span>; <span style="color: #0000ff;"><span style="color: #0000ff;">set</span></span>; }</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> NetTrafficReceive { <span style="color: #0000ff;"><span style="color: #0000ff;">get</span></span>; <span style="color: #0000ff;"><span style="color: #0000ff;">set</span></span>; } </span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">DateTime</span></span> SamplingTime { <span style="color: #0000ff;"><span style="color: #0000ff;">get</span></span>; <span style="color: #0000ff;"><span style="color: #0000ff;">set</span></span>; }</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">private </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span> cpuProcessorTime = <span style="color: #0000ff;"><span style="color: #0000ff;">new </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span>(<span style="color: #a31515;"><span style="color: #a31515;">"Processor"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"% Processor Time"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"_Total"</span></span>);</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">private </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span> cpuPrivilegedTime = <span style="color: #0000ff;"><span style="color: #0000ff;">new </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span>(<span style="color: #a31515;"><span style="color: #a31515;">"Processor"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"% Privileged Time"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"_Total"</span></span>);</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">private </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span> cpuInterruptTime = <span style="color: #0000ff;"><span style="color: #0000ff;">new </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span>(<span style="color: #a31515;"><span style="color: #a31515;">"Processor"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"% Interrupt Time"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"_Total"</span></span>);</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">private </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span> cpuDPCTime = <span style="color: #0000ff;"><span style="color: #0000ff;">new </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span>(<span style="color: #a31515;"><span style="color: #a31515;">"Processor"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"% DPC Time"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"_Total"</span></span>);</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">private </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span> memAvailable = <span style="color: #0000ff;"><span style="color: #0000ff;">new </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span>(<span style="color: #a31515;"><span style="color: #a31515;">"Memory"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"Available MBytes"</span></span>, <span style="color: #0000ff;"><span style="color: #0000ff;">null</span></span>);</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">private</span></span><span style="color: #2b91af;"><span style="color: #2b91af;"> PerformanceCounter</span></span> memCommited = <span style="color: #0000ff;"><span style="color: #0000ff;">new </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span>(<span style="color: #a31515;"><span style="color: #a31515;">"Memory"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"Committed Bytes"</span></span>, <span style="color: #0000ff;"><span style="color: #0000ff;">null</span></span>);</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">private </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span> memCommitLimit = <span style="color: #0000ff;"><span style="color: #0000ff;">new </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span>(<span style="color: #a31515;"><span style="color: #a31515;">"Memory"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"Commit Limit"</span></span>, <span style="color: #0000ff;"><span style="color: #0000ff;">null</span></span>);</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">private </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span> memCommitedPerc = <span style="color: #0000ff;"><span style="color: #0000ff;">new </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span>(<span style="color: #a31515;"><span style="color: #a31515;">"Memory"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"% Committed Bytes In Use"</span></span>, <span style="color: #0000ff;"><span style="color: #0000ff;">null</span></span>);</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">private </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span> memPollPaged = <span style="color: #0000ff;"><span style="color: #0000ff;">new </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span>(<span style="color: #a31515;"><span style="color: #a31515;">"Memory"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"Pool Paged Bytes"</span></span>, <span style="color: #0000ff;"><span style="color: #0000ff;">null</span></span>);</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">private </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span> memPollNonPaged = <span style="color: #0000ff;"><span style="color: #0000ff;">new </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span>(<span style="color: #a31515;"><span style="color: #a31515;">"Memory"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"Pool Nonpaged Bytes"</span></span>, <span style="color: #0000ff;"><span style="color: #0000ff;">null</span></span>);</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">private </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span> memCached = <span style="color: #0000ff;"><span style="color: #0000ff;">new </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span>(<span style="color: #a31515;"><span style="color: #a31515;">"Memory"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"Cache Bytes"</span></span>, <span style="color: #0000ff;"><span style="color: #0000ff;">null</span></span>);</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">private </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span> pageFile = <span style="color: #0000ff;"><span style="color: #0000ff;">new </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span>(<span style="color: #a31515;"><span style="color: #a31515;">"Paging File"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"% Usage"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"_Total"</span></span>);</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">private </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span> processorQueueLengh = <span style="color: #0000ff;"><span style="color: #0000ff;">new </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span>(<span style="color: #a31515;"><span style="color: #a31515;">"System"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"Processor Queue Length"</span></span>, <span style="color: #0000ff;"><span style="color: #0000ff;">null</span></span>);</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">private </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span> diskQueueLengh = <span style="color: #0000ff;"><span style="color: #0000ff;">new </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span>(<span style="color: #a31515;"><span style="color: #a31515;">"PhysicalDisk"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"Avg. Disk Queue Length"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"_Total"</span></span>);</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">private </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span> diskRead = <span style="color: #0000ff;"><span style="color: #0000ff;">new </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span>(<span style="color: #a31515;"><span style="color: #a31515;">"PhysicalDisk"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"Disk Read Bytes/sec"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"_Total"</span></span>);</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">private </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span> diskWrite = <span style="color: #0000ff;"><span style="color: #0000ff;">new </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span>(<span style="color: #a31515;"><span style="color: #a31515;">"PhysicalDisk"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"Disk Write Bytes/sec"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"_Total"</span></span>);</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">private </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span> diskAverageTimeRead = <span style="color: #0000ff;"><span style="color: #0000ff;">new </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span>(<span style="color: #a31515;"><span style="color: #a31515;">"PhysicalDisk"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"Avg. Disk sec/Read"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"_Total"</span></span>);</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">private </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span> diskAverageTimeWrite = <span style="color: #0000ff;"><span style="color: #0000ff;">new </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span>(<span style="color: #a31515;"><span style="color: #a31515;">"PhysicalDisk"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"Avg. Disk sec/Write"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"_Total"</span></span>);</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">private </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span> diskTime = <span style="color: #0000ff;"><span style="color: #0000ff;">new </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span>(<span style="color: #a31515;"><span style="color: #a31515;">"PhysicalDisk"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"% Disk Time"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"_Total"</span></span>);</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">private </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span> handleCountCounter = <span style="color: #0000ff;"><span style="color: #0000ff;">new </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span>(<span style="color: #a31515;"><span style="color: #a31515;">"Process"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"Handle Count"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"_Total"</span></span>);</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">private </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span> threadCount = <span style="color: #0000ff;"><span style="color: #0000ff;">new </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span>(<span style="color: #a31515;"><span style="color: #a31515;">"Process"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"Thread Count"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"_Total"</span></span>);</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">private </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span> contentSwitches = <span style="color: #0000ff;"><span style="color: #0000ff;">new </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span>(<span style="color: #a31515;"><span style="color: #a31515;">"System"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"Context Switches/sec"</span></span>, <span style="color: #0000ff;"><span style="color: #0000ff;">null</span></span>);</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">private </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span> systemCalls = <span style="color: #0000ff;"><span style="color: #0000ff;">new </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span>(<span style="color: #a31515;"><span style="color: #a31515;">"System"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"System Calls/sec"</span></span>, <span style="color: #0000ff;"><span style="color: #0000ff;">null</span></span>);</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">private </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounterCategory</span></span> performanceNetCounterCategory;</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">private </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span>[] trafficSentCounters;</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">private </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span>[] trafficReceivedCounters;</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">private </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">string</span></span>[] interfaces = <span style="color: #0000ff;"><span style="color: #0000ff;">null</span></span>;</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public</span></span><span style="color: #0000ff;"><span style="color: #0000ff;"> void</span></span> initNetCounters()</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">{</span></p>
<p style="padding-left: 60px;"><span style="color: #008000; font-family: courier new,courier;"><span style="color: #008000;">// PerformanceCounter(CategoryName,CounterName,InstanceName)</span></span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">performanceNetCounterCategory = <span style="color: #0000ff;"><span style="color: #0000ff;">new</span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounterCategory</span></span>(<span style="color: #a31515;"><span style="color: #a31515;">"Network Interface"</span></span>);</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">interfaces = performanceNetCounterCategory.GetInstanceNames();</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">int</span></span> length = interfaces.Length;</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">if</span></span> (length &gt; 0)</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">{</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">trafficSentCounters = <span style="color: #0000ff;"><span style="color: #0000ff;">new</span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span>[length];</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">trafficReceivedCounters = <span style="color: #0000ff;"><span style="color: #0000ff;">new</span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span>[length];</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">}</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">for</span></span> (<span style="color: #0000ff;"><span style="color: #0000ff;">int</span></span> i = 0; i &lt; length; i++)</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">{</span></p>
<p style="padding-left: 60px;"><span style="color: #008000; font-family: courier new,courier;"><span style="color: #008000;">// Initializes a new, read-only instance of the PerformanceCounter class.</span></span></p>
<p style="padding-left: 60px;"><span style="color: #008000; font-family: courier new,courier;"><span style="color: #008000;">//&nbsp;&nbsp; 1st paramenter: "categoryName"-The name of the performance counter category (performance object) with which this performance counter is associated.</span></span></p>
<p style="padding-left: 60px;"><span style="color: #008000; font-family: courier new,courier;"><span style="color: #008000;">//&nbsp;&nbsp; 2nd paramenter: "CounterName" -The name of the performance counter. </span></span></p>
<p style="padding-left: 60px;"><span style="color: #008000; font-family: courier new,courier;"><span style="color: #008000;">//&nbsp;&nbsp; 3rd paramenter: "instanceName" -The name of the performance counter category instance, or an empty string (""), if the category contains a single instance. </span></span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">trafficReceivedCounters[i] = <span style="color: #0000ff;"><span style="color: #0000ff;">new </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span>(<span style="color: #a31515;"><span style="color: #a31515;">"Network Interface"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"Bytes Sent/sec"</span></span>, interfaces[i]);</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">trafficSentCounters[i] =<span style="color: #0000ff;"><span style="color: #0000ff;">new </span></span><span style="color: #2b91af;"><span style="color: #2b91af;">PerformanceCounter</span></span>(<span style="color: #a31515;"><span style="color: #a31515;">"Network Interface"</span></span>, <span style="color: #a31515;"><span style="color: #a31515;">"Bytes Sent/sec"</span></span>, interfaces[i]);</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">}</span></p>
<p style="padding-left: 60px;"><span style="color: #008000; font-family: courier new,courier;"><span style="color: #008000;">// List of all names of the network interfaces</span></span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">for</span></span> (<span style="color: #0000ff;"><span style="color: #0000ff;">int</span></span> i = 0; i &lt; length; i++)</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">{</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;"><span style="color: #2b91af;"><span style="color: #2b91af;">Console</span></span>.WriteLine(<span style="color: #a31515;"><span style="color: #a31515;">"Name netInterface: {0}"</span></span>, performanceNetCounterCategory.GetInstanceNames()[i]);</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">}</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">}</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">void</span></span> getProcessorCpuTime()</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">{</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> tmp = cpuProcessorTime.NextValue();</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">CPUProcessorTime = (<span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span>)(<span style="color: #2b91af;"><span style="color: #2b91af;">Math</span></span>.Round((<span style="color: #0000ff;"><span style="color: #0000ff;">double</span></span>)tmp, 1));</span></p>
<p style="padding-left: 60px;"><span style="color: #008000; font-family: courier new,courier;"><span style="color: #008000;">// Environment.ProcessorCount: return the total number of cores</span></span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">}</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">void</span></span> getCpuPrivilegedTime()</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">{</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> tmp = cpuPrivilegedTime.NextValue();</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">CPUPrivilegedTime = (<span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span>)(<span style="color: #2b91af;"><span style="color: #2b91af;">Math</span></span>.Round((<span style="color: #0000ff;"><span style="color: #0000ff;">double</span></span>)tmp, 1));</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">}</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">void</span></span> getCpuinterruptTime()</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">{</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> tmp = cpuInterruptTime.NextValue();</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">CPUInterruptTime = (<span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span>)(<span style="color: #2b91af;"><span style="color: #2b91af;">Math</span></span>.Round((<span style="color: #0000ff;"><span style="color: #0000ff;">double</span></span>)tmp, 1));</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">}</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">void</span></span> getcpuDPCTime()</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">{</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> tmp = cpuDPCTime.NextValue();</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">CPUDPCTime = (<span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span>)(<span style="color: #2b91af;"><span style="color: #2b91af;">Math</span></span>.Round((<span style="color: #0000ff;"><span style="color: #0000ff;">double</span></span>)tmp, 1));</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">}</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">void</span></span> getPageFile()</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">{</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">PageFile = pageFile.NextValue();</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">}</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">void</span></span> getProcessorQueueLengh()</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">{</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">ProcessorQueueLengh = processorQueueLengh.NextValue();</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">}</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">void</span></span> getMemAvailable()</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">{</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">MEMAvailable = memAvailable.NextValue();</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">}</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">void</span></span> getMemCommited()</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">{</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">MEMCommited = memCommited.NextValue() / (1024 * 1024);</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">}</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">void</span></span> getMemCommitLimit()</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">{</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">MEMCommitLimit = memCommitLimit.NextValue() / (1024 * 1024);</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">}</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public</span></span><span style="color: #0000ff;"><span style="color: #0000ff;"> void</span></span> getMemCommitedPerc()</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">{</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> tmp = memCommitedPerc.NextValue();</span></p>
<p style="padding-left: 60px;"><span style="color: #008000; font-family: courier new,courier;"><span style="color: #008000;">// return the value of Memory Commit Limit</span></span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">MEMCommitedPerc = (<span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span>)(<span style="color: #2b91af;"><span style="color: #2b91af;">Math</span></span>.Round((<span style="color: #0000ff;"><span style="color: #0000ff;">double</span></span>)tmp, 1));</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">}</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">void</span></span> getMemPoolPaged()</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">{</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> tmp = memPollPaged.NextValue() / (1024 * 1024);</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">MEMPoolPaged = (<span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span>)(<span style="color: #2b91af;"><span style="color: #2b91af;">Math</span></span>.Round((<span style="color: #0000ff;"><span style="color: #0000ff;">double</span></span>)tmp, 1));</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">}</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">void</span></span> getMemPoolNonPaged()</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">{</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> tmp = memPollNonPaged.NextValue() / (1024 * 1024);</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">MEMPoolNonPaged = (<span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span>)(<span style="color: #2b91af;"><span style="color: #2b91af;">Math</span></span>.Round((<span style="color: #0000ff;"><span style="color: #0000ff;">double</span></span>)tmp, 1));</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">}</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">void</span></span> getMemCachedBytes()</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">{</span></p>
<p style="padding-left: 60px;"><span style="color: #008000; font-family: courier new,courier;"><span style="color: #008000;">// return the value of Memory Cached in MBytes</span></span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">MEMCached = memCached.NextValue() / (1024 * 1024);</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">}</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">void</span></span> getDiskQueueLengh()</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">{</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">DISCQueueLengh = diskQueueLengh.NextValue();</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">}</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">void</span></span> getDiskRead()</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">{</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> tmp=diskRead.NextValue()/1024;</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">DISKRead = (<span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span>)(<span style="color: #2b91af;"><span style="color: #2b91af;">Math</span></span>.Round((<span style="color: #0000ff;"><span style="color: #0000ff;">double</span></span>)tmp,1));</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">}</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">void</span></span> getDiskWrite()</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">{</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> tmp=diskWrite.NextValue()/1024;</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">DISKWrite = (<span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span>)(<span style="color: #2b91af;"><span style="color: #2b91af;">Math</span></span>.Round((<span style="color: #0000ff;"><span style="color: #0000ff;">double</span></span>)tmp,1)); <span style="color: #008000;"><span style="color: #008000;">// round 1 digit decimal</span></span></span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">}</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">void</span></span> getDiskAverageTimeRead()</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">{</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> tmp = diskAverageTimeRead.NextValue() * 1000;</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">DISKAverageTimeRead = (<span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span>)(<span style="color: #2b91af;"><span style="color: #2b91af;">Math</span></span>.Round((<span style="color: #0000ff;"><span style="color: #0000ff;">double</span></span>)tmp, 1)); <span style="color: #008000;"><span style="color: #008000;">// round 1 digit decimal</span></span></span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">}</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">void</span></span> getDiskAverageTimeWrite()</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">{</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> tmp = diskAverageTimeWrite.NextValue()*1000;</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">DISKAverageTimeWrite = (<span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span>)(<span style="color: #2b91af;"><span style="color: #2b91af;">Math</span></span>.Round((<span style="color: #0000ff;"><span style="color: #0000ff;">double</span></span>)tmp, 1)); <span style="color: #008000;"><span style="color: #008000;">// round 1 digit decimal</span></span></span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">}</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">void</span></span> getDiskTime()</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">{</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> tmp = diskTime.NextValue();</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">DISKTime = (<span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span>)(<span style="color: #2b91af;"><span style="color: #2b91af;">Math</span></span>.Round((<span style="color: #0000ff;"><span style="color: #0000ff;">double</span></span>)tmp, 1));</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">}</span></p>
<p>　</p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">void</span></span> getHandleCountCounter()</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">{</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">HANDLECountCounter = handleCountCounter.NextValue();</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">}</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">void</span></span> getThreadCount()</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">{</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">THREADCount = threadCount.NextValue();</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">}</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">void</span></span> getContentSwitches()</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">{</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">CONTENTSwitches = (<span style="color: #0000ff;"><span style="color: #0000ff;">int</span></span>)<span style="color: #2b91af;"><span style="color: #2b91af;">Math</span></span>.Ceiling(contentSwitches.NextValue());</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">}</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">void</span></span> getsystemCalls()</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">{</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">SYSTEMCalls = (<span style="color: #0000ff;"><span style="color: #0000ff;">int</span></span>)<span style="color: #2b91af;"><span style="color: #2b91af;">Math</span></span>.Ceiling(systemCalls.NextValue());</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">}</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public</span></span><span style="color: #0000ff;"><span style="color: #0000ff;"> void</span></span> getCurretTrafficSent()</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">{</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">int</span></span> length = interfaces.Length;</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> sendSum = 0.0F;</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">for</span></span> (<span style="color: #0000ff;"><span style="color: #0000ff;">int</span></span> i = 0; i &lt; length; i++)</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">{</span></p>
<p style="padding-left: 90px;"><span style="font-family: courier new,courier;">sendSum += trafficSentCounters[i].NextValue();</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">}</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> tmp = 8 * (sendSum / 1024);</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">NetTrafficSend = (<span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span>)(<span style="color: #2b91af;"><span style="color: #2b91af;">Math</span></span>.Round((<span style="color: #0000ff;"><span style="color: #0000ff;">double</span></span>)tmp, 1));</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">}</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">void</span></span> getCurretTrafficReceived()</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">{</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">int</span></span> length = interfaces.Length;</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> receiveSum = 0.0F;</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">for</span></span> (<span style="color: #0000ff;"><span style="color: #0000ff;">int</span></span> i = 0; i &lt; length; i++)</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">{</span></p>
<p style="padding-left: 90px;"><span style="font-family: courier new,courier;">receiveSum += trafficReceivedCounters[i].NextValue();</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">}</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span> tmp = 8 * (receiveSum / 1024);</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">NetTrafficReceive = (<span style="color: #0000ff;"><span style="color: #0000ff;">float</span></span>)(<span style="color: #2b91af;"><span style="color: #2b91af;">Math</span></span>.Round((<span style="color: #0000ff;"><span style="color: #0000ff;">double</span></span>)tmp, 1));</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">}</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"><span style="color: #0000ff;"><span style="color: #0000ff;">public </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">void</span></span> getSampleTime()</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">{</span></p>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier;">SamplingTime =<span style="color: #2b91af;"><span style="color: #2b91af;">DateTime</span></span>.Now;</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">}</span></p>
<p><span style="font-family: courier new,courier;">}</span></p>
<p>A description of program workflow is reported in figure 2 and figure 3</p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinPerfCounterApp/3463.02.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinPerfCounterApp/3463.02.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinPerfCounterApp/3463.02.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinPerfCounterApp/3463.02.jpg" alt="" width="605" height="569" border="0" /></a></p>
<p style="text-align: center;">Figure 2: program workflow</p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinPerfCounterApp/7382.03.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinPerfCounterApp/7382.03.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinPerfCounterApp/7382.03.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinPerfCounterApp/7382.03.jpg" alt="" width="603" height="529" border="0" /></a></p>
<p>&nbsp;</p>
<p style="text-align: center;">Figure 3: program workflow</p>
<p>&nbsp;<span style="font-size: small;">You can run the program on your Window 8 laptop or Azure IaaS VM with Windows 2012 R2 (you do not need to install any further package, transfer the list of files under the binary folder and run it).</span></p>
<p><span style="font-size: small;">Here how look like a typical output:</span></p>
<p style="text-align: center;"><span style="font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinPerfCounterApp/2477.04.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinPerfCounterApp/2477.04.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinPerfCounterApp/2477.04.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinPerfCounterApp/2477.04.jpg" alt="" width="514" height="899" border="0" /></a></span>&nbsp;</p>
<p style="text-align: center;">Figure 4: Performance counters parameters on the console</p>
<p>Program has small CPU impact; on Azure IaaS VM &ndash;A1 (basic tier) with Windows 2012 R2 the CPU consumption is between 1% and 5% as shown in figure 4 and figure 5.</p>
<p style="text-align: center;" align="center">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinPerfCounterApp/8546.Azure01.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinPerfCounterApp/8546.Azure01.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinPerfCounterApp/8546.Azure01.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinPerfCounterApp/8546.Azure01.jpg" alt="" width="454" height="258" border="0" /></a></p>
<p style="text-align: center;">Figure 5: CPU consumption of program</p>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinPerfCounterApp/2308.Azure02.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinPerfCounterApp/2308.Azure02.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinPerfCounterApp/2308.Azure02.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinPerfCounterApp/2308.Azure02.jpg" alt="" width="444" height="222" border="0" /></a>&nbsp;</p>
<p style="text-align: center;">&nbsp;&nbsp;Figure 6: CPU consumption of program</p>
<p style="text-align: justify;"><span style="font-size: small;">To control the record format stored in log file we can change the content in <strong><span style="color: #000080; font-family: courier new,courier;">app.config</span></strong> file</span></p>
<p>&nbsp;</p>
<h2><span style="color: #000080;">3.1 Tracking CPU and Network performance counters only</span></h2>
<p style="text-align: justify;">&nbsp;<span style="font-size: small;">To monitor the CPU and network traffic counters is enough to change the <span style="font-family: courier new,courier;"><strong><span style="color: #000080;">app.config</span></strong></span> file structure:</span></p>
<p>&nbsp;<strong><span style="font-family: courier new,courier; font-size: small;">&lt;?xml version="1.0"?&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&lt;configuration&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp; &lt;startup&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;supportedRuntime version="<span style="color: #0000ff;">v4.0</span>" sku="<span style="color: #0000ff;">.NETFramework,Version=v4.5</span>"/&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp; &lt;/startup&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp; &lt;appSettings&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">SamplingTime</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">NodeName</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">false</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">CPUProcessorTime</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">CPUPrivilegedTime</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">CPUInterruptTime</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">CPUDPCTime</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">MEMAvailable</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;"><strong><span style="font-family: courier new,courier; font-size: small;"><span style="color: #0000ff;">false</span></span></strong></span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">MEMCommited</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;"><strong><span style="font-family: courier new,courier; font-size: small;"><span style="color: #0000ff;">false</span></span></strong></span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">MEMCommitLimit</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;"><strong><span style="font-family: courier new,courier; font-size: small;"><span style="color: #0000ff;">false</span></span></strong></span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">MEMCommitedPerc</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;"><strong><span style="font-family: courier new,courier; font-size: small;"><span style="color: #0000ff;">false</span></span></strong></span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">MEMPoolPaged</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;"><strong><span style="font-family: courier new,courier; font-size: small;"><span style="color: #0000ff;">false</span></span></strong></span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">MEMPoolNonPaged</span>" <span style="color: #ff0000;">value</span>="<strong><span style="font-family: courier new,courier; font-size: small;"><span style="color: #0000ff;">false</span></span></strong>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">MEMCached</span>" <span style="color: #ff0000;">value</span>="<strong><span style="font-family: courier new,courier; font-size: small;"><span style="color: #0000ff;">false</span></span></strong>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">PageFile</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;"><strong><span style="font-family: courier new,courier; font-size: small;"><span style="color: #0000ff;">false</span></span></strong></span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">ProcessorQueueLengh</span>" <span style="color: #ff0000;">value</span>="<strong><span style="font-family: courier new,courier; font-size: small;"><span style="color: #0000ff;">false</span></span></strong>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">DISCQueueLengh</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;"><strong><span style="font-family: courier new,courier; font-size: small;"><span style="color: #0000ff;">false</span></span></strong></span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">DISKRead</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;"><strong><span style="font-family: courier new,courier; font-size: small;"><span style="color: #0000ff;">false</span></span></strong></span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">DISKWrite</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;"><strong><span style="font-family: courier new,courier; font-size: small;"><span style="color: #0000ff;">false</span></span></strong></span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">DISKAverageTimeRead</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;"><strong><span style="font-family: courier new,courier; font-size: small;"><span style="color: #0000ff;">false</span></span></strong></span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">DISKAverageTimeWrite</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;"><strong><span style="font-family: courier new,courier; font-size: small;"><span style="color: #0000ff;">false</span></span></strong></span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">DISKTime</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;"><strong><span style="font-family: courier new,courier; font-size: small;"><span style="color: #0000ff;">false</span></span></strong></span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">HANDLECountCounter</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;"><strong><span style="font-family: courier new,courier; font-size: small;"><span style="color: #0000ff;">false</span></span></strong></span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">THREADCount</span>" <span style="color: #ff0000;">value</span>="<strong><span style="font-family: courier new,courier; font-size: small;"><span style="color: #0000ff;">false</span></span></strong>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">CONTENTSwitches</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;"><strong><span style="font-family: courier new,courier; font-size: small;"><span style="color: #0000ff;">false</span></span></strong></span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">SYSTEMCalls</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;"><strong><span style="font-family: courier new,courier; font-size: small;"><span style="color: #0000ff;">false</span></span></strong></span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">NumProcess</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;"><strong><span style="font-family: courier new,courier; font-size: small;"><span style="color: #0000ff;"><strong><span style="font-family: courier new,courier; font-size: small;"><span style="color: #0000ff;">false</span></span></strong></span></span></strong></span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">NetTrafficSend</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">NetTrafficReceive</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;&nbsp; &nbsp;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp; &lt;/appSettings&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&lt;/configuration&gt;</span></strong></p>
<p style="text-align: justify;">&nbsp;<span style="font-size: small;">or differently we can cut out all the pairs (key, value) that we do not want to track:</span></p>
<p>&nbsp;<strong><span style="font-family: courier new,courier; font-size: small;">&lt;?xml version="1.0"?&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&lt;configuration&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp; &lt;startup&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;supportedRuntime version="<span style="color: #0000ff;">v4.0</span>" sku="<span style="color: #0000ff;">.NETFramework,Version=v4.5</span>"/&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp; &lt;/startup&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp; &lt;appSettings&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">SamplingTime</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">NodeName</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">false</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">CPUProcessorTime</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">CPUPrivilegedTime</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">CPUInterruptTime</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">CPUDPCTime</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br style="font-family: courier new,courier; font-size: small;" /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">NetTrafficSend</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">NetTrafficReceive</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;&nbsp; &nbsp;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp; &lt;/appSettings&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&lt;/configuration&gt;</span></strong></p>
<p>&nbsp;</p>
<p style="text-align: justify;"><span style="font-size: small;">we get a log file look like:</span></p>
<table style="width: 618px;" border="1" frame="border" rules="all" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="bottom" nowrap="nowrap" width="131">
<p>Sampling<br />&nbsp; Time</p>
</td>
<td valign="bottom" nowrap="nowrap" width="55">
<p align="right">CPU time %</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">CPU Privileged %</p>
</td>
<td valign="bottom" nowrap="nowrap" width="78">
<p align="right">CPU Interrupt %</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">CPU deferred %</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p>NetTrafficSent</p>
<p align="right">(kbps)</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p>NetTrafficRecv</p>
<p align="right">(kbps)</p>
</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="131">
<p>2014-11-20-18.35.28</p>
</td>
<td valign="bottom" nowrap="nowrap" width="55">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="78">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">0</p>
</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="131">
<p>2014-11-20-18.35.29</p>
</td>
<td valign="bottom" nowrap="nowrap" width="55">
<p align="right">20</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">5</p>
</td>
<td valign="bottom" nowrap="nowrap" width="78">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">26.5</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">27.1</p>
</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="131">
<p>2014-11-20-18.35.30</p>
</td>
<td valign="bottom" nowrap="nowrap" width="55">
<p align="right">10.4</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">1.5</p>
</td>
<td valign="bottom" nowrap="nowrap" width="78">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">41.7</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">69.5</p>
</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="131">
<p>2014-11-20-18.35.31</p>
</td>
<td valign="bottom" nowrap="nowrap" width="55">
<p align="right">2.7</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">1.5</p>
</td>
<td valign="bottom" nowrap="nowrap" width="78">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">72.3</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">43.3</p>
</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="131">
<p>2014-11-20-18.35.32</p>
</td>
<td valign="bottom" nowrap="nowrap" width="55">
<p align="right">4.5</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">3</p>
</td>
<td valign="bottom" nowrap="nowrap" width="78">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">34.6</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">34.7</p>
</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="131">
<p>2014-11-20-18.35.33</p>
</td>
<td valign="bottom" nowrap="nowrap" width="55">
<p align="right">36</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">11.9</p>
</td>
<td valign="bottom" nowrap="nowrap" width="78">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">424.1</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">424.3</p>
</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="131">
<p>2014-11-20-18.35.34</p>
</td>
<td valign="bottom" nowrap="nowrap" width="55">
<p align="right">1.7</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">3</p>
</td>
<td valign="bottom" nowrap="nowrap" width="78">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">219</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">218.2</p>
</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="131">
<p>2014-11-20-18.35.35</p>
</td>
<td valign="bottom" nowrap="nowrap" width="55">
<p align="right">19.5</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">11.9</p>
</td>
<td valign="bottom" nowrap="nowrap" width="78">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">1.5</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">48.5</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">48.5</p>
</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="131">
<p>2014-11-20-18.35.36</p>
</td>
<td valign="bottom" nowrap="nowrap" width="55">
<p align="right">21.8</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">15</p>
</td>
<td valign="bottom" nowrap="nowrap" width="78">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">1.5</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">43.2</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">43.4</p>
</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="131">
<p>2014-11-20-18.35.37</p>
</td>
<td valign="bottom" nowrap="nowrap" width="55">
<p align="right">0.7</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">1.5</p>
</td>
<td valign="bottom" nowrap="nowrap" width="78">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">21.7</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">23.5</p>
</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="131">
<p>2014-11-20-18.35.38</p>
</td>
<td valign="bottom" nowrap="nowrap" width="55">
<p align="right">11.8</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">7.3</p>
</td>
<td valign="bottom" nowrap="nowrap" width="78">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">31.1</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">29.5</p>
</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="131">
<p>2014-11-20-18.35.39</p>
</td>
<td valign="bottom" nowrap="nowrap" width="55">
<p align="right">4.7</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">3</p>
</td>
<td valign="bottom" nowrap="nowrap" width="78">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">22.8</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">22.7</p>
</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="131">
<p>2014-11-20-18.35.40</p>
</td>
<td valign="bottom" nowrap="nowrap" width="55">
<p align="right">1.6</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">1.5</p>
</td>
<td valign="bottom" nowrap="nowrap" width="78">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">15.3</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">15.3</p>
</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="131">
<p>2014-11-20-18.35.41</p>
</td>
<td valign="bottom" nowrap="nowrap" width="55">
<p align="right">5.2</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">3</p>
</td>
<td valign="bottom" nowrap="nowrap" width="78">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">29</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">28.9</p>
</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="131">
<p>2014-11-20-18.35.42</p>
</td>
<td valign="bottom" nowrap="nowrap" width="55">
<p align="right">2.2</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">1.5</p>
</td>
<td valign="bottom" nowrap="nowrap" width="78">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">28.4</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">28.5</p>
</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="131">
<p>2014-11-20-18.35.43</p>
</td>
<td valign="bottom" nowrap="nowrap" width="55">
<p align="right">6.6</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">4.5</p>
</td>
<td valign="bottom" nowrap="nowrap" width="78">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">27.5</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">27.3</p>
</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="131">
<p>2014-11-20-18.35.44</p>
</td>
<td valign="bottom" nowrap="nowrap" width="55">
<p align="right">6.3</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">3</p>
</td>
<td valign="bottom" nowrap="nowrap" width="78">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">23.9</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">24</p>
</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="131">
<p>2014-11-20-18.35.45</p>
</td>
<td valign="bottom" nowrap="nowrap" width="55">
<p align="right">7.6</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">3</p>
</td>
<td valign="bottom" nowrap="nowrap" width="78">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">25.7</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">25.8</p>
</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="131">
<p>2014-11-20-18.35.46</p>
</td>
<td valign="bottom" nowrap="nowrap" width="55">
<p align="right">1.1</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="78">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">22.4</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">22.3</p>
</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="131">
<p>2014-11-20-18.35.48</p>
</td>
<td valign="bottom" nowrap="nowrap" width="55">
<p align="right">5.6</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">2.9</p>
</td>
<td valign="bottom" nowrap="nowrap" width="78">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="84">
<p align="right">0</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">20.9</p>
</td>
<td valign="bottom" nowrap="nowrap" width="93">
<p align="right">20.9</p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p style="text-align: justify;"><span style="font-size: small;">To change the sequence of performance counters in the log file is enough to change the order in <span style="color: #000080;"><strong>app.config</strong></span></span></p>
<p><strong><strong><span style="font-family: courier new,courier; font-size: small;">&lt;?xml version="1.0"?&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&lt;configuration&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp; &lt;startup&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;supportedRuntime version="<span style="color: #0000ff;">v4.0</span>" sku="<span style="color: #0000ff;">.NETFramework,Version=v4.5</span>"/&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp; &lt;/startup&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp; &lt;appSettings&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">SamplingTime</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">NodeName</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">false</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">NetTrafficSend</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">NetTrafficReceive</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">CPUProcessorTime</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">CPUPrivilegedTime</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br style="font-family: courier new,courier; font-size: small;" /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">CPUInterruptTime</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;add <span style="color: #ff0000;">key</span>="<span style="color: #0000ff;">CPUDPCTime</span>" <span style="color: #ff0000;">value</span>="<span style="color: #0000ff;">true</span>" /&gt;&nbsp; &nbsp;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp; &lt;/appSettings&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&lt;/configuration&gt;</span></strong></strong></p>
<p><span style="font-size: small;">To reset the default parameters of <span style="color: #000080; font-family: courier new,courier;"><strong>app.config</strong></span> you can delete the file or set the content to:</span></p>
<p><span style="font-size: small;"><strong><strong><span style="font-family: courier new,courier; font-size: small;">&lt;?xml version="1.0"?&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&lt;configuration&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp; &lt;startup&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; &lt;supportedRuntime version="<span style="color: #0000ff;">v4.0</span>" sku="<span style="color: #0000ff;">.NETFramework,Version=v4.5</span>"/&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp; &lt;/startup&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp; &lt;appSettings&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&nbsp; &lt;/appSettings&gt;</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;">&lt;/configuration&gt;</span></strong></strong></span></p>
<p>&nbsp;</p>
<h1><span style="color: #000080;">4 Azure Files to store performance counter log of multiple Azure Windows VM</span></h1>
<p style="text-align: justify;"><span style="font-size: small;">If we want to Tracking Performance Counters on single Azure Windows VM, it is enough to copy the binary in the Azure windows VM and run it.</span></p>
<p style="text-align: justify;"><span style="font-size: small;">Azure Files is a great feature that exposes file shares using the standard SMB 2.1 protocol. &nbsp;As pointed out from the Azure storage product team an Azure File share can also be used to save diagnostic files like logs, metrics, and crash dumps. Multiple Azure VMs can mount the same file share an write the log file in different folders.</span></p>
<p style="text-align: justify;"><span style="font-size: small;">The diagram in Figure 7 shows how to use Azure File as repository of Performance counters log files generated from different Azure VMs.</span></p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinPerfCounterApp/4604.AzureFiles.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinPerfCounterApp/4604.AzureFiles.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinPerfCounterApp/4604.AzureFiles.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinPerfCounterApp/4604.AzureFiles.jpg" alt="" width="682" height="304" border="0" /></a></p>
<p style="text-align: center;">Figure 7: store Performance Counters log files in Azure File</p>
<p style="text-align: justify;"><span style="font-size: small;">Azure Files can be defined through Azure powershell with simple basic command:</span></p>
<p style="text-align: justify;"><span style="color: #000080;"><strong><span style="font-family: courier new,courier;">Import-Module Azure </span></strong></span></p>
<p style="text-align: justify;"><strong></strong><span style="font-family: courier new,courier;"><strong><span style="color: #000080;">Select-AzureSubscription &ndash;SubscriptionName </span><em>[[SubscriptionName]]</em></strong><em></em></span><br /><span style="color: #000080; font-family: courier new,courier;"><strong>Get-AzureSubscription &ndash;current </strong></span><br /><span style="font-family: courier new,courier;"><strong><span style="color: #000080;">New-AzureStorageAccount -StorageAccountName</span> <em>[[AzureStorageAccountName]]</em> <span style="color: #000080;">-Label</span> <em>[[AzureStorageAccountName]]</em> <span style="color: #000080;">-Locatio</span>n "North Europe"</strong></span><br /><br /><br /><span style="font-family: courier new,courier;"><strong># To find out the version of the module you're using </strong></span><br /><span style="color: #000080; font-family: courier new,courier;"><strong>(get-module azure).version </strong></span><br /><br /><span style="font-family: courier new,courier;"><strong><span style="color: #000080;">$ctx=New-AzureStorageContext</span> <em>[[AzureStorageAccountName]]&nbsp;[[AzureStorageAccountKey]] </em></strong></span><br /><span style="font-family: courier new,courier;"><strong><span style="color: #000080;">$ctx = New-AzureStorageContext -StorageAccountName </span><em>[[AzureStorageAccountName]]</em> <span style="color: #000080;">-StorageAccountKey</span> <em>[[AzureStorageAccountKey]] </em></strong></span><br /><br /><span style="font-family: courier new,courier;"><strong># create a new share </strong></span><br /><span style="font-family: courier new,courier;"><strong><span style="color: #000080;">$s = New-AzureStorageShare</span> <em>[[shareName]] </em><span style="color: #000080;">-Context</span> $ctx</strong></span></p>
<p style="text-align: justify;">&nbsp;</p>
<p style="text-align: justify;"><span style="font-size: small;">In our case we define a share name equal to &ldquo;logshare1&rdquo;:</span></p>
<p><strong><span style="font-family: courier new,courier;">$s = New-AzureStorageShare logshare1 -Context $ctx</span></strong></p>
<p>&nbsp;</p>
<p style="text-align: justify;"><span style="font-size: small;">To mount the shared folder in the Azure Windows VM we can use the command in both azure Windows VMs:</span></p>
<p><strong><span style="font-family: courier new,courier;">net use z: <a href="file:///\\[[AzureStorageAccountName]].file.core.windows.net/logshare1"><span lang="EN">\\<em>[[AzureStorageAccountName]].</em>file.core.windows.net\logshare1</span></a><span lang="EN"> /u:<em>[[AzureStorageAccountName]] [[AzureStorageAccountKey]]</em></span></span></strong></p>
<p style="text-align: justify;"><span style="font-size: small;">This command mount the shared folder &ldquo;logshare1&rdquo; of Azure Storage account as driver Z:</span></p>
<p align="left"><span style="font-size: small;">To store the log files in different folder we can change the value <strong>&lt;FolderPath&gt;</strong> in &nbsp;<strong>SysField.XML </strong>file</span><strong>&nbsp;</strong></p>
<p style="text-align: justify;" align="left"><span style="font-size: small;"><strong>Content of </strong><span style="color: #000080; font-family: courier new,courier;"><strong>SysField.XML </strong></span>file in test01 Azure VM:</span></p>
<p style="text-align: justify;" align="left"><span style="font-family: courier new,courier;">&lt;?xml version="1.0" encoding="utf-8" ?&gt;</span><br /><span style="font-family: courier new,courier;">&lt;AppValues&gt;</span><br /><span style="font-family: courier new,courier;">&nbsp; &lt;FolderPath&gt;Z:\SysParamsLog<span style="background-color: #ffff00;">1</span>\&lt;/FolderPath&gt;</span><br /><span style="font-family: courier new,courier;">&nbsp; &lt;FileName&gt;fftest<span style="background-color: #ffff00;">01</span>.txt&lt;/FileName&gt;</span><br /><span style="font-family: courier new,courier;">&nbsp; &lt;WriteToLogFile&gt;true&lt;/WriteToLogFile&gt;</span><br /><span style="font-family: courier new,courier;">&nbsp; &lt;MaxNumberRecordsInLogFile&gt;20&lt;/MaxNumberRecordsInLogFile&gt;</span><br /><span style="font-family: courier new,courier;">&nbsp; &lt;PollingSysParamsInterval&gt;1&lt;/PollingSysParamsInterval&gt;</span><br /><span style="font-family: courier new,courier;">&lt;/AppValues&gt;</span></p>
<p align="left"><span style="font-size: small;"><strong>Content of </strong><span style="color: #000080; font-family: courier new,courier;"><strong>SysField.XML </strong></span>file in test02 Azure VM:</span></p>
<p align="left"><span style="font-family: courier new,courier;">&lt;?xml version="1.0" encoding="utf-8" ?&gt;</span><br /><span style="font-family: courier new,courier;">&lt;AppValues&gt;</span><br /><span style="font-family: courier new,courier;">&nbsp; &lt;FolderPath&gt;Z:\SysParamsLog<span style="background-color: #ffff00;">2</span>\&lt;/FolderPath&gt;</span><br /><span style="font-family: courier new,courier;">&nbsp; &lt;FileName&gt;fftest<span style="background-color: #ffff00;">02</span>.txt&lt;/FileName&gt;</span><br /><span style="font-family: courier new,courier;">&nbsp; &lt;WriteToLogFile&gt;true&lt;/WriteToLogFile&gt;</span><br /><span style="font-family: courier new,courier;">&nbsp; &lt;MaxNumberRecordsInLogFile&gt;20&lt;/MaxNumberRecordsInLogFile&gt;</span><br /><span style="font-family: courier new,courier;">&nbsp; &lt;PollingSysParamsInterval&gt;1&lt;/PollingSysParamsInterval&gt;</span><br /><span style="font-family: courier new,courier;">&lt;/AppValues&gt;</span></p>
<p>&nbsp;</p>
<p style="text-align: justify;">Y<span style="font-size: small;">ou can download the SysParams project here:</span></p>
<p style="padding-left: 60px;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinPerfCounterApp/2806.SysParams.zip" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinPerfCounterApp/2806.SysParams.zip"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinPerfCounterApp/8306.zip.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinPerfCounterApp/8306.zip.jpg" alt="" width="84" height="81" border="0" /> <span style="font-size: large;"><strong><span style="font-family: courier new,courier;">SysParams.zip</span></strong></span></a></p>
<p>&nbsp;</p>
<h1 align="left"><span style="color: #000080;">5 Reference</span></h1>
<p><span style="font-size: small;">PhysicalDisk Object: <a href="http://msdn.microsoft.com/en-us/library/ms804035.aspx">http://msdn.microsoft.com/en-us/library/ms804035.aspx</a></span></p>
<p><span style="font-size: small;">Monitoring Threads: <a href="http://technet.microsoft.com/en-us/library/cc776966(v=ws.10).aspx">http://technet.microsoft.com/en-us/library/cc776966(v=ws.10).aspx</a></span></p>
<p><span style="font-size: small;">Memory Object: <a href="http://msdn.microsoft.com/en-us/library/ms804008.aspx">http://msdn.microsoft.com/en-us/library/ms804008.aspx</a></span></p>
<p><span style="font-size: small;"><a href="http://blogs.technet.com/b/askcore/archive/2012/03/16/windows-performance-monitor-disk-counters-explained.aspx">http://blogs.technet.com/b/askcore/archive/2012/03/16/windows-performance-monitor-disk-counters-explained.aspx</a></span></p>
<p align="left">&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Offloading Excel workbook to Azure worker roles</title>
      <link>https://docs.microsoft.com/archive/blogs/faber/offloading-excel-workbook-to-azure-worker-roles</link>
      <pubDate>Thu, 13 Nov 2014 13:59:00 GMT</pubDate>
      <dc:creator><![CDATA[faberspot]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/faber/2014/11/13/offloading-excel-workbook-to-azure-worker-roles/</guid>
      <description><![CDATA[1 Introduction
HPC services for Excel support offloading a Microsoft Excel workbook to a cluster....]]></description>
      <content:encoded><![CDATA[<h1 align="left"><strong><span style="color: #000080;">1 Introduction</span></strong></h1>
<p><span style="font-size: small;">HPC services for Excel support offloading a Microsoft Excel workbook to a cluster. In a burst-to-Windows Azure cluster with Microsoft HPC Pack 2008 R2 onwards, you can now use Windows Azure worker role instances (worker nodes) for Excel offloading instead Azure IaaS VMs.</span></p>
<p><span style="font-size: small;">This blog walks you through the steps to run an Excel workbook in a burst-to-Windows Azure scenario, where the HPC head node runs on Azure IaaS VM while the Compute Nodes are Windows Azure Worker Roles.</span></p>
<p align="left"><span style="font-size: small;">This blog covers the steps for running and Excel Workbook in Azure worker role; in summary the list of actions:</span></p>
<p><span style="font-size: small;">1. Create a VHD which contains un unattended installation of Excel office installation files</span></p>
<p><span style="font-size: small;">2. Upload the VHD to the storage which the burst nodes will deploy into using &ldquo;hpcpack upload&rdquo;</span></p>
<p><span style="font-size: small;">&nbsp;&nbsp;&nbsp; Example:</span></p>
<p><span style="color: #000080; font-size: small;"><strong>&nbsp;&nbsp;&nbsp; hpcpack upload OFFICE.VHD /account:[[storageAccount]] /key:[[storageAccessKey]]</strong></span></p>
<p><span style="font-size: small;">3. Create a cmd to install Excel in unattended mode and copying some HPC DDLs on the worker role</span></p>
<p><span style="font-size: small;"><strong>&nbsp;<span style="color: #000080;">&nbsp;&nbsp; F:\setup.exe /adminfile F:\Updates\ExcelOnly.msp</span></strong></span></p>
<p><span style="font-size: small;"><strong style="color: #000080; font-size: small;">&nbsp;&nbsp;&nbsp; robocopy F:\ E:\approot Microsoft.Hpc.Excel.dll Microsoft.Hpc.Excel.ExcelService.dll Microsoft.Hpc.Excel.ExcelService_1.0.config</strong></span></p>
<p><span style="font-size: small;"><strong style="color: #000080; font-size: small;"></strong>4. Create and upload the cmd to storage</span></p>
<p><span style="font-size: small;">&nbsp;&nbsp;&nbsp; Example:<strong><span style="color: #000080;">&nbsp; </span></strong></span></p>
<p><span style="font-size: small;"><strong><span style="color: #000080;">&nbsp;&nbsp;&nbsp; hpcpack create InstallExcel.zip InstallExcel.cmd</span></strong></span></p>
<p><span style="font-size: small; color: #000080;"><strong>&nbsp;&nbsp;&nbsp; hpcpack upload InstallExcel.zip /account:[[storageAccount]] /key:[[storageAccessKey]]</strong></span></p>
<p><span style="font-size: small;"><strong></strong>5. Create Azure Node Template to mount the VHD and set the startup script to install excel when the work role start</span></p>
<p><span style="font-size: small;">6. Add Azure worker roles using the HPC Azure Node Template, the worker role will install excel automatically</span></p>
<p><span style="font-size: small;">7. To run the Excel workbook, you should pack and upload the workbook the Azure storage</span></p>
<p><span style="font-size: small;">&nbsp;&nbsp;&nbsp; Example:</span></p>
<p align="left"><span style="font-size: small;"><strong><span style="color: #000080;">&nbsp;&nbsp;&nbsp; hpcpack create xxx.zip xxx.xlsm</span></strong></span></p>
<p align="left"><span style="font-size: small; color: #000080;"><strong>&nbsp;&nbsp;&nbsp; hpcpack upload xxx.zip /account:[[storageAccount]] /key:[[storageAccessKey]]</strong></span></p>
<p align="left"><span style="font-size: small;">8. When the Azure nodes are ready, start the workbook in client machine.</span></p>
<p><span style="font-size: small;">Note: In HPC2012 and later releases, you need to add an <span style="font-family: courier new,courier; font-size: medium;"><strong>excel.exe.config</strong></span> in the same folder with <strong>excel.exe</strong> on client machine</span></p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="641">
<p align="center">Content of <span style="font-family: courier new,courier; font-size: medium; color: #000080; background-color: #ffff00;"><strong>excel.exe.config</strong></span> file</p>
</td>
</tr>
<tr>
<td valign="top" width="641">
<p><span style="font-family: courier new,courier; font-size: small; color: #000080;"><strong>&lt;?xml version="1.0"?&gt; </strong></span></p>
<p><span style="font-family: courier new,courier; font-size: small; color: #000080;"><strong>&lt;configuration&gt; </strong></span></p>
<p><span style="font-family: courier new,courier; font-size: small; color: #000080;"><strong>&nbsp;&nbsp; &lt;startup useLegacyV2RuntimeActivationPolicy="true"&gt; </strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: small; color: #000080;"><strong>&nbsp;&nbsp; &lt;supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/&gt; </strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: small; color: #000080;"><strong>&nbsp; &lt;/startup&gt;</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: small; color: #000080;"><strong>&lt;/configuration&gt;</strong></span><strong></strong></p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p align="left">&nbsp;</p>
<h1><strong><span style="color: #000080;">2 Install Windows HPC Head Node on Azure IaaS VM</span></strong></h1>
<p style="text-align: justify;"><span style="font-size: small;">In Azure image gallery is available an image with Windows 2012 R2 Datacenter OS with embedded Windows HPC PACK 2012 R2 Update1. In this image is also pre-installed Microsoft SQL Server 2014 Express, to host the HPC DBs. This image can be used to create the HPC head node in Azure IaaS VM. Recommended VM size for the HPC is A4, but for testing purpose, you can use smaller VM.</span></p>
<p style="text-align: justify;" align="left"><span style="font-size: small;">Before creating the HPC head node in Azure IaaS VM it is good practice:</span></p>
<ul>
<li style="text-align: justify;"><span style="font-size: small;">Define an Azure affinity group (logical group associated with a specific Azure datacenter)</span></li>
<li style="text-align: justify;"><span style="font-size: small;">Create an Azure&nbsp; Storage Account <span style="text-decoration: underline;">in the same datacenter</span> where you spin up the HPC head node</span></li>
<li style="text-align: justify;"><span style="font-size: small;">Create an Azure Virtual Network associate with the affinity group defined before.</span></li>
</ul>
<p style="text-align: justify;" align="left"><span style="font-size: small;">Steps to create a HPC head node in IaaS VM has been described in the blog.</span></p>
<p align="left"><strong><span style="font-size: small;"><a href="http://blogs.msdn.com/b/faber/archive/2014/04/13/burst-to-azure-with-microsoft-hpc-pack-a-step-by-step-configuration-guide.aspx">http://blogs.msdn.com/b/faber/archive/2014/04/13/burst-to-azure-with-microsoft-hpc-pack-a-step-by-step-configuration-guide.aspx</a></span></strong></p>
<p style="text-align: justify;" align="left"><span style="font-size: small;">At this point of time, this blog assume that you have the HPC head node up and running. If you deploy an HPC head node using the <strong>PACK 2012 R2 Update1</strong> available in the Azure image gallery you might check the version of HPC PACK by the HPC Management console:</span></p>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/1106.01.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/1106.01.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/1106.01.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/1106.01.jpg" alt="" width="385" height="221" border="0" /></a>&nbsp;</p>
<p style="text-align: center;">Figure 1: PACK 2012 R2 Update1</p>
<h1><strong><span style="color: #000080;">3 Install Excel on Windows Azure nodes</span></strong></h1>
<p style="text-align: justify;"><span style="font-size: small;">Running an Excel workbook requires Excel to be installed on each compute node. However, an HPC compute node deployed ad Azure worker role is stateless, which means it could be recycled and redeployed in Windows Azure from time to time, and all settings will be discarded. Fortunately, the HPC Windows Azure Node Template provides a way to mount a VHD and execute a startup script when the worker node is started.</span></p>
<p>&nbsp;</p>
<h2><strong><span style="color: #000080;">3.1 Create an unattended Excel installer</span></strong></h2>
<p style="text-align: justify;"><span style="font-size: small;">On your local desktop/laptop you can create an unattended Excel installer. To install Excel in unattended mode follow the official guideline <a href="http://technet.microsoft.com/en-us/library/cc179132.aspx">Office Customization Tool</a>.</span></p>
<p style="text-align: justify;"><span style="font-size: small;">Unattended Office installer produces a .<strong>MSP</strong> file; we choice as name of the MSP file &ldquo;<strong>ExcelOnly.msp</strong>&rdquo; and store it in root folder with the Office setup.exe file.</span></p>
<p><span style="font-size: small;">In my blog</span></p>
<p><span style="font-size: small;"><a href="http://blogs.msdn.com/b/faber/archive/2013/06/14/running-parallel-excel-on-windows-hpc-2008-r2-hosted-in-windows-azure-iaas-vms.aspx">http://blogs.msdn.com/b/faber/archive/2013/06/14/running-parallel-excel-on-windows-hpc-2008-r2-hosted-in-windows-azure-iaas-vms.aspx</a> &nbsp;&nbsp;</span></p>
<p style="text-align: justify;"><span style="font-size: small;">I have shown how to create a custom unattended installation of Excel.</span></p>
<ol>
<li style="text-align: justify;"><span style="font-size: small;"><strong></strong>open the command shell with Administrator right, move in the root folder where Office2010 Administrator credential, run the command: <strong>setup /admin</strong><strong></strong></span></li>
<li style="text-align: justify;"><span style="font-size: small;"><strong></strong>Follow the instruction as in the blog and store the outcome file <strong>ExcelOnly.msp in root installation directory of Office package.</strong><strong></strong></span></li>
</ol>
<p style="text-align: justify;"><span style="font-size: small;">When the operation is completed, you can create a VHD containing all the installation files along with the &ldquo;<strong>ExcelOnly.msp</strong>&rdquo; file and then upload the VHD file to Windows Azure storage blob.</span></p>
<p>&nbsp;</p>
<h2><strong><span style="color: #000080;">3.2 Create a VHD file</span></strong></h2>
<p style="text-align: justify;"><span style="font-size: small;">On your local desktop/laptop, open Disk Management (click <strong>Start</strong>, type <strong>diskmgmt.msc</strong>, and then press ENTER; this operation open the Disk Management MMC snap-in).</span></p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/2867.02.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/2867.02.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/2867.02.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/2867.02.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 2: Disk Management snap-in</p>
<p style="text-align: justify;"><span style="font-size: small;">Select <strong>Create VHD</strong> from the <strong>Action</strong> menu</span></p>
<p>&nbsp;</p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/7128.03.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/7128.03.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/7128.03.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/7128.03.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 3: Create a new VHD</p>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/8231.04.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/8231.04.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/8231.04.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/8231.04.jpg" alt="" width="417" height="505" border="0" /></a>&nbsp;</p>
<p style="text-align: center;">Figure 4: specify the format of VHD file</p>
<ul>
<li style="text-align: justify;"><span style="font-size: small;"><strong>Location</strong>: This is the location and file name where the new VHD will be saved when it is created</span></li>
<li><span style="font-size: small;"><strong>Virtual hard disk size</strong>: This is the size of the VHD; keep the default (<strong>Fixed size</strong>)</span></li>
</ul>
<p align="center">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/3884.05.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/3884.05.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/3884.05.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/3884.05.jpg" alt="" width="443" height="532" border="0" /></a></p>
<p style="text-align: center;">Figure 5: define location and size of VHD</p>
<p style="text-align: justify;"><span style="font-size: small;">At this stage, the VHD is attached and appears as an <em>uninitialized</em> disk.</span></p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/3058.06.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/3058.06.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/3058.06.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/3058.06.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 6: Volume before initialization</p>
<p>&nbsp;</p>
<p style="text-align: justify;"><span style="font-size: small;">To initialize the disk, right-click the disk name in the <strong>Disk Management</strong> pane and click <strong>Initialize Disk</strong></span></p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/5355.07.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/5355.07.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/5355.07.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/5355.07.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 7: initialize the VHD disk</p>
<p>&nbsp;</p>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/0218.08.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/0218.08.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/0218.08.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/0218.08.jpg" alt="" border="0" /></a>&nbsp;</p>
<p style="text-align: center;">Figure 8: define the partition style of VHD</p>
<p>&nbsp;</p>
<p style="text-align: justify;"><span style="font-size: small;">After initializing the VHD, you can format and assign a drive letters to the volume.</span></p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/6470.09.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/6470.09.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/6470.09.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/6470.09.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 9: VHD volume after initialization</p>
<p>&nbsp;</p>
<p style="text-align: justify;"><span style="font-size: small;">Right-click on the unallocated space and choice <strong>New Simple Volume</strong>. Follow the instructions in the <strong>New Simple Volume Wizard</strong> to select the volume size, drive letter, format, and disk block size.</span></p>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/5810.10.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/5810.10.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/5810.10.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/5810.10.jpg" alt="" border="0" /></a>&nbsp;</p>
<p style="text-align: center;">Figure 10: create a new Simple Volume</p>
<p>&nbsp;</p>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/1300.11.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/1300.11.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/1300.11.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/1300.11.jpg" alt="" width="504" height="393" border="0" /></a>&nbsp;</p>
<p style="text-align: center;">Figure 11: define volume size</p>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/2465.12.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/2465.12.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/2465.12.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/2465.12.jpg" alt="" width="501" height="392" border="0" /></a>&nbsp;</p>
<p style="text-align: center;">Figure 12: &nbsp;assign a drive letter to the volume</p>
<p>&nbsp;</p>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/5773.13.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/5773.13.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/5773.13.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/5773.13.jpg" alt="" width="503" height="392" border="0" /></a>&nbsp;</p>
<p style="text-align: center;">Figure 13: specify the file system for the volume</p>
<p>&nbsp;</p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/0458.14.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/0458.14.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/0458.14.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/0458.14.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 14: new volume online</p>
<p>&nbsp;</p>
<h2><strong><span style="color: #000080;">3.3 Copy the Office package in the VHD Volume</span></strong></h2>
<p style="text-align: justify;"><span style="font-size: small;">Copy all the Office installation package (including the file <strong>ExcelOnly.msp</strong>) inside the VHD Volume.</span></p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/3007.15.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/3007.15.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/3007.15.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/3007.15.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 15: copying the Office installation package in the VHD volume</p>
<p>&nbsp;</p>
<h2><strong><span style="color: #000080;">3.4 Move the VHD volume offline and detach</span></strong></h2>
<p style="text-align: justify;"><span style="font-size: small;">The volume needs to be move in offline and therefore detached</span></p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/7610.16.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/7610.16.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/7610.16.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/7610.16.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 16: Detach the VHD volume</p>
<h2><strong><span style="color: #000080;">3.5 Copy the .VHD file in Azure storage blob</span></strong></h2>
<p style="text-align: justify;"><span style="font-size: small;">To copy the OFFICE.VHD file (containing the Office installation package) in Azure storage, you can use AZCOPY command line <a href="https://aka.ms/AzCopy">https://aka.ms/AzCopy</a>:</span></p>
<pre class="scroll"><span style="font-family: courier new,courier; color: #000080;"><strong><code class="php">AzCopy /Source:C:\tmp /Dest:https://<em><span style="background-color: #ffff00;">&lt;NameStorageAccount&gt;</span></em>.blob.core.windows.net/excel /DestKey:<em><span style="background-color: #ffff00;">&lt;AzureStorageKey&gt;</span></em> /pattern:Office.VHD</code></strong></span></pre>
<p style="text-align: justify;">&nbsp;<span style="font-size: small;">To run the command you need to replace with name and key of your Azure Storage Account:</span></p>
<ul>
<li style="text-align: justify;"><span style="font-size: small;"><span style="background-color: #ffff00;"><strong><em>&lt;NameStorageAccount&gt;</em></strong></span><em> : </em>your Azure Storage account name</span></li>
<li style="text-align: justify;"><span style="font-size: small;"><span style="background-color: #ffff00;"><strong><em>&lt;AzureStorageKey</em></strong></span><em><span style="background-color: #ffff00;">&gt;</span>: </em>primary key of your Azure Storage account</span></li>
</ul>
<p>&nbsp;</p>
<h2><strong><span style="color: #000080;">3.6 Move the VHD in the HPC head node an add some .DLL to it</span></strong></h2>
<p style="text-align: justify;"><span style="font-size: small;">Now that <strong>OFFICE.VHD </strong>is in Azure Storage account use AZCOPY to transfer the VHD file from the Azure storage blob to the HPC head node. (Note: AZCOPY is already installed by default in the HPC head node, in the folder <strong>C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy</strong> ):</span></p>
<pre class="scroll"><span style="font-family: courier new,courier; font-size: medium; color: #000080;"><strong><code class="php">AzCopy /Source:https://<em>&lt;NameStorageAccount&gt;</em>.blob.core.windows.net/excel /Dest:C:\Users\toor\Desktop\Office1 /SourceKey:<em>&lt;AzureStorageKey&gt;</em> /pattern:Office.VHD</code></strong></span></pre>
<p style="text-align: justify;">&nbsp;</p>
<h2><strong><span style="color: #000080;">3.7 Add some .DLL to the VHD file</span></strong></h2>
<p><span style="font-size: small;">To run Excel you need to copy some .DLLs in the VHD.</span></p>
<p><span style="font-size: small;">On the HPC head node you can simply mount the <strong>OFFICE.VHD</strong> with simple click-on from Windows explorer.</span></p>
<p>&nbsp;</p>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/7853.17.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/7853.17.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/7853.17.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/7853.17.jpg" alt="" border="0" /></a>&nbsp;</p>
<p style="text-align: center;">Figure 17: double click on the OFFICE.VHD to mount the volume</p>
<p>&nbsp;</p>
<p align="center">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/4431.18.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/4431.18.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/4431.18.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/4431.18.jpg" alt="" width="487" height="198" border="0" /></a></p>
<p style="text-align: center;">Figure 18: list of files in OFFICE.VHD mounted on the head node</p>
<p>&nbsp;</p>
<p><span style="font-size: small;">The <strong>OFFICE.VHD</strong> is automatically mounted ad driver <strong>F:</strong></span></p>
<p><span style="font-size: small;">Here a list of DDL files for Excel to be considered:</span></p>
<pre class="scroll"><span style="font-family: courier new,courier; font-size: medium; color: #000080;"><strong><code class="php">%systemroot%\Microsoft.NET\assembly\GAC_MSIL\Microsoft.Hpc.Excel\v4.0_2.0.0.0__31bf3856ad364e35\Microsoft.Hpc.Excel.dll<br />%ccp_home%bin\Microsoft.Hpc.Excel.ExcelService.dll<br />%ccp_home%bin\Microsoft.Hpc.Excel.Internal.dll<br />%ccp_home%bin\Microsoft.Hpc.Excel.tlb<br />%ccp_home%bin\Microsoft.Hpc.Trace.dll<br />%ccp_home%bin\CosmosLoggingManaged.dll<br />%ccp_home%bin\XLL64\Microsoft.Hpc.Excel.XllContainer64.dll<br />%ccp_home%bin\XLL64\Microsoft.Hpc.Excel.XllConnector.dll<br />%ccp_home%ServiceRegistration\Microsoft.Hpc.Excel.ExcelService_1.0.config<br />%ccp_home%ServiceRegistration\Microsoft.Hpc.Excel.XllContainer64_1.2.config</code></strong></span></pre>
<p>&nbsp;</p>
<p><span style="font-size: small;">Only three DLLs need to be copied in root of VHD volume:</span></p>
<pre class="scroll"><strong><span style="color: #000080; font-size: medium; font-family: courier new,courier;"><code class="php">%systemroot%\Microsoft.NET\assembly\GAC_MSIL\Microsoft.Hpc.Excel\v4.0_2.0.0.0__31bf3856ad364e35\Microsoft.Hpc.Excel.dll<br />%ccp_home%bin\Microsoft.Hpc.Excel.ExcelService.dll<br />%ccp_home%ServiceRegistration\Microsoft.Hpc.Excel.ExcelService_1.0.config</code></span></strong></pre>
<p><span style="font-size: small; font-family: 'courier new', courier; color: #000080;"><strong><br /></strong></span></p>
<p><span style="font-size: small;">To copy the DLLs you might use the robocopy command:</span></p>
<pre class="scroll"><span style="color: #000080; font-size: medium; font-family: courier new,courier;"><strong><code class="php">robocopy %systemroot%\Microsoft.NET\assembly\GAC_MSIL\Microsoft.Hpc.Excel\v4.0_2.0.0.0__31bf3856ad364e35\ F:\ Microsoft.Hpc.Excel.dll<br />robocopy "%ccp_home%bin" F:\ Microsoft.Hpc.Excel.ExcelService.dll <br />robocopy "%ccp_home%ServiceRegistration" F:\ Microsoft.Hpc.Excel.ExcelService_1.0.config</code></strong></span></pre>
<p>&nbsp;</p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/3007.19.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/3007.19.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/3007.19.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/3007.19.jpg" alt="" width="411" height="519" border="0" /></a></p>
<p style="text-align: center;">Figure 19: list of DLL files copied in OFFICE.VHD</p>
<p>&nbsp;</p>
<p><span style="font-size: small;">We can now dismount the <strong>OFFICE.VHD</strong> volume by eject:</span></p>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/5621.20.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/5621.20.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/5621.20.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/5621.20.jpg" alt="" width="440" height="699" border="0" /></a>&nbsp;</p>
<p style="text-align: center;">Figure 20: Eject the volume OFFICE.VHD</p>
<p>&nbsp;</p>
<h2><strong><span style="color: #000080;">3.8 Create a script to install Excel</span></strong></h2>
<p><span style="font-size: small;">You need to create a script to install OFFICE.VHD when the worker nodes start up. If &ldquo;<strong>setup.exe</strong>&rdquo; and &ldquo;<strong>ExcelOnly.msp</strong>&rdquo; are in the root directory of the <strong>OFFICE.VHD</strong> you can simply use the following command line:</span></p>
<pre class="scroll"><span style="font-size: medium; font-family: courier new,courier;"><strong><span style="color: #000080;"><code class="php">%CCP_APPDRIVE%setup.exe /adminfile %CCP_APPDRIVE%ExcelOnly.msp<br />robocopy %CCP_APPDRIVE% %CCP_HOME% Microsoft.Hpc.Excel.dll Microsoft.Hpc.Excel.ExcelService.dll Microsoft.Hpc.Excel.ExcelService_1.0.config</code></span></strong></span></pre>
<p>&nbsp;<span style="font-size: small;">Uses the environment variables <strong>%CCP_APPDRIVE%</strong> and <strong>%CCP_HOME%</strong></span></p>
<p><span style="font-size: small;">Save the above command line to <strong>installExcel.cmd</strong>.</span></p>
<p>&nbsp;</p>
<h2><strong><span style="color: #000080;">3.9 Use the hpcpack to package the script</span></strong></h2>
<p><span style="font-size: small;">On the HPC head node use the <a href="http://technet.microsoft.com/library/gg481764(v=ws.10).aspx">hpcpack</a> command to package the script &ldquo;<strong>installExcel.cmd</strong>&rdquo;:</span></p>
<pre class="scroll"><span style="font-family: courier new,courier; color: #000080; font-size: medium;"><strong><code class="cplusplus">hpcpack create installExcel.zip installExcel.cmd</code></strong></span></pre>
<p>&nbsp;</p>
<h2><strong><span style="color: #000080;">3.10 Use the hpcpack to upload the script and VHD file in Azure Storage account</span></strong></h2>
<p><span style="font-size: small;">Upload the &ldquo;<strong>installExcel.zip&rdquo;</strong> to the Azure storage account that is used for deploying the Azure nodes:</span></p>
<pre class="scroll"><span style="color: #000080;"><strong><span style="font-family: courier new,courier; font-size: medium;"><code class="php">hpcpack upload installExcel.zip /account:&lt;NameStorageAccount&gt; /key:&lt;AzureStorageKey&gt;<br /><br class="php" /></code></span></strong></span></pre>
<p><span style="font-size: small;">Upload the &ldquo;<strong>OFFICE.VHD&rdquo; </strong>file containing the Office installation package in Azure Storage account</span></p>
<pre class="scroll"><span style="font-size: medium; font-family: courier new,courier; color: #000080;"><strong><code class="php">hpcpack upload Office.VHD /account: &lt;NameStorageAccount&gt; /key:&lt;AzureStorageKey&gt;<br /><br class="php" /></code></strong></span></pre>
<h2><strong><span style="color: #000080;">3.11 Create an Azure Cloud Services to guest HPC worker role</span></strong></h2>
<p><span style="font-size: small;">To host the HPC worker role is required a new Azure Cloud Services.</span></p>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/8015.21.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/8015.21.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/8015.21.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/8015.21.jpg" alt="" border="0" /></a>&nbsp;</p>
<p style="text-align: center;">Figure 21: Create a new Cloud Services to host the HPC worker roles</p>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/8750.22.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/8750.22.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/8750.22.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/8750.22.jpg" alt="" border="0" /></a>&nbsp;</p>
<p style="text-align: center;">Figure 22: name and affinity associated with the new cloud Services</p>
<p>&nbsp;</p>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/1261.23.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/1261.23.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/1261.23.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/1261.23.jpg" alt="" width="464" height="302" border="0" /></a>&nbsp;</p>
<p style="text-align: center;">Figure 22: name and affinity associated with the new cloud Services</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/0020.24.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/0020.24.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/0020.24.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/0020.24.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 23: new available Azure Cloud Service</p>
<p>&nbsp;</p>
<h2><strong><span style="color: #000080;">3.12 Create an HPC Azure node template to mount the VHD and execute the startup script</span></strong></h2>
<p style="text-align: justify;"><span style="font-size: small;">Open the HPC management console and create a Windows Azure node template (i.e. assign the name &ldquo;<strong>AzureNodeExcel</strong>&rdquo;). You can just follow the guidance of the <strong>Create Node Template</strong> Wizard as usual, as long as you specify the same storage account that you used for uploading the Excel installer. When configuring the HPC worker role in the HPC Node Template, you should choose to mount the VHD you just made.</span></p>
<p style="text-align: justify;">&nbsp;</p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/6683.25.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/6683.25.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/6683.25.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/6683.25.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 24: choice &ldquo;<strong>New</strong>&rdquo; in actions pane to create a new Node template</p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/3252.26.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/3252.26.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/3252.26.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/3252.26.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 25: select the Windows Azure Node Template</p>
<p align="center">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/6014.27.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/6014.27.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/6014.27.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/6014.27.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 26: specify a name for the new Node Template</p>
<p style="text-align: center;">&nbsp;</p>
<p align="center">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/5367.28.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/5367.28.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/5367.28.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/5367.28.jpg" alt="" border="0" /></a></p>
<p align="center">Figure 27: browse in the list of management certificate</p>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/5165.29.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/5165.29.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/5165.29.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/5165.29.jpg" alt="" width="394" height="546" border="0" /></a></p>
<p style="text-align: center;">Figure 28: select a digital certificate loaded in the Azure subscription</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/4137.30.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/4137.30.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/4137.30.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/4137.30.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 29: specify the Azure subscription ID where we want spin up the HPC worker roles</p>
<p>&nbsp;&nbsp;</p>
<p><span style="font-size: small;">The same digital certificate selected in the Azure node template need to be loaded in the Azure subscription</span></p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/4135.29B.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/4135.29B.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/4135.29B.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/4135.29B.jpg" alt="" width="582" height="154" border="0" /></a></p>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/0777.31.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/0777.31.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/0777.31.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/0777.31.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 30: select the cloud service and storage account used to deploy Azure worker roles</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/7065.32.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/7065.32.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/7065.32.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/7065.32.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 31: specify the size and number of proxy nodes</p>
<p>&nbsp;</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/0675.33.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/0675.33.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/0675.33.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/0675.33.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 32: select the OFFICE.VHD available in Azure storage and the OS version used to deploy the HPC worker roles</p>
<p>&nbsp;</p>
<p><span style="font-size: small;">On the <strong>Specify startup script</strong> page, fill in &ldquo;<strong>installExcel.cmd</strong>&rdquo;.</span></p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/0336.34.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/0336.34.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/0336.34.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/0336.34.jpg" alt="" width="590" height="382" border="0" /></a></p>
<p style="text-align: center;">Figure 33: specify the command to install on the HPC worker roles Excel in unattended mode</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/6283.35.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/6283.35.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/6283.35.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/6283.35.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 34: specify an optional virtual network where HPC worker roles needs to be attached</p>
<p>&nbsp;</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/2728.36.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/2728.36.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/2728.36.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/2728.36.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 35: specify the administrator credential for the HPC worker roles</p>
<p>&nbsp;</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/2465.37.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/2465.37.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/2465.37.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/2465.37.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 36: select the way to spin-up the Azure worker roles</p>
<p>&nbsp;</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/2642.38.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/2642.38.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/2642.38.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/2642.38.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 37: summary of the new Node Template for the worker roles</p>
<p>&nbsp;</p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/5123.39.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/5123.39.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/5123.39.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/5123.39.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 38: Node template used to deploy worker roles with Excel</p>
<p>&nbsp;</p>
<p><span style="font-size: small;">After Azure Node template is created, you can add HPC worker roles to the HPC cluster using the template.</span></p>
<p>&nbsp;</p>
<h2><strong><span style="color: #000080;">3.13 Add Node</span></strong></h2>
<p><span style="font-size: small;">In the HPC Management Console select <strong>Node Management</strong> and therefore in <strong>Actions</strong> pane choice <strong>Add Node</strong></span></p>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/7318.40.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/7318.40.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/7318.40.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/7318.40.jpg" alt="" width="208" height="469" border="0" /></a></p>
<p style="text-align: center;">Figure 39: add a new Compute Nodes to the HPC cluster</p>
<p>&nbsp;</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/5023.41.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/5023.41.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/5023.41.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/5023.41.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 40: option to add new HPC worker roles to the cluster</p>
<p>&nbsp;</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/2450.42.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/2450.42.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/2450.42.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/2450.42.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 41: select the Azure Node Template, number and size of the worker roles</p>
<p>&nbsp;</p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/5722.43.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/5722.43.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/5722.43.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/5722.43.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 42: worker roles appear as un-deployed in list of nodes</p>
<p>&nbsp;</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/3240.44.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/3240.44.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/3240.44.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/3240.44.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 43: click-on <strong>Start</strong> command to deploy the worker roles with policy define in Azure Node Template</p>
<p>&nbsp;</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/1401.45.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/1401.45.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/1401.45.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/1401.45.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 44: after successful deployment of HPC worker roles the nodes are move in Offline state</p>
<p>&nbsp;</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/3036.46.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/3036.46.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/3036.46.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/3036.46.jpg" alt="" width="629" height="222" border="0" /></a>&nbsp;</p>
<p style="text-align: center;">Figure 45: list of nodes belonging to the cloud service (proxies and worker roles)</p>
<p>&nbsp;</p>
<p><span style="font-size: small;">In the table below a successful deployment of an HPC worker role.</span></p>
<table style="width: 834px; height: 762px; border-color: #990033; border-width: 0px; border-style: solid; background-color: #deffde;" border="0" frame="box" rules="all">
<tbody>
<tr>
<td>
<p align="left"><strong><span style="font-family: 'courier new',courier; font-size: x-small;">Time&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Message</span></strong></p>
<p align="left"><strong><span style="font-family: 'courier new',courier; font-size: x-small;">11/12/2014 7:37:00 PM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Moving node AZURE\AzureCN-0004 from state Provisioning to state Offline</span></strong></p>
<p align="left"><strong><span style="font-family: 'courier new',courier; font-size: x-small;">11/12/2014 7:37:00 PM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Node AZURE\AzureCN-0004 has become available</span></strong></p>
<p align="left"><strong><span style="font-family: 'courier new',courier; font-size: x-small;">11/12/2014 7:36:00 PM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Moving node AZURE\AzureCN-0005 from state Provisioning to state Offline</span></strong></p>
<p align="left"><strong><span style="font-family: 'courier new',courier; font-size: x-small;">11/12/2014 7:36:00 PM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Node AZURE\AzureCN-0005 has become available</span></strong></p>
<p align="left"><strong><span style="font-family: 'courier new',courier; font-size: x-small;">11/12/2014 7:32:01 PM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Updating scheduler data for node AZURE\AzureCN-0004</span></strong></p>
<p align="left"><strong><span style="font-family: 'courier new',courier; font-size: x-small;">11/12/2014 7:32:01 PM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Updating the scheduler configuration for node AZURE\AzureCN-0004</span></strong></p>
<p align="left"><strong><span style="font-family: 'courier new',courier; font-size: x-small;">11/12/2014 7:32:01 PM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Updating scheduler data for node AZURE\AzureCN-0005</span></strong></p>
<p align="left"><strong><span style="font-family: 'courier new',courier; font-size: x-small;">11/12/2014 7:32:01 PM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Updating the scheduler configuration for node AZURE\AzureCN-0005</span></strong></p>
<p align="left"><strong><span style="font-family: 'courier new',courier; font-size: x-small;">11/12/2014 7:32:00 PM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Updating the scheduler configuration for creating deployment a122af35-b0f5-4fed-af16-cc2b49f75809.</span></strong></p>
<p align="left"><strong><span style="font-family: 'courier new',courier; font-size: x-small;">11/12/2014 7:32:00 PM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Windows Azure operation succeeded</span></strong></p>
<p align="left"><strong><span style="font-family: 'courier new',courier; font-size: x-small;">11/12/2014 7:31:04 PM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Waiting for Windows Azure deployment to start</span></strong></p>
<p align="left"><strong><span style="font-family: 'courier new',courier; font-size: x-small;">11/12/2014 7:31:04 PM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The Operation Id for transitioning Windows Azure deployment to state Running is bdf62bcf89232ca4992bbbaa8a7beb72</span></strong></p>
<p align="left"><strong><span style="font-family: 'courier new',courier; font-size: x-small;">11/12/2014 7:31:03 PM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Transitioning Windows Azure deployment to the Running state</span></strong></p>
<p align="left"><strong><span style="font-family: 'courier new',courier; font-size: x-small;">11/12/2014 7:31:00 PM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Windows Azure operation succeeded</span></strong></p>
<p align="left"><strong><span style="font-family: 'courier new',courier; font-size: x-small;">11/12/2014 7:30:04 PM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Waiting for Windows Azure deployment creation to complete</span></strong></p>
<p align="left"><strong><span style="font-family: 'courier new',courier; font-size: x-small;">11/12/2014 7:30:03 PM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Configuring HPC cluster storage in Windows Azure</span></strong></p>
<p align="left"><strong><span style="font-family: 'courier new',courier; font-size: x-small;">11/12/2014 7:30:02 PM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Windows Azure deployment started: a122af35-b0f5-4fed-af16-cc2b49f75809. Operation Id for this deployment is 5b6d4602717a24d08f63c1491919ff2f</span></strong></p>
<p align="left"><strong><span style="font-family: 'courier new',courier; font-size: x-small;">11/12/2014 7:30:02 PM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Deployment a122af35-b0f5-4fed-af16-cc2b49f75809 is locked.</span></strong></p>
<p align="left"><strong><span style="font-family: 'courier new',courier; font-size: x-small;">11/12/2014 7:29:54 PM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Starting Windows Azure deployment</span></strong></p>
<p align="left"><strong><span style="font-family: 'courier new',courier; font-size: x-small;">11/12/2014 7:29:54 PM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Creating snapthot for VHD blob https://ffhpcstorage01.blob.core.windows.net/hpcpackages-36a153ea-f6f6-4df2-924c-4262851cf440/office.vhd</span></strong></p>
<p align="left"><strong><span style="font-family: 'courier new',courier; font-size: x-small;">11/12/2014 7:29:47 PM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Uploading HPC cluster certificate to Windows Azure storage</span></strong></p>
<p align="left"><strong><span style="font-family: 'courier new',courier; font-size: x-small;">11/12/2014 7:29:41 PM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Uploading Windows Azure proxy certificate to the Windows Azure certificate store</span></strong></p>
<p align="left"><strong><span style="font-family: 'courier new',courier; font-size: x-small;">11/12/2014 7:29:39 PM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HPC runtime uploaded successfully</span></strong></p>
<p align="left"><strong><span style="font-family: 'courier new',courier; font-size: x-small;">11/12/2014 7:29:38 PM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Uploading the HPC cluster runtime package to Windows Azure storage</span></strong></p>
<p align="left"><strong><span style="font-family: 'courier new',courier; font-size: x-small;">11/12/2014 7:29:38 PM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HPC runtime is missing from Windows Azure storage</span></strong></p>
<p align="left"><strong><span style="font-family: 'courier new',courier; font-size: x-small;">11/12/2014 7:29:38 PM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Generated HPC runtime package</span></strong></p>
<p align="left"><strong><span style="font-family: 'courier new',courier; font-size: x-small;">11/12/2014 7:29:28 PM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Moving node AZURE\AzureCN-0004 from state Not-Deployed to state Provisioning</span></strong></p>
<p align="left"><strong><span style="font-family: 'courier new',courier; font-size: x-small;">11/12/2014 7:29:28 PM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Moving node AZURE\AzureCN-0005 from state Not-Deployed to state Provisioning</span></strong></p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/5367.47.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/5367.47.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/5367.47.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/5367.47.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 46: Bring the HPC worker roles Online</p>
<p>&nbsp;</p>
<p><span style="font-size: small;">When the entire HPC node are <strong>Online</strong>, the cluster is ready to run HPC jobs.</span></p>
<p>&nbsp;</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/4478.48.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/4478.48.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/4478.48.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/4478.48.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 47: all the HPC nodes are Online</p>
<p>&nbsp;</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/3652.49.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/3652.49.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/3652.49.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/3652.49.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 48: connect to the Azure worker role through Remote Desktop</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/0131.50.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/0131.50.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/0131.50.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/0131.50.jpg" alt="" border="0" /></a>&nbsp;</p>
<p style="text-align: center;">Figure 49: GUI to connect via RDP to the HPC worker roles</p>
<p>&nbsp;</p>
<h2><strong><span style="color: #000080;">3.14 Install Excel 2010 on the HPC client</span></strong></h2>
<p><span style="font-size: small;">In production environment is recommended run HPC head node and HPC client node on different hosts. In our case HPC client runs on the HPC head node.</span></p>
<p><span style="font-size: small;">To install Excel mount the OFFICE.VHD, open a command shell and change the driver (F:)</span></p>
<p><span style="font-size: small;">Run the command for unattended Excel 2010 installation:</span></p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="641">
<p><span style="color: #000080; font-family: 'courier new', courier; font-size: small;"><strong>setup.exe /adminfile ExcelOnly.msp</strong></span></p>
</td>
</tr>
</tbody>
</table>
<p><span style="font-size: small;">After unattended installation, eject the OFFICE.VHD volume</span></p>
<p>&nbsp;</p>
<h2><strong><span style="color: #000080;">3.15 Create a file in HPC client</span></strong></h2>
<p><span style="font-size: small;">For HPC 2012 and later version, you need to add an <strong>excel.exe.config</strong> in the same folder with excel.exe on HPC client.</span></p>
<p><span style="font-size: small;">The content of <strong>excel.exe.config</strong> is:</span></p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="641">
<p><span style="font-family: 'courier new', courier;"><strong>&lt;?xml version="1.0"?&gt; </strong></span></p>
<p><span style="font-family: 'courier new', courier;"><strong>&lt;configuration&gt; </strong></span></p>
<p><span style="font-family: 'courier new', courier;"><strong>&nbsp; &lt;startup useLegacyV2RuntimeActivationPolicy="true"&gt; </strong></span></p>
<p><span style="font-family: 'courier new', courier;"><strong>&nbsp;&nbsp;&nbsp; &lt;supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/&gt; </strong></span></p>
<p><span style="font-family: 'courier new', courier;"><strong>&nbsp; &lt;/startup&gt;</strong></span></p>
<p><span style="font-family: 'courier new', courier;"><strong>&lt;/configuration&gt;</strong></span></p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p><span style="font-size: small;"><strong>excel.exe</strong> file is located by default in the folder:&nbsp;<span style="color: #000080;"><strong>C:\Program Files\Microsoft Office\Office14</strong></span></span></p>
<p><span style="font-size: small;">Run our Excel workbook without this file causes the following message:</span></p>
<p align="center"><br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/6281.51.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/6281.51.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/6281.51.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/6281.51.jpg" alt="" width="295" height="172" border="0" /></a>&nbsp;</p>
<p style="text-align: center;">Figure 50: error in Excel worksheet due to missing<strong> excel.exe.config </strong>file in the HPC client</p>
<p>&nbsp;</p>
<h2><strong><span style="color: #000080;">3.16 Deployment of Excel workbook on the worker role</span></strong></h2>
<p style="text-align: justify;"><span style="font-size: small;"><strong>hpcpack</strong> is a tool provided with Windows HPC Server which packages files for staging on Azure worker roles.&nbsp; You can use it to package HPC services or regular files.&nbsp; A &ldquo;package&rdquo; is just a zip file with some additional metadata used for installation.&nbsp; The hpcpack tool is used both to create packages and to upload those packages to Azure storage.</span></p>
<p style="text-align: justify;"><span style="font-size: small;">When you start Azure worker nodes in the HPC Cluster Manager, any software which has been previously staged &ndash; including SOA services and file packages &ndash; will be automatically installed on the nodes.&nbsp; This is done when the nodes are started, using a tool called <strong>hpcsync</strong>.&nbsp; Any package which has been created and uploaded using hpcpack will be automatically installed on startup.</span></p>
<p style="text-align: justify;"><span style="font-size: small;">If the nodes are already running, using hpcpack you can create or modify a package, and therefore by hpcsync you can ensure that the latest package version is installed on your HPC worker Roles.&nbsp; We will use hpcpack and hpcsync to move files to the Azure cloud and configure the Azure worker roles.</span></p>
<p style="text-align: justify;"><span style="font-size: small;">After you create an Excel workbook to run on the HPC cluster, you should pack it (by the command &ldquo;<strong>hpcpack create</strong>&rdquo;), upload it to Windows Azure storage (by the command &ldquo;<strong>hpcpack upload&rdquo;</strong>), and sync it to all Windows Azure worker roles (by the command &ldquo;<strong>clusrun hpcsync&rdquo;</strong>).</span></p>
<h3><strong><span style="color: #000080;">3.16.1 Package the Excel file</span></strong></h3>
<p style="text-align: justify;"><span style="font-size: small;">Packaging is done on the HPC client. In our setup the HPC client is the head node, but in production you can use a different host join to the AD DC. In our case the Excel workbook is named <strong>CP1.xlsb</strong></span></p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="641">
<p><span style="font-family: 'courier new', courier; font-size: small; color: #000080;"><strong>hpcpack create CP1.zip CP1.xlsb</strong></span></p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<h3><strong><span style="color: #000080;">3.16.2 Transfer the package in Azure Storage<br /></span></strong></h3>
<p align="left">&nbsp;Command to transfer the package to the Azure Storage</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="641">
<p align="left"><span style="font-family: 'courier new', courier; font-size: small; color: #000080;"><strong>hpcpack upload CP1.zip /account:<em>&lt;NameStorageAccount&gt;</em></strong><em> </em>&nbsp;<strong>&nbsp;/key:<em>&lt;AzureStorageKey</em></strong><em>&gt;</em></span></p>
</td>
</tr>
</tbody>
</table>
<p align="left">&nbsp;</p>
<h3><strong><span style="color: #000080;">3.16.3 Synchronization between Azure Storage and HPC Worker Roles<br /></span></strong></h3>
<p style="text-align: justify;"><span style="font-size: small;">To sync all HCP worker roles with Windows Azure Storage runs the command:</span></p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="641">
<p><span style="font-size: small; font-family: 'courier new', courier; color: #000080;"><strong>clusrun /nodegroup:AzureNodes hpcsync</strong></span></p>
</td>
</tr>
</tbody>
</table>
<p style="text-align: justify;"><span style="font-size: small;">Then you can run the Excel workbook in the usual way and the calculation will be distributed on the cluster. Whenever if you modify the workbook, or create a new one, you need to repeat the steps to package, upload to Azure Storage and synchronizing the package from the Azure Store to HPC worker roles.</span></p>
<p>&nbsp;</p>
<h2><strong><span style="color: #000080;">3.17 Run a basic multiplication table on HPC cluster</span></strong></h2>
<p style="text-align: justify;"><span style="font-size: small;">The primary benefit of this model is that it requires no extra software (just Excel and the HPC client utilities). The main limitation of this model is that it requires Administrator permissions to move the spreadsheet to the cloud.&nbsp; That means that regular users won&rsquo;t be able to install new or modified spreadsheets themselves. Another benefit of this approach is that in many cases it will be the fastest way to use Excel and Azure. Because the spreadsheet is already present on the worker roles, the calculation can start almost immediately &ndash; it does not have to copy the spreadsheet before it starts running.</span></p>
<p style="text-align: justify;">As basic example to run an Excel cluster on HPC, we use the same Excel workbook described in the blog:</p>
<p><strong><a href="http://blogs.msdn.com/b/faber/archive/2013/07/04/running-parallel-excel-on-windows-hpc-2008-r2-hosted-in-windows-azure-iaas-vms-part-2.aspx">http://blogs.msdn.com/b/faber/archive/2013/07/04/running-parallel-excel-on-windows-hpc-2008-r2-hosted-in-windows-azure-iaas-vms-part-2.aspx</a></strong></p>
<p style="text-align: justify;" align="center">&nbsp;<span style="font-size: small;">To run the Excel workbook in Azure worker roles, you need to change the VM macro:<strong> HPCControlMacros</strong></span></p>
<pre class="scroll"><code class="cplusplus"><span style="font-family: courier new,courier; font-size: small;">'==========================================================</span><br /><span style="font-family: courier new,courier; font-size: small;"> ' This is a skeleton macro file for using the HPC/Excel</span><br /><span style="font-family: courier new,courier; font-size: small;"> ' VBA macros with an HPC cluster.</span><br /><span style="font-family: courier new,courier; font-size: small;"> '</span><br /><span style="font-family: courier new,courier; font-size: small;"> ' Be sure to add references to the required component:</span><br /><span style="font-family: courier new,courier; font-size: small;"> ' Microsoft_Hpc_Excel</span><br /><span style="font-family: courier new,courier; font-size: small;"> ' using the VBA editor menu Tools -&gt; References.</span><br /><span style="font-family: courier new,courier; font-size: small;"> '</span><br /><span style="font-family: courier new,courier; font-size: small;"> '==========================================================</span><br /><span style="font-family: courier new,courier; font-size: small;"> <strong>Option Explicit</strong></span><br /> <br /><span style="font-family: courier new,courier; font-size: small;"> '----------------------------------------------------------</span><br /><span style="font-family: courier new,courier; font-size: small;"> ' This is the cluster scheduler, or head node. </span><br /><span style="font-family: courier new,courier; font-size: small;"> '----------------------------------------------------------</span><br /><span style="font-family: courier new,courier; font-size: small;"> <strong>Private Const HPC_ClusterScheduler = "HEADNODE"</strong></span><br /> <br /><span style="font-family: courier new,courier; font-size: small;"> '----------------------------------------------------------</span><br /><span style="font-family: courier new,courier; font-size: small;"> ' Job Template</span><br /><span style="font-family: courier new,courier; font-size: small;"> '----------------------------------------------------------</span><br /><span style="font-family: courier new,courier; font-size: small;"> <strong>Private Const Azure_JobTemplate = "Default"</strong></span><br /> <br /><span style="font-family: courier new,courier; font-size: small;"> '----------------------------------------------------------</span><br /><span style="font-family: courier new,courier; font-size: small;"> ' This object is our client for connecting to the HPC</span><br /><span style="font-family: courier new,courier; font-size: small;"> ' cluster and running calculations.</span><br /><span style="font-family: courier new,courier; font-size: small;"> '----------------------------------------------------------</span><br /><strong><span style="font-family: courier new,courier; font-size: small;"> Private HPCExcelClient As IExcelClient</span></strong><br /> <br /> <br /><span style="font-family: courier new,courier; font-size: small;"> '----------------------------------------------------------</span><br /><span style="font-family: courier new,courier; font-size: small;"> '</span><br /><span style="font-family: courier new,courier; font-size: small;"> ' This is the main calculation function, which connects</span><br /><span style="font-family: courier new,courier; font-size: small;"> ' to the client object and runs a calculation. The method</span><br /><span style="font-family: courier new,courier; font-size: small;"> ' can run both desktop and cluster calculations, controlled</span><br /><span style="font-family: courier new,courier; font-size: small;"> ' by the function parameter "CalculateOnDesktop".</span><br /><span style="font-family: courier new,courier; font-size: small;"> '</span><br /><span style="font-family: courier new,courier; font-size: small;"> ' You'll see below two functions that run calculations</span><br /><span style="font-family: courier new,courier; font-size: small;"> ' by calling this method, with the parameter set for either</span><br /><span style="font-family: courier new,courier; font-size: small;"> ' cluster or desktop calculation.</span><br /><span style="font-family: courier new,courier; font-size: small;"> '</span><br /><span style="font-family: courier new,courier; font-size: small;"> '----------------------------------------------------------</span><br /><strong><span style="font-family: courier new,courier; font-size: small;"> Private Sub CalculateWorkbook(CalculateOnDesktop As Boolean)</span></strong><br /> <br /><strong><span style="font-family: courier new,courier; font-size: small;"> Dim HPCWorkbookPath As String</span></strong> <br /><strong><span style="font-family: courier new,courier; font-size: small;"> On Error GoTo ErrorHandler</span></strong><br /> <br /><span style="font-family: courier new,courier; font-size: small;"> ' Create a new excelCient instance per session</span><br /><span style="color: #000080;"><strong><span style="font-family: courier new,courier; font-size: small;"> Set HPCExcelClient = New ExcelClient</span></strong></span><br /> <br /><span style="font-family: courier new,courier; font-size: small;"> ' Initialize the excel client object with the current workbook</span><br /><span style="color: #000080;"><strong><span style="font-family: courier new,courier; font-size: small;"> HPCExcelClient.Initialize ActiveWorkbook</span></strong></span><br /> <br /><strong><span style="font-family: courier new,courier; font-size: small;"> If CalculateOnDesktop = False Then</span></strong> <br /><span style="font-family: courier new,courier; font-size: small;"> ' Create a cluster session with the desired options. Here, we're</span><br /><span style="font-family: courier new,courier; font-size: small;"> ' just using the scheduler name and (optionally) a job template.</span> <br /><strong><span style="font-family: courier new,courier; font-size: small;"> If Azure_JobTemplate &lt;&gt; "" Then</span></strong><br /><span style="color: #000080;"><strong><span style="font-family: courier new,courier; font-size: small;"> HPCExcelClient.OpenSession HPC_ClusterScheduler, "Multi.xlsb", 1, 128, SessionUnitType_Core, jobTemplate:=Azure_JobTemplate</span></strong></span><br /><strong><span style="font-family: courier new,courier; font-size: small;"> Else</span></strong><br /><span style="color: #000080;"><strong><span style="font-family: courier new,courier; font-size: small;"> HPCExcelClient.OpenSession HPC_ClusterScheduler, "Multi.xlsb"</span></strong></span><br /><strong><span style="font-family: courier new,courier; font-size: small;"> End If</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;"> End If</span></strong><br /> <br /><span style="font-family: courier new,courier; font-size: small;"> ' Run on local machine or cluster as chosen in workbook</span><br /><span style="color: #000000;"><strong><span style="font-family: courier new,courier; font-size: small;"> HPCExcelClient.Run CalculateOnDesktop</span></strong></span><br /><strong><span style="font-family: courier new,courier; font-size: small;"> Exit Sub</span></strong><br /> <br /><strong><span style="font-family: courier new,courier; font-size: small;"> ErrorHandler:</span></strong><br /><span style="font-family: courier new,courier; font-size: small;"> ' Notify user of error and clean up any allocated resources</span><br /><strong><span style="font-family: courier new,courier; font-size: small;"> MsgBox Prompt:=Err.Description, Title:="HPC Calculation Error"</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;"> If Not HPCExcelClient Is Nothing Then</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;"> HPCExcelClient.Dispose</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;"> End If</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;"> End Sub</span></strong><br /> <br /><span style="font-family: courier new,courier; font-size: small;"> '----------------------------------------------------------</span><br /><span style="font-family: courier new,courier; font-size: small;"> ' This is a public method for running a calculation on the desktop.</span><br /><span style="font-family: courier new,courier; font-size: small;"> '----------------------------------------------------------</span><br /><strong><span style="font-family: courier new,courier; font-size: small;"> Public Sub CalculateWorkbookOnDesktop()</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;"> CalculateWorkbook (True)</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;"> End Sub</span></strong><br /> <br /><span style="font-family: courier new,courier; font-size: small;"> '----------------------------------------------------------</span><br /><span style="font-family: courier new,courier; font-size: small;"> ' This is a public method for running a calculation on the cluster.</span><br /><span style="font-family: courier new,courier; font-size: small;"> '----------------------------------------------------------</span><br /><strong><span style="font-family: courier new,courier; font-size: small;"> Public Sub CalculateWorkbookOnCluster()</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;"> CalculateWorkbook (False)</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;"> End Sub</span></strong><br /> <br /><span style="font-family: courier new,courier; font-size: small;"> '----------------------------------------------------------</span><br /><span style="font-family: courier new,courier; font-size: small;"> ' This method is used to clean up a calculation after it's finished; </span><br /><span style="font-family: courier new,courier; font-size: small;"> '----------------------------------------------------------</span><br /><strong><span style="font-family: courier new,courier; font-size: small;"> Public Sub CleanUpClusterCalculation()</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;"> On Error Resume Next</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;"> HPCExcelClient.CloseSession</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;"> HPCExcelClient.Dispose</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;"> On Error GoTo 0</span></strong><br /><strong><span style="font-family: courier new,courier; font-size: small;"> End Sub</span></strong><br /> <br /><br /></code></pre>
<p>Before run the <strong>Multi.xlsb</strong> file you need to deploy the Excel on the worker roles:</p>
<pre class="scroll"><strong><span style="color: #000080; font-family: courier new,courier; font-size: medium;"><code class="cplusplus">hpcpack create Multi.zip Multi.xlsb<br />hpcpack upload Multi.zip /account:<em>&lt;AzureStorageAccount&gt;</em> /key:<em>&lt;AzureStorageKey&gt;</em><br />lusrun /nodegroup:AzureNodes hpcsync</code></span></strong></pre>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/6406.MutiplicationTable.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/6406.MutiplicationTable.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/6406.MutiplicationTable.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/6406.MutiplicationTable.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 52: multiplication table in Excel workbook running on the HPC cluster</p>
<p style="text-align: justify;"><span style="font-size: small;">You can download the Excel workbook here:</span></p>
<p style="padding-left: 60px;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/0830.Multi.xlsb" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/0830.Multi.xlsb"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/2548.Excel.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/2548.Excel.jpg" alt="" border="0" /><span style="font-size: x-large;">Multi.xlsb</span></a>&nbsp;<br /> <strong><span style="font-size: medium;">Table multiplication</span></strong></p>
<h2><strong><span style="color: #000080;">3.18 Run Excel bond price model file on HPC cluster</span></strong></h2>
<p style="text-align: justify;"><span style="font-size: small;">As a second example we can run an HPC cluster an Excel workkook with bond price model.</span> This example is more complex of the simple multiplication table<span style="font-size: small;">, but has the same structure in HPC VB macro.</span></p>
<p style="text-align: justify;"><span style="font-size: small;">You can download the Excel workbook here:<br /></span></p>
<p style="text-align: justify; padding-left: 60px;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/1220.CP1.xlsb" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/1220.CP1.xlsb"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/2548.Excel.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/2548.Excel.jpg" alt="" border="0" /> <span style="font-size: x-large;">CP1.xlsb</span></a>&nbsp;<br /> <strong><span style="font-size: medium;">Bond price model</span></strong></p>
<p style="text-align: justify; padding-left: 60px;"><span style="font-size: medium;"><br /></span></p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/5861.52.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/5861.52.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/5861.52.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/5861.52.jpg" alt="" width="668" height="461" border="0" /></a></p>
<p style="text-align: center;">Figure 53: press the button &ldquo;<strong>Calc</strong><strong>ulate on Cloud</strong>&rdquo; to run on HPC worker roles</p>
<p>&nbsp;</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/7658.53.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/7658.53.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/7658.53.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/7658.53.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 54: job is composed by two tasks (task 1.1 and task 1.2)</p>
<p>&nbsp;</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/8424.54.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/8424.54.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/8424.54.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/8424.54.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 55: every task runs on one HPC worker role</p>
<p>&nbsp;</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/1803.55.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/1803.55.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/1803.55.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/1803.55.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 56: Task1.1 runs on AzureCN-0004</p>
<p>&nbsp;</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/1172.56.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/1172.56.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/OffloadingExcel/1172.56.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-OffloadingExcel/1172.56.jpg" alt="" border="0" /></a>&nbsp;</p>
<p style="text-align: center;">Figure 57: task 1.2 runs on the AzureCN-005</p>
<p>&nbsp;</p>
<h2><strong><span style="color: #000080;">3.19 Description of the Excel workbook</span></strong></h2>
<p><span style="font-size: small;">The primary benefit of this model is that it requires no extra software (just Excel and the HPC client utilities).&nbsp; The main limitation of this model is that it requires Administrator permissions to move the spreadsheet to the cloud.&nbsp; That means that regular users won&rsquo;t be able to install new or modified spreadsheets themselves.&nbsp;</span></p>
<p><span style="font-size: small;">Another benefit of this approach is that in many cases it will be the fastest way to use Excel and Azure.&nbsp; Because the spreadsheet is already present on the worker roles, the calculation can start almost immediately &ndash; it does not have to copy the spreadsheet before it starts running.</span></p>
<h3><strong><span style="color: #000080;">3.19.1 Configuring the Example</span></strong></h3>
<p><span style="font-size: small;">To run the example, open the spreadsheet file &ldquo;CP1.xlsb&rdquo; on your desktop.&nbsp; Before running on the cloud, we need to make one change to the spreadsheet.&nbsp; The spreadsheet VBA code connects to the cluster using the name of the cluster head node.&nbsp; Open the VBA editor (From Excel, press Alt+F11).&nbsp; In the VBA editor, in the tree view on the top of the left-hand side, double-click the module named &ldquo;HPCControlMacros&rdquo; to open it.</span></p>
<p><span style="font-size: small;">In this file, locate the line</span></p>
<p><span style="font-size: small;"><strong>Private Const HPC_ClusterScheduler = "HEADNODE"</strong></span></p>
<p><span style="font-size: small;">Change the value of <strong>HEADNODE</strong> to match your cluster head node.&nbsp; This should be the machine name.&nbsp;</span></p>
<p><span style="font-size: small;">The file also specifies the name of the Job Template, which we used above when installing the spreadsheet on the cloud.&nbsp; The file uses the name we suggested, &ldquo;<strong>Default</strong>&rdquo;.&nbsp; If you used a different job template name, then find the line</span></p>
<p><span style="font-size: small;"><strong>Private Const Azure_jobTemplate = "Default"</strong></span></p>
<p><span style="font-size: small;">and change the value &ldquo;<strong>Default</strong>&rdquo; to match your HPC job template name; remember that this is the job template, not the node template.</span></p>
<h3><strong><span style="color: #000080;">3.19.2 Note</span></strong></h3>
<p><span style="font-size: small;">In Excel burst scenario, the max allowed length of Excel workbook file name is <strong>39</strong>.</span></p>
<p><span style="font-size: small;">The root cause of this issue is Excel file path can&rsquo;t exceed 218 characters:when you save or open a file if the path to the file (including the file name) exceeds 218 characters an error occurs. This limitation includes three characters representing the drive, the characters in folder names, the backslash character between folders, and the characters in the file name. The file path pattern of the hpcpack is very long, the following is one example:</span></p>
<pre class="scroll"><span style="font-size: medium; font-family: courier new,courier;"><strong><code class="java">C:\Resources\Directory\c49f08fea9464edc901ed3c52ae8cb98.HpcWorkerRole1.Microsoft.Hpc.Azure.LocalStorage.Application\convertiblepricing_azurecloud_static\2013-06-04T083747.0000000Z\ConvertiblePricing_AzureCloud_Static.xlsb.</code></strong></span></pre>
<p>&nbsp;</p>
<h1 align="left"><strong><span style="color: #000080;">4 Reference</span></strong></h1>
<p style="padding-left: 30px;" align="left"><span style="font-size: medium;"><a href="http://technet.microsoft.com/en-us/library/jj899632.aspx">http://technet.microsoft.com/en-us/library/jj899632.aspx</a></span></p>
<p style="padding-left: 30px;" align="left"><span style="font-size: medium;"><a href="http://technet.microsoft.com/en-us/library/hh162018.aspx">http://technet.microsoft.com/en-us/library/hh162018.aspx</a></span></p>
<p align="left">&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>How to install VNC in Azure Oracle Linux VM</title>
      <link>https://docs.microsoft.com/archive/blogs/faber/how-to-install-vnc-in-azure-oracle-linux-vm</link>
      <pubDate>Thu, 16 Oct 2014 05:06:00 GMT</pubDate>
      <dc:creator><![CDATA[faberspot]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/faber/2014/10/16/how-to-install-vnc-in-azure-oracle-linux-vm/</guid>
      <description><![CDATA[1 Introduction
In the Azure VM gallery are available a list of Linux distributions, including...]]></description>
      <content:encoded><![CDATA[<div class="WordSection1">
<h1 align="left"><span style="color: #000080;">1 Introduction</span></h1>
<p style="text-align: justify;"><span style="font-size: small;">In the Azure VM gallery are available a list of Linux distributions, including Oracle Linux. One of effective way to access remotely the Linux VM desktop is through VNC (Virtual Network Computing). VNC is used to display an X windows session running on another computer. Unlike a remote X connection, the xserver is running on the remote computer, not on your local workstation. Your workstation (Linux or Windows ) is only displaying a copy of the display that is running on the remote machine. In this note are reported the configuration steps required to connect to the Oracle Linux VM through VNC (Virtual Network Computing). The present note shows up two configurations:</span></p>
</div>
<ul>
<li><span style="font-size: small;">direct connection to the VNC Server</span></li>
<li><span style="font-size: small;">tunneling VNC connections over SSH.</span></li>
</ul>
<p align="left">&nbsp;</p>
<h1 align="left"><span style="color: #000080;">2 Create an Oracle Linux IaaS VM</span></h1>
<p align="left"><span style="font-size: small;">Login in Azure Management portal and create an IaaS VM through the VM gallery</span></p>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/7318.01.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/7318.01.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/7318.01.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/7318.01.jpg" alt="" border="0" /></a>&nbsp;</p>
<p style="text-align: center;">Figure 1: Create a new IaaS VM from the image gallery</p>
<p><span style="font-size: small;">&nbsp;Select the Oracle Linux image available in the VM gallery.</span></p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/0724.02.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/0724.02.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/0724.02.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/0724.02.jpg" alt="" width="548" height="328" border="0" /></a></p>
<p style="text-align: center;">Figure 2: Oracle Linux 6.4.0.0.0 available in Azure image gallery</p>
<p><span style="font-size: small;">Define the name of VM, size and administrator credentials (username and password) to access to the Oracle Linux VM.</span></p>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/5807.03.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/5807.03.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/5807.03.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/5807.03.jpg" alt="" border="0" /></a>&nbsp;</p>
<p style="text-align: center;">Figure 3: define IaaS size and administrator credentials</p>
<p>&nbsp;</p>
<p><span style="font-size: small;">Select the affinity group and storage account to store the .VHD file of the Linux VM</span></p>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/3821.04.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/3821.04.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/3821.04.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/3821.04.jpg" alt="" border="0" /></a>&nbsp;</p>
<p style="text-align: center;">Figure 4: specify an Affinity Group and Azure Storage account</p>
<p align="left"><span style="font-size: small;">Install the VM agent in the Linux VM.</span></p>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/8814.05.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/8814.05.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/8814.05.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/8814.05.jpg" alt="" border="0" /></a>&nbsp;</p>
<p style="text-align: center;">Figure 5: keep the default option to install the VM Agent</p>
<p>&nbsp;</p>
<h1 align="left"><span style="color: #000080;">3 Install the desktop package in Oracle Linux</span></h1>
<p align="left"><span style="font-size: small;">When the Oracle Linux VM is up and running connect to the VM through SSH session.</span></p>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/2146.06.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/2146.06.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/2146.06.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/2146.06.jpg" alt="" border="0" /></a>&nbsp;</p>
<p style="text-align: center;">Figure 6: Oracle Linux VM up and running</p>
<p align="left">&nbsp;</p>
<p align="left"><span style="font-size: small;">To login in the system use the same credential specified in the creation of VM.</span></p>
<p align="left"><span style="font-size: small;">It is easy to work with group of packages; there are some useful commands:</span></p>
<p align="left">&nbsp;</p>
<table style="border-color: #0000cc; border-width: 1px;" dir="ltr" border="1" frame="box" rules="cols">
<tbody>
<tr>
<td><span style="font-size: small; font-family: courier new,courier; color: #000080;"><strong>sudo yum grouplist &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</strong></span></td>
</tr>
</tbody>
</table>
<p align="left">&nbsp;<span style="font-size: small;">it lists the installed and available groups for your system in two separate lists.</span></p>
<p align="left">&nbsp;</p>
<table style="border-color: #0000cc; border-width: 1px; width: 439px; height: 20px;" dir="ltr" border="1" rules="cols" align="left">
<tbody>
<tr>
<td><span style="font-size: small; font-family: courier new,courier; color: #000080;"><strong>sudo yum groupinfo <em>&lt;groupname&gt;</em></strong></span></td>
</tr>
</tbody>
</table>
<p align="left">&nbsp;</p>
<p align="left"><span style="font-size: small;">&nbsp;It provides you detailed information for each group including: description, mandatory, default and optional packages.</span></p>
<p align="left">&nbsp;</p>
<p><span style="font-size: small;">When you create an Azure Oracle Linux IaaS VM, by default you do not have GUI and desktop environment.</span></p>
<p align="left"><span style="font-size: small;">To install X Window and fonts run the command:</span></p>
<table style="border-color: #0000cc; border-width: 1px;" dir="ltr" border="1" rules="cols">
<tbody>
<tr>
<td><span style="font-family: courier new,courier; font-size: small; color: #000080;"><strong>sudo yum -y groupinstall "Desktop Platform" "X Window System" "Fonts" &nbsp; &nbsp; &nbsp;&nbsp;</strong></span></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<table style="border-color: #000000; border-width: 1px;" border="1" rules="cols">
<tbody>
<tr>
<td>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>&hellip;..</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>Running rpm_check_debug</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>Running Transaction Test</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>Transaction Test Succeeded</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>Running Transaction</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>Warning: RPMDB altered outside of yum.</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>** Found 4 pre-existing rpmdb problem(s), 'yum check' output follows:</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>glibc-headers-2.12-1.107.el6_4.4.x86_64 has missing requires of kernel-headers</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>glibc-headers-2.12-1.107.el6_4.4.x86_64 has missing requires of kernel-headers &gt;= ('0', '2.2.1', None)</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>oracle-rdbms-server-11gR2-preinstall-1.0-7.el6.x86_64 <span style="color: #800000;">has missing requires of kernel-uek</span></strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>oracle-rdbms-server-12cR1-preinstall-1.0-8.el6.x86_64 <span style="color: #800000;">has missing requires of kernel-uek</span></strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>&hellip;&hellip;.</strong></span></p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p align="left">You can ignore the reference to the new <strong>Linux kernel uek (unbreakable enterprise kernel)</strong></p>
<p align="left">&nbsp;</p>
<p align="left">If you install GNOME desktop, using the command:</p>
<table style="border-color: #0000cc; border-width: 1px;" dir="ltr" border="1" rules="cols" align="left">
<tbody>
<tr>
<td><span style="font-family: courier new,courier; font-size: small; color: #000080;"><strong>sudo yum -y groupinstall "Desktop" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</strong></span></td>
</tr>
</tbody>
</table>
<p align="left">&nbsp;</p>
<p align="left">&nbsp;you get the message:</p>
<table style="width: 623px; height: 230px;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="611">
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>&hellip;.</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>--&gt; Finished Dependency Resolution</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>Error: WALinuxAgent conflicts with 1:NetworkManager-0.8.1-66.el6.x86_64</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>&nbsp;You could try using --skip-broken to work around the problem</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>** Found 4 pre-existing rpmdb problem(s), 'yum check' output follows:</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>glibc-headers-2.12-1.107.el6_4.4.x86_64 has missing requires of kernel-headers</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>glibc-headers-2.12-1.107.el6_4.4.x86_64 has missing requires of kernel-headers &gt;= ('0', '2.2.1', None)</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>oracle-rdbms-server-11gR2-preinstall-1.0-7.el6.x86_64 has missing requires of kernel-uek</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>oracle-rdbms-server-12cR1-preinstall-1.0-8.el6.x86_64 has missing requires of kernel-uek</strong></span></p>
</td>
</tr>
</tbody>
</table>
<p align="left">&nbsp;</p>
<p align="left">Installation procedure aborts because it tries to install <strong>NetworkManager</strong> package as part of this install, but the already installed <strong>WALinuxAgent</strong> is conflicting with NetworkManager package.</p>
<p align="left">To skip the dependent packages and proceed GNOME Desktop installation use<span style="font-family: courier new,courier;"> <strong>--skip-broken</strong></span> as</p>
<table style="border-color: #0000cc; border-width: 1px;" dir="ltr" border="1" rules="cols">
<tbody>
<tr>
<td><span style="font-family: courier new,courier; font-size: small; color: #000080;"><strong>sudo yum -y --skip-broken groupinstall "Desktop" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</strong></span></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p><span style="font-size: small;">You can also install the following <span style="text-decoration: underline;">optional GUI packages</span>.</span></p>
<table style="border-color: #0000cc; border-width: 1px; width: 587px; height: 73px;" dir="ltr" border="1" rules="cols">
<tbody>
<tr>
<td>
<p align="left"><span style="font-size: small; font-family: courier new,courier; color: #000080;"><strong>sudo yum -y groupinstall "Graphical Administration Tools"</strong></span></p>
<p align="left"><span style="font-size: small; font-family: courier new,courier; color: #000080;"><strong>sudo yum -y groupinstall "Internet Browser"</strong></span></p>
<p align="left"><span style="font-size: small; font-family: courier new,courier; color: #000080;"><strong>sudo yum -y groupinstall "General Purpose Desktop"</strong></span></p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p align="left"><span style="font-size: small;">It is useful to add other packages to our Oracle Linux VM:</span></p>
<ul>
<li><span style="font-size: small;"><span style="font-family: courier new,courier; color: #800000;"><strong>xterm</strong></span> is the standard terminal emulator for the X Window System. A user can have many different invocations of xterm running at once on the same display</span></li>
<li><span style="font-size: small;"><span style="color: #800000;"><strong>twm</strong></span> is a window manager for the X Window System. It provides titlebars, shaped windows, several forms of icon management, user-defined macro functions, click-to-type and pointer-driven keyboard focus, and user-specified key and pointer button bindings.</span></li>
<li><span style="font-size: small;"><span style="color: #800000;"><strong>xsetroot</strong></span> program allows you to tailor the appearance of the background ("root") window on a workstation display running X.</span></li>
</ul>
<p><span style="font-size: small;"><br /></span></p>
<table style="border-color: #0000cc; border-width: 1px; width: 585px; height: 19px;" dir="ltr" border="1" rules="cols">
<tbody>
<tr>
<td><span style="font-family: courier new,courier; font-size: small;"><strong><span style="color: #000080;">sudo yum -y install</span> <span style="color: #800000;">xterm</span> <span style="color: #800000;">twm</span> <span style="color: #800000;">xsetroot</span></strong></span></td>
</tr>
</tbody>
</table>
<p align="left">&nbsp;</p>
<p align="left">You can install optional xorg fonts packages through the command:</p>
<table style="border-color: #0000cc; border-width: 1px;" dir="ltr" border="1" rules="cols">
<tbody>
<tr>
<td><span style="font-family: courier new,courier; font-size: small; color: #000080;"><strong>sudo yum install xorg-x11-fonts-base xorg-x11-fonts-misc xorg-x11-font-utils xorg-x11-fonts-Type1</strong></span></td>
</tr>
</tbody>
</table>
<p align="left">&nbsp;</p>
<p align="left">&nbsp;</p>
<h1 align="left"><span style="color: #000080;">4 Install the VNC server in Oracle Linux VM</span></h1>
<p align="left"><span style="font-size: small;">In this paragraph, you have the procedure to install the VNC server in Oracle Linux VM.</span></p>
<p align="left"><span style="font-size: small;">For setting up the VNC server, we perform the following steps:</span></p>
<ol>
<li><span style="font-size: small;">Install the VNC server package</span></li>
<li><span style="font-size: small;">Create the VNC users accounts</span></li>
<li><span style="font-size: small;">Edit the VNC server configuration</span></li>
<li><span style="font-size: small;">Set your users' VNC passwords</span></li>
<li><span style="font-size: small;">Confirm that the VNC server can start and stops cleanly</span></li>
<li><span style="font-size: small;">Starting VNC server service automatically at boot</span></li>
<li><span style="font-size: small;">Customize xstartup scripts</span></li>
<li><span style="font-size: small;">Test each VNC user through direct connection to the VNC Server</span></li>
</ol>
<h2><span style="color: #000080;">4.1 Installing the required VNC server package</span></h2>
<p><span style="font-size: small;">Login as administrator in Oracle Linux VM and install the VNC Server.</span></p>
<p align="left"><span style="font-size: small;">Our VM runs with Oracle Linux 6, the server is <strong>tigervnc-server</strong> (and not <strong>vnc-server</strong>).</span></p>
<table style="border-color: #0000cc; border-width: 1px;" dir="ltr" border="1" rules="cols">
<tbody>
<tr>
<td><span style="font-family: courier new,courier; font-size: small; color: #000080;"><strong>sudo yum install tigervnc-server &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</strong></span></td>
</tr>
</tbody>
</table>
<p align="left">&nbsp;</p>
<h2><span style="color: #000080;">4.2&nbsp; Create the VNC users accounts.</span></h2>
<p align="left"><span style="font-size: small;">By default the Oracle Linux VM install an oracle user in the system.</span></p>
<table style="border-color: #0000cc; border-width: 1px; width: 592px; height: 127px;" dir="ltr" border="1" rules="cols">
<tbody>
<tr>
<td>
<p align="left"><span style="font-family: courier new,courier; font-size: small; color: #000080;"><strong>sudo cat /etc/passwd</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: small;"><strong>&hellip;&hellip;</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: small;"><strong>oracle:x:54321:54321::/home/oracle:/bin/bash</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: small;"><strong>aroot:x:54322:54323::/home/aroot:/bin/bash</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: small;"><strong><span style="font-family: courier new,courier; font-size: small;"><strong>&hellip;&hellip;</strong></span></strong></span></p>
</td>
</tr>
</tbody>
</table>
<p align="left">&nbsp;</p>
<p align="left"><span style="font-size: small;">To reset the password of Oracle user:</span></p>
<table style="border-color: #0000cc; border-width: 1px; width: 590px; height: 127px;" dir="ltr" border="1" rules="cols">
<tbody>
<tr>
<td>
<p align="left"><span style="font-family: courier new,courier; font-size: small; color: #000080;"><strong>sudo</strong><strong> </strong><strong>passwd oracle</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: small;"><strong>Changing password for user oracle.</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: small;"><strong>New password:</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: small;"><strong>Retype new password:</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: small;"><strong>passwd: all authentication tokens updated successfully.</strong></span></p>
</td>
</tr>
</tbody>
</table>
<p align="left">&nbsp;</p>
<p align="left">&nbsp;</p>
<p align="left">&nbsp;</p>
<h2><span style="color: #000080;">4.3&nbsp; Edit the VNC server configuration</span></h2>
<p><span style="font-size: small;">Edit the "<span style="color: #000000;"><strong>/etc/sysconfig/vncservers</strong></span>" file to configure the required displays.</span></p>
<table style="border-color: #0000cc; border-width: 1px; width: 585px; height: 19px;" dir="ltr" border="1" rules="cols">
<tbody>
<tr>
<td><span style="font-family: courier new,courier; font-size: small; color: #000080;"><strong>sudo vi /etc/sysconfig/vncservers</strong></span></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p><span style="font-size: small;">Add to the file <strong>/etc/sysconfig/vncservers</strong> the following entries to enable VNC for display number &ldquo;<strong>.1</strong>&rdquo; and &ldquo;<strong>.2</strong>&rdquo;</span></p>
<table style="border-color: #0000cc; border-width: 1px; width: 582px; height: 73px;" dir="ltr" border="1" rules="cols">
<tbody>
<tr>
<td>
<p align="left"><span style="font-family: courier new,courier; font-size: small; color: #000080;"><strong>VNCSERVERS="1:aroot 2:oracle"</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: small; color: #000080;"><strong>VNCSERVERARGS[1]="-geometry 1024x768 -nolisten tcp"</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: small; color: #000080;"><strong>VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp"</strong></span></p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p align="left"><span style="font-size: small;">Notice multiple "display:user" pairs are defined on a single line, but the arguments for each display are defined separately.</span></p>
<p><span style="font-size: small;">With these entries we define that a VNC server instance should be started as user &ldquo;atoor&rdquo; on display 1 and the user &ldquo;oracle&rdquo; on <strong>display 2</strong> and we also set some options for this server such as <strong>resolution</strong> and <strong>color depth</strong>. Each VNC server instance <em>listens on port 5900 plus the display number</em> on which the server runs. In our case,</span></p>
<ul>
<li><span style="font-size: small;">aroot&rsquo;s vnc server would listen on port 5901</span></li>
<li><span style="font-size: small;">oracle&rsquo;s vnc server would listen on port 5902</span></li>
</ul>
<h2><span style="color: #000080;">4.4&nbsp; Set your users' VNC passwords</span></h2>
<p><span style="font-size: small;">Set the VNC password for any users defined in the "<span style="color: #000080;"><strong><span style="color: #000000;">/etc/sysconfig/vncserver</span>s</strong></span>" file.</span></p>
<p><span style="font-size: small;">Switch user into the account for each user, and as noted below, run: <strong><em>vncpasswd</em></strong></span></p>
<p><span style="font-size: small;">We are prompted for a password. This is the password that we will use when we connect to userid&rsquo;s vnc server instance.</span></p>
<p align="left">&nbsp;</p>
<table style="border-color: #000000; border-width: 1px; width: 448px; height: 262px;" dir="ltr" border="1" rules="cols">
<tbody>
<tr>
<td>
<p align="left"><span style="font-family: courier new,courier; font-size: small;"><strong>[aroot@fftest5 ~]$ <span style="color: #000080;">vncpasswd</span></strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: small;"><strong>Password:</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: small;"><strong>Verify:</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: small;"><strong>[aroot@fftest5 ~]$ <span style="color: #000080;">su - oracle</span></strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: small;"><strong>Password:</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: small;"><strong>&nbsp;</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: small;"><strong>[oracle@fftest5 ~]$ <span style="color: #000080;">vncpasswd</span></strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: small;"><strong>Password:</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: small;"><strong>Verify:</strong></span></p>
<span style="font-family: courier new,courier; font-size: small;"><strong>[oracle@ffora1 ~]$</strong></span></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p align="left"><span style="font-size: small;">This will create the<strong>~/.vnc</strong> directory for that userid:</span></p>
<p align="left">&nbsp;</p>
<p align="left"><span style="font-family: courier new,courier; font-size: small;"><strong>[aroot@fftest5 ~]$ <span style="color: #000080;">ls -al /home/aroot/.vnc/</span></strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>total 12</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>drwxrwxr-x. 2 aroot aroot 4096 Oct 16 08:54 .</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>drwx------. 3 aroot aroot 4096 Oct 16 08:54 ..</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>-rw-------. 1 aroot aroot&nbsp;&nbsp;&nbsp; 8 Oct 16 08:54 passwd</strong></span></p>
<p align="left">&nbsp;</p>
<h2><span style="color: #000080;">4.5&nbsp; Confirm that the VNC server can start and stop cleanly</span></h2>
<p align="left">&nbsp;</p>
<table style="border-color: #0000cc; border-width: 1px; width: 466px; height: 19px;" dir="ltr" border="1" rules="cols">
<tbody>
<tr>
<td><span style="font-family: courier new,courier; font-size: small; color: #000080;"><strong>sudo /sbin/service&nbsp; vncserver start</strong></span></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>[aroot@fftest5 ~]$ sudo /sbin/service vncserver start</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>[sudo] password for aroot:</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>Starting VNC server: 1:aroot xauth:&nbsp; creating new authority file /home/aroot/.Xauthority</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>&nbsp;</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>New 'fftest5:1 (aroot)' desktop is fftest5:1</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>&nbsp;</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>Creating default startup script /home/aroot/.vnc/xstartup</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>Starting applications specified in /home/aroot/.vnc/xstartup</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>Log file is /home/aroot/.vnc/fftest5:1.log</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>&nbsp;</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>2:oracle</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>New 'fftest5:2 (oracle)' desktop is fftest5:2</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>&nbsp;</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>Creating default startup script /home/oracle/.vnc/xstartup</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>Starting applications specified in /home/oracle/.vnc/xstartup</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>Log file is /home/oracle/.vnc/fftest5:2.log</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </strong><strong>[&nbsp; OK&nbsp; ]</strong></span></p>
<p align="left">&nbsp;</p>
<table style="border-color: #0000cc; border-width: 1px; width: 476px; height: 20px;" dir="ltr" border="1" rules="cols">
<tbody>
<tr>
<td><span style="color: #000080;"><strong>s<span style="font-family: courier new,courier; font-size: small;">udo /sbin/service&nbsp; vncserver stop</span></strong></span></td>
</tr>
</tbody>
</table>
<p align="left">&nbsp;</p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>Shutting down VNC server: 1:aroot 2:oracle&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&nbsp; OK&nbsp; ]</strong></span></p>
<p align="left"><strong>&nbsp;</strong></p>
<p>Start again the vncserver:</p>
<table style="border-color: #0000cc; border-width: 1px; width: 472px; height: 19px;" dir="ltr" border="1" rules="cols">
<tbody>
<tr>
<td><span style="font-family: courier new,courier; font-size: small; color: #000080;"><strong>sudo /sbin/service&nbsp; vncserver start</strong></span></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h2><span style="color: #000080;">4.6&nbsp; Starting VNC server service automatically at boot</span></h2>
<p><span style="font-size: small;">To enable the vncserver service to be automatically started at boot:</span></p>
<table style="border-color: #0000cc; border-width: 1px; width: 469px; height: 20px;" dir="ltr" border="1" rules="cols">
<tbody>
<tr>
<td><span style="font-size: small; color: #000080;"><strong>sudo /sbin/chkconfig&nbsp; vncserver on &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</strong></span></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p><span style="font-size: small;">Checking correct automatic boot:</span></p>
<p><span style="font-size: small; font-family: courier new,courier;"><strong>[aroot@fftest5 ~]$ <span style="color: #000080;">sudo chkconfig vncserver --list</span></strong></span></p>
<p><span style="font-size: small; font-family: courier new,courier;"><strong>vncserver&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0:off&nbsp;&nbsp; 1:off&nbsp;&nbsp; 2:on&nbsp;&nbsp;&nbsp; 3:on&nbsp;&nbsp;&nbsp; 4:on&nbsp;&nbsp;&nbsp; 5:on&nbsp;&nbsp;&nbsp; 6:off</strong></span></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h2><span style="color: #000080;">4.7 Customize xstartup scripts</span></h2>
<p><span style="font-size: small;">After the VNC service is started, some new files are created in <span style="color: #000080;"><strong><span style="color: #000000;">/home/aroot/.vnc</span>/</strong></span> directory. These include aroot&rsquo;s vnc server log file, pid file and an X startup script. As user &ldquo;aroot&rdquo; we edit the script in order to customize some settings. The default <strong>/home/aroot/.vnc/xstartup</strong> script contains some commands that are executed when the VNC server is started.</span></p>
<table style="border-color: #000000; border-width: 1px; width: 503px; height: 720px;" dir="ltr" border="1" rules="cols">
<tbody>
<tr>
<td>
<p align="left"><span style="font-family: courier new,courier;"><strong>#!/bin/sh</strong></span></p>
<p align="left"><span style="font-family: courier new,courier;"><strong>[ -r /etc/sysconfig/i18n ] &amp;&amp; . /etc/sysconfig/i18n</strong></span></p>
<p align="left"><span style="font-family: courier new,courier;"><strong>export LANG</strong></span></p>
<p align="left"><span style="font-family: courier new,courier;"><strong>export SYSFONT</strong></span></p>
<p align="left"><span style="font-family: courier new,courier;"><strong>vncconfig -iconic &amp;</strong></span></p>
<p align="left"><span style="font-family: courier new,courier;"><strong>unset SESSION_MANAGER</strong></span></p>
<p align="left"><span style="font-family: courier new,courier;"><strong>unset DBUS_SESSION_BUS_ADDRESS</strong></span></p>
<p align="left"><span style="font-family: courier new,courier;"><strong>OS=`uname -s`</strong></span></p>
<p align="left"><span style="font-family: courier new,courier;"><strong>if [ $OS = 'Linux' ]; then</strong></span></p>
<p align="left"><span style="font-family: courier new,courier;"><strong>&nbsp; case "$WINDOWMANAGER" in</strong></span></p>
<p align="left"><span style="font-family: courier new,courier;"><strong>&nbsp;&nbsp;&nbsp; *gnome*)</strong></span></p>
<p align="left"><span style="font-family: courier new,courier;"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if [ -e /etc/SuSE-release ]; then</strong></span></p>
<p align="left"><span style="font-family: courier new,courier;"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PATH=$PATH:/opt/gnome/bin</strong></span></p>
<p align="left"><span style="font-family: courier new,courier;"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; export PATH</strong></span></p>
<p align="left"><span style="font-family: courier new,courier;"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fi</strong></span></p>
<p align="left"><span style="font-family: courier new,courier;"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;;</strong></span></p>
<p align="left"><span style="font-family: courier new,courier;"><strong>&nbsp; esac</strong></span></p>
<p align="left"><span style="font-family: courier new,courier;"><strong>fi</strong></span></p>
<p align="left"><span style="font-family: courier new,courier;"><strong>if [ -x /etc/X11/xinit/xinitrc ]; then</strong></span></p>
<p align="left"><span style="font-family: courier new,courier;"><strong>&nbsp; exec /etc/X11/xinit/xinitrc</strong></span></p>
<p align="left"><span style="font-family: courier new,courier;"><strong>fi</strong></span></p>
<p align="left"><span style="font-family: courier new,courier;"><strong>if [ -f /etc/X11/xinit/xinitrc ]; then</strong></span></p>
<p align="left"><span style="font-family: courier new,courier;"><strong>&nbsp; exec sh /etc/X11/xinit/xinitrc</strong></span></p>
<p align="left"><span style="font-family: courier new,courier;"><strong>fi</strong></span></p>
<p align="left"><span style="font-family: courier new,courier;"><strong>[ -r $HOME/.Xresources ] &amp;&amp; xrdb $HOME/.Xresources</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; color: #800000;"><strong>xsetroot -solid grey</strong></span></p>
<p align="left"><span style="font-family: courier new,courier;"><strong><span style="color: #800000;">xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop"</span> &amp;</strong></span></p>
<span style="font-family: courier new,courier;"><strong><span style="color: #800000;">twm</span> &amp;</strong></span></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<ul>
<li><span style="font-size: small;"><span style="color: #800000; font-family: courier new,courier;"><strong>xsetroot</strong></span> in this case sets the background color.</span></li>
<li><span style="font-size: small;"><span style="color: #800000; font-family: courier new,courier;"><strong>vncconfig</strong></span> is a supplementary program that can be used to control the VNC server. Apart from this, when run without arguments it acts as a helper application and its main purpose is to provide support for clipboard transfers between the client (vncviewer) and the vnc server.</span></li>
<li><span style="font-size: small;"><span style="color: #800000; font-family: courier new,courier;"><strong>xterm</strong></span> starts an xterm terminal.</span></li>
<li><span style="font-size: small;"><span style="color: #800000; font-family: courier new,courier;"><strong>twm</strong></span> starts the X server&rsquo;s default window manager. We probably want to change that to a more user-friendly window manager.</span></li>
</ul>
<p><span style="font-size: small;">The presence of the "<span style="color: #800000; font-family: courier new,courier;"><strong>&amp;</strong></span>" symbol after each command, so that it goes to the background and the xstartup script continues on.</span></p>
<p>&nbsp;</p>
<h2><span style="color: #000080;">4.8&nbsp; Test each VNC user through direct connection to the VNC server<br /></span></h2>
<p><span style="font-size: small;">You should now be able to use a VNC viewer to connect to system using the display numbers and passwords defined. In our case, we have two VNC users: <strong>aroot</strong> and <strong>oracle</strong>.</span></p>
<p><span style="font-size: small;">To allow direct VNC connection we need to open the related TCP ports on Oracle Linux VM.</span></p>
<p><span style="font-size: small;">Open the Azure Management portal, select the Oracle Linux VM and select ENDPOINTS to control traffic incoming on public VIP (Virtual IP Address).</span></p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/6153.07.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/6153.07.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/6153.07.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/6153.07.jpg" alt="" border="0" /></a>Figure 7: ENDPOINTS to control incoming network traffic in IaaS VM</p>
<p>&nbsp;</p>
<p><span style="font-size: small;">Add&nbsp; a new ENDPOINT</span></p>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/6646.08.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/6646.08.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/6646.08.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/6646.08.jpg" alt="" border="0" /></a>&nbsp;</p>
<p style="text-align: center;">Figure 8: first step to add a new public ENDPOINT</p>
<p><span style="font-size: small;">We can example map a public TCP port like 6901 in the port 5901:</span></p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/0118.09.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/0118.09.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/0118.09.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/0118.09.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">&nbsp;Figure 9: public port 6901 is mapped into private TCP port 5901</p>
<p>&nbsp;</p>
<p><span style="font-size: small;">We need to add a second ENDPOINT to the Oracle Linux VM to allow to the user oracle to connect to the&nbsp; private TCP port 5902.</span></p>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/0777.10.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/0777.10.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/0777.10.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/0777.10.jpg" alt="" border="0" /></a>&nbsp;</p>
<p style="text-align: center;">Figure 10: add a second ENDPOINT to connect to the VM through oracle user</p>
<p>&nbsp;</p>
<p><span style="font-size: small;">After adding the two public Azure ENDPOINTS we have:</span></p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/7853.20.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/7853.20.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/7853.20.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/7853.20.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/0777.10.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/0777.10.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/0777.10.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/0777.10.jpg" alt="" border="0" /></a></p>
<p align="center">&nbsp;</p>
<p style="text-align: center;">Figure 11: endpoints mapping on Oracle Linux VM</p>
<p>&nbsp;</p>
<h2><span style="color: #000080;">4.9&nbsp; Install VNC client on your local host</span></h2>
<p><span style="font-size: small;">Once your VNC server is configured, you can connect to it from any VNC client. On your local linux host (my local CentOS client run in hyper-V in Windows 8), install the VNC client using the following command.</span></p>
<table style="border-color: #0000cc; border-width: 1px; width: 598px; height: 19px;" dir="ltr" border="1" rules="cols">
<tbody>
<tr>
<td><span style="font-family: courier new,courier; font-size: small; color: #000080;"><strong>sudo yum install tigervnc</strong></span></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p align="left"><span style="font-size: small;">We are now ready from our local linux VM to open a VNC connection to the Oracle Linux VM running in Azure. To manage the remote Oracle Linux VM through the user too we use the command:</span></p>
<table style="border-color: #0000cc; border-width: 1px; width: 593px; height: 19px;" dir="ltr" border="1" rules="cols">
<tbody>
<tr>
<td><span style="font-family: courier new,courier; font-size: small; color: #000080;"><strong>vncviewer fftest5.cloudapp.net:6901:1</strong></span></td>
</tr>
</tbody>
</table>
<p align="left">&nbsp;</p>
<p align="left"><span style="font-size: small;">A GUI ask for the VNC password assigned to the user toor.</span></p>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/4237.11.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/4237.11.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/4237.11.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/4237.11.jpg" alt="" border="0" /></a>&nbsp;</p>
<p style="text-align: center;">Figure 12: vnc client ask for toor password to connect to remote Oracle Linux VM</p>
<p align="left">&nbsp;</p>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/5444.12.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/5444.12.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/5444.12.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/5444.12.jpg" alt="" border="0" /></a>&nbsp;</p>
<p style="text-align: center;">Figure 13: successful connection to the Oracle Linux VM through the VNC client</p>
<p align="left">&nbsp;</p>
<p align="left"><span style="font-size: small;">We can establish a second VNC connection to the Oracle Linux VM through oracle user:</span></p>
<table style="border-color: #0000cc; border-width: 1px; width: 585px; height: 19px;" dir="ltr" border="1" rules="cols">
<tbody>
<tr>
<td><span style="font-size: small; font-family: courier new,courier; color: #000080;"><strong>vncviewer fftest5.cloudapp.net:6902:2</strong></span></td>
</tr>
</tbody>
</table>
<p align="left">&nbsp;</p>
<p align="center">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/4555.13.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/4555.13.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/4555.13.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/4555.13.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 14: remote connection via VNC client as oracle user</p>
<p style="text-align: center;">&nbsp;</p>
<h1><span style="color: #000080;">5 Tunneling VNC connections over SSH</span></h1>
<p><span style="font-size: small;">The VNC protocol is not a secure communication protocol. Presence of a vnc password provides security to access to the server, but the whole VNC session is transmitted in the clear, without encryption. A way to secure our connection to the VNC server is to connect through an encrypted <strong>SSH tunnel</strong>. This way the whole session get encrypted.</span></p>
<h2><span style="color: #000080;">5.1 Open the incoming SSH port in the Oracle Linux VM</span></h2>
<p><span style="font-size: small;">In the last paragraph, we have used a direct connection from VNC client to VNC server using the TCP ports above 5900. First of all we do not need any more of public ENDPOINTs on Oracle Linux VM, and we can remove it. The only Endpoint we need is the TCP port 22, to accept incoming SSH traffic.</span></p>
<p align="center">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/1007.14.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/1007.14.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/1007.14.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/1007.14.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 15: the only endpoint required to tunnel VNC on SSL is the TCP port 22</p>
<p>&nbsp;</p>
<p><span style="font-size: small;">We want to configure a local port forwarding for a VNC session</span></p>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/3465.15.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/3465.15.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/3465.15.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/3465.15.jpg" alt="" border="0" /></a>&nbsp;</p>
<p style="text-align: center;">Figure 16: local port forwarding for a VNC session</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p style="text-align: justify;"><span style="font-size: small;">The syntax for local port forwarding as used in the example:</span><strong></strong></p>
<p style="text-align: justify;"><span style="font-size: small; font-family: courier new,courier;"><strong>ssh username@RemoteServerHost -L localport:LocalHost:RemotePort</strong></span></p>
<p><em><br /></em></p>
<p><span style="font-size: small;"><em>The operating systems on client and on the server are irrelevant. What matters is that local client has a SSH client and VNC viewer, and the remote machine (Azure Oracle Linux VM) has a SSH server and VNC server.</em></span><em></em></p>
<p>&nbsp;</p>
<h2><span style="color: #000080;">5.2 Change the VNC server configuration</span></h2>
<p><span style="font-size: small;">Edit the file<span style="font-family: courier new,courier; color: #000080;"> <strong>/etc/sysconfig/vncservers</strong></span> and modify the entry:</span></p>
<p align="left"><strong><br /></strong></p>
<p align="left"><span style="font-family: courier new,courier; color: #000080;"><strong>VNCSERVERS="1:toor 2:oracle"</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; color: #000080;"><strong>VNCSERVERARGS[1]="-geometry 1024x768 <span style="color: #0000ff;">&ndash;depth 24</span> -nolisten tcp <span style="color: #0000ff;">-localhost</span>"</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; color: #000080;"><strong>VNCSERVERARGS[2]="-geometry 800x600 <span style="color: #0000ff;">&ndash;depth 16</span> -nolisten tcp <span style="color: #0000ff;">-localhost</span>"</strong></span></p>
<p>&nbsp;</p>
<p><span style="font-size: small;">where:</span></p>
<p><span style="font-size: small;">"<span style="color: #0000ff; font-family: courier new,courier;"><strong>-localhost</strong></span>" option prevents remote VNC clients connecting except when doing so through a secure tunnel</span></p>
<p><span style="font-size: small;">&ldquo;<span style="color: #0000ff; font-family: courier new,courier;"><strong>-depth 16</strong></span>&rdquo; option to specify the color depth in the VNC session</span></p>
<p align="left">&nbsp;</p>
<p align="left"><span style="font-size: small;">To get the new configuration Restart the VNC service:</span></p>
<table style="border-color: #0000cc; border-width: 1px; width: 458px; height: 19px;" dir="ltr" border="1" rules="cols">
<tbody>
<tr>
<td><span style="font-size: small; font-family: courier new,courier; color: #0000ff;"><strong>sudo service vncserver restart</strong></span></td>
</tr>
</tbody>
</table>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>Shutting down VNC server: 1:aroot 2:oracle&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&nbsp; OK&nbsp; ]</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>Starting VNC server: 1:aroot</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>New 'fftest5:1 (aroot)' desktop is fftest5:1</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>&nbsp;</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>Starting applications specified in /home/aroot/.vnc/xstartup</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>Log file is /home/aroot/.vnc/fftest5:1.log</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>&nbsp;</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>2:oracle</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>New 'fftest5:2 (oracle)' desktop is fftest5:2</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>&nbsp;</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>Starting applications specified in /home/oracle/.vnc/xstartup</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>Log file is /home/oracle/.vnc/fftest5:2.log</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp; OK&nbsp; ]</strong></span></p>
<p align="left">&nbsp;</p>
<h2><span style="color: #000080;">5.3&nbsp; Open an SSL connection with port forwarding</span></h2>
<p><span style="font-size: small;">The syntax for local port forwarding as used in the example:</span></p>
<pre><span style="font-size: small;"><strong>ssh RemoteUsername@RemoteServerHost -L localport:LocalHost:RemotePort<em></em></strong></span></pre>
<p><span style="font-size: small;">We want to create an encrypted tunnel, and connect to our VNC server through it, but we also want the tunnel to be &rdquo;<strong>automatically closed</strong>&rdquo;, as soon as we shut down vncviewer:</span></p>
<table style="border-color: #0000cc; border-width: 1px; width: 615px; height: 19px;" dir="ltr" border="1" rules="cols">
<tbody>
<tr>
<td>
<p align="left"><span style="font-size: small; font-family: courier new,courier;"><span style="color: #000080;"><strong>ssh </strong><span style="color: #0000ff;"><a href="mailto:aroot@fftest5.cloudapp.net"><span style="color: #0000ff;"><strong>toor@fftest5.cloudapp.net</strong></span></a></span></span><span style="color: #800000;"><strong> &ndash;f &ndash;L 6901:localhost:5901 -v sleep 10</strong></span></span></p>
</td>
</tr>
</tbody>
</table>
<p align="left"><span style="font-size: small;">where:</span></p>
<ul>
<li><span style="font-size: small;"><span style="color: #0000ff;"><strong><span style="font-family: courier new,courier;">toor@ffora1.cloudapp.net</span></strong></span> = SSH host to connect to</span></li>
<li><span style="font-size: small;"><span style="color: #800000; font-family: courier new,courier;"><strong>-f</strong></span> forks the SSH session to the background, while&nbsp;sleep&nbsp;is being executed on the remote machine. This ssh option is needed because we want to execute the following command (vncviewer) in the same local machine&rsquo;s terminal.</span></li>
<li><span style="font-size: small;"><span style="color: #800000; font-family: courier new,courier;"><strong>-L</strong></span> = Option to enable local port forwarding</span></li>
<li><span style="font-size: small;"><strong><span style="color: #800000; font-family: courier new,courier;">6901</span></strong> = Port on the client PC</span></li>
<li><span style="font-size: small;"><strong><span style="color: #800000; font-family: courier new,courier;">localhost</span></strong> = Host server to connect to (the <span style="text-decoration: underline;">remote</span> PC, same as 127.0.0.1)</span></li>
<li><span style="font-size: small;"><strong><span style="color: #800000;">5901</span></strong> = Port on the remote host (forwarded from the client PC)</span></li>
<li><span style="font-size: small;">The <span style="color: #800000; font-family: courier new,courier;"><strong>sleep</strong></span> command is of major importance in the above line as it keeps the encrypted tunnel open for 10 seconds. If no application uses it during this period of time, then it is closed. Contrariwise, if an application uses it during the 10 sec period, then the tunnel remains open until this application is shutdown. This way the tunnel is automatically closed at the time we close vncviewer&rsquo;s window, without leaving any SSH processes running on our workstation.</span></li>
</ul>
<p><span style="font-size: small;">To connect to the VNC server, open a new Xterm session and enter the following command:</span></p>
<table style="border-color: #0000cc; border-width: 1px; width: 603px; height: 19px;" dir="ltr" border="1" rules="cols">
<tbody>
<tr>
<td><span style="font-family: courier new,courier; color: #000080;"><strong><span style="font-size: small;">vncviewer localhost:6901:1</span></strong></span></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/2818.17.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/2818.17.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/2818.17.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/2818.17.jpg" alt="" border="0" /></a>&nbsp;</p>
<p style="text-align: center;">Figure 17: connection to the VNC Server</p>
<p>Instead to open two Xterm sessions to connect to VNC server, you can run all in unique command:</p>
<table style="border-color: #0000cc; border-width: 1px; width: 764px; height: 19px;" dir="ltr" border="1" rules="cols">
<tbody>
<tr>
<td><strong><span style="font-size: small; font-family: courier new,courier;"><span style="color: #000080;">ssh toor@fftest5.cloudapp.net &ndash;f &ndash;L 6901:localhost:5901 sleep 10; vncviewer localhost:6901:1</span></span></strong></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><span style="font-size: small;">A second SSH tunnel can be opened from local Linux host to the Oracle Linux IaaS VM, using the remote port 5902:</span></p>
<table style="border-color: #0000cc; border-width: 1px; width: 580px; height: 19px;" dir="ltr" border="1" rules="cols">
<tbody>
<tr>
<td>
<p align="left"><span style="font-family: courier new,courier; font-size: small;"><span style="color: #000080;"><strong>ssh </strong></span><a href="mailto:aroot@fftest5.cloudapp.net"><strong>toor@fftest5.cloudapp.net</strong></a><span style="color: #800000;"><strong> &ndash;f &ndash;L 6902:localhost:5902 -v sleep 10</strong></span></span></p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p><span style="font-size: small;">On the local linux host to remote VNC server, run the command in a new XTERM session:</span></p>
<table style="border-color: #0000cc; border-width: 1px; width: 572px; height: 19px;" dir="ltr" border="1" rules="cols">
<tbody>
<tr>
<td><span style="font-size: small; font-family: courier new,courier; color: #000080;"><strong>vncviewer localhost:6902:2</strong></span></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p><span style="font-size: small;">In VNC authentication, specify the oracle&rsquo;s user credential.</span></p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/2570.18.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/2570.18.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/2570.18.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/2570.18.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">&nbsp;Figure 18: vnc client ask for oracle&rsquo;s user credential</p>
<p>&nbsp;</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/5086.19.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/5086.19.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/VNCOracleLinux/5086.19.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-VNCOracleLinux/5086.19.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Figure 19: connection to remote Oracle Linux VM through oracle&rsquo;s user credential</p>
<p>You can connect to the VNC server with "oracle" user credential using a unique command (in single Xterm session):</p>
<table style="border-color: #0000cc; border-width: 1px;" dir="ltr" border="1" rules="cols">
<tbody>
<tr>
<td><span style="color: #000080; font-family: courier new,courier; font-size: small;">ssh oracle@fftest5.cloudapp.net &ndash;f &ndash;L 6902:localhost:5902 sleep 10; vncviewer localhost:6902:2</span></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h1 align="left"><span style="color: #000080;">6 Reference</span></h1>
<ul>
<li><span style="font-family: courier new,courier; font-size: small;">HowTo VNC: <a href="http://wiki.centos.org/HowTos/VNC-Server">http://wiki.centos.org/HowTos/VNC-Server</a></span></li>
<li><span style="font-family: courier new,courier; font-size: small;">Configuring VNC Server on Linux: <a href="http://www.oracle-base.com/articles/linux/configuring-vnc-server-on-linux.php">http://www.oracle-base.com/articles/linux/configuring-vnc-server-on-linux.php</a></span></li>
</ul>
<p align="left">&nbsp;</p>
<h1 align="left"><span style="color: #000080;">7 Glossary</span></h1>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="55">
<p align="left"><span style="font-size: small;"><strong>IaaS</strong></span></p>
</td>
<td valign="top" width="571">
<p align="left"><span style="font-size: small;">Infrastructure as a Service</span></p>
</td>
</tr>
<tr>
<td valign="top" width="55">
<p align="left"><span style="font-size: small;"><strong>SSH</strong></span></p>
</td>
<td valign="top" width="571">
<p align="left"><span style="font-size: small;">Secure Shell</span></p>
</td>
</tr>
<tr>
<td valign="top" width="55">
<p align="left"><span style="font-size: small;"><strong>VM</strong></span></p>
</td>
<td valign="top" width="571">
<p align="left"><span style="font-size: small;">Virtual Machine</span></p>
</td>
</tr>
<tr>
<td valign="top" width="55">
<p align="left"><span style="font-size: small;"><strong>VNC</strong></span></p>
</td>
<td valign="top" width="571">
<p align="left"><span style="font-size: small;">Virtual Network Computing</span></p>
</td>
</tr>
<tr>
<td valign="top" width="55">
<p align="left"><span style="font-size: small;"><strong>yum</strong></span></p>
</td>
<td valign="top" width="571">
<p align="left"><span style="font-size: small;">Yellowdog Updater, Modified (linux command)</span></p>
</td>
</tr>
</tbody>
</table>]]></content:encoded>
    </item>
    <item>
      <title>Copy an object from Amazon S3 to Azure Blob Storage</title>
      <link>https://docs.microsoft.com/archive/blogs/faber/copy-an-object-from-amazon-s3-to-azure-blob-storage</link>
      <pubDate>Mon, 14 Apr 2014 06:59:00 GMT</pubDate>
      <dc:creator><![CDATA[faberspot]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/faber/2014/04/14/copy-an-object-from-amazon-s3-to-azure-blob-storage/</guid>
      <description><![CDATA[1. Introduction: StartCopyFromBlob
The Microsoft Azure Storage team has introduced an improvement...]]></description>
      <content:encoded><![CDATA[<h1><span style="color: #000080;">1. Introduction: StartCopyFromBlob<br /></span></h1>
<p><span style="font-size: small;">The Microsoft Azure Storage team has introduced an improvement in asynchronous copy blob<a href="http://blogs.msdn.com/b/windowsazurestorage/archive/2012/06/12/introducing-asynchronous-cross-account-copy-blob.aspx"> http://blogs.msdn.com/b/windowsazurestorage/archive/2012/06/12/introducing-asynchronous-cross-account-copy-blob.aspx</a></span></p>
<p style="text-align: justify;"><span style="font-size: small;">Making copy asynchronous is a major change that greatly differs from previous versions. Previously, the Azure Blob service returns a successful response back to the user only when the copy operation has completed. With new version, the Azure Blob service will instead schedule the copy operation to be completed asynchronously: a success response only indicates that the copy operation has been successfully scheduled. In our example we can focus on&nbsp;</span><span><span style="font-size: small;"> Block Blob only. Asynchronous Blob copy is implemented through</span></span><span style="font-size: small;"><strong><span style="color: #000080;"> StartCopyFromBlob</span>,</strong> a method of<span style="color: #000080;"> <strong>CloudBlockBlob</strong></span> class belonging to the library <span style="color: #000080;"><strong>Microsoft.WindowsAzure.Storage.Blob</strong></span></span></p>
<p><span style="font-size: small;">When you call <span style="color: #000080;"><strong>StartCopyFromBlob</strong></span> operation on a blob, Blob Storage Service puts the copy operation in a queue; </span><span style="font-size: small;">since it's an asynchronous operation you wouldn't know when it will be processed. <br /></span></p>
<p><span style="font-size: small;">To track the progress of the copy can be done a polling the property</span><span style="font-size: small; color: #000080;"><strong> <span style="font-size: small; color: #000080;"><strong>CopyState</strong></span></strong></span><span style="font-size: small;"> on <strong><span style="font-size: small;"><span style="color: #000080;">CloudBlockBlob</span></span></strong>.</span></p>
<p><span style="font-size: small;"><strong><span style="font-size: small; color: #000080;"><strong>CopyState</strong></span></strong> retuns one of values:</span></p>
<p><span style="font-size: small; font-family: courier new,courier;"><strong>Aborted</strong>:&nbsp;&nbsp; The copy operation has been aborted.</span><br /><span style="font-size: small; font-family: courier new,courier;"><strong>Failed</strong>: &nbsp;&nbsp; The copy operation encountered an error.</span><br /><span style="font-size: small; font-family: courier new,courier;"><strong>Invalid</strong>:&nbsp;&nbsp; The copy status is invalid.</span><br /><span style="font-size: small; font-family: courier new,courier;"><strong>Pending</strong>:&nbsp;&nbsp; The copy operation is pending.</span><br /><span style="font-size: small; font-family: courier new,courier;"><strong>Success</strong>:&nbsp;&nbsp; The copy operation succeeded.</span></p>
<p><span style="font-size: small;">With asynchronous copy, we can copy content from Amazon S3 to Azure blob basically with the logic:</span></p>
<ol>
<li><span style="font-size: small;">get the link of the Amazon S3 source container.</span></li>
<li><span style="color: #000080; font-size: small;"><span style="color: #000000;">set a</span> <strong><span style="color: #000080;">StartCopyFromBloboperation </span></strong><span style="color: #000000;">to a destination Azure blob container.</span></span></li>
<li><span style="font-size: small;">track the copy status; if it has failed or has been aborted, start a new copy operation.</span></li>
</ol>
<p>&nbsp;</p>
<h1><span style="color: #000080;">2. Copy from Amazon S3 to Azure Block Blob in .NET </span></h1>
<p><span style="font-size: small;">A blog post has been written on how to copy from Amazon S3 to Azure blob in .NET. <a href="http://gauravmantri.com/2012/06/14/how-to-copy-an-object-from-amazon-s3-to-windows-azure-blob-storage-using-copy-blob/">http://gauravmantri.com/2012/06/14/how-to-copy-an-object-from-amazon-s3-to-windows-azure-blob-storage-using-copy-blob/</a></span></p>
<p><span style="font-size: small;">I use roughly the same code running in Visual Studio C# console application, uptodate to run on current Azure storage .NET SDK. </span></p>
<!--[if gte mso 9]><xml>
 <o:OfficeDocumentSettings>
  <o:AllowPNG/>
 </o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:Zoom>0</w:Zoom>
  <w:TrackMoves/>
  <w:TrackFormatting/>
  <w:PunctuationKerning/>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  <w:DoNotPromoteQF/>
  <w:LidThemeOther>EN-US</w:LidThemeOther>
  <w:LidThemeAsian>X-NONE</w:LidThemeAsian>
  <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
  <w:Compatibility>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
   <w:DontGrowAutofit/>
   <w:SplitPgBreakAndParaMark/>
   <w:EnableOpenTypeKerning/>
   <w:DontFlipMirrorIndents/>
   <w:OverrideTableStyleHps/>
  </w:Compatibility>
  <m:mathPr>
   <m:mathFont m:val="Cambria Math"/>
   <m:brkBin m:val="before"/>
   <m:brkBinSub m:val="&#45;-"/>
   <m:smallFrac m:val="off"/>
   <m:dispDef/>
   <m:lMargin m:val="0"/>
   <m:rMargin m:val="0"/>
   <m:defJc m:val="centerGroup"/>
   <m:wrapIndent m:val="1440"/>
   <m:intLim m:val="subSup"/>
   <m:naryLim m:val="undOvr"/>
  </m:mathPr></w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="false"
  DefSemiHidden="false" DefQFormat="false" DefPriority="99"
  LatentStyleCount="371">
  <w:LsdException Locked="false" Priority="0" QFormat="true" Name="Normal"/>
  <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 1"/>
  <w:LsdException Locked="false" Priority="9" SemiHidden="true"
   UnhideWhenUsed="true" QFormat="true" Name="heading 2"/>
  <w:LsdException Locked="false" Priority="9" SemiHidden="true"
   UnhideWhenUsed="true" QFormat="true" Name="heading 3"/>
  <w:LsdException Locked="false" Priority="9" SemiHidden="true"
   UnhideWhenUsed="true" QFormat="true" Name="heading 4"/>
  <w:LsdException Locked="false" Priority="9" SemiHidden="true"
   UnhideWhenUsed="true" QFormat="true" Name="heading 5"/>
  <w:LsdException Locked="false" Priority="9" SemiHidden="true"
   UnhideWhenUsed="true" QFormat="true" Name="heading 6"/>
  <w:LsdException Locked="false" Priority="9" SemiHidden="true"
   UnhideWhenUsed="true" QFormat="true" Name="heading 7"/>
  <w:LsdException Locked="false" Priority="9" SemiHidden="true"
   UnhideWhenUsed="true" QFormat="true" Name="heading 8"/>
  <w:LsdException Locked="false" Priority="9" SemiHidden="true"
   UnhideWhenUsed="true" QFormat="true" Name="heading 9"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="index 1"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="index 2"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="index 3"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="index 4"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="index 5"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="index 6"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="index 7"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="index 8"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="index 9"/>
  <w:LsdException Locked="false" Priority="39" SemiHidden="true"
   UnhideWhenUsed="true" Name="toc 1"/>
  <w:LsdException Locked="false" Priority="39" SemiHidden="true"
   UnhideWhenUsed="true" Name="toc 2"/>
  <w:LsdException Locked="false" Priority="39" SemiHidden="true"
   UnhideWhenUsed="true" Name="toc 3"/>
  <w:LsdException Locked="false" Priority="39" SemiHidden="true"
   UnhideWhenUsed="true" Name="toc 4"/>
  <w:LsdException Locked="false" Priority="39" SemiHidden="true"
   UnhideWhenUsed="true" Name="toc 5"/>
  <w:LsdException Locked="false" Priority="39" SemiHidden="true"
   UnhideWhenUsed="true" Name="toc 6"/>
  <w:LsdException Locked="false" Priority="39" SemiHidden="true"
   UnhideWhenUsed="true" Name="toc 7"/>
  <w:LsdException Locked="false" Priority="39" SemiHidden="true"
   UnhideWhenUsed="true" Name="toc 8"/>
  <w:LsdException Locked="false" Priority="39" SemiHidden="true"
   UnhideWhenUsed="true" Name="toc 9"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Normal Indent"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="footnote text"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="annotation text"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="header"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="footer"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="index heading"/>
  <w:LsdException Locked="false" Priority="35" SemiHidden="true"
   UnhideWhenUsed="true" QFormat="true" Name="caption"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="table of figures"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="envelope address"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="envelope return"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="footnote reference"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="annotation reference"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="line number"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="page number"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="endnote reference"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="endnote text"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="table of authorities"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="macro"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="toa heading"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="List"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="List Bullet"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="List Number"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="List 2"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="List 3"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="List 4"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="List 5"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="List Bullet 2"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="List Bullet 3"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="List Bullet 4"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="List Bullet 5"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="List Number 2"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="List Number 3"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="List Number 4"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="List Number 5"/>
  <w:LsdException Locked="false" Priority="10" QFormat="true" Name="Title"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Closing"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Signature"/>
  <w:LsdException Locked="false" Priority="1" SemiHidden="true"
   UnhideWhenUsed="true" Name="Default Paragraph Font"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Body Text"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Body Text Indent"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="List Continue"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="List Continue 2"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="List Continue 3"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="List Continue 4"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="List Continue 5"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Message Header"/>
  <w:LsdException Locked="false" Priority="11" QFormat="true" Name="Subtitle"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Salutation"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Date"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Body Text First Indent"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Body Text First Indent 2"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Note Heading"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Body Text 2"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Body Text 3"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Body Text Indent 2"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Body Text Indent 3"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Block Text"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Hyperlink"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="FollowedHyperlink"/>
  <w:LsdException Locked="false" Priority="22" QFormat="true" Name="Strong"/>
  <w:LsdException Locked="false" Priority="20" QFormat="true" Name="Emphasis"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Document Map"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Plain Text"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="E-mail Signature"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="HTML Top of Form"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="HTML Bottom of Form"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Normal (Web)"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="HTML Acronym"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="HTML Address"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="HTML Cite"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="HTML Code"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="HTML Definition"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="HTML Keyboard"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="HTML Preformatted"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="HTML Sample"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="HTML Typewriter"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="HTML Variable"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Normal Table"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="annotation subject"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="No List"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Outline List 1"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Outline List 2"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Outline List 3"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table Simple 1"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table Simple 2"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table Simple 3"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table Classic 1"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table Classic 2"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table Classic 3"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table Classic 4"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table Colorful 1"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table Colorful 2"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table Colorful 3"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table Columns 1"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table Columns 2"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table Columns 3"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table Columns 4"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table Columns 5"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table Grid 1"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table Grid 2"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table Grid 3"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table Grid 4"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table Grid 5"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table Grid 6"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table Grid 7"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table Grid 8"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table List 1"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table List 2"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table List 3"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table List 4"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table List 5"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table List 6"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table List 7"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table List 8"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table 3D effects 1"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table 3D effects 2"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table 3D effects 3"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table Contemporary"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table Elegant"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table Professional"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table Subtle 1"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table Subtle 2"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table Web 1"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table Web 2"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table Web 3"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Balloon Text"/>
  <w:LsdException Locked="false" Priority="39" Name="Table Grid"/>
  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
   Name="Table Theme"/>
  <w:LsdException Locked="false" SemiHidden="true" Name="Placeholder Text"/>
  <w:LsdException Locked="false" Priority="1" QFormat="true" Name="No Spacing"/>
  <w:LsdException Locked="false" Priority="60" Name="Light Shading"/>
  <w:LsdException Locked="false" Priority="61" Name="Light List"/>
  <w:LsdException Locked="false" Priority="62" Name="Light Grid"/>
  <w:LsdException Locked="false" Priority="63" Name="Medium Shading 1"/>
  <w:LsdException Locked="false" Priority="64" Name="Medium Shading 2"/>
  <w:LsdException Locked="false" Priority="65" Name="Medium List 1"/>
  <w:LsdException Locked="false" Priority="66" Name="Medium List 2"/>
  <w:LsdException Locked="false" Priority="67" Name="Medium Grid 1"/>
  <w:LsdException Locked="false" Priority="68" Name="Medium Grid 2"/>
  <w:LsdException Locked="false" Priority="69" Name="Medium Grid 3"/>
  <w:LsdException Locked="false" Priority="70" Name="Dark List"/>
  <w:LsdException Locked="false" Priority="71" Name="Colorful Shading"/>
  <w:LsdException Locked="false" Priority="72" Name="Colorful List"/>
  <w:LsdException Locked="false" Priority="73" Name="Colorful Grid"/>
  <w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 1"/>
  <w:LsdException Locked="false" Priority="61" Name="Light List Accent 1"/>
  <w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 1"/>
  <w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 1"/>
  <w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 1"/>
  <w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 1"/>
  <w:LsdException Locked="false" SemiHidden="true" Name="Revision"/>
  <w:LsdException Locked="false" Priority="34" QFormat="true"
   Name="List Paragraph"/>
  <w:LsdException Locked="false" Priority="29" QFormat="true" Name="Quote"/>
  <w:LsdException Locked="false" Priority="30" QFormat="true"
   Name="Intense Quote"/>
  <w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 1"/>
  <w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 1"/>
  <w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 1"/>
  <w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 1"/>
  <w:LsdException Locked="false" Priority="70" Name="Dark List Accent 1"/>
  <w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 1"/>
  <w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 1"/>
  <w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 1"/>
  <w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 2"/>
  <w:LsdException Locked="false" Priority="61" Name="Light List Accent 2"/>
  <w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 2"/>
  <w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 2"/>
  <w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 2"/>
  <w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 2"/>
  <w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 2"/>
  <w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 2"/>
  <w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 2"/>
  <w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 2"/>
  <w:LsdException Locked="false" Priority="70" Name="Dark List Accent 2"/>
  <w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 2"/>
  <w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 2"/>
  <w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 2"/>
  <w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 3"/>
  <w:LsdException Locked="false" Priority="61" Name="Light List Accent 3"/>
  <w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 3"/>
  <w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 3"/>
  <w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 3"/>
  <w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 3"/>
  <w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 3"/>
  <w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 3"/>
  <w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 3"/>
  <w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 3"/>
  <w:LsdException Locked="false" Priority="70" Name="Dark List Accent 3"/>
  <w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 3"/>
  <w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 3"/>
  <w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 3"/>
  <w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 4"/>
  <w:LsdException Locked="false" Priority="61" Name="Light List Accent 4"/>
  <w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 4"/>
  <w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 4"/>
  <w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 4"/>
  <w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 4"/>
  <w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 4"/>
  <w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 4"/>
  <w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 4"/>
  <w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 4"/>
  <w:LsdException Locked="false" Priority="70" Name="Dark List Accent 4"/>
  <w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 4"/>
  <w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 4"/>
  <w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 4"/>
  <w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 5"/>
  <w:LsdException Locked="false" Priority="61" Name="Light List Accent 5"/>
  <w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 5"/>
  <w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 5"/>
  <w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 5"/>
  <w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 5"/>
  <w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 5"/>
  <w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 5"/>
  <w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 5"/>
  <w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 5"/>
  <w:LsdException Locked="false" Priority="70" Name="Dark List Accent 5"/>
  <w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 5"/>
  <w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 5"/>
  <w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 5"/>
  <w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 6"/>
  <w:LsdException Locked="false" Priority="61" Name="Light List Accent 6"/>
  <w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 6"/>
  <w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 6"/>
  <w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 6"/>
  <w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 6"/>
  <w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 6"/>
  <w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 6"/>
  <w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 6"/>
  <w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 6"/>
  <w:LsdException Locked="false" Priority="70" Name="Dark List Accent 6"/>
  <w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 6"/>
  <w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 6"/>
  <w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 6"/>
  <w:LsdException Locked="false" Priority="19" QFormat="true"
   Name="Subtle Emphasis"/>
  <w:LsdException Locked="false" Priority="21" QFormat="true"
   Name="Intense Emphasis"/>
  <w:LsdException Locked="false" Priority="31" QFormat="true"
   Name="Subtle Reference"/>
  <w:LsdException Locked="false" Priority="32" QFormat="true"
   Name="Intense Reference"/>
  <w:LsdException Locked="false" Priority="33" QFormat="true" Name="Book Title"/>
  <w:LsdException Locked="false" Priority="37" SemiHidden="true"
   UnhideWhenUsed="true" Name="Bibliography"/>
  <w:LsdException Locked="false" Priority="39" SemiHidden="true"
   UnhideWhenUsed="true" QFormat="true" Name="TOC Heading"/>
  <w:LsdException Locked="false" Priority="41" Name="Plain Table 1"/>
  <w:LsdException Locked="false" Priority="42" Name="Plain Table 2"/>
  <w:LsdException Locked="false" Priority="43" Name="Plain Table 3"/>
  <w:LsdException Locked="false" Priority="44" Name="Plain Table 4"/>
  <w:LsdException Locked="false" Priority="45" Name="Plain Table 5"/>
  <w:LsdException Locked="false" Priority="40" Name="Grid Table Light"/>
  <w:LsdException Locked="false" Priority="46" Name="Grid Table 1 Light"/>
  <w:LsdException Locked="false" Priority="47" Name="Grid Table 2"/>
  <w:LsdException Locked="false" Priority="48" Name="Grid Table 3"/>
  <w:LsdException Locked="false" Priority="49" Name="Grid Table 4"/>
  <w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark"/>
  <w:LsdException Locked="false" Priority="51" Name="Grid Table 6 Colorful"/>
  <w:LsdException Locked="false" Priority="52" Name="Grid Table 7 Colorful"/>
  <w:LsdException Locked="false" Priority="46"
   Name="Grid Table 1 Light Accent 1"/>
  <w:LsdException Locked="false" Priority="47" Name="Grid Table 2 Accent 1"/>
  <w:LsdException Locked="false" Priority="48" Name="Grid Table 3 Accent 1"/>
  <w:LsdException Locked="false" Priority="49" Name="Grid Table 4 Accent 1"/>
  <w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark Accent 1"/>
  <w:LsdException Locked="false" Priority="51"
   Name="Grid Table 6 Colorful Accent 1"/>
  <w:LsdException Locked="false" Priority="52"
   Name="Grid Table 7 Colorful Accent 1"/>
  <w:LsdException Locked="false" Priority="46"
   Name="Grid Table 1 Light Accent 2"/>
  <w:LsdException Locked="false" Priority="47" Name="Grid Table 2 Accent 2"/>
  <w:LsdException Locked="false" Priority="48" Name="Grid Table 3 Accent 2"/>
  <w:LsdException Locked="false" Priority="49" Name="Grid Table 4 Accent 2"/>
  <w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark Accent 2"/>
  <w:LsdException Locked="false" Priority="51"
   Name="Grid Table 6 Colorful Accent 2"/>
  <w:LsdException Locked="false" Priority="52"
   Name="Grid Table 7 Colorful Accent 2"/>
  <w:LsdException Locked="false" Priority="46"
   Name="Grid Table 1 Light Accent 3"/>
  <w:LsdException Locked="false" Priority="47" Name="Grid Table 2 Accent 3"/>
  <w:LsdException Locked="false" Priority="48" Name="Grid Table 3 Accent 3"/>
  <w:LsdException Locked="false" Priority="49" Name="Grid Table 4 Accent 3"/>
  <w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark Accent 3"/>
  <w:LsdException Locked="false" Priority="51"
   Name="Grid Table 6 Colorful Accent 3"/>
  <w:LsdException Locked="false" Priority="52"
   Name="Grid Table 7 Colorful Accent 3"/>
  <w:LsdException Locked="false" Priority="46"
   Name="Grid Table 1 Light Accent 4"/>
  <w:LsdException Locked="false" Priority="47" Name="Grid Table 2 Accent 4"/>
  <w:LsdException Locked="false" Priority="48" Name="Grid Table 3 Accent 4"/>
  <w:LsdException Locked="false" Priority="49" Name="Grid Table 4 Accent 4"/>
  <w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark Accent 4"/>
  <w:LsdException Locked="false" Priority="51"
   Name="Grid Table 6 Colorful Accent 4"/>
  <w:LsdException Locked="false" Priority="52"
   Name="Grid Table 7 Colorful Accent 4"/>
  <w:LsdException Locked="false" Priority="46"
   Name="Grid Table 1 Light Accent 5"/>
  <w:LsdException Locked="false" Priority="47" Name="Grid Table 2 Accent 5"/>
  <w:LsdException Locked="false" Priority="48" Name="Grid Table 3 Accent 5"/>
  <w:LsdException Locked="false" Priority="49" Name="Grid Table 4 Accent 5"/>
  <w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark Accent 5"/>
  <w:LsdException Locked="false" Priority="51"
   Name="Grid Table 6 Colorful Accent 5"/>
  <w:LsdException Locked="false" Priority="52"
   Name="Grid Table 7 Colorful Accent 5"/>
  <w:LsdException Locked="false" Priority="46"
   Name="Grid Table 1 Light Accent 6"/>
  <w:LsdException Locked="false" Priority="47" Name="Grid Table 2 Accent 6"/>
  <w:LsdException Locked="false" Priority="48" Name="Grid Table 3 Accent 6"/>
  <w:LsdException Locked="false" Priority="49" Name="Grid Table 4 Accent 6"/>
  <w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark Accent 6"/>
  <w:LsdException Locked="false" Priority="51"
   Name="Grid Table 6 Colorful Accent 6"/>
  <w:LsdException Locked="false" Priority="52"
   Name="Grid Table 7 Colorful Accent 6"/>
  <w:LsdException Locked="false" Priority="46" Name="List Table 1 Light"/>
  <w:LsdException Locked="false" Priority="47" Name="List Table 2"/>
  <w:LsdException Locked="false" Priority="48" Name="List Table 3"/>
  <w:LsdException Locked="false" Priority="49" Name="List Table 4"/>
  <w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark"/>
  <w:LsdException Locked="false" Priority="51" Name="List Table 6 Colorful"/>
  <w:LsdException Locked="false" Priority="52" Name="List Table 7 Colorful"/>
  <w:LsdException Locked="false" Priority="46"
   Name="List Table 1 Light Accent 1"/>
  <w:LsdException Locked="false" Priority="47" Name="List Table 2 Accent 1"/>
  <w:LsdException Locked="false" Priority="48" Name="List Table 3 Accent 1"/>
  <w:LsdException Locked="false" Priority="49" Name="List Table 4 Accent 1"/>
  <w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark Accent 1"/>
  <w:LsdException Locked="false" Priority="51"
   Name="List Table 6 Colorful Accent 1"/>
  <w:LsdException Locked="false" Priority="52"
   Name="List Table 7 Colorful Accent 1"/>
  <w:LsdException Locked="false" Priority="46"
   Name="List Table 1 Light Accent 2"/>
  <w:LsdException Locked="false" Priority="47" Name="List Table 2 Accent 2"/>
  <w:LsdException Locked="false" Priority="48" Name="List Table 3 Accent 2"/>
  <w:LsdException Locked="false" Priority="49" Name="List Table 4 Accent 2"/>
  <w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark Accent 2"/>
  <w:LsdException Locked="false" Priority="51"
   Name="List Table 6 Colorful Accent 2"/>
  <w:LsdException Locked="false" Priority="52"
   Name="List Table 7 Colorful Accent 2"/>
  <w:LsdException Locked="false" Priority="46"
   Name="List Table 1 Light Accent 3"/>
  <w:LsdException Locked="false" Priority="47" Name="List Table 2 Accent 3"/>
  <w:LsdException Locked="false" Priority="48" Name="List Table 3 Accent 3"/>
  <w:LsdException Locked="false" Priority="49" Name="List Table 4 Accent 3"/>
  <w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark Accent 3"/>
  <w:LsdException Locked="false" Priority="51"
   Name="List Table 6 Colorful Accent 3"/>
  <w:LsdException Locked="false" Priority="52"
   Name="List Table 7 Colorful Accent 3"/>
  <w:LsdException Locked="false" Priority="46"
   Name="List Table 1 Light Accent 4"/>
  <w:LsdException Locked="false" Priority="47" Name="List Table 2 Accent 4"/>
  <w:LsdException Locked="false" Priority="48" Name="List Table 3 Accent 4"/>
  <w:LsdException Locked="false" Priority="49" Name="List Table 4 Accent 4"/>
  <w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark Accent 4"/>
  <w:LsdException Locked="false" Priority="51"
   Name="List Table 6 Colorful Accent 4"/>
  <w:LsdException Locked="false" Priority="52"
   Name="List Table 7 Colorful Accent 4"/>
  <w:LsdException Locked="false" Priority="46"
   Name="List Table 1 Light Accent 5"/>
  <w:LsdException Locked="false" Priority="47" Name="List Table 2 Accent 5"/>
  <w:LsdException Locked="false" Priority="48" Name="List Table 3 Accent 5"/>
  <w:LsdException Locked="false" Priority="49" Name="List Table 4 Accent 5"/>
  <w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark Accent 5"/>
  <w:LsdException Locked="false" Priority="51"
   Name="List Table 6 Colorful Accent 5"/>
  <w:LsdException Locked="false" Priority="52"
   Name="List Table 7 Colorful Accent 5"/>
  <w:LsdException Locked="false" Priority="46"
   Name="List Table 1 Light Accent 6"/>
  <w:LsdException Locked="false" Priority="47" Name="List Table 2 Accent 6"/>
  <w:LsdException Locked="false" Priority="48" Name="List Table 3 Accent 6"/>
  <w:LsdException Locked="false" Priority="49" Name="List Table 4 Accent 6"/>
  <w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark Accent 6"/>
  <w:LsdException Locked="false" Priority="51"
   Name="List Table 6 Colorful Accent 6"/>
  <w:LsdException Locked="false" Priority="52"
   Name="List Table 7 Colorful Accent 6"/>
 </w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>

<![endif]--><!--[if gte mso 9]><xml>
 <o:OfficeDocumentSettings>
  <o:AllowPNG/>
 </o:OfficeDocumentSettings>
</xml><![endif]-->
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> System;</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> System.Collections.Generic;</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> System.Linq;</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> System.Text;</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> Microsoft.WindowsAzure.Storage;</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> Microsoft.WindowsAzure.Storage.Auth;</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> Microsoft.WindowsAzure.Storage.Blob;</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> Microsoft.WindowsAzure.Storage.Blob.Protocol;</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> System.IO;</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">using</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> System.Configuration;</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"><br /></span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">namespace</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> AzureBlobStorage01</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">{</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">class </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">Program</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp; {<strong></strong></span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: green; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // <strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: green; background: none repeat scroll 0% 0% white;">amazonObjUrl&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : it is the Amazon S3 source URL</span></strong><br /></span></strong></span></strong></span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: green; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // <strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: green; background: none repeat scroll 0% 0% white;">azureStorageAccoutName</span></strong>: <strong><span style="font-size: 9.5pt; font-family: Consolas; color: green; background: none repeat scroll 0% 0% white;">it is the name of <strong><span style="font-size: 9.5pt; font-family: Consolas; color: green; background: none repeat scroll 0% 0% white;"><strong></strong>destination </span></strong>Azure</span> </strong></span></strong>storage account <br /></span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: green; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // <strong><span style="font-size: 9.5pt; font-family: Consolas; color: green; background: none repeat scroll 0% 0% white;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: green; background: none repeat scroll 0% 0% white;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: green; background: none repeat scroll 0% 0% white;">azureStorageAccoutName</span></strong></span></strong></span></strong>: <strong><span style="font-size: 9.5pt; font-family: Consolas; color: green; background: none repeat scroll 0% 0% white;">it is <strong><span style="font-size: 9.5pt; font-family: Consolas; color: green; background: none repeat scroll 0% 0% white;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: green; background: none repeat scroll 0% 0% white;">the key of destination</span></strong></span></strong></span></strong> Azure</span> </strong></span></strong>storage account</span></strong><br /></span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: green; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // azureBlobContainerName: it is the name of destination blob container&nbsp; </span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: green; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // azureBlobContainerName: it is the name of destination blob </span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">private</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">static</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">readonly</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> amazonObjectUrl = </span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ConfigurationManager</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">.AppSettings[</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: none repeat scroll 0% 0% white;">"AmazonSourceObjectURL"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">];</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">private</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">static</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">readonly</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> azureStorageAccountName = </span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ConfigurationManager</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">.AppSettings[</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: none repeat scroll 0% 0% white;">"DestinationStorageAccountName"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">];&nbsp;&nbsp;</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">private</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">static</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">readonly</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> azureStorageAccountKey = </span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ConfigurationManager</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">.AppSettings[</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: none repeat scroll 0% 0% white;">"DestinationStorageAccountKey"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">];&nbsp;&nbsp;&nbsp;&nbsp;</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">private</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">static</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">readonly</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> azureBlobContainerName = </span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ConfigurationManager</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">.AppSettings[</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: none repeat scroll 0% 0% white;">"DestinationBlobContainerName"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">];&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-size: 9.5pt; font-family: Consolas; color: green; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp; </span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">private</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">static</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">readonly</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> azureBlobName = </span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ConfigurationManager</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">.AppSettings[</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: none repeat scroll 0% 0% white;">"DestinationBlobName"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">];</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">static</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">void</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> Main(</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">string</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">[] args)</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">CloudStorageAccount</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> storageAccount = </span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">CloudStorageAccount</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">(</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">new</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;"> StorageCredentials</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">(azureStorageAccountName, azureStorageAccountKey), </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">true</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">);</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">CloudBlobClient</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> cloudBlobClient = storageAccount.CreateCloudBlobClient();</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">CloudBlobContainer</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> blobContainer = cloudBlobClient.GetContainerReference(azureBlobContainerName);</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">Console</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">.WriteLine(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: none repeat scroll 0% 0% white;">"Trying to create the blob container...."</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">);</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; blobContainer.CreateIfNotExists();</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">Console</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">.WriteLine(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: none repeat scroll 0% 0% white;">"Blob container created successfully"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">);</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">Console</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">.WriteLine(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: none repeat scroll 0% 0% white;">"------------------------------------"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">);</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">CloudBlockBlob</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> blockBlob = blobContainer.GetBlockBlobReference(azureBlobName);</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">Console</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">.WriteLine(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: none repeat scroll 0% 0% white;">"Created a reference for block blob in Windows Azure...."</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">);</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;" lang="IT">Console</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;" lang="IT">.WriteLine(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: none repeat scroll 0% 0% white;" lang="IT">"Blob Uri: "</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;" lang="IT"> + blockBlob.Uri.AbsoluteUri);</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;" lang="IT">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">Console</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">.WriteLine(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: none repeat scroll 0% 0% white;">"Now trying to initiate copy...."</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">);</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; blockBlob.StartCopyFromBlob(</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">new</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;"> Uri</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">(amazonObjectUrl), </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">null</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">, </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">null</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">, </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">null</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">);</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">Console</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">.WriteLine(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: none repeat scroll 0% 0% white;">"Copy started...."</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">);</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">Console</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">.WriteLine(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: none repeat scroll 0% 0% white;">"Now tracking blob's copy progress...."</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">);</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">DateTime</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> startTime = </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">DateTime</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">.UtcNow;</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">bool</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> continueLoop = </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">true</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">;</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">while</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> (continueLoop)</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">Console</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">.WriteLine(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: none repeat scroll 0% 0% white;">""</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">);</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">Console</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">.WriteLine(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: none repeat scroll 0% 0% white;">"Fetching lists of blobs in Azure blob container...."</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">);</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">IEnumerable</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&lt;</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">IListBlobItem</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&gt; blobsList = blobContainer.ListBlobs(</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">null</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">, </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">true</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">, </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">BlobListingDetails</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">.Copy);</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">foreach</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> (</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">var</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> blob </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">in</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> blobsList)</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">var</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> tempBlockBlob = (</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">CloudBlockBlob</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">)blob;</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">var</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> destBlob = blob </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">as </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">CloudBlockBlob</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">;</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">if</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> (tempBlockBlob.Name == azureBlobName)</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">var</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> copyStatus = tempBlockBlob.CopyState;</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">if</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> (copyStatus != </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">null</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">)</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">Console</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">.WriteLine(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: none repeat scroll 0% 0% white;">"Status of blob copy...."</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> + copyStatus.Status);</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">float</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> percentComplete = <strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">100* </span></strong></span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">float</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">.Parse(copyStatus.BytesCopied.ToString()) / </span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; float</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">.Parse(copyStatus.TotalBytes.ToString());</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">Console</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">.WriteLine(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: none repeat scroll 0% 0% white;">"Total bytes to copy...."</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> + copyStatus.TotalBytes);</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">Console</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">.WriteLine(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: none repeat scroll 0% 0% white;">"Total bytes copied....."</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> + copyStatus.BytesCopied);</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">Console</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">.WriteLine(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: none repeat scroll 0% 0% white;">"Perc. byte copied......{0:N1}"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">, percentComplete);</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">if</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> (copyStatus.Status != </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">CopyStatus</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">.Pending)</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;continueLoop = </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: none repeat scroll 0% 0% white;">false</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">;</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">Console</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">.WriteLine(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: none repeat scroll 0% 0% white;">""</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">);</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">Console</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">.WriteLine(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: none repeat scroll 0% 0% white;">"=============================================="</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">);</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.Threading.</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">Thread</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">.Sleep(1000);</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">DateTime</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> endTime = </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">DateTime</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">.UtcNow;</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">TimeSpan</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> diffTime = endTime - startTime;</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">Console</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">.ForegroundColor = </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">ConsoleColor</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">.Yellow;</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">Console</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">.WriteLine(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: none repeat scroll 0% 0% white;">"time transfer (D HH:mm:ss):&nbsp; "</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> + </span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; diffTime.Days + </span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: none repeat scroll 0% 0% white;">" "</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> + diffTime.Hours + </span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: none repeat scroll 0% 0% white;">":"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> + </span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; diffTime.Minutes + </span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: none repeat scroll 0% 0% white;">":"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;"> + diffTime.Seconds);</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">Console</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">.ResetColor();</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">Console</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">.WriteLine(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: none repeat scroll 0% 0% white;">"Press any key to terminate the program...."</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">);</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: none repeat scroll 0% 0% white;">Console</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">.ReadLine();</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">&nbsp;&nbsp;&nbsp; }</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><strong><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: none repeat scroll 0% 0% white;">}</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;">&nbsp;</p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: small;">The content of <strong>App.config</strong> file&nbsp;<span style="font-size: small;">In Visual Studio project</span> is shown below:</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;">&nbsp;</p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">&lt;?</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">xml</span><span style="font-size: 9.5pt; font-family: Consolas; color: red; background: white; mso-highlight: white;">version</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">=</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">"</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">1.0</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">"</span><span style="font-size: 9.5pt; font-family: Consolas; color: red; background: white; mso-highlight: white;">encoding</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">=</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">"</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">utf-8</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">"</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;"> ?&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">&lt;</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">configuration</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp; </span>&lt;</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">startup</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp; </span>&lt;</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">supportedRuntime</span><span style="font-size: 9.5pt; font-family: Consolas; color: red; background: white; mso-highlight: white;">version</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">=</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">"</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">v4.0</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">"</span><span style="font-size: 9.5pt; font-family: Consolas; color: red; background: white; mso-highlight: white;">sku</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">=</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">"</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">.NETFramework,Version=v4.5</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">"</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;"> /&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp; </span>&lt;/</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">startup</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp; </span>&lt;</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">appSettings</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp; </span>&lt;</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">add</span><span style="font-size: 9.5pt; font-family: Consolas; color: red; background: white; mso-highlight: white;"> key</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">=</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">"</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">AmazonsourceObjectURL</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">"</span><span style="font-size: 9.5pt; font-family: Consolas; color: red; background: white; mso-highlight: white;">value</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">=</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">"</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">http://AMAZON_URL</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">"</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">/&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp; </span>&lt;</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">add</span><span style="font-size: 9.5pt; font-family: Consolas; color: red; background: white; mso-highlight: white;"> key</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">=</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">"</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">DestinationStorageAccountName</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">"</span><span style="font-size: 9.5pt; font-family: Consolas; color: red; background: white; mso-highlight: white;">value</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">=</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="color: #0000ff;">AZURE_DESTINATION_STORAGE_ACCOUNT_NAME</span>"</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">/&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp; </span>&lt;</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">add </span><span style="font-size: 9.5pt; font-family: Consolas; color: red; background: white; mso-highlight: white;">key</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">=</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">"</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">DestinationStorageAccountKey</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">"</span><span style="font-size: 9.5pt; font-family: Consolas; color: red; background: white; mso-highlight: white;">value</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">=</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">"</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">AZURE_DESTINATION_STORAGE_ACCOUNT</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="color: #0000ff;">_KEY</span>"</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">/&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp; </span>&lt;</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">add </span><span style="font-size: 9.5pt; font-family: Consolas; color: red; background: white; mso-highlight: white;">key</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">=</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">"</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">DestinationBlobContainerName</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">"</span><span style="font-size: 9.5pt; font-family: Consolas; color: red; background: white; mso-highlight: white;">value</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">=</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">"</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">AZURE_BLOB_CONTAINER_NAME</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">"</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">/&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp; </span>&lt;</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">add </span><span style="font-size: 9.5pt; font-family: Consolas; color: red; background: white; mso-highlight: white;">key</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">=</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">"</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">DestinationBlobName</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">"</span><span style="font-size: 9.5pt; font-family: Consolas; color: red; background: white; mso-highlight: white;">value</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">=</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">"<span style="color: #0000ff;">BLOB_NAME</span></span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">"</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">/&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp; </span>&lt;/</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">appSettings</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">&gt;</span></p>
<p class="MsoNormal"><span style="font-size: 9.5pt; line-height: 107%; font-family: Consolas; color: blue; background: white; mso-highlight: white;">&lt;/</span><span style="font-size: 9.5pt; line-height: 107%; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">configuration</span><span style="font-size: 9.5pt; line-height: 107%; font-family: Consolas; color: blue; background: white; mso-highlight: white;">&gt;</span></p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal"><span style="font-size: small;">Before running the project set the right values in Visual Studio <strong>App.config</strong> file.</span></p>
<p class="MsoNormal"><span style="font-size: small;">To compile and run the program you need to reference the Windows Azure Storage Library for .NET available on&nbsp; NuGet:&nbsp; <a href="http://www.nuget.org/packages/WindowsAzure.Storage/">http://www.nuget.org/packages/WindowsAzure.Storage/</a> </span></p>
<p class="MsoNormal">Azure Storage library can be installed easily through <span style="font-size: small;">Visual Studio Package Management; from Visual Studio open <strong>TOOLS</strong> -&gt; <strong>NuGet Package Manager</strong> -&gt; <strong>Package Manager Console</strong><br /></span></p>
<p class="MsoNormal" style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/CopyFromAmazonS3/8507.01.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-CopyFromAmazonS3/8507.01.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/CopyFromAmazonS3/8507.01.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-CopyFromAmazonS3/8507.01.jpg" alt="" border="0" /></a><span><strong>Figure1</strong> Visual Studio menu navigation to access to NuGet Package Manager&nbsp;</span></p>
<p class="MsoNormal"><span style="font-size: small;">In the windows below is shown the Visual Studio<span style="color: #000080;"> Package Management</span> (PM) Console</span></p>
<p class="MsoNormal" style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/CopyFromAmazonS3/3465.02.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-CopyFromAmazonS3/3465.02.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/CopyFromAmazonS3/3465.02.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-CopyFromAmazonS3/3465.02.jpg" alt="" border="0" /></a><span><strong>Figure2</strong> Visual Studio Package Management Console</span></p>
<p class="MsoNormal" style="text-align: center;"><span><br /></span></p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal"><span style="font-size: small;">In Package Management (PM) Console write the command:</span></p>
<p class="MsoNormal"><span style="font-size: small;"><strong>PM&gt;<span style="color: #0000ff;"> Install-Package WindowsAzure.Storage</span></strong></span></p>
<p class="MsoNormal"><span style="font-size: small;">NuGet install following libraries (from log):</span><br /><span style="font-family: courier new,courier; font-size: small;">Attempting to resolve dependency '<span style="color: #ff0000;"><strong>Microsoft.Data.OData</strong></span> (&ge; 5.6.0)'.</span><br /><span style="font-family: courier new,courier; font-size: small;">Attempting to resolve dependency '<span style="color: #ff0000;"><strong>System.Spatial</strong></span> (= 5.6.0)'.</span><br /><span style="font-family: courier new,courier; font-size: small;">Attempting to resolve dependency '<span style="color: #ff0000;"><strong>Microsoft.Data.Edm</strong></span> (= 5.6.0)'.</span><br /><span style="font-family: courier new,courier; font-size: small;">Attempting to resolve dependency '<span style="color: #ff0000;"><strong>Newtonsoft.Json</strong></span> (&ge; 5.0.6)'.</span><br /><span style="font-family: courier new,courier; font-size: small;">Attempting to resolve dependency '<span style="color: #ff0000;"><strong>Microsoft.Data.Services.Client</strong></span> (&ge; 5.6.0)'.</span><br /><span style="font-family: courier new,courier; font-size: small;">Attempting to resolve dependency '<span style="color: #ff0000;"><strong>Microsoft.WindowsAzure.ConfigurationManager</strong></span> (&ge; 1.8.0.0)'.</span><span style="font-size: small;"><br /></span></p>
<p><strong><span style="font-size: small;">.........</span></strong></p>
<p><span style="font-size: small;">The list of all included libraries included through NuGet is reported in Figure 3</span> <br /><strong></strong></p>
<p style="text-align: center;"><span style="font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/CopyFromAmazonS3/4744.03.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-CopyFromAmazonS3/4744.03.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/CopyFromAmazonS3/4744.03.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-CopyFromAmazonS3/4744.03.jpg" alt="" width="391" height="342" border="0" /></a></span></p>
<p style="text-align: center;"><strong>Figure3</strong> list <span style="font-size: small;">of libraries included through NuGet</span></p>
<p style="text-align: center;"><span style="font-size: small;"><br /></span></p>
<p>&nbsp;</p>
<p><span style="font-size: small;">To read the pairs (key, value) in <strong>App.config</strong> we need to add to the Visual Studio project the system library: <span style="color: #000080;"><strong>System.Configuration</strong></span></span></p>
<p>&nbsp;</p>
<h1><span style="color: #000080;">3. Copy from Amazon S3 to Azure Block Blob in Java </span></h1>
<p><span style="font-size: small;">Microsoft has published the Windows Azure Storage SDK for Java at GitHub&nbsp; <a href="https://github.com/Azure/azure-storage-java">https://github.com/Azure/azure-storage-java</a> and the related documentation is available at the link :<a href="http://dl.windowsazure.com/storage/javadoc/">http://dl.windowsazure.com/storage/javadoc</a></span></p>
<p><span style="font-size: small;">Using the <span style="font-size: small;">Windows Azure Storage SDK for Java </span>we can port the code from.NET (see code above) to Java:</span></p>
<p>&nbsp;</p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: green; background: white; mso-highlight: white;">// This java program copies the content from Amazon S3 to Azure Storage block blob </span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: green; background: white; mso-highlight: white;">// Before running fill up the right input values for:</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: green; background: white; mso-highlight: white;">//<span style="mso-spacerun: yes;">&nbsp;&nbsp; </span>azureStorageAccountName : Name of the Azure Storage Account<span style="mso-spacerun: yes;">&nbsp; </span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: green; background: white; mso-highlight: white;">//<span style="mso-spacerun: yes;">&nbsp;&nbsp; </span>azureStorageAccountKey<span style="mso-spacerun: yes;">&nbsp; </span>: Primary Key of the Azure Storage Account </span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: green; background: white; mso-highlight: white;">//<span style="mso-spacerun: yes;">&nbsp;&nbsp; </span>azureBlobContainerName<span style="mso-spacerun: yes;">&nbsp; </span>: Name of Azure blob destination container name</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: green; background: white; mso-highlight: white;">//<span style="mso-spacerun: yes;">&nbsp;&nbsp; </span>amazonObjectUrl<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>: URL of input file</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: green; background: white; mso-highlight: white;">//<span style="mso-spacerun: yes;">&nbsp;&nbsp; </span>azureBlobName<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>: Name of destination blob in Azure Storage Account</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="color: #0000ff;">package</span> test2;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="color: #0000ff;">import</span> com.microsoft.windowsazure.storage.*;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="color: #0000ff;">import</span> com.microsoft.windowsazure.storage.blob.*;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="color: #0000ff;">import</span> java.net.URISyntaxException;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="color: #0000ff;">import</span> java.security.InvalidKeyException;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="color: #0000ff;">import</span> java.io.FileNotFoundException;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="color: #0000ff;">import</span> java.io.IOException;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="color: #0000ff;">import</span> java.net.URI;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="color: #0000ff;">import</span> java.util.*;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">&nbsp;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">public</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">class</span><span style="font-size: 9.5pt; font-family: Consolas; color: #2b91af; background: white; mso-highlight: white;">S3toBlob</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> {</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;</span></span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;"> private</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">static</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> final String amazonObjectUrl = </span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">"http://AMAZON_URL/"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;</span></span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;"> private</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">static</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> final String azureStorageAccountName = </span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">"AZURE_DESTINATION_STORAGE_ACCOUNT_NAME"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">; </span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp; </span></span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">private</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">static</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> final String azureStorageAccountKey = </span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">"AZURE_DESTINATION_STORAGE_ACCOUNT_KEY"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">;<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp; </span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp; </span></span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">private</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">static</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> final String azureBlobContainerName = </span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">"</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;"><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">AZURE_BLOB_CONTAINER_NAME</span>"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">;<span style="mso-spacerun: yes;">&nbsp; </span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp; </span></span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">private</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">static</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> final String azureBlobName = </span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">"AZURE_BLOB_NAME"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp; </span></span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">private</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">static</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> String storageConnectionString ;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp; </span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">&nbsp; public</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">static</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">void</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> main(String[] args) throws </span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; URISyntaxException, </span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; StorageException, </span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InvalidKeyException,FileNotFoundException, </span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IOException {<span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">try</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 9.5pt; font-family: Consolas; color: green; background: white; mso-highlight: white;">//Define the connection-string with your values</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; </span>StringBuilder _sb = </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">new</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> StringBuilder();</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>_sb.append(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">"DefaultEndpointsProtocol=http;"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">).append(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">"AccountName="</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">);</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>_sb.append(azureStorageAccountName);</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>_sb.append(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">";"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">);</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>_sb.append(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">"AccountKey="</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">);</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>_sb.append(azureStorageAccountKey);</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>storageConnectionString = _sb.toString();</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 5;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-spacerun: yes;">&nbsp;</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 9.5pt; font-family: Consolas; color: green; background: white; mso-highlight: white;">// Retrieve storage account from connection-string</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 9.5pt; font-family: Consolas; color: green; background: white; mso-highlight: white;">// Retrieve storage account from connection-string</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>CloudStorageAccount storageAccount = CloudStorageAccount.parse(storageConnectionString);</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>CloudBlobClient blobClient = storageAccount.createCloudBlobClient();</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>CloudBlobContainer container = blobClient.getContainerReference(azureBlobContainerName);</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">&nbsp;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 9.5pt; font-family: Consolas; color: green; background: white; mso-highlight: white;">// Create the container if it does not exist</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>container.createIfNotExists();<span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp; </span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>CloudBlockBlob blockBlob = container.getBlockBlobReference(azureBlobName);</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>System.</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">out</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">.println(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">"Created a reference for block blob in Windows Azure...."</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">);</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>System.</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">out</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">.println(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">"Blob Uri: "</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> + blockBlob.getUri());</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>System.</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">out</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">.println(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">"Now trying to initiate copy...."</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">);</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></p>
<p><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>OperationContext op = </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">new</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> OperationContext();<span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>blockBlob.startCopyFromBlob(</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">new</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> URI(amazonObjectUrl), </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">null</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">, </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">null</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">, </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">null</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">,op);</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>System.</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">out</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">.println(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">"Copy started...."</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">);</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>System.</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">out</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">.println(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">"Now tracking blob's copy progress...."</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">);</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Date startTime = </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">new</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> Date();</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">&nbsp;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>boolean continueLoop = </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">true</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp; </span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">while</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> (continueLoop)</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>System.</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">out</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">.println(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">""</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">);</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>System.</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">out</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">.println(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">"Fetching lists of blobs in Azure blob container...."</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">);</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Iterable&lt;ListBlobItem&gt; blobsList = container.listBlobs(</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">null</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">, </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">true</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">, EnumSet.of(BlobListingDetails.COPY), </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">null</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">, op);</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">for</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> (ListBlobItem blob : blobsList)</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>CloudBlockBlob tempBlockBlob = (CloudBlockBlob) blob;</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>System.</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">out</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">.println(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">"Name<span style="mso-spacerun: yes;">&nbsp; </span>blockblob in cast: "</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">+ tempBlockBlob.getName().toString());</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white; mso-ansi-language: IT;" lang="IT">System.</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white; mso-ansi-language: IT;" lang="IT">out</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white; mso-ansi-language: IT;" lang="IT">.println(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white; mso-ansi-language: IT;" lang="IT">"URI<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>: "</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white; mso-ansi-language: IT;" lang="IT">+ tempBlockBlob.getUri().toString());</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white; mso-ansi-language: IT;" lang="IT"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">if</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> ((tempBlockBlob.getName()).equals(azureBlobName))</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>CopyState copyStatus =<span style="mso-spacerun: yes;">&nbsp; </span>(CopyState) tempBlockBlob.getCopyState();<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></p>
<p><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>System.</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">out</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">.println(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">"Getting CopyState......"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">);</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">if</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> (tempBlockBlob != </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">null</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">)</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1;">&nbsp;&nbsp; </span>System.</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">out</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">.println(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">"Status blob copy......"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> + tempBlockBlob.getCopyState().getStatus().toString());</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1;">&nbsp;&nbsp; </span>System.</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">out</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">.println(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">"Total bytes..........."</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> + tempBlockBlob.getCopyState().getTotalBytes());</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1;">&nbsp;&nbsp; </span>System.</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">out</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">.println(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">"Total bytes to copy..."</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> + tempBlockBlob.getCopyState().getBytesCopied());</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1;">&nbsp;&nbsp; </span></span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">float</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> percentComplete = 100* </span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ( tempBlockBlob.getCopyState().getBytesCopied()).floatValue() / </span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ( tempBlockBlob.getCopyState().getTotalBytes()).floatValue();</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="mso-tab-count: 1;">&nbsp;&nbsp; </span>System.</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">out</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">.print(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">"Perc. byte copied......"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">);</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1;">&nbsp;&nbsp; </span>System.</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">out</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">.format(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">"%.2f\n"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">, percentComplete);<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1;">&nbsp;&nbsp; </span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">if</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> (copyStatus.getStatus() != CopyStatus.PENDING)</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>continueLoop = </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">false</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>System.</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">out</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">.println(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">"=============================================="</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">);</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Thread.sleep(1000);</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Date endTime = </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">new</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> Date();<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">long</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> diffTime = endTime.getTime() - startTime.getTime();</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">long</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> diffSeconds = diffTime / 1000 % 60;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">long</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> diffMinutes = diffTime / (60 * 1000) % 60;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">long</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> diffHours = diffTime / (60 * 60 * 1000) % 24;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">long</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> diffDays = diffTime / (24 * 60 * 60 * 1000);</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">&nbsp;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>System.</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">out</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">.println(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">"time transfer (D HH:mm:ss):<span style="mso-spacerun: yes;">&nbsp; </span>"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">+ </span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>diffDays + </span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">" "</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> + </span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>diffHours +</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">":"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">+ </span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>diffMinutes+</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">":"</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">+</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>diffSeconds);</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>System.</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">out</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">.println(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">"Press any key to terminate the program...."</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">);</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>System.</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">in</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">.read();<span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="mso-spacerun: yes;">&nbsp; </span>} </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">catch</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> (StorageException storageException) {</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>System.</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">out</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">.print(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">"StorageException encountered: "</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">);</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>System.</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">out</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">.println(storageException.getMessage());</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>System.exit(-1);</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="mso-spacerun: yes;">&nbsp;&nbsp; </span>} </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">catch</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> (URISyntaxException uriSyntaxException) {</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>System.</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">out</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">.print(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">"URISyntaxException encountered: "</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">);</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>System.</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">out</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">.println(uriSyntaxException.getMessage());</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>System.exit(-1);</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="mso-spacerun: yes;">&nbsp; </span>} </span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">catch</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"> (Exception e) {</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>System.</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">out</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">.print(</span><span style="font-size: 9.5pt; font-family: Consolas; color: #a31515; background: white; mso-highlight: white;">"Exception encountered: "</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">);</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>System.</span><span style="font-size: 9.5pt; font-family: Consolas; color: blue; background: white; mso-highlight: white;">out</span><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">.println(e.getMessage());</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>System.exit(-1);</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="mso-spacerun: yes;">&nbsp; </span>}</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;"><span style="mso-tab-count: 1;">&nbsp; </span>}</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-layout-grid-align: none; text-autospace: none;"><span style="font-size: 9.5pt; font-family: Consolas; color: black; background: white; mso-highlight: white;">}</span></p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Burst to Azure with Microsoft HPC Pack 2012 R2: a step-by-step configuration guide</title>
      <link>https://docs.microsoft.com/archive/blogs/faber/burst-to-azure-with-microsoft-hpc-pack-2012-r2-a-step-by-step-configuration-guide</link>
      <pubDate>Sun, 13 Apr 2014 02:52:00 GMT</pubDate>
      <dc:creator><![CDATA[faberspot]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/faber/2014/04/13/burst-to-azure-with-microsoft-hpc-pack-2012-r2-a-step-by-step-configuration-guide/</guid>
      <description><![CDATA[1&nbsp;Introduction
This&nbsp;blog shows you how to use Microsoft HPC Pack 2012 R2 and Microsoft...]]></description>
      <content:encoded><![CDATA[<h1 style="text-align: justify;"><span style="color: #000080;">1&nbsp;Introduction</span></h1>
<p style="text-align: justify;"><span style="font-size: small;">This&nbsp;blog shows you how to use Microsoft HPC Pack 2012 R2 and Microsoft Azure to set up an High Performance Computing (HPC) cluster. Microsoft HPC Pack 2012 R2 is a middleware free of change, available at Microsoft download center: <span style="font-size: small;"> <a href="http://www.microsoft.com/en-gb/download/details.aspx?id=41630">http://www.microsoft.com/en-gb/download/details.aspx?id=41630</a> </span></span></p>
<p style="text-align: justify;"><span style="font-size: small;">This&nbsp;blog assumes no prior experience with HPC Pack and&nbsp;it is intended only to help you deploy a cluster quickly for demonstration </span><span style="font-size: small;">purposes. The cluster will consist of an&nbsp; head node</span><span style="font-size: small;"> running in Azure IaaS Virtual Machine and some compute nodes you </span><span style="font-size: small;">deploy on-demand as Azure worker role instances in Azure Cloud Service. Some of technical choices used in this&nbsp;paper are not recommended in a production environment, and they are used for demonstration purposes only. The examples in this&nbsp;paper refer to Windows Server&nbsp;2012&nbsp;R2. H</span><span style="font-size: small;">ere the table of content:</span></p>
<table style="width: 737px; height: 378px;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="76">
<p style="text-align: center;" align="left"><strong>Chapter</strong></p>
</td>
<td valign="top" width="543">
<p style="text-align: center;" align="left"><strong>Title</strong></p>
</td>
</tr>
<tr>
<td valign="top" width="76">
<p style="text-align: center;" align="left"><span style="font-size: large;">2</span></p>
</td>
<td valign="top" width="543">
<p align="left"><strong>Lab topology architecture for Windows HPC in Azure </strong></p>
<p align="left">Provides an overview of the lab architecture that was implemented, with a description of all HPC nodes run in Windows Azure.</p>
</td>
</tr>
<tr>
<td valign="top" width="76">
<p style="text-align: center;" align="left"><span style="font-size: large;">&nbsp;3</span></p>
</td>
<td valign="top" width="543">
<p align="left"><strong>Pre installation tasks in Azure</strong></p>
<p style="text-align: justify;" align="left">Few propaedeutic operations in Windows Azure are required before creation of the HPC cluster in Azure: defining of an Azure.Affinity Group, Azure Storage Account and Azure VNET (Virtual Network). All the propaedeutic operations can be done through Azure Management Portal. If you are already familiar with Azure environment, you can skip this part.</p>
</td>
</tr>
<tr>
<td valign="top" width="76">
<p style="text-align: center;" align="left"><span style="font-size: large;">4</span></p>
</td>
<td valign="top" width="543">
<p align="left"><strong>Configuring the Windows HPC head node</strong><strong></strong></p>
<p style="text-align: justify;" align="left">Describes the procedure to configure the head node of HPC cluster and install the HPC Pack. The HPC head node runs in Windows Azure IaaS VM and for simplicity&rsquo;s sake is a root domain controller managing authentication and authorization.</p>
</td>
</tr>
<tr>
<td valign="top" width="76">
<p style="text-align: center;" align="left"><span style="font-size: large;">5</span></p>
</td>
<td valign="top" width="543">
<p style="text-align: justify;" align="left"><strong>Prepare the Azure subscription</strong><strong></strong></p>
<p style="text-align: justify;" align="left">Show up the steps required to the head node to communicate with Azure subscription, setup of the Azure Cloud Service and Azure Storage Account associated with HPC Azure compute nodes.</p>
</td>
</tr>
<tr>
<td valign="top" width="76">
<p style="text-align: center;" align="left"><span style="font-size: large;">6</span></p>
</td>
<td valign="top" width="543">
<p align="left"><strong>Deploying Windows Azure nodes in Windows HPC Server 2012 R2</strong><strong></strong></p>
<p style="text-align: justify;" align="left">Presents the procedure to add and remove Windows Azure nodes to the HPC cluster.</p>
</td>
</tr>
</tbody>
</table>
<p style="text-align: justify;" align="left">&nbsp;</p>
<h1 style="text-align: justify;" align="left"><span style="color: #000080;">2 Lab topology architecture for Windows HPC in Azure</span></h1>
<p style="text-align: justify;" align="left"><span style="font-size: small;">Our Windows HPC Server architecture consists of one head node a some compute nodes run in Azure (the topology is shown in Figure&nbsp;1):</span></p>
<ul style="text-align: justify;">
<li>
<div style="text-align: justify;"><span style="font-size: small;">The head node is the master node in the HPC cluster and runs in Azure IaaS Virtual Machine (VM). It controls and manages all resources that are available in HPC system.</span></div>
</li>
<li style="text-align: justify;"><span style="font-size: small;">All HPC compute nodes (slaves of the cluster) run in Azure as Worker Role (PaaS).</span></li>
<li><span style="font-size: small;">In the midst of deployment of HPC compute nodes in Azure, two or more Compute Proxies (Azure Worker Roles) are created</span><span style="font-size: small;"> automatically to control communications between the head node and the compute nodes.</span></li>
</ul>
<p style="text-align: center;" align="left">&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8233.01.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8233.01.jpg"> <img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8233.01.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8233.01.jpg" alt="" width="735" height="472" /> </a><strong>Figure </strong><strong>1</strong>&nbsp;&nbsp;&nbsp;Architecture of the Windows HPC Server cluster fully in Azure</p>
<p style="text-align: justify;"><span style="font-size: small;">In Windows HPC Server, the cluster authorization and authentication is based on an Active Directory domain controller. For stability and security in a production environment, it is recommended that you install a domain controller on a dedicated Azure IaaS VM that is different from the HPC head node. However, in our lab to save up some resources, the domain controller is installed on the head node of the HPC cluster as the root domain <strong>hpcdom.local</strong>. &nbsp;The Windows domain is set in Azure and it is not propagated to on-premises; in case were necessary integrate the user&rsquo;s credential with on-premises credential an Azure site-to-site VPN will be needed to interconnect the Azure VNET (Virtual Network) with existing AD DC on-premises. Our HPC head node in IaaS VM is attached to the Azure Virtual Network with network belonging to the subnet 10.1.1.0/24.</span></p>
<p style="text-align: justify;" align="left"><span style="font-size: small;">The first step to create a cluster in Windows HPC Server is to configure the HPC head node.</span></p>
<p style="text-align: justify;" align="left">&nbsp;</p>
<h1 style="text-align: justify;" align="left"><span style="color: #000080;">3&nbsp;Pre installation tasks in Azure</span></h1>
<p style="text-align: justify;" align="left"><span style="font-size: small;">Few basic pre installation tasks has to be completed thought the Azure Management portal before setting up the HPC cluster fully in Azure.</span></p>
<h2 style="text-align: justify;"><span style="color: #000080;">&nbsp; 3.1&nbsp;&nbsp;Definite an Azure Affinity Group</span></h2>
<p style="text-align: justify;"><span style="font-size: small;">Affinity groups are the way to group the services in your Windows Azure subscription that need to work together in order to achieve optimal performance. When you create an affinity group, it lets Azure know to keep all of the services that belong to your affinity group running at the same data center cluster. This reduces latency and increases performance.</span></p>
<p style="text-align: justify;"><span style="font-size: small;">Login in Azure Management portal, select &ldquo;<strong>SETTING</strong>&rdquo; tab, &ldquo;<strong>AFFITINITY GROUPS</strong>&rdquo; and therefore click-on &ldquo;<strong>ADD AN AFFINITY GROUP</strong>&rdquo;</span></p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/3750.02.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/3750.02.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/3750.02.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/3750.02.jpg" alt="" width="483" height="273" border="0" /></a><strong>Figure </strong><strong>2</strong> Add a new Affinity Group</p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/5861.03.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/5861.03.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/5861.03.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/5861.03.jpg" alt="" width="396" height="314" border="0" /></a><strong>Figure </strong><strong>3</strong>&nbsp; Selection of specific Azure datacenter associated with affinity group</p>
<p style="text-align: justify;">&nbsp;</p>
<h2 style="text-align: justify;"><span style="color: #000080;">&nbsp; 3.2&nbsp;Define an Azure Storage Account</span></h2>
<p style="text-align: justify;">&nbsp;An Azure Storage Account is required to store the image (.VHD file) of HPC head node running in Azure IaaS VM.</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/2210.04.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/2210.04.jpg"> <img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/2210.04.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/2210.04.jpg" alt="" width="455" height="205" /></a><strong>Figure </strong><strong>4</strong>&nbsp;&nbsp;&nbsp;create a new Azure Storage account</p>
<p style="text-align: justify;"><span style="font-size: small;">In our lab we haven&rsquo;t any interest for geo resiliency of the head node, for this reason the Azure storage account is created with <strong>Local Redundant</strong>; in production is recommended usage of Azure <strong>Geo-Redundant</strong>&nbsp; storage account to guarantee data recovery in case of major disaster on the Azure primary datacenter.</span></p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8836.05.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8836.05.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8836.05.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8836.05.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>5</strong>&nbsp;&nbsp;&nbsp;specify the URL for the storage account and reference the affinity group created in previous step</p>
<p style="text-align: justify;">&nbsp;</p>
<h2 style="text-align: justify;"><span style="color: #000080;">&nbsp; 3.3&nbsp;&nbsp;Define an Azure VNET</span></h2>
<p style="text-align: justify;"><span style="font-size: small;">Azure Virtual Network (VNET) is a virtual segment in Azure datacenter to interconnect Virtual Machines (IaaS and PaaS); we proceed now in the creation of HPC Virtual VNET.</span></p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1754.06.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1754.06.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1754.06.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1754.06.jpg" alt="" width="465" height="346" border="0" /></a><strong>Figure </strong><strong>6</strong>&nbsp; add a new VNET</p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8117.07.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8117.07.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8117.07.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8117.07.jpg" alt="" width="391" height="301" border="0" /></a><strong>Figure </strong><strong>7</strong> specify a mnemonic name for the VNET and the affinity group created in previous step</p>
<p style="text-align: justify;"><span style="font-size: small;">In our configuration the head node is a root domain AD and runs in IaaS VM connected to the VNET. A right setup requires that the DHCP </span><span style="font-size: small;">serves associated to the VNET assigns as DNS the IP Address of Domain Controller. The head node will borrow the IP address <strong>.4</strong> (see <strong>Figure 8A </strong>and<strong> Figure 8B</strong>).</span></p>
<p>&nbsp;</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/6433.07B.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/6433.07B.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/6433.07B.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/6433.07B.jpg" alt="" width="457" height="231" border="0" /></a>&nbsp;</p>
<p style="text-align: center;"><strong>Figure </strong><strong>8A</strong> DNS server and DHCP server associated to the Azure VNET</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/2211.08.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/2211.08.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/2211.08.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/2211.08.jpg" alt="" width="597" height="252" border="0" /></a><strong>Figure </strong><strong>8B</strong> the HPC head node is the DNS server for the Azure VNET</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/3252.09.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/3252.09.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/3252.09.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/3252.09.jpg" alt="" width="583" height="372" border="0" /></a><strong>Figure </strong><strong>9</strong>&nbsp;&nbsp;&nbsp;specify the major network and a subnet associated to the VNET</p>
<p style="text-align: center;">&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1643.10.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1643.10.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1643.10.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1643.10.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>10</strong>&nbsp;&nbsp;&nbsp;VNET configuration summary</p>
<p style="text-align: justify;">&nbsp;</p>
<h2 style="text-align: justify;"><span style="color: #000080;">3.4&nbsp;Add an Azure IaaS VM to run the HPC head node</span></h2>
<p style="text-align: justify;"><span style="font-size: small;">We are now ready to define the Azure IaaS VM to guest the HPC head node.</span></p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/5773.11.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/5773.11.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/5773.11.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/5773.11.jpg" alt="" width="200" height="309" border="0" /></a><strong>Figure </strong><strong>11</strong><strong> </strong>add a new Azure IaaS VM through the Azure Management portal</p>
<p style="text-align: center;">&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8867.12.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8867.12.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8867.12.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8867.12.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>12</strong> selection of the OS in images library</p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1854.13.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1854.13.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1854.13.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1854.13.jpg" alt="" width="446" height="336" border="0" /></a><strong>Figure </strong><strong>13</strong> choice Windows Server 2012 R2 OS image</p>
<p style="text-align: center;"><strong><br /></strong></p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/0385.14.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/0385.14.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/0385.14.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/0385.14.jpg" alt="" width="414" height="368" border="0" /></a><strong>Figure </strong><strong>14</strong> define the hostname, size and local administrator password for the Azure IaaS VM</p>
<p style="text-align: center;"><strong><br /></strong></p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/4341.15.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/4341.15.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/4341.15.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/4341.15.jpg" alt="" width="418" height="424" border="0" /></a><strong>Figure </strong><strong>15</strong> define the cloud service, virtual network and storage account associated with IaaS VM</p>
<p style="text-align: justify;"><span style="font-size: small;">Cloud Services is a logical container for one or more Virtual Machines. You can create a cloud service for a single VM or you can load balance multiple VMs by placing them in the same cloud service.</span></p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/7737.16.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/7737.16.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/7737.16.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/7737.16.jpg" alt="" width="493" height="268" border="0" /></a><strong>Figure </strong><strong>16</strong> define the VM Agent and endpoints</p>
<p style="text-align: justify;"><span style="font-size: small;">The VM Agent is used to install and manage extensions that help you interact with the VM (for example password recovery).<br /></span></p>
<p style="text-align: justify;">&nbsp;</p>
<h1 style="text-align: justify;">&nbsp;<span style="color: #000080;">4&nbsp;Configuring the Windows HPC head node</span></h1>
<p style="text-align: justify;" align="left"><span style="font-size: small;">The Windows HPC Server head node is the mandatory host for our lab; use the following process to install Windows Server&nbsp;2012&nbsp;R2 on Azure IaaS VM and configure the head node.</span></p>
<h2 style="text-align: justify;" align="left"><span style="color: #000080;">&nbsp; 4.1&nbsp;Promote the HPC head node as the domain controller</span></h2>
<p style="text-align: justify;" align="left"><span style="font-size: small;">Login in via RDP to the IaaS VM by local administrator credential and promote the HPC head node as the domain controller:</span></p>
<p><span style="font-size: small;">1. In the server manager click-on <strong>Add role and features</strong>:</span></p>
<p style="text-align: center;" align="left">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/2577.17.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/2577.17.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/2577.17.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/2577.17.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>17</strong>&nbsp;&nbsp;&nbsp;Add a new Role</p>
<p style="text-align: center;" align="left">&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/6445.18.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/6445.18.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/6445.18.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/6445.18.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>18</strong>&nbsp;&nbsp;&nbsp;selection of Role-based installation</p>
<p style="text-align: center;" align="left">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8244.19.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8244.19.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8244.19.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8244.19.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>19</strong>&nbsp;&nbsp;&nbsp;Add the <strong>Active Directory Domain Services</strong> role</p>
<p style="text-align: center;" align="left">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/2620.20.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/2620.20.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/2620.20.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/2620.20.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>20</strong>&nbsp;&nbsp;&nbsp;AD DC role installation component</p>
<p style="text-align: center;" align="left">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1033.21.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1033.21.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1033.21.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1033.21.jpg" alt="" width="482" height="84" border="0" /></a><strong>Figure </strong><strong>21</strong> to complete installation of AD DC role access to the system tasks</p>
<p style="text-align: justify;" align="left">&nbsp;<span style="font-size: small;">When the AD Directory Domain Services are installed, select the icon flag and choice &ldquo;<strong>Promote this server to domain controller</strong>&rdquo;</span></p>
<p style="text-align: center;" align="left">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8054.22.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8054.22.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8054.22.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8054.22.jpg" alt="" width="516" height="331" border="0" /></a><strong>Figure </strong><strong>22</strong>&nbsp;&nbsp;&nbsp;Promotion of IaaS VM as AD Domain Controller</p>
<p><span style="font-size: small;">2. Specify the option to create a new domain in a new forest:</span></p>
<p style="text-align: center;" align="left">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1680.23.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1680.23.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1680.23.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1680.23.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>23</strong>&nbsp;&nbsp;&nbsp;define the IaaS VM as root domain controller and assign the FQDN to be associated with the root domain</p>
<p style="text-align: center;" align="left">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8712.24.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8712.24.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8712.24.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8712.24.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>24</strong>&nbsp;&nbsp;&nbsp;specify the forest level and domain level in the root domain</p>
<p style="text-align: justify;" align="left"><span style="font-size: small;">Leave the properties of AD DC as specified by default; the domain controller needs to have Domain Name System (DNS) server capabilities.</span></p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/7840.25.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/7840.25.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/7840.25.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/7840.25.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>25</strong>&nbsp;&nbsp;&nbsp;leave the NetBIOS domain name as is</p>
<p style="text-align: center;" align="left">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/6562.26.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/6562.26.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/6562.26.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/6562.26.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>26</strong>&nbsp; a warning message inform that it is not best practice use dynamic IP address on AD DC</p>
<p style="text-align: justify;"><span style="font-size: small;">A warning message advice that the IP address on the NIC is set as dynamic, but in our setup it is fine because the IP addresses assigned to all IaaS VMs attached to the Azure VNET are managed by the Azure fabric.</span></p>
<p align="center">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1830.26A.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1830.26A.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1830.26A.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1830.26A.jpg" alt="" border="0" /></a></p>
<p style="text-align: justify;" align="left"><span style="font-size: small;">We are ready to install HPC Pack 2012 R2 on the head node (winhpchn).</span></p>
<h2 style="text-align: justify;" align="left"><span style="color: #000080;">&nbsp; 4.2&nbsp;Install Windows HPC Pack 2012 R2&nbsp; on the head node</span></h2>
<p style="text-align: justify;"><span style="font-size: small;">Windows HPC Pack 2012 R2&nbsp;enables you to create an HPC cluster. Log on as a domain administrator in the head node, download from Microsoft web site the Windows HPC Pack 2012 R2 (version <strong><span style="color: #0000ff;">4.2.4400.0</span></strong>) and run setup. Select the option <span style="color: #000000;"><strong>New installation or add features to an existing installation</strong></span>.</span></p>
<p style="text-align: center;" align="left">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/7801.27.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/7801.27.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/7801.27.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/7801.27.jpg" alt="" width="431" height="260" border="0" /></a><strong>Figure </strong><strong>27</strong>&nbsp;&nbsp;&nbsp;Install HPC Pack 2012 R2</p>
<p style="text-align: justify;" align="left">&nbsp;<span style="font-size: small;">In the HPC Pack&nbsp;2012&nbsp;R2 Installation Wizard, select <strong>Create a new HPC cluster by creating a head node</strong>.</span></p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1212.28.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1212.28.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1212.28.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1212.28.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>28</strong>&nbsp;&nbsp;&nbsp;Create a new head node</p>
<p align="left">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8306.29A.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8306.29A.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8306.29A.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8306.29A.jpg" alt="" border="0" /></a></p>
<p style="text-align: justify;" align="left"><span style="font-size: small;">Window HPC Pack&nbsp;2012&nbsp;R2 creates five HPC databases on the head node:</span></p>
<ul style="text-align: justify;">
<li><span style="font-size: small;">Cluster management database (HPCManagement): Stores node performance counter data</span></li>
<li><span style="font-size: small;">Job scheduling database (HPCScheduler): Stores job properties, job allocation, and history</span></li>
<li><span style="font-size: small;">Reporting database (HPCReporting): Stores historical data about the cluster such as cluster utilization, node availability, and aggregation of job statistics</span></li>
<li><span style="font-size: small;">Diagnostic database (HPCDiagnostics): Stores diagnostic test results</span></li>
<li><span style="font-size: small;">Monitoring database</span></li>
</ul>
<p style="text-align: justify;" align="left"><span style="font-size: small;">Windows HPC Pack&nbsp;2012&nbsp;R2 supports features to install the HPC databases locally or remotely. In our setup, all HPC databases are installed on the SQL Server running in the head node, as shown in the <strong>Figure 29</strong>.</span></p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1667.29B.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1667.29B.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1667.29B.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1667.29B.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>29</strong>&nbsp;&nbsp;&nbsp;Install all HPC databases on the local SQL Server instance</p>
<p style="text-align: center;" align="left">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/2086.30.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/2086.30.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/2086.30.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/2086.30.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>30</strong>&nbsp;&nbsp;&nbsp;default SQL Server instance named <strong>COMPUTECLUSTER</strong></p>
<p style="text-align: justify;" align="left">&nbsp;<span style="font-size: small;">The Installation Wizard enables administrator to specify a folder to install SQL Server databases and log files.</span></p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/0247.31.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/0247.31.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/0247.31.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/0247.31.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>31</strong>&nbsp;&nbsp;&nbsp;Specify a directory to store databases and logs</p>
<p style="text-align: justify;" align="left">&nbsp;<span style="font-size: small;">The administrator of the HPC cluster can choose the folder location for installing the Windows HPC Pack 2012&nbsp;R2 files and system data (including executables, .dll files, and script files), as shown in Figure 32.</span></p>
<p style="text-align: center;" align="left">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/5432.32.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/5432.32.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/5432.32.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/5432.32.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>32</strong>&nbsp;&nbsp;&nbsp;Folder location to store Windows HPC Pack&nbsp;2012&nbsp;R2 files and data</p>
<p style="text-align: justify;" align="left">&nbsp;Figure 33 shows the list of role services and software components that are needed to install HPC Pack 2012 R2&nbsp;.</p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/3858.33.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/3858.33.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/3858.33.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/3858.33.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>33</strong>&nbsp;&nbsp;&nbsp;Software components required to run HPC middleware</p>
<p style="text-align: center;" align="left">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/4174.34.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/4174.34.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/4174.34.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/4174.34.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>34</strong>&nbsp; start installation of Microsoft SQL Server 2012 Express edition</p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/7043.35.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/7043.35.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/7043.35.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/7043.35.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>35</strong>&nbsp; setup of HPC PACK 2012 R2</p>
<p style="text-align: justify;" align="left">&nbsp;<span style="font-size: small;">After the Windows HPC Pack&nbsp;2012&nbsp;R2 installation, the following HPC services are installed on the head node (winhpchn):</span></p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/2234.36.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/2234.36.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/2234.36.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/2234.36.jpg" alt="" width="677" height="213" border="0" /></a><strong>Figure </strong><strong>36</strong>&nbsp;&nbsp;&nbsp;HPC services on the head node</p>
<p style="text-align: justify;">&nbsp;</p>
<h2 style="text-align: justify;" align="left"><span style="color: #000080;">&nbsp; 4.3&nbsp;Configure the head node</span></h2>
<p style="text-align: justify;" align="left"><span style="font-size: small;">Setup of Windows HPC Pack&nbsp;2012&nbsp;R2 on head node requires the follow steps.<br /></span></p>
<p><span style="font-size: small;">Open the HPC Management Console; a list of configuration tasks appears in the <strong>Deployment</strong> <strong>To-do-list </strong>pane.</span></p>
<p style="text-align: center;" align="left">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8664.37.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8664.37.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8664.37.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8664.37.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>37</strong>&nbsp;&nbsp;&nbsp;To-do list in the HPC management console</p>
<p style="text-align: justify;" align="left"><span style="font-size: small;">The first task in the <strong>Deployment</strong> <strong>To-do List</strong> is to select a network topology for the HPC cluster. There are five topologies to choose from, and we choose Topology 5: <strong>All nodes only on an enterprise network</strong>.</span></p>
<p style="text-align: justify;" align="left"><span style="font-size: small;">Note: Topology 5 does not allow a bare-metal installation of on-premises compute nodes. In our lab, we have only Azure PaaS compute nodes , where baremental is not required</span><span style="font-size: small;">.</span></p>
<p style="text-align: center;" align="left">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/7120.38.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/7120.38.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/7120.38.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/7120.38.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>38</strong>&nbsp;&nbsp;&nbsp;Topology 5 with all nodes connected on the same network</p>
<p style="text-align: justify;" align="left">&nbsp;The<strong> Figure 39 </strong>shows how the network adapter on the head node connected to segment named in HPC term as <strong>enterprise network</strong>.</p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/3542.39.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/3542.39.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/3542.39.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/3542.39.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>39</strong>&nbsp;&nbsp;&nbsp;Select the network adapter for the HPC head node</p>
<p style="text-align: justify;" align="left">&nbsp;<span style="font-size: small;">In our system, all HPC nodes run in Azure where a front-end firewall is present to control traffic on IP Public Endpoints; presence of further Windows Firewall inside the HPC nodes is not required and we disable it.</span></p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1423.40.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1423.40.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1423.40.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1423.40.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>40</strong>&nbsp;&nbsp;&nbsp;Disable the Windows Firewall in the HPC nodes</p>
<p style="text-align: justify;">&nbsp;<span style="font-size: small;">The Figure 41 shows a review of the setup for the Enterprise Network of the HPC cluster.</span></p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/7128.41.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/7128.41.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/7128.41.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/7128.41.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>41</strong>&nbsp; Setup review</p>
<p style="text-align: justify;" align="left"><span style="font-size: small;">The second task on the to-do list is to define the domain user who is responsible for managing the HPC cluster.</span></p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1817.42.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1817.42.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1817.42.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1817.42.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>42</strong>&nbsp;&nbsp;&nbsp;Provide credentials for HPC cluster administration</p>
<p style="text-align: justify;" align="left">&nbsp;<span style="font-size: small;">In our configuration, bare-mental installation is not used. However, the HPC Management Console requires a mandatory naming convention for compute nodes that are installed</span><span style="font-size: small;"> through a bare-metal procedure.</span></p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/5187.43.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/5187.43.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/5187.43.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/5187.43.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>43</strong>&nbsp;&nbsp;&nbsp;Naming convention for HPC compute nodes installed through bare-metal procedure</p>
<h2 style="text-align: justify;" align="left"><span style="color: #000080;">&nbsp; 4.4&nbsp;&nbsp;Define a node template to complete the Deployment to-do List</span></h2>
<p style="text-align: justify;"><span style="font-size: small;">The last step to complete the tasks in <strong>Deployment to-do List</strong> is&nbsp; the definition of a HPC node template. Nevertheless it is not used, we choose to create a node template for an on-premises compute node.</span></p>
<p style="text-align: center;" align="left">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/3733.44.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/3733.44.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/3733.44.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/3733.44.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>44</strong>&nbsp;&nbsp;&nbsp;Create an HPC node template</p>
<p style="text-align: center;" align="left">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/6765.45.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/6765.45.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/6765.45.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/6765.45.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>45</strong>&nbsp;&nbsp;&nbsp;add the on-premises node template</p>
<p style="text-align: justify;"><span style="font-size: small;">Fill up the name for the new node template.</span></p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/0268.46.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/0268.46.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/0268.46.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/0268.46.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>46</strong>&nbsp;&nbsp;&nbsp;Name the node template</p>
<p style="text-align: justify;" align="left">&nbsp;<span style="font-size: small;">We will not use this template to add an on-premises compute node to the cluster but only to complete the Deployment to-do-List.</span></p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/0028.47.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/0028.47.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/0028.47.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/0028.47.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>47</strong>&nbsp;&nbsp;&nbsp;Create a node template without an operating system</p>
<p align="left">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/0181.47B.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/0181.47B.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/0181.47B.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/0181.47B.jpg" alt="" border="0" /></a></p>
<p style="text-align: justify;" align="left"><span style="font-size: small;">We do not add security updates to the node template (we do not care of it).</span></p>
<p style="text-align: center;" align="left">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8284.48.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8284.48.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8284.48.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8284.48.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>48</strong>&nbsp;&nbsp;&nbsp;Do not request updates</p>
<p style="text-align: justify;" align="left">&nbsp;<span style="font-size: small;">The Figure 49 is the <strong>Deployment To-do</strong> <strong>List</strong> after completion of the mandatory tasks.</span></p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/3108.49.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/3108.49.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/3108.49.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/3108.49.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>49</strong>&nbsp;&nbsp;&nbsp;Completed mandatory tasks</p>
<p style="text-align: justify;">&nbsp;</p>
<h1 style="text-align: justify;" align="left"><span style="color: #000080;">5&nbsp;Prepare the Azure subscription</span></h1>
<p style="text-align: justify;"><span style="font-size: small;">These steps are needed to Azure nodes from the head node.</span></p>
<ul style="text-align: justify;">
<li style="text-align: justify;"><span style="font-size: small;">Upload a management certificate (needed for secure connections between the head node and the Azure Cloud Services)</span></li>
<li style="text-align: justify;"><span style="font-size: small;">Create an Azure Cloud service in which Azure nodes (worker role instances) will run</span></li>
<li style="text-align: justify;"><span style="font-size: small;">Create a Windows Azure storage account</span></li>
</ul>
<h2 style="text-align: justify;"><span style="color: #000080;">&nbsp; 5.1&nbsp;Upload the HPC default management certificate</span></h2>
<p style="text-align: justify;"><span style="font-size: small;">HPC Pack installs by default a self-signed certificate on the head node, called the <strong>Default Microsoft HPC Azure Management </strong>certificate (the file is stored in <strong>%CCP_HOME%\Bin\hpccert.cer</strong>), which you can upload as an Azure <em><strong>management certificate</strong></em> in Azure subscription. This certificate is provided for testing purposes and </span><span style="font-size: small;">proof-of-concept deployments. The management certificate (also referred to as a <em><strong>subscription certificate</strong></em>)</span></p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/7762.50.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/7762.50.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/7762.50.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/7762.50.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>50</strong>&nbsp;&nbsp;&nbsp;location of <strong>Default Microsoft HPC Azure Management</strong> certificate (hpccert.cer)</p>
<p style="text-align: justify;"><span style="font-size: small;">To upload the hpccert.cer in the Azure subscription:</span></p>
<ol style="text-align: justify;" start="1">
<li style="text-align: justify;"><span style="font-size: small;">Connect to the HPC head node computer, open the web browser and sign in to the <a href="https://manage.windowsazure.com/">Management&nbsp;Portal</a>.</span></li>
<li style="text-align: justify;"><span style="font-size: small;">In Azure Management portal click <strong>Settings</strong>, and then click <strong>Management Certificates</strong>.</span></li>
<li style="text-align: justify;"><span style="font-size: small;">On the command bar, click <strong>Upload</strong>.</span></li>
</ol>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/3343.51.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/3343.51.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/3343.51.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/3343.51.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>51</strong>&nbsp;&nbsp;&nbsp;upload the <strong>Default Microsoft HPC Azure Management</strong> certificate in Azure subscription</p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/6038.52.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/6038.52.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/6038.52.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/6038.52.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>52</strong>&nbsp;&nbsp;&nbsp;selection of hpccert.cer certificate in the HPC head node</p>
<p style="text-align: justify;">&nbsp;</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/7002.53.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/7002.53.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/7002.53.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/7002.53.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>53</strong>&nbsp;&nbsp;&nbsp;<strong>Default HPC Azure Management </strong>certificate loaded in the Azure subscription</p>
<p style="text-align: justify;">&nbsp;<span style="font-size: small;">You will see <strong>Default HPC Azure Management</strong> in the list of management certificates.</span></p>
<h2 style="text-align: justify;"><span style="color: #000080;">&nbsp; 5.2&nbsp;&nbsp;Create an Azure Cloud Services</span></h2>
<p style="text-align: justify;"><span style="font-size: small;">Define an Azure Cloud Service to run HPC PaaS Compute Nodes:</span></p>
<ol style="text-align: justify;" start="1">
<li style="text-align: justify;"><span style="font-size: small;">In the Management Portal, on the command bar, click <strong>New</strong>.</span></li>
<li style="text-align: justify;"><span style="font-size: small;">Click <strong>Compute</strong>, click <strong>Cloud Service</strong>, and then click <strong>Quick Create</strong>.</span></li>
<li style="text-align: justify;"><span style="font-size: small;">Type a URL for the cloud service, and then click <strong>Create Cloud Service</strong>.</span></li>
</ol>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1856.54.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1856.54.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1856.54.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1856.54.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>54</strong>&nbsp;&nbsp;&nbsp;define a new Cloud Service</p>
<p style="text-align: justify;">&nbsp;<span style="font-size: small;">For best performance, the cloud service and the storage account are created in the same affinity group.</span></p>
<table style="width: 700px; height: 108px;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="626">
<p style="text-align: center;" align="left"><em><strong>Important </strong></em></p>
<p style="text-align: justify;"><strong><span style="font-size: small; color: #0000ff;">You must configure a separate hosted service for each Windows Azure node template that you create. However, you can configure a storage account that is used in multiple node templates.</span></strong></p>
<p style="text-align: justify;"><strong><span style="font-size: small; color: #0000ff;">For each Windows Azure node template, ensure that the Azure Cloud Service and the Azure Storage Account are configured in the same subscription.</span></strong></p>
</td>
</tr>
</tbody>
</table>
<p style="text-align: justify;">&nbsp;</p>
<h2 style="text-align: justify;"><span style="color: #000080;">&nbsp; 5.3&nbsp;Create a Windows Azure storage account</span></h2>
<p style="text-align: justify;"><span style="font-size: small;">Create a new Azure storage account to run the HPC PaaS Compute nodes:</span></p>
<ol style="text-align: justify;" start="1">
<li style="text-align: justify;"><span style="font-size: small;">In the Management Portal, on the command bar, click <strong>New</strong>.</span></li>
<li style="text-align: justify;"><span style="font-size: small;">Click <strong>Data Services</strong>, click <strong>Storage</strong>,&nbsp;and then click <strong>Quick Create</strong>.</span></li>
<li style="text-align: justify;"><span style="font-size: small;">Type a URL for the account, and then click <strong>Create Storage Account</strong>.</span></li>
</ol>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/5557.55.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/5557.55.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/5557.55.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/5557.55.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>55</strong>&nbsp;&nbsp;&nbsp;define a new Azure Storage Account</p>
<p style="text-align: justify;" align="left">&nbsp;</p>
<h1 style="text-align: justify;" align="left"><span style="color: #000080;">6&nbsp;&nbsp;Deploying Windows Azure nodes in Windows HPC Server 2012 R2</span></h1>
<p style="text-align: justify;" align="left"><span style="font-size: small;">The following paragraph describes the full process for deploying Windows Azure worker nodes to a cluster running Windows HPC Server 2012 R2.</span></p>
<h2 style="text-align: justify;" align="left"><span style="color: #000080;">&nbsp; 6.1&nbsp;Create a Windows Azure Worker Node Template</span></h2>
<p style="text-align: justify;" align="left"><span style="font-size: small;">A worker node template specifies the information configured in your </span><span style="font-size: small;">Windows Azure subscription that will be used to add a set of Windows Azure</span><span style="font-size: small;"> nodes to the cluster. This information includes:</span></p>
<ul>
<li>
<div style="text-align: justify;"><span style="font-size: small;"><span style="color: #0000ff;"><strong>Azure Subscription ID</strong></span>. Azure Subscription ID is a 32-character hexadecimal string, in the dashes form</span><span style="font-size: small;"> xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</span></div>
</li>
<li>
<div style="text-align: justify;"><span style="font-size: small;"><span style="color: #0000ff;"><strong>certificate thumbprint</strong></span> for your management certificate. The thumbprint of a subscription certificate</span><span style="font-size: small;"> (also referred to as a management certificate) provides the required authentication for clients to connect to the Windows Azure subscription. This</span><span style="font-size: small;"> is a 40-character hexadecimal string</span></div>
</li>
<li>
<div style="text-align: justify;" align="left"><span style="font-size: small; color: #0000ff;"><strong>name of an Azure Cloud Service</strong></span></div>
</li>
<li>
<div style="text-align: justify;" align="left"><span style="font-size: small;"><span style="color: #0000ff;"><strong>name of an Azure Storage Account</strong></span>.</span></div>
</li>
</ul>
<div style="text-align: justify;" align="left"><span style="font-size: small;">To create a Windows Azure worker node template:</span></div>
<p><span style="font-size: small;">1. Open the HPC Cluster Manager</span></p>
<p><span style="font-size: small;">2. In <strong>Configuration</strong>, in the Navigation Pane, click <strong>Node Templates</strong>.</span></p>
<p><span style="font-size: small;">3. In the Actions pane, click <strong>New</strong>, which will bring up <strong>The Create Node Template Wizard</strong>.</span></p>
<p style="text-align: center;" align="left">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/7522.56.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/7522.56.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/7522.56.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/7522.56.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>56 </strong>Creation of a new template<strong></strong></p>
<p>&nbsp;<span style="font-size: small;">4. On the <strong>Choose Node Template Type</strong> page, click </span><span style="font-size: small;"><span style="text-decoration: underline;"><strong>Windows Azure node template</strong></span>, and </span><span style="font-size: small;">then click <strong>Next</strong>.</span></p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/0160.57.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/0160.57.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/0160.57.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/0160.57.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>57 </strong>Selection of a Windows Azure node template</p>
<p style="text-align: justify;">&nbsp;</p>
<p><span style="font-size: small;">5. On the <strong>Specify Template Name</strong> dialog, type a name for the worker node template and click <strong>Next</strong>.</span></p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/0333.58.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/0333.58.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/0333.58.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/0333.58.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>58</strong>&nbsp;&nbsp;Name the new template</p>
<p style="text-align: justify;" align="left"><span style="font-size: small;">6. On the <strong>Provide Subscription Information </strong>page, provide the Windows Azure subscription that will be used to add the nodes:</span></p>
<p style="text-align: justify; padding-left: 30px;" align="left"><span style="font-size: small;">a. In the <strong>Subscription ID</strong> text box, type or paste the ID of a valid Windows Azure subscription account.</span></p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/0755.59.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/0755.59.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/0755.59.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/0755.59.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>59</strong>&nbsp;&nbsp;The Azure subscription ID</p>
<p style="padding-left: 30px;"><span style="font-size: small;">b. In the <strong>Management certificate</strong> text box browse in the Certificates store of the local computer account and select the <strong>Default Microsoft HPC Azure Management</strong></span><span style="font-size: small;"> certificate, then click <strong>Next</strong>.</span></p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/5344.60.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/5344.60.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/5344.60.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/5344.60.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>60</strong>&nbsp;&nbsp; &nbsp;selection of the Default Microsoft HPC Azure Management certificate</p>
<p style="text-align: justify;" align="left">&nbsp;</p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/2158.61.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/2158.61.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/2158.61.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/2158.61.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>61</strong>&nbsp; &nbsp;Specification of the Azure Subscription ID and certificate thumbprint</p>
<p style="text-align: justify;"><span style="font-size: small;">7. On the <strong>Provide Service Information</strong> page, select the cloud service and the storage account that you created in a previous step. Then click <strong>Next</strong>.</span></p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8512.62.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8512.62.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8512.62.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8512.62.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>62</strong><strong> </strong>&nbsp;&nbsp;&nbsp;select the Azure Cloud Service and Storage Account created before<strong></strong></p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8103.63.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8103.63.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8103.63.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8103.63.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>63</strong>&nbsp;&nbsp;&nbsp; define number of Azure proxy nodes</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8461.64.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8461.64.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8461.64.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8461.64.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>64</strong>&nbsp;&nbsp;&nbsp; specify the OS family for the compute nodes (worker roles)</p>
<p style="text-align: justify;">&nbsp;<span style="font-size: small;">The Azure Cloud Services are available in three different OS family: <strong>Windows 2008 R2</strong>, <strong>Windows 2012</strong>, <strong>Windows 2012 R2</strong>. Our Azure node template will create worker role with Windows Server 2012 R2 OS.</span></p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1602.65.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1602.65.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1602.65.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1602.65.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>65</strong>&nbsp;&nbsp;&nbsp; empty startup script</p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8308.66.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8308.66.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8308.66.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8308.66.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>66</strong>&nbsp;&nbsp;&nbsp; template define worker roles attachment to the same VNET of the head node</p>
<p style="text-align: justify;"><span style="font-size: small;">8. on the <strong>Configure Remote Desktop Credentials</strong> page, type a user name and password that you can use to make Remote Desktop connections to your Windows Azure nodes. The credentials you provide will be used only to connect to the Windows Azure nodes that are deployed using this template. They should be different than your domain credentials or any local credentials. The password you provide is encrypted in the HPC databases and it is not exported if you export the node template.</span></p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/2235.67.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/2235.67.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/2235.67.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/2235.67.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>67</strong>&nbsp;Specify Remote Desktop credentials to access the Azure worker node</p>
<p><span style="font-size: small;">9. On the <strong>Configure Azure Availability Policy</strong> page, select how you want the Windows Azure worker nodes to start and stop (manually or by weekly-based calendar scheduler).</span></p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/7888.68.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/7888.68.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/7888.68.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/7888.68.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>68</strong>&nbsp; Policy associated to the Azure Node template</p>
<p>&nbsp;<span style="font-size: small;">10. To modify the worker role template, right click on node template, select <strong>Edit</strong>&hellip; &nbsp;(Figure 69).</span></p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1541.69.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1541.69.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1541.69.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1541.69.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>69</strong> changing parameters and options in Azure node template</p>
<p>&nbsp;<span style="font-size: small;">11. To validate the Windows Azure connection information, on the <strong>Connection Information</strong> tab, click <strong>Validate connection information</strong>.</span></p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/2555.70.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/2555.70.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/2555.70.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/2555.70.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>70 </strong>Validating the connection of head node to Azure Cloud Service and Storage Account</p>
<p style="text-align: justify;" align="left">&nbsp;<span style="font-size: small;">During the validation process, Windows HPC Server 2012 R2 connects to the Windows Azure subscription using the configured certificate, and verifies that the Azure Cloud Service and Azure Storage Account can be reached.</span></p>
<h2 style="text-align: justify;" align="left"><span style="color: #003366;">&nbsp; 6.2&nbsp;Change the role in HPC head node</span></h2>
<p style="text-align: justify;" align="left"><span style="font-size: small;">By default, HPC head node has the role of Head Node, Broker Node and Compute Node. it is a good practice to disable the Compute Node role in the HPC head node to avoid CPU overload in case of heavy jobs (main purpose of head node is to control and manage the HPC clusters).<br /></span></p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1256.71.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1256.71.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1256.71.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1256.71.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>71</strong>&nbsp;&nbsp; head node in offline</p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1200.72.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1200.72.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1200.72.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1200.72.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>72</strong>&nbsp;&nbsp; change role of the head node</p>
<p style="text-align: center;" align="left">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8154.73.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8154.73.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8154.73.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8154.73.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>73</strong>&nbsp;&nbsp; deselect Compute Node role</p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/2605.74.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/2605.74.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/2605.74.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/2605.74.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>74</strong>&nbsp;&nbsp; head node has the only Head node and WCFBroker node roles</p>
<h2 style="text-align: justify;"><span style="color: #003366;">&nbsp; 6.3&nbsp;Customize the Heat Map</span></h2>
<p style="text-align: justify;"><span style="font-size: small;">HPC Heat Map is a powerful embedded tool in HPC Management console to acquire the fully status of cluster. To customize the HPC Heat Map select the tab, right-click on mouse and therefore &ldquo;<strong>Customize Tab&hellip;</strong>&rdquo; option.</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/3276.75.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/3276.75.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/3276.75.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/3276.75.jpg" alt="" width="490" height="383" border="0" /></a></p>
<p style="text-align: center;"><strong>Figure </strong><strong>75</strong>&nbsp;&nbsp; option to customize the heat map in the HPC Management Console</p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/5241.76.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/5241.76.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/5241.76.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/5241.76.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>76</strong>&nbsp;&nbsp; selection of three system parameters to include in the heat map</p>
<p style="text-align: justify;">&nbsp;</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/0456.77.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/0456.77.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/0456.77.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/0456.77.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>77</strong>&nbsp;&nbsp; heat map with tracking of CPU, Core in Use and Network Usage</p>
<p style="text-align: justify;">&nbsp;</p>
<h2 style="text-align: justify;" align="left"><span style="color: #003366;">&nbsp; 6.4&nbsp;&nbsp;Add Windows Azure Worker Nodes to the HPC Cluster</span></h2>
<p>Still now our HPC cluster includes only the head node (master). To add new Azure HPC compute nodes to the cluster follow the procedure described below.</p>
<ol style="text-align: justify;" start="1">
<li><span style="font-size: small;">In the <strong>Actions </strong>pane<strong> </strong>in the <strong>Node Management </strong>page, click <strong>Add Node </strong>to bring up the <strong>Add Node Wizard</strong>.</span></li>
</ol>
<p style="text-align: center;" align="left">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1122.78.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1122.78.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1122.78.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1122.78.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>78</strong>&nbsp;&nbsp; Add node to the HPC head node</p>
<p style="text-align: justify;">&nbsp;</p>
<ol style="text-align: justify;" start="2">
<li><span style="font-size: small;">On the <strong>Select Deployment Method</strong> page (Figure&nbsp;79), select <strong>Add Windows Azure nodes</strong>, and then click <strong>Next</strong>.</span></li>
</ol>
<p style="text-align: center;" align="left">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/6574.79.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/6574.79.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/6574.79.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/6574.79.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>79</strong>&nbsp;Specifying the type of node to add to the HPC cluster</p>
<p style="text-align: justify;" align="left">&nbsp;</p>
<ol style="text-align: justify;" start="3">
<li><span style="font-size: small;">On the <strong>Specify New Nodes</strong> page (Figure 80), select the Azure node template, specify the number and the size of the worker nodes, and then click <strong>Next</strong>.</span></li>
</ol>
<p style="text-align: center;" align="left">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/6082.80.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/6082.80.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/6082.80.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/6082.80.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>80</strong> &nbsp;Assign a number of azure nodes and azure node size</p>
<p style="text-align: justify;"><span style="font-size: small;"><strong>The number of worker nodes</strong> is the number of role instances that will be deployed in Windows Azure when you start the nodes.</span></p>
<p style="text-align: justify;" align="left"><span style="font-size: small;"><strong>The size of the worker nodes</strong> defines types of predefined PaaS VM sizes in Windows Azure: Small (A1), Medium (A2), Large (A3), or Extra Large (A4), A5, A6, A7, A8 and A9. The size of the</span><span style="font-size: small;"> virtual machine determines the number of CPU cores, the memory capacity, and the local file system size of each role instance.</span></p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1832.81.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1832.81.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1832.81.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1832.81.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>81</strong>&nbsp;&nbsp; define the number and size of Windows Azure nodes</p>
<ol style="text-align: justify;" start="4">
<li><span style="font-size: small;">On the <strong>Completing the Add Node Wizard</strong> dialog, click <strong>Finish</strong>.</span></li>
</ol>
<p style="text-align: center;" align="left">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/0028.82.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/0028.82.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/0028.82.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/0028.82.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>82</strong>&nbsp; &nbsp;Azure node in Not-Deployed state</p>
<p style="text-align: justify;"><span style="font-size: small;"><strong>Note</strong>: If you want to add worker nodes of different sizes, you must run the <strong>Add Node Wizard </strong>separately for each size. After you add worker nodes to the cluster, they are in the <strong>Not-Deployed</strong> state, and they have a health state of <strong>Unapproved</strong>. </span><span style="font-size: small;">Before you can use the worker nodes to run jobs, you must start them and then bring them <strong>ONLINE</strong>. Worker nodes are numbered consecutively in a naming series </span><span style="font-size: small;">that begins with the root name <strong>AzureCN </strong>(the naming series for the worker nodes cannot be configured).</span></p>
<p style="text-align: justify;" align="left"><span style="font-size: small;">At this stage in the Azure Cloud Service associated with the Azure node template the number of instances are empty.</span></p>
<p style="text-align: center;" align="left">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/4747.83.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/4747.83.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/4747.83.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/4747.83.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>83</strong>&nbsp;&nbsp; Azure Cloud Service is initially empty</p>
<h2 style="text-align: justify;" align="left"><span style="color: #003366;">&nbsp; 6.5&nbsp;Start the Windows Azure Worker Nodes</span></h2>
<p style="text-align: justify;" align="left"><span style="font-size: small;">To provision the role instances in Windows Azure, you must start the worker nodes that you added to the HPC cluster; to provision the role instance:</span></p>
<ol style="text-align: justify;" start="1">
<li><span style="font-size: small;">Open the HPC Management console</span></li>
<li><span style="font-size: small;">In <strong>Node Management</strong>, in the Navigation Pane, click <strong>Nodes</strong>.</span></li>
<li><span style="font-size: small;">In the List or Heat Map view, select one or more worker nodes.</span></li>
<li><span style="font-size: small;">In the Actions pane, click <strong>Start </strong>to bring up the<strong> Start Windows Azure Nodes </strong>dialog <strong>(</strong>Figure 84<strong></strong><strong>)</strong>.</span></li>
</ol>
<p style="text-align: center;" align="left">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/7827.84.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/7827.84.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/7827.84.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/7827.84.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>84</strong><strong> &nbsp;&nbsp;</strong>Starting an Azure Worker Node</p>
<ol style="text-align: justify;" start="5">
<li><span style="font-size: small;">Click &ldquo;<strong>Start&rdquo; (</strong>Figure 85<strong></strong><strong>) </strong>to kick off the deployment phase.</span></li>
</ol>
<p style="text-align: center;" align="left">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/4606.85.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/4606.85.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/4606.85.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/4606.85.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>85</strong>&nbsp;using a specific Node Template to start Azure nodes</p>
<p style="text-align: justify;">&nbsp;</p>
<ol style="text-align: justify;" start="6">
<li><span style="font-size: small;">During the start process, the state of the worker nodes changes from <strong>Not Deployed</strong> to <strong>Provisioning</strong>.&nbsp;If you want to track the provisioning progress, select a worker node, and then in the Details Pane, click the <strong>Provisioning Log</strong> tab (Figure 86).</span></li>
</ol>
<table style="width: 654px; height: 840px;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="626">
<p align="left"><strong>Time&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Message</strong></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>3/12/2014 5:23:01 PM Moving node AZURE\AzureCN-0005 from state Provisioning to state&nbsp; Offline</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>3/12/2014 5:23:01 PM Moving node AZURE\AzureCN-0004 from state Provisioning to state&nbsp; Offline</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>3/12/2014 5:23:00 PM Moving node AZURE\AzureCN-0003 from state Provisioning to state&nbsp; Offline</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>3/12/2014 5:23:00 PM Node AZURE\AzureCN-0004 has become available</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>3/12/2014 5:23:00 PM Node AZURE\AzureCN-0003 has become available</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>3/12/2014 5:23:00 PM Node AZURE\AzureCN-0005 has become available</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>3/12/2014 5:13:00 PM Updating scheduler data for node AZURE\AzureCN-0004</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>3/12/2014 5:13:00 PM Updating the scheduler configuration for node AZURE\AzureCN-0004</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>3/12/2014 5:13:00 PM Updating scheduler data for node AZURE\AzureCN-0003</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>3/12/2014 5:13:00 PM Updating the scheduler configuration for node AZURE\AzureCN-0003</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>3/12/2014 5:13:00 PM Updating scheduler data for node AZURE\AzureCN-0005</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>3/12/2014 5:13:00 PM Updating the scheduler configuration for node AZURE\AzureCN-0005</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>3/12/2014 5:13:00 PM Updating the scheduler configuration for creating deployment<br />&nbsp; bbf25bf7-dfaf-4574-b966-41b27879dd43.</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>3/12/2014 5:13:00 PM Windows Azure operation succeeded</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>3/12/2014 5:12:05 PM Waiting for Windows Azure deployment to start</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>3/12/2014 5:12:05 PM The Operation Id for transitioning Windows Azure deployment to<br />&nbsp; state Running is 9fe3c16cb86476fd8265cbd37a9633a3</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>3/12/2014 5:12:04 PM Transitioning Windows Azure deployment to the Running state</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>3/12/2014 5:12:00 PM Windows Azure operation succeeded</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>3/12/2014 5:10:55 PM Waiting for Windows Azure deployment creation to complete</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>3/12/2014 5:10:55 PM Configuring HPC cluster storage in Windows Azure</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>3/12/2014 5:10:54 PM Windows Azure deployment started:<br />&nbsp; bbf25bf7-dfaf-4574-b966-41b27879dd43. Operation Id for this deployment is<br />&nbsp; 44f97c4625f4742e8e67c72d6d55026d</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>3/12/2014 5:10:54 PM Deployment bbf25bf7-dfaf-4574-b966-41b27879dd43 is locked.</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>3/12/2014 5:10:49 PM Starting Windows Azure deployment</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>3/12/2014 5:10:48 PM Uploading HPC cluster certificate to Windows Azure storage</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>3/12/2014 5:10:47 PM Uploading Windows Azure proxy certificate to the Windows Azure certificate store</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>3/12/2014 5:10:47 PM The HPC cluster runtime package is present in Windows Azure storage</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>3/12/2014 5:10:46 PM Skipping VPN validation because a VPN gateway is not configured in the Windows Azure Virtual Network.</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>3/12/2014 5:10:45 PM Moving node AZURE\AzureCN-0004 from state Not-Deployed to state Provisioning</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>3/12/2014 5:10:45 PM Moving node AZURE\AzureCN-0003 from state Not-Deployed to state Provisioning</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>3/12/2014 5:10:45 PM Moving node AZURE\AzureCN-0005 from state Not-Deployed to state Provisioning</strong></span></p>
</td>
</tr>
</tbody>
</table>
<p style="text-align: justify;" align="left"><strong>Figure </strong><strong>86</strong>&nbsp;Provisioning log of one worker node</p>
<p style="text-align: justify;" align="left">&nbsp;</p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/5710.87.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/5710.87.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/5710.87.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/5710.87.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>87</strong>&nbsp;&nbsp; &nbsp;Worker nodes in the <strong>Provisioning</strong> state</p>
<p style="text-align: justify;" align="left">&nbsp;<span style="font-size: small;">The status of Azure Paas VMs as reported in Azure Management portal is shown in Azure management portal (Figure 88-89)<br /></span></p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/6813.88.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/6813.88.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/6813.88.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/6813.88.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>88</strong>&nbsp;&nbsp; initial state of Azure compute nodes and proxies in deployment phase</p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8306.89.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8306.89.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8306.89.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8306.89.jpg" alt="" border="0" /></a> <strong>Figure </strong><strong>89</strong>&nbsp;&nbsp; creating PasS VMs in deployment phase</p>
<ol style="text-align: justify;" start="7">
<li><span style="font-size: small;">To bring the nodes online, in the HPC management console select the nodes that are in the <strong>Offline</strong> state, right-click, and then click <strong>Bring Online (</strong>Figure 90<strong></strong><strong>)</strong>.</span></li>
</ol>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/0250.90.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/0250.90.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/0250.90.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/0250.90.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>90</strong>&nbsp;&nbsp;Bring the Azure worker nodes Online</p>
<p style="text-align: justify;" align="left"><span style="font-size: small;">During the provisioning process, Windows HPC Server 2012 R2 automatically retrieves the primary access key for the storage account that is specified in the Azure node template.</span></p>
<p style="text-align: justify;" align="left"><span style="font-size: small;">After a worker node starts successfully, the node state changes to <strong>Offline.</strong></span></p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="626">
<p style="text-align: center;" align="left"><strong>Note</strong></p>
<p align="left"><span style="font-size: small;">Each time that you start a set of Windows Azure nodes, two (or more) additional proxy role instances are automatically configured in Windows Azure to facilitate communication between the head node and the Windows Azure nodes (Figure 91).</span><br /><span style="font-size: small;">The proxy role instances are not shown in HPC Cluster Manager after the nodes are provisioned. However, the instances appear in the Windows Azure Management Portal. The proxy role instances incur charges in Windows Azure along with the Windows Azure node instances.</span></p>
</td>
</tr>
</tbody>
</table>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8562.91.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8562.91.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/8562.91.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/8562.91.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>91</strong>&nbsp;HPC proxies automatically configured from the HPC Head node</p>
<p style="text-align: justify;" align="left">&nbsp;<span style="font-size: small;">In<strong> Figure 92</strong> is shown a deployment with two Azure compute proxies and two Azure worker roles.</span></p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/2112.92.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/2112.92.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/2112.92.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/2112.92.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>92</strong>&nbsp; HPC Compute Proxies and HPC Azure Worker</p>
<p style="text-align: justify;">&nbsp;</p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/4331.93.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/4331.93.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/4331.93.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/4331.93.jpg" alt="" border="0" /></a> <strong>Figure </strong><strong>93</strong>&nbsp; HPC heat map with the head node and three Azure nodes</p>
<p style="text-align: justify;" align="left"><span style="font-size: small;">If you want to remove a set of role instances in Windows Azure, stop the nodes by using HPC Cluster Manager (apply the <strong>Stop</strong> action). This deletes the role instances from the service and changes the state of the worker nodes in the HPC cluster to <strong>Not-Deployed</strong>.</span></p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/3173.94.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/3173.94.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/3173.94.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/3173.94.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>94</strong>&nbsp; action to delete Azure node in Azure Cloud Services</p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/6406.95.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/6406.95.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/6406.95.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/6406.95.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>95</strong>&nbsp; Action to stop Azure compute nodes</p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/0876.96.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/0876.96.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/0876.96.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/0876.96.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>96</strong>&nbsp; Azure node in transitional phase from Running to Not-Deployment</p>
<p style="text-align: center;" align="left"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1614.97.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1614.97.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2012R2/1614.97.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2012R2/1614.97.jpg" alt="" border="0" /></a><strong>Figure </strong><strong>97</strong>&nbsp; Azure nodes in Not-Deployed state</p>
<p style="text-align: justify;" align="left"><span style="font-size: small;">When Azure nodes reach the <strong>Not-Deployed</strong> state, the corresponding Azure Cloud Service is empty.</span></p>
<p style="text-align: justify;" align="left">&nbsp;</p>
<h1 style="text-align: justify;" align="left"><span style="color: #003366;">7&nbsp;Reference</span></h1>
<ul style="text-align: justify;">
<li>
<div align="left"><strong>Burst to Windows Azure with Microsoft HPC Pack </strong></div>
</li>
</ul>
<p style="text-align: justify; padding-left: 30px;" align="left"><a href="http://technet.microsoft.com/library/gg481749.aspx">http://technet.microsoft.com/library/gg481749.aspx</a></p>
<ul style="text-align: justify;">
<li>
<div align="left"><strong>Virtual Machine and Cloud Service Sizes for Windows Azure</strong></div>
</li>
</ul>
<p style="text-align: justify; padding-left: 30px;" align="left"><a href="http://msdn.microsoft.com/en-us/library/windowsazure/dn197896.aspx">http://msdn.microsoft.com/en-us/library/windowsazure/dn197896.aspx</a></p>
<ul style="text-align: justify;">
<li>
<div align="left"><strong>A8 and A9 Compute Intensive Instances: Quick Start with HPC Pack</strong><strong></strong></div>
</li>
</ul>
<p style="text-align: justify; padding-left: 30px;" align="left"><a href="http://msdn.microsoft.com/library/windowsazure/dn594431.aspx">http://msdn.microsoft.com/library/windowsazure/dn594431.aspx</a></p>
<ul style="text-align: justify;">
<li>
<div align="left"><strong>Set up a Hybrid Cluster with Microsoft HPC Pack:</strong></div>
</li>
</ul>
<p style="text-align: justify; padding-left: 30px;" align="left"><a href="http://www.windowsazure.com/en-us/documentation/articles/set-up-hybrid-cluster-microsoft-hpc-pack-2012-sp1/">http://www.windowsazure.com/en-us/documentation/articles/set-up-hybrid-cluster-microsoft-hpc-pack-2012-sp1/</a></p>
<p style="text-align: justify;" align="left">&nbsp;</p>
<h1 style="text-align: justify;" align="left"><span style="color: #003366;">8&nbsp;Glossary</span></h1>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="79">
<p align="left"><strong>AD DC</strong></p>
</td>
<td valign="top" width="372">
<p align="left"><strong>A</strong>ctive <strong>D</strong>irectory <strong>D</strong>omain <strong>C</strong>ontroller</p>
</td>
</tr>
<tr>
<td valign="top" width="79">
<p align="left"><strong>HPC</strong></p>
</td>
<td valign="top" width="372">
<p align="left"><strong>H</strong>igh <strong>P</strong>erformance <strong>C</strong>omputing</p>
</td>
</tr>
<tr>
<td valign="top" width="79">
<p align="left"><strong>IaaS </strong></p>
</td>
<td valign="top" width="372">
<p align="left"><strong>I</strong>nfrastructure<strong> a</strong>s<strong> a S</strong>ervice</p>
</td>
</tr>
<tr>
<td valign="top" width="79">
<p align="left"><strong>NIC</strong></p>
</td>
<td valign="top" width="372">
<p align="left"><strong>N</strong>etwork <strong>I</strong>nterface Card</p>
</td>
</tr>
<tr>
<td valign="top" width="79">
<p align="left"><strong>OS</strong></p>
</td>
<td valign="top" width="372">
<p align="left"><strong>O</strong>perating<strong> S</strong>ystem<strong></strong></p>
</td>
</tr>
<tr>
<td valign="top" width="79">
<p align="left"><strong>PaaS</strong></p>
</td>
<td valign="top" width="372">
<p align="left"><strong>P</strong>latform<strong> a</strong>s<strong> a S</strong>ervice<strong></strong></p>
</td>
</tr>
<tr>
<td valign="top" width="79">
<p align="left"><strong>VM</strong></p>
</td>
<td valign="top" width="372">
<p align="left"><strong>V</strong>irtual <strong>M</strong>achine<strong></strong></p>
</td>
</tr>
</tbody>
</table>
<p style="text-align: justify;" align="left">&nbsp;</p>
<p><span style="font-size: small;">required</span></p>]]></content:encoded>
    </item>
    <item>
      <title>Running parallel Excel on Windows HPC 2008 R2 hosted in Windows Azure IaaS VMs: Part 4</title>
      <link>https://docs.microsoft.com/archive/blogs/faber/running-parallel-excel-on-windows-hpc-2008-r2-hosted-in-windows-azure-iaas-vms-part-4</link>
      <pubDate>Thu, 11 Jul 2013 12:38:00 GMT</pubDate>
      <dc:creator><![CDATA[faberspot]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/faber/2013/07/11/running-parallel-excel-on-windows-hpc-2008-r2-hosted-in-windows-azure-iaas-vms-part-4/</guid>
      <description><![CDATA[click here to Move to&nbsp;previous blog-Part3
1&nbsp; Introduction
In this post, we proceed with...]]></description>
      <content:encoded><![CDATA[<h2><span style="font-size: small;"><span style="font-size: large;"><strong><span style="font-size: small;"><span style="font-size: large;"><strong><span style="font-size: small;">click here to <span style="font-size: large;"><strong><a href="http://blogs.msdn.com/b/faber/archive/2013/07/04/running-parallel-excel-on-windows-hpc-2008-r2-hosted-in-windows-azure-iaas-vms-part-3.aspx">Move to&nbsp;previous blog-Part3</a></strong></span></span></strong></span></span></strong></span></span></h2>
<h1><span style="color: #000080;">1&nbsp; Introduction</span></h1>
<p style="text-align: justify;"><span style="font-size: small;">In this post, we proceed with further discussion on simulation through Excel workbook running in parallel on HPC cluster. Below the list of related blogs:</span></p>
<ul>
<li style="text-align: justify;"><em><span style="font-size: medium;"><strong><a href="http://blogs.msdn.com/b/faber/archive/2013/06/14/running-parallel-excel-on-windows-hpc-2008-r2-hosted-in-windows-azure-iaas-vms.aspx">Blog-Part1</a> </strong></span></em><span style="font-size: small;">: how to build up a Windows HPC 2008 R2 cluster in Azure IaaS VMs and installation of Excel 2010 on HPC cluster nodes</span></li>
<li style="text-align: justify;"><em><em><span style="font-size: medium;"><strong><a href="http://blogs.msdn.com/b/faber/archive/2013/06/25/running-parallel-excel-on-windows-hpc-2008-r2-hosted-in-windows-azure-iaas-vms-part-2.aspx">Blog-Part2</a>&nbsp;</strong></span></em></em><span style="font-size: small;">: how to run a Excel 2010 workbook in parallel on Windows HPC 2008 R2 cluster; it is&nbsp;discussed a&nbsp;basic multiplication table rows&nbsp;by columns</span></li>
<li style="text-align: justify;"><em><em><em><span style="font-size: medium;"><strong><a href="http://blogs.msdn.com/b/faber/archive/2013/07/04/running-parallel-excel-on-windows-hpc-2008-r2-hosted-in-windows-azure-iaas-vms-part-3.aspx">Blog-Part3</a> </strong></span></em></em></em><span style="font-size: small;">: how to run in Excel 2010 workbook a multiplication table row&nbsp;by column in parallel with data partition in block</span></li>
</ul>
<p style="text-align: justify;"><span style="font-size: small;">In this forth blog we discuss a more complex Excel workbook to calculate a Fresnel transform, very common in linear optics. Fresnel transform is CPU intensive&nbsp;and therefore&nbsp;a good example&nbsp;to point out advantages to run Excel on multiple HPC compute nodes&nbsp;vs single desktop/laptop.</span></p>
<p>&nbsp;</p>
<h1><span style="color: #000080;">2 Fresnel transform in Excel running in parallel on Windows HPC cluster</span></h1>
<p style="text-align: justify;"><span style="font-size: small;">In linear optics, electromagnetic diffraction through a plane screen is described in good approximation with Fresnel transform. Let V0(s,t) the electromagnetic field on a point (p,q,z=0) on a plane z=0 and V(x,y,z) the electromagnetic field on point (x,y,z)&nbsp;as shown in Figure 1</span></p>
<p>&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/1854.01_CoordinatesSystem.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/1854.01_5F00_CoordinatesSystem.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/1854.01_CoordinatesSystem.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/1854.01_5F00_CoordinatesSystem.jpg" alt="" width="356" height="192" border="0" /></a></p>
<p style="text-align: center;">&nbsp;Figure 1</p>
<p style="text-align: justify;"><span style="font-size: small;">At distance&nbsp;z&gt;&gt;<span style="font-family: symbol;"> l</span> the electromagnetic field V(x,y,z) is described with good approximation through the Fresnel transform:</span><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/8750.02_Formula.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/8750.02_5F00_Formula.jpg">&nbsp;<img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/8750.02_Formula.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/8750.02_5F00_Formula.jpg" alt="" width="796" height="79" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Equation&nbsp;1: Fresnel equation</span></p>
<p style="text-align: justify;"><span style="font-size: small;">where:</span><br />&nbsp;&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/5226.03_Formula.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/5226.03_5F00_Formula.jpg"> <img style="float: left;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/5226.03_Formula.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/5226.03_5F00_Formula.jpg" alt="" width="332" height="105" border="0" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p style="text-align: justify;"><span style="font-size: small;">Our goal is to write an Excel workbook able to run in parallel on Windows HPC cluster installed in windows Azure IaaS VMs. By substitution of Eulero's formula</span>&nbsp;</p>
<p>&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/7713.04_Formula.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/7713.04_5F00_Formula.jpg"> <img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/7713.04_Formula.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/7713.04_5F00_Formula.jpg" alt="" width="171" height="21" border="0" /></a></p>
<p style="text-align: justify;"><span style="font-size: small;">in Equation 1 we&nbsp;get the electromagnetic pattern V(x,y,z) on a plan (x,y,z)&nbsp;composed of&nbsp;real part and imaginary part:</span><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/7345.05_Formula.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/7345.05_5F00_Formula.jpg">&nbsp;<img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/7345.05_Formula.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/7345.05_5F00_Formula.jpg" alt="" width="649" height="48" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Equation 2: Fresnel equation slit up in real and imaginary parts</span></p>
<p style="text-align: justify;"><span style="font-size: small;">For simplicity, we set the real and imaginary part:</span><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/3225.06_Formula.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/3225.06_5F00_Formula.jpg">&nbsp;<img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/3225.06_Formula.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/3225.06_5F00_Formula.jpg" alt="" width="491" height="95" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Equation 3:&nbsp;real and imaginary part of Fresnel equation&nbsp;</span></p>
<p style="text-align: justify;">&nbsp;<span style="font-size: small;">To run a compute simulation we need to apply a sampling in plane </span><span style="font-size: small;">(p,q,z=0) and in plane (x,y,z). </span><span style="font-size: small;">Let consider </span></p>
<ul>
<li>
<div style="text-align: justify;"><span style="font-size: small;">a segment L<sub>p</sub> centered around the p axis and L<sub>q</sub> centered around the q axis</span></div>
</li>
<li>
<div style="text-align: justify;"><span style="font-size: small;">a segment X<sub>m</sub> centered around the x axis and Y<sub>n</sub> centered aroung the y axis</span></div>
</li>
<li>
<div style="text-align: justify;"><span style="font-size: small;">N<sub>p</sub> the number of samples in the p axis</span></div>
</li>
<li>
<div style="text-align: justify;"><span style="font-size: small;">N<sub>q</sub> the number of samples in the q axis</span></div>
</li>
<li>
<div style="text-align: justify;"><span style="font-size: small;">N<sub>m</sub> the number of samples in the x axis</span></div>
</li>
<li>
<div style="text-align: justify;"><span style="font-size: small;">N<sub>n</sub> the number of samples&nbsp; in the y axis</span></div>
</li>
</ul>
<p>&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/7345.05_Formula.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/7345.05_5F00_Formula.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/7345.05_Formula.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/7345.05_5F00_Formula.jpg" alt="" width="594" height="44" border="0" /> </a></p>
<p>&nbsp;</p>
<p>&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/4885.07A_Formula.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/4885.07A_5F00_Formula.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/4885.07A_Formula.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/4885.07A_5F00_Formula.jpg" alt="" width="483" height="259" border="0" /> </a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 2: sampling intervals on two planes</span></p>
<p style="text-align: justify;"><span style="font-size: small;">In&nbsp;Equation 4&nbsp;&nbsp;is reported the sampling intervals and the relative ranges</span></p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/2437.07_Formula.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/2437.07_5F00_Formula.jpg">&nbsp;<img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/2437.07_Formula.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/2437.07_5F00_Formula.jpg" alt="" width="507" height="251" border="0" /></a><span style="font-size: small;">Equation 4: sampling intervals and range of sampling</span></p>
<p style="text-align: justify;"><span style="font-size: small;">In Equation 4 we have following values:</span></p>
<p style="text-align: justify; padding-left: 30px;"><span style="font-size: small;"><span style="font-family: symbol;">D</span>p: it is distance between two adjacency samples along the p axis</span></p>
<p style="text-align: justify; padding-left: 30px;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-family: symbol;">D</span>q: it is the distance between two adjacency samples along the q axis</span></span></p>
<p style="text-align: justify; padding-left: 30px;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-family: symbol;">D</span>x: it is the distance between two adjacency samples along the&nbsp;x axis</span></span></span></span></p>
<p style="text-align: justify; padding-left: 30px;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-family: symbol;">D</span>y: it is the distance between two adjacency samples along the&nbsp;y axis</span></span></span></span></span></span></span></span></p>
<p style="text-align: justify;"><span style="font-size: small;">The distance</span><span style="font-size: small;"> r<sub>jl</sub></span><span style="font-size: small;"> between the sample (p<sub>j</sub>,q<sub>l</sub>,z=0) and the sample (x<sub>m</sub>,y<sub>n</sub>,z) is shown in Equation 5:</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/1440.08_Formula.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/1440.08_5F00_Formula.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/1440.08_Formula.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/1440.08_5F00_Formula.jpg" alt="" width="251" height="30" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Equation 5: sampled intervals </span></p>
<p style="text-align: justify;"><span style="font-size: small;">The discrete expression for real and imaginary part of electromagnetic field are shown in the Equation 6:</span></p>
<p>&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/0636.09_Formula.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/0636.09_5F00_Formula.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/0636.09_Formula.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/0636.09_5F00_Formula.jpg" alt="" width="476" height="92" border="0" /> </a></p>
<p style="text-align: center;">&nbsp;</p>
<p>&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/6180.10_Formula.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/6180.10_5F00_Formula.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/6180.10_Formula.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/6180.10_5F00_Formula.jpg" alt="" width="491" height="88" border="0" /> </a></p>
<p style="text-align: center;"><span style="font-size: small;">Equation 6: discrete expression of real and imaginary part of Fresnel equation</span></p>
<p style="text-align: justify;"><span style="font-size: small;">The intensity I(x<sub>m</sub>,y<sub>n</sub>,z) of electromagnetic&nbsp;field&nbsp; is equal to the square of module of electromagnetic field V(x<sub>m</sub>,y<sub>n</sub>,z):</span><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/6758.11_Formula.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/6758.11_5F00_Formula.jpg">&nbsp;<img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/6758.11_Formula.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/6758.11_5F00_Formula.jpg" alt="" width="485" height="39" border="0" /></a></p>
<p style="text-align: center;">&nbsp;Equation 7: discrete expression of&nbsp;electromagnetic&nbsp;intensity</p>
<p style="text-align: justify;"><span style="font-size: small;">Our simulation&nbsp;is based on&nbsp;the&nbsp;Equation 4-Equation 7.&nbsp;&nbsp;</span></p>
<h1><span style="color: #000080;">3&nbsp;Project organization</span></h1>
<p style="text-align: justify;"><span style="font-size: small;">Project is organized in four modules:</span></p>
<ul>
<li style="text-align: justify;"><span style="font-size: small;"><strong><span style="font-size: medium;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/3146.HPCExcelMacros.bas" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/3146.HPCExcelMacros.bas">HPCExcelMacros.bas</a></span></strong>: it contains all HPC macro framework functions designated to support parallel execution</span></li>
<li style="text-align: justify;"><span style="font-size: small;"><span style="font-size: medium;"><strong><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/7752.HPCControlMacros.bas" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/7752.HPCControlMacros.bas">HPCControlMacros.bas</a></strong></span>: a set of VBA&nbsp;codes contains the &ldquo;control&rdquo; functions. In this VBA module we have few parameters as the name of HPC head node and the shared folder used from the different HPC compute nodes to get the Excel file for running the simulation</span></li>
<li style="text-align: justify;"><span style="font-size: small;"><strong><span style="font-size: medium;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/4885.WorkingFunctions.bas" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/4885.WorkingFunctions.bas">WorkingFunctions.bas</a></span></strong>: code to run discrete Fresnel transform (Equation 4-&nbsp;Equation 7)</span></li>
<li style="text-align: justify;"><span style="font-size: small;"><span style="font-size: medium;"><strong><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/1106.PlottingGraph.bas" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/1106.PlottingGraph.bas">PlottingGraph.bas</a></strong></span>:&nbsp; function to plot outcome of simulation [intensity <strong>I(x,y,z)</strong> of electromagnetic field&nbsp;in Fresnel approximation].This VBA module contains some controls that allow to change view and orientation of graphical chart (clockwise rotation, anticlockwise rotation,&nbsp;&nbsp;change in perspective angle, elevation angle).</span></li>
</ul>
<h2 style="text-align: justify;"><span style="color: #000080;">3.1&nbsp; HPCExcelMacros.bas</span></h2>
<pre class="scroll"><code class="cplusplus"><strong><span style="font-size: x-small;">Attribute VB_Name = "HPCExcelMacros" </span></strong><br /><strong><span style="font-size: x-small;"> Option Explicit </span></strong><br /><strong><span style="font-size: x-small;"> '========================================================== </span></strong><br /><strong><span style="font-size: x-small;"> ' Section 1: Variables and constants </span></strong><br /><strong><span style="font-size: x-small;"> '========================================================== </span></strong><br /><strong><span style="font-size: x-small;"> Public Pi As Double </span></strong><br /><strong><span style="font-size: x-small;"> Public z As Double </span></strong><br /><strong><span style="font-size: x-small;"> Public lambda As Double </span></strong><br /><strong><span style="font-size: x-small;"> Public K As Double </span></strong><br /><strong><span style="font-size: x-small;"> Public V0 As Double </span></strong><br /><strong><span style="font-size: x-small;"> Public Nx As Integer </span></strong><br /><strong><span style="font-size: x-small;"> Public Ny As Integer </span></strong><br /><strong><span style="font-size: x-small;"> Public Lx As Double </span></strong><br /><strong><span style="font-size: x-small;"> Public Ly As Double </span></strong><br /><strong><span style="font-size: x-small;"> Public deltaX As Double </span></strong><br /><strong><span style="font-size: x-small;"> Public deltaY As Double </span></strong><br /> <br /><strong><span style="font-size: x-small;"> Public Np As Integer </span></strong><br /><strong><span style="font-size: x-small;"> Public Nq As Integer </span></strong><br /><strong><span style="font-size: x-small;"> Public Lp As Double </span></strong><br /><strong><span style="font-size: x-small;"> Public Lq As Double </span></strong><br /><strong><span style="font-size: x-small;"> Public percentageCompletion As Single </span></strong><br /><strong><span style="font-size: x-small;"> Public m As Integer </span></strong><br /><strong><span style="font-size: x-small;"> Public n As Integer </span></strong><br /><strong><span style="font-size: x-small;"> Public indexRow As Integer </span></strong><br /><strong><span style="font-size: x-small;"> Public indexCol As Integer </span></strong><br /><strong><span style="font-size: x-small;"> Public CounterStatus As Integer </span></strong><br /> <br /><strong><span style="font-size: x-small;"> Dim CalculationComplete As Boolean </span></strong><br /><strong><span style="font-size: x-small;"> Dim StartTime As Double </span></strong><br /><strong><span style="font-size: x-small;"> Dim FinishTime As Double </span></strong><br /><strong><span style="font-size: x-small;"> Public Const SingleBlock As Integer = 5 </span></strong><br /><strong><span style="font-size: x-small;"> Public Const NumBlocks As Integer = 50 </span></strong><br /><strong><span style="font-size: x-small;"> Public Const SizeVector As Integer = NumBlocks * SingleBlock </span></strong><br /> <br /> <br /><strong><span style="font-size: x-small;"> '========================================================== </span></strong><br /><strong><span style="font-size: x-small;"> ' Section 2: HPC Calculation Macros </span></strong><br /><strong><span style="font-size: x-small;"> '========================================================== </span></strong><br /><strong><span style="font-size: x-small;"> Public Function HPC_GetVersion() </span></strong><br /><strong><span style="font-size: x-small;"> HPC_GetVersion = "1.0" </span></strong><br /><strong><span style="font-size: x-small;"> End Function </span></strong><br /> <br /><strong><span style="font-size: x-small;"> Public Function HPC_Initialize() </span></strong><br /><strong><span style="font-size: x-small;"> ThisWorkbook.Sheets("Sheet2").Cells.ClearContents </span></strong><br /><strong><span style="font-size: x-small;"> ThisWorkbook.Sheets("Sheet1").Range("percentageCompletion").Value = 0 </span></strong><br /><strong><span style="font-size: x-small;"> percentageCompletion = 0 </span></strong><br /><strong><span style="font-size: x-small;"> Call DeleteGraph("Sheet1") </span></strong><br /><strong><span style="font-size: x-small;"> '============================================== </span></strong><br /><strong><span style="font-size: x-small;"> Application.ScreenUpdating = False </span></strong><br /> <br /><strong><span style="font-size: x-small;"> V0 = ThisWorkbook.Sheets("Sheet1").Range("V0").Value </span></strong><br /><strong><span style="font-size: x-small;"> z = ThisWorkbook.Sheets("Sheet1").Range("zaxis").Value </span></strong><br /><strong><span style="font-size: x-small;"> lambda = ThisWorkbook.Sheets("Sheet1").Range("lambda").Value </span></strong><br /><strong><span style="font-size: x-small;"> Nx = ThisWorkbook.Sheets("Sheet1").Range("Nx").Value ' Nx: number of samples in x-axis </span></strong><br /><strong><span style="font-size: x-small;"> Ny = ThisWorkbook.Sheets("Sheet1").Range("Ny").Value ' Ny: number of samples in y-axis </span></strong><br /><strong><span style="font-size: x-small;"> Lx = ThisWorkbook.Sheets("Sheet1").Range("Lx").Value </span></strong><br /><strong><span style="font-size: x-small;"> Ly = ThisWorkbook.Sheets("Sheet1").Range("Ly").Value </span></strong><br /><strong><span style="font-size: x-small;"> Np = ThisWorkbook.Sheets("Sheet1").Range("Np").Value ' Np: number of samples in x-axis </span></strong><br /><strong><span style="font-size: x-small;"> Nq = ThisWorkbook.Sheets("Sheet1").Range("Nq").Value ' Nq: number of samples in y-axis </span></strong><br /><strong><span style="font-size: x-small;"> Lp = ThisWorkbook.Sheets("Sheet1").Range("Lp").Value </span></strong><br /><strong><span style="font-size: x-small;"> Lq = ThisWorkbook.Sheets("Sheet1").Range("Lq").Value </span></strong><br /> <br /><strong><span style="font-size: x-small;"> deltaX = Lx / Nx </span></strong><br /><strong><span style="font-size: x-small;"> deltaY = Ly / Ny </span></strong><br /> <br /><strong><span style="font-size: x-small;"> Pi = 4 * Atn(1) </span></strong><br /><strong><span style="font-size: x-small;"> m = -Nx / 2 </span></strong><br /><strong><span style="font-size: x-small;"> n = -Ny / 2 </span></strong><br /> <br /><strong><span style="font-size: x-small;"> indexRow = 1 </span></strong><br /><strong><span style="font-size: x-small;"> indexCol = 1 </span></strong><br /><strong><span style="font-size: x-small;"> CounterStatus = 0 ' counter on number of record computed </span></strong><br /><strong><span style="font-size: x-small;"> CalculationComplete = False </span></strong><br /><strong><span style="font-size: x-small;"> StartTime = Timer </span></strong><br /><strong><span style="font-size: x-small;"> End Function </span></strong><br /> <br /> <br /><strong><span style="font-size: x-small;"> Public Function HPC_Partition() As Variant </span></strong><br /><strong><span style="font-size: x-small;"> Dim data(SizeVector) As Variant </span></strong><br /><strong><span style="font-size: x-small;"> Dim indexBlock As Integer </span></strong><br /><strong><span style="font-size: x-small;"> Dim x As Double </span></strong><br /><strong><span style="font-size: x-small;"> Dim y As Double </span></strong><br /> <br /><strong><span style="font-size: x-small;"> For indexBlock = 0 To (NumBlocks - 1) </span></strong><br /><strong><span style="font-size: x-small;"> If indexCol &gt; Nx Then </span></strong><br /><strong><span style="font-size: x-small;"> indexCol = 1 </span></strong><br /><strong><span style="font-size: x-small;"> m = -Nx / 2 </span></strong><br /><strong><span style="font-size: x-small;"> '---- </span></strong><br /><strong><span style="font-size: x-small;"> indexRow = indexRow + 1 </span></strong><br /><strong><span style="font-size: x-small;"> n = n + 1 </span></strong><br /><strong><span style="font-size: x-small;"> End If </span></strong><br /> <br /><strong><span style="font-size: x-small;"> If indexRow &gt; Ny Then </span></strong><br /><strong><span style="font-size: x-small;"> ' return null to indicate the end of the calculation </span></strong><br /><strong><span style="font-size: x-small;"> HPC_Partition = Null </span></strong><br /><strong><span style="font-size: x-small;"> ' and exit the function now, we can skip the rest </span></strong><br /><strong><span style="font-size: x-small;"> Exit Function </span></strong><br /><strong><span style="font-size: x-small;"> End If </span></strong><br /> <br /><strong><span style="font-size: x-small;"> x = m * deltaX </span></strong><br /><strong><span style="font-size: x-small;"> y = n * deltaY </span></strong><br /> <br /><strong><span style="font-size: x-small;"> data(0 + indexBlock * SingleBlock) = indexCol </span></strong><br /><strong><span style="font-size: x-small;"> data(1 + indexBlock * SingleBlock) = indexRow </span></strong><br /><strong><span style="font-size: x-small;"> data(2 + indexBlock * SingleBlock) = x </span></strong><br /><strong><span style="font-size: x-small;"> data(3 + indexBlock * SingleBlock) = y </span></strong><br /> <br /><strong><span style="font-size: x-small;"> If ((indexRow = Nx) And (indexCol = Ny)) Then </span></strong><br /><strong><span style="font-size: x-small;"> m = m + 1 </span></strong><br /><strong><span style="font-size: x-small;"> indexCol = indexCol + 1 </span></strong><br /><strong><span style="font-size: x-small;"> Exit For </span></strong><br /><strong><span style="font-size: x-small;"> End If </span></strong><br /> <br /><strong><span style="font-size: x-small;"> ' move to the next sample </span></strong><br /><strong><span style="font-size: x-small;"> m = m + 1 </span></strong><br /><strong><span style="font-size: x-small;"> ' move to the next col </span></strong><br /><strong><span style="font-size: x-small;"> indexCol = indexCol + 1 </span></strong><br /><strong><span style="font-size: x-small;"> Next </span></strong><br /><strong><span style="font-size: x-small;"> HPC_Partition = data </span></strong><br /><strong><span style="font-size: x-small;"> End Function </span></strong><br /> <br /> <br /><strong><span style="font-size: x-small;"> Public Function HPC_Execute(data As Variant) As Variant </span></strong><br /><strong><span style="font-size: x-small;"> Dim x As Double </span></strong><br /><strong><span style="font-size: x-small;"> Dim y As Double </span></strong><br /><strong><span style="font-size: x-small;"> Dim resultVal As Double </span></strong><br /><strong><span style="font-size: x-small;"> Dim indexBlock As Integer </span></strong><br /> <br /><strong><span style="font-size: x-small;"> V0 = ThisWorkbook.Sheets("Sheet1").Range("V0").Value </span></strong><br /><strong><span style="font-size: x-small;"> z = ThisWorkbook.Sheets("Sheet1").Range("zaxis").Value </span></strong><br /><strong><span style="font-size: x-small;"> lambda = ThisWorkbook.Sheets("Sheet1").Range("lambda").Value </span></strong><br /><strong><span style="font-size: x-small;"> Np = ThisWorkbook.Sheets("Sheet1").Range("Np").Value ' Np: number of samples in x-axis </span></strong><br /><strong><span style="font-size: x-small;"> Nq = ThisWorkbook.Sheets("Sheet1").Range("Nq").Value ' Nq: number of samples in y-axis </span></strong><br /><strong><span style="font-size: x-small;"> Lp = ThisWorkbook.Sheets("Sheet1").Range("Lp").Value </span></strong><br /><strong><span style="font-size: x-small;"> Lq = ThisWorkbook.Sheets("Sheet1").Range("Lq").Value </span></strong><br /> <br /><strong><span style="font-size: x-small;"> For indexBlock = 0 To (((UBound(data)) / SingleBlock) - 1) </span></strong><br /><strong><span style="font-size: x-small;"> x = data(2 + indexBlock * SingleBlock) </span></strong><br /><strong><span style="font-size: x-small;"> y = data(3 + indexBlock * SingleBlock) </span></strong><br /> <br /><strong><span style="font-size: x-small;"> resultVal = FresnelTransform(x, y, z, V0, lambda, Lp, Lq, Np, Nq) </span></strong><br /><strong><span style="font-size: x-small;"> data(4 + indexBlock * SingleBlock) = resultVal </span></strong><br /><strong><span style="font-size: x-small;"> Next </span></strong><br /><strong><span style="font-size: x-small;"> ' return value from the function </span></strong><br /><strong><span style="font-size: x-small;"> HPC_Execute = data </span></strong><br /><strong><span style="font-size: x-small;"> End Function </span></strong><br /> <br /> <br /><strong><span style="font-size: x-small;"> Public Function HPC_Merge(data As Variant) </span></strong><br /><strong><span style="font-size: x-small;"> Dim indexBlock As Integer </span></strong><br /><strong><span style="font-size: x-small;"> Dim i As Integer </span></strong><br /><strong><span style="font-size: x-small;"> Dim j As Integer </span></strong><br /><strong><span style="font-size: x-small;"> Dim x As Double </span></strong><br /><strong><span style="font-size: x-small;"> Dim y As Double </span></strong><br /><strong><span style="font-size: x-small;"> Dim resultVal As Double </span></strong><br /> <br /><strong><span style="font-size: x-small;"> 'Application.ScreenUpdating = False </span></strong><br /><strong><span style="font-size: x-small;"> For indexBlock = 0 To (((UBound(data)) / SingleBlock) - 1) </span></strong><br /><strong><span style="font-size: x-small;"> i = data(0 + indexBlock * SingleBlock) </span></strong><br /><strong><span style="font-size: x-small;"> j = data(1 + indexBlock * SingleBlock) </span></strong><br /><strong><span style="font-size: x-small;"> x = data(2 + indexBlock * SingleBlock) </span></strong><br /><strong><span style="font-size: x-small;"> y = data(3 + indexBlock * SingleBlock) </span></strong><br /><strong><span style="font-size: x-small;"> resultVal = data(4 + indexBlock * SingleBlock) </span></strong><br /> <br /> <br /><strong><span style="font-size: x-small;"> ThisWorkbook.Sheets("Sheet2").Cells(1, i + 1).Value = x </span></strong><br /><strong><span style="font-size: x-small;"> ThisWorkbook.Sheets("Sheet2").Cells(j + 1, 1).Value = y </span></strong><br /><strong><span style="font-size: x-small;"> ThisWorkbook.Sheets("Sheet2").Cells(j + 1, i + 1).Value = resultVal </span></strong><br /><strong><span style="font-size: x-small;"> CounterStatus = CounterStatus + 1 </span></strong><br /><strong><span style="font-size: x-small;"> If (i = Nx) And (j = Ny) Then </span></strong><br /><strong><span style="font-size: x-small;"> Call UpdateStatus </span></strong><br /><strong><span style="font-size: x-small;"> Application.ScreenUpdating = True </span></strong><br /><strong><span style="font-size: x-small;"> Exit For </span></strong><br /><strong><span style="font-size: x-small;"> End If </span></strong><br /><strong><span style="font-size: x-small;"> Next </span></strong><br /><strong><span style="font-size: x-small;"> Call UpdateStatus </span></strong><br /><strong><span style="font-size: x-small;"> 'Application.ScreenUpdating = True </span></strong><br /> <br /><strong><span style="font-size: x-small;"> End Function </span></strong><br /> <br /> <br /><strong><span style="font-size: x-small;"> Public Function HPC_Finalize() </span></strong><br /><strong><span style="font-size: x-small;"> Dim cellRangeGraph As String </span></strong><br /><strong><span style="font-size: x-small;"> Dim cellRangeFormatting As String </span></strong><br /> <br /><strong><span style="font-size: x-small;"> FinishTime = Timer </span></strong><br /><strong><span style="font-size: x-small;"> CalculationComplete = True </span></strong><br /><strong><span style="font-size: x-small;"> Call UpdateStatus </span></strong><br /> <br /><strong><span style="font-size: x-small;"> ' Clean up the calculation. It's a good idea to </span></strong><br /><strong><span style="font-size: x-small;"> ' leave this here, even if you make changes to </span></strong><br /><strong><span style="font-size: x-small;"> ' this function. The function we call here is in </span></strong><br /><strong><span style="font-size: x-small;"> ' the "HPCControlMacros" module. </span></strong><br /> <br /><strong><span style="font-size: x-small;"> CleanUpClusterCalculation </span></strong><br /> <br /><strong><span style="font-size: x-small;"> cellRangeGraph = Worksheets("Sheet2").Cells(1, 1).Address(False, False) + ":" + Worksheets("Sheet2").Cells(Nx + 1, Ny + 1).Address(False, False) </span></strong><br /><strong><span style="font-size: x-small;"> cellRangeFormatting = Worksheets("Sheet2").Cells(2, 2).Address(False, False) + ":" + Worksheets("Sheet2").Cells(Nx + 1, Ny + 1).Address(False, False) </span></strong><br /> <br /><strong><span style="font-size: x-small;"> Call GenerateGraph("Sheet1", "Sheet2", cellRangeGraph) </span></strong><br /><strong><span style="font-size: x-small;"> Call ConditionalFormatting("Sheet2", cellRangeFormatting) </span></strong><br /><strong><span style="font-size: x-small;"> Application.ScreenUpdating = True </span></strong><br /><strong><span style="font-size: x-small;"> End Function </span></strong><br /> <br /> <br /><strong><span style="font-size: x-small;"> Public Function HPC_ExecutionError(errorMessage As String, errorContents As String) </span></strong><br /><strong><span style="font-size: x-small;"> MsgBox errorMessage &amp; vbCrLf &amp; vbCrLf &amp; errorContents </span></strong><br /><strong><span style="font-size: x-small;"> End Function </span></strong><br /> <br /><strong><span style="font-size: x-small;"> Sub UpdateStatus() </span></strong><br /><strong><span style="font-size: x-small;"> Dim statusMessage As String </span></strong><br /> <br /><strong><span style="font-size: x-small;"> Application.ScreenUpdating = True </span></strong><br /><strong><span style="font-size: x-small;"> If Not CalculationComplete Then </span></strong><br /><strong><span style="font-size: x-small;"> statusMessage = "Calculated " &amp; CounterStatus &amp; "/" &amp; (Nx * Ny) </span></strong><br /><strong><span style="font-size: x-small;"> Else </span></strong><br /><strong><span style="font-size: x-small;"> statusMessage = "Calculated " &amp; CounterStatus &amp; "/" &amp; (Nx * Ny) </span></strong><br /><strong><span style="font-size: x-small;"> statusMessage = statusMessage &amp; "; completed in " &amp; FormatNumber(FinishTime - StartTime) &amp; "s" </span></strong><br /><strong><span style="font-size: x-small;"> End If </span></strong><br /><strong><span style="font-size: x-small;"> Application.StatusBar = statusMessage </span></strong><br /><strong><span style="font-size: x-small;"> ActiveSheet.Range("percentageCompletion").Value = CounterStatus / (Nx * Ny) </span></strong><br /><strong><span style="font-size: x-small;"> Application.ScreenUpdating = False </span></strong><br /><strong><span style="font-size: x-small;"> End Sub</span></strong> <br /> </code></pre>
<p style="text-align: justify;">&nbsp;</p>
<p style="text-align: justify;">&nbsp;</p>
<h2 style="text-align: justify;"><span style="color: #000080;">3.2&nbsp; HPCControlMacros.bas</span></h2>
<p style="text-align: justify;">&nbsp;</p>
<pre class="scroll"><code class="cplusplus"><strong><span style="font-size: x-small;">Attribute VB_Name = "HPCControlMacros" </span></strong><br /> <br /><strong><span style="font-size: x-small;"> Option Explicit </span></strong><br /> <br /><strong><span style="font-size: x-small;"> '========================================================== </span></strong><br /><strong><span style="font-size: x-small;"> ' Section 1: Variables and constants </span></strong><br /><strong><span style="font-size: x-small;"> '========================================================== </span></strong><br /><strong><span style="font-size: x-small;"> Private Const HPC_ClusterScheduler = "exhn001" </span></strong><br /><strong><span style="font-size: x-small;"> Private Const HPC_NetworkShare = "\\exhn001\share" </span></strong><br /><strong><span style="font-size: x-small;"> Private Const HPC_JobTemplate = "" </span></strong><br /><strong><span style="font-size: x-small;"> Private HPCExcelClient As IExcelClient </span></strong><br /> <br /><strong><span style="font-size: x-small;"> '========================================================== </span></strong><br /><strong><span style="font-size: x-small;"> ' Section 2: Control Functions </span></strong><br /><strong><span style="font-size: x-small;"> '========================================================== </span></strong><br /> <br /><strong><span style="font-size: x-small;"> Private Sub CalculateWorkbook(CalculateOnDesktop As Boolean) </span></strong><br /><strong><span style="font-size: x-small;"> Dim HPCWorkbookPath As String </span></strong><br /><strong><span style="font-size: x-small;"> On Error GoTo ErrorHandler </span></strong><br /> <br /><strong><span style="font-size: x-small;"> ' Create a new excelCient instance per session </span></strong><br /><strong><span style="font-size: x-small;"> Set HPCExcelClient = New ExcelClient </span></strong><br /> <br /><strong><span style="font-size: x-small;"> ' Initialize the excel client object with the current workbook </span></strong><br /><strong><span style="font-size: x-small;"> HPCExcelClient.Initialize ActiveWorkbook </span></strong><br /> <br /><strong><span style="font-size: x-small;"> If CalculateOnDesktop = False Then </span></strong><br /> <br /><strong><span style="font-size: x-small;"> ' We need a copy of the file on the network, so it's accessible </span></strong><br /><strong><span style="font-size: x-small;"> ' by the cluster compute nodes. Save a temporary copy to the </span></strong><br /><strong><span style="font-size: x-small;"> ' share directory. </span></strong><br /> <br /><strong><span style="font-size: x-small;"> HPCWorkbookPath = HPC_NetworkShare &amp; Application.PathSeparator &amp; ActiveWorkbook.Name </span></strong><br /> <br /><strong><span style="font-size: x-small;"> ActiveWorkbook.SaveCopyAs HPCWorkbookPath </span></strong><br /> <br /><strong><span style="font-size: x-small;"> ' Create a cluster session with the desired options. Here, we're </span></strong><br /><strong><span style="font-size: x-small;"> ' just using the scheduler name and (optionally) a job template. </span></strong><br /> <br /><strong><span style="font-size: x-small;"> If HPC_JobTemplate &lt;&gt; "" Then </span></strong><br /><strong><span style="font-size: x-small;"> HPCExcelClient.OpenSession headNode:=HPC_ClusterScheduler, remoteWorkbookPath:=HPCWorkbookPath, jobTemplate:=HPC_JobTemplate </span></strong><br /><strong><span style="font-size: x-small;"> Else </span></strong><br /><strong><span style="font-size: x-small;"> HPCExcelClient.OpenSession headNode:=HPC_ClusterScheduler, remoteWorkbookPath:=HPCWorkbookPath </span></strong><br /><strong><span style="font-size: x-small;"> End If </span></strong><br /> <br /><strong><span style="font-size: x-small;"> End If </span></strong><br /> <br /><strong><span style="font-size: x-small;"> ' Run on local machine or cluster as chosen in workbook </span></strong><br /><strong><span style="font-size: x-small;"> HPCExcelClient.Run CalculateOnDesktop </span></strong><br /><strong><span style="font-size: x-small;"> Exit Sub </span></strong><br /> <br /><strong><span style="font-size: x-small;"> ErrorHandler: </span></strong><br /><strong><span style="font-size: x-small;"> ' Notify user of error and clean up any allocated resources </span></strong><br /><strong><span style="font-size: x-small;"> MsgBox Prompt:=Err.Description, Title:="HPC Calculation Error" </span></strong><br /><strong><span style="font-size: x-small;"> If Not HPCExcelClient Is Nothing Then </span></strong><br /><strong><span style="font-size: x-small;"> HPCExcelClient.Dispose </span></strong><br /><strong><span style="font-size: x-small;"> End If </span></strong><br /><strong><span style="font-size: x-small;"> End Sub </span></strong><br /> <br /><strong><span style="font-size: x-small;"> Public Sub CalculateWorkbookOnDesktop() </span></strong><br /><strong><span style="font-size: x-small;"> CalculateWorkbook (True) </span></strong><br /><strong><span style="font-size: x-small;"> End Sub </span></strong><br /> <br /><strong><span style="font-size: x-small;"> Public Sub CalculateWorkbookOnCluster() </span></strong><br /><strong><span style="font-size: x-small;"> CalculateWorkbook (False) </span></strong><br /><strong><span style="font-size: x-small;"> End Sub </span></strong><br /> <br /><strong><span style="font-size: x-small;"> Public Sub CleanUpClusterCalculation() </span></strong><br /> <br /><strong><span style="font-size: x-small;"> On Error Resume Next </span></strong><br /><strong><span style="font-size: x-small;"> HPCExcelClient.CloseSession </span></strong><br /><strong><span style="font-size: x-small;"> HPCExcelClient.Dispose </span></strong><br /><strong><span style="font-size: x-small;"> On Error GoTo 0 </span></strong><br /><strong><span style="font-size: x-small;"> End Sub</span></strong> <br /> </code></pre>
<p style="text-align: justify;">&nbsp;</p>
<p style="text-align: justify;">&nbsp;</p>
<h2 style="text-align: justify;"><span style="color: #000080;">3.3&nbsp; WorkingFunctions.bas</span></h2>
<pre class="scroll"><code class="cplusplus"><strong><span style="font-size: x-small;">Attribute VB_Name = "WorkingFunctions" </span></strong><br /><strong><span style="font-size: x-small;"> Option Explicit </span></strong> <br /><strong><span style="font-size: x-small;"> ' Np: number samples in origin plane in p axis </span></strong><br /><strong><span style="font-size: x-small;"> ' Nq: number samples in origin plane in q axis </span></strong><br /><strong><span style="font-size: x-small;"> Public Function FresnelTransform(x As Double, y As Double, z As Double, V0 As Double, lambda As Double, Lp As Double, Lq As Double, Np As Integer, Nq As Integer) As Double </span></strong><br /><strong><span style="font-size: x-small;"> Dim realPart As Double </span></strong><br /><strong><span style="font-size: x-small;"> Dim imgPart As Double </span></strong><br /><strong><span style="font-size: x-small;"> Dim i As Integer </span></strong><br /><strong><span style="font-size: x-small;"> Dim j As Integer </span></strong><br /><strong><span style="font-size: x-small;"> Dim p As Double </span></strong><br /><strong><span style="font-size: x-small;"> Dim q As Double </span></strong><br /><strong><span style="font-size: x-small;"> Dim r As Double </span></strong><br /><strong><span style="font-size: x-small;"> Dim deltaP As Double </span></strong><br /><strong><span style="font-size: x-small;"> Dim deltaQ As Double </span></strong><br /> <br /><strong><span style="font-size: x-small;"> deltaP = Lp / Np </span></strong><br /><strong><span style="font-size: x-small;"> deltaQ = Lq / Nq </span></strong><br /> <br /><strong><span style="font-size: x-small;"> Pi = 4 * Atn(1) </span></strong><br /> <br /><strong><span style="font-size: x-small;"> K = 2 * Pi / lambda </span></strong><br /><strong><span style="font-size: x-small;"> realPart = 0 </span></strong><br /><strong><span style="font-size: x-small;"> imgPart = 0 </span></strong><br /><strong><span style="font-size: x-small;"> For j = (-Nq / 2) To (Nq / 2) Step 1 </span></strong><br /><strong><span style="font-size: x-small;"> q = j * deltaQ </span></strong><br /><strong><span style="font-size: x-small;"> For i = (-Np / 2) To (Np / 2) Step 1 </span></strong><br /><strong><span style="font-size: x-small;"> p = i * deltaP </span></strong><br /><strong><span style="font-size: x-small;"> r = Sqr(z ^ 2 + (x - p) ^ 2 + (y - q) ^ 2) </span></strong><br /><strong><span style="font-size: x-small;"> realPart = realPart + disturbance(V0, p, q) * Sin(K * r) * ((z * deltaP * deltaQ) / (lambda * (r ^ 2))) </span></strong><br /><strong><span style="font-size: x-small;"> imgPart = imgPart - disturbance(V0, p, q) * Cos(K * r) * ((z * deltaP * deltaQ) / (lambda * (r ^ 2))) </span></strong><br /><strong><span style="font-size: x-small;"> Next i </span></strong><br /><strong><span style="font-size: x-small;"> Next j </span></strong><br /> <br /><strong><span style="font-size: x-small;"> ' return value </span></strong><br /><strong><span style="font-size: x-small;"> FresnelTransform = ((realPart ^ 2) + (imgPart ^ 2)) </span></strong><br /><strong><span style="font-size: x-small;"> End Function </span></strong><br /> <br /> <br /><strong><span style="font-size: x-small;"> Function disturbance(V0 As Double, p As Double, q As Double) As Double </span></strong><br /><strong><span style="font-size: x-small;"> Dim Radius As Double </span></strong><br /><strong><span style="font-size: x-small;"> Radius = 0.0005 </span></strong> <br /><strong><span style="font-size: x-small;"> If ((p ^ 2) + (q ^ 2)) &lt;= (Radius * Radius) Then </span></strong><br /><strong><span style="font-size: x-small;"> disturbance = V0 </span></strong><br /><strong><span style="font-size: x-small;"> Else </span></strong><br /><strong><span style="font-size: x-small;"> disturbance = 0 </span></strong><br /><strong><span style="font-size: x-small;"> End If </span></strong><br /><strong><span style="font-size: x-small;"> End Function</span></strong> <br /> <br /> </code></pre>
<p style="text-align: justify;">In the <strong>WorkingFunctions.bas</strong> macro it is useful enlighten some variables:</p>
<ul>
<li>
<div style="text-align: justify;"><strong>lambda</strong>: it is the&nbsp;wavelength <strong></strong></div>
</li>
<li>
<div style="text-align: justify;"><strong>K=2 * Pi / lambda&nbsp;</strong> : it is the wavenumber</div>
</li>
<li>
<div style="text-align: justify;">the <strong>Function disturbance(V0 As Double, p As Double, q As Double)</strong> is the electromagnetic function in the plane (p,q,z0)</div>
</li>
<li>
<div style="text-align: justify;"><strong>R</strong> is the radius of pinhole in the plane z=0</div>
</li>
<li>
<div style="text-align: justify;"><strong>Public Function FresnelTransform</strong> it is the Intensity of light at the coordinate (x,y,z)</div>
</li>
</ul>
<p style="text-align: justify;">&nbsp;</p>
<h2><span style="color: #000080;">&nbsp;3.4&nbsp;PlottingGraph.bas</span></h2>
<pre class="scroll"><strong><span style="font-size: x-small;"><code class="cplusplus">Attribute VB_Name = "PlottingGraph" <br /> Option Explicit <br /> <br /> Public Const NameGraph As String = "Intensity" <br /> <br /> Public Sub DeleteGraph(sheetGraphName As String) <br /> Dim ws As Worksheet <br /> Set ws = Worksheets(sheetGraphName) <br /> On Error Resume Next <br /> 'ActiveSheet.ChartObjects.Delete <br /> ws.ChartObjects.Delete <br /> End Sub <br /> <br /> Public Sub GenerateGraph(sheetGraphName As String, sheetDataName As String, rangeCellsToBePlot As String) <br /> Dim ws As Worksheet <br /> Dim wsData As Worksheet <br /> Dim rSrc As Range, rLocation As Range <br /> Dim chtO As ChartObject <br /> <br /> <br /> Set ws = Worksheets(sheetGraphName) <br /> Set wsData = Worksheets(sheetDataName) <br /> <br /> <br /> Set rSrc = wsData.Range(rangeCellsToBePlot) <br /> Set rLocation = ws.Range("E4:L33") <br /> <br /> With rLocation <br /> Set chtO = ws.ChartObjects.Add(.Left, .Top, .Width, .Height) <br /> chtO.Name = NameGraph <br /> End With <br /> <br /> With chtO.Chart <br /> .SetSourceData Source:=rSrc <br /> ' xlSurface: Displays a standard surface chart <br /> ' xlSurfaceWireFrame: Displays a surface chart without colors <br /> ' xlSurfaceTopView: Displays the a surface chart viewed from above <br /> ' xlSurfaceTopViewWireFrame: Displays a surface chart without colors, viewed from abov <br /> .ChartType = xlSurface <br /> .HasTitle = True <br /> .ChartTitle.Font.Size = 10 <br /> .ChartTitle.Font.Color = RGB(110, 10, 155) <br /> .ChartTitle.Text = "Intensity-Fresnel approx." <br /> .Legend.Position = xlRight <br /> .Legend.Font.Size = 8 <br /> .Legend.Font.Name = "Arial" <br /> End With <br /> <br /> 'With chtO.Chart <br /> ' .Rotation = 40 <br /> ' .Elevation = 30 <br /> ' .Perspective = 15 <br /> 'End With <br /> End Sub <br /> ' The rotation of the 3-D chart view (the rotation of the plot area around the z-axis, in degrees). <br /> ' The default value is 20. <br /> Sub Rotation1_Click() <br /> Dim objCht As ChartObject <br /> Dim rotationValue As Integer <br /> On Error Resume Next <br /> Set objCht = Worksheets("Sheet1").ChartObjects(NameGraph) <br /> If Not objCht Is Nothing Then <br /> rotationValue = Worksheets("Sheet1").ChartObjects(NameGraph).Chart.Rotation <br /> With Worksheets("Sheet1").ChartObjects(NameGraph).Chart <br /> .Rotation = rotationValue + 20 <br /> End With <br /> End If <br /> End Sub <br /> <br /> ' The rotation of the 3-D chart view (the rotation of the plot area around the z-axis, in degrees). <br /> ' The default value is 20. <br /> Sub Rotation2_Click() <br /> Dim objCht As ChartObject <br /> Dim rotationValue As Integer <br /> On Error Resume Next <br /> Set objCht = Worksheets("Sheet1").ChartObjects(NameGraph) <br /> If Not objCht Is Nothing Then <br /> rotationValue = Worksheets("Sheet1").ChartObjects(NameGraph).Chart.Rotation <br /> With Worksheets("Sheet1").ChartObjects(NameGraph).Chart <br /> .Rotation = rotationValue - 20 <br /> End With <br /> End If <br /> End Sub <br /> <br /> Sub Elevation1_Click() <br /> Dim objCht As ChartObject <br /> Dim elevationValue As Integer <br /> On Error Resume Next <br /> Set objCht = Worksheets("Sheet1").ChartObjects(NameGraph) <br /> If Not objCht Is Nothing Then <br /> 'Elevation: Gets or sets the elevation of the 3-D chart view, in degrees. <br /> elevationValue = Worksheets("Sheet1").ChartObjects(NameGraph).Chart.Elevation <br /> With Worksheets("Sheet1").ChartObjects(NameGraph).Chart <br /> .Elevation = (elevationValue + 20) Mod 90 <br /> End With <br /> End If <br /> End Sub <br /> <br /> Sub Elevation2_Click() <br /> Dim objCht As ChartObject <br /> Dim elevationValue As Integer <br /> On Error Resume Next <br /> Set objCht = Worksheets("Sheet1").ChartObjects(NameGraph) <br /> If Not objCht Is Nothing Then <br /> 'Elevation: Gets or sets the elevation of the 3-D chart view, in degrees. <br /> elevationValue = Worksheets("Sheet1").ChartObjects(NameGraph).Chart.Elevation <br /> With Worksheets("Sheet1").ChartObjects(NameGraph).Chart <br /> .Elevation = Abs((elevationValue - 20) Mod 90) <br /> End With <br /> End If <br /> End Sub <br /> <br /> ' Perspective: Gets or sets the perspective for the 3-D chart view. <br /> ' the perspective for the 3-D chart view. Must be between 0 and 100. <br /> Sub Perspective1_Click() <br /> Dim objCht As ChartObject <br /> Dim perspectiveValue As Integer <br /> On Error Resume Next <br /> Set objCht = Worksheets("Sheet1").ChartObjects(NameGraph) <br /> If Not objCht Is Nothing Then <br /> 'Elevation: Gets or sets the elevation of the 3-D chart view, in degrees. <br /> perspectiveValue = Worksheets("Sheet1").ChartObjects(NameGraph).Chart.Perspective <br /> With Worksheets("Sheet1").ChartObjects(NameGraph).Chart <br /> .Perspective = (perspectiveValue + 20) Mod 100 <br /> End With <br /> End If <br /> End Sub <br /> Sub Perspective2_Click() <br /> Dim objCht As ChartObject <br /> Dim perspectiveValue As Integer <br /> On Error Resume Next <br /> Set objCht = Worksheets("Sheet1").ChartObjects(NameGraph) <br /> If Not objCht Is Nothing Then <br /> 'Elevation: Gets or sets the elevation of the 3-D chart view, in degrees. <br /> perspectiveValue = Worksheets("Sheet1").ChartObjects(NameGraph).Chart.Perspective <br /> With Worksheets("Sheet1").ChartObjects(NameGraph).Chart <br /> .Perspective = Abs((perspectiveValue - 20) Mod 100) <br /> End With <br /> End If <br /> End Sub <br /> <br /> <br /> <br /> ' http://msdn.microsoft.com/en-us/library/office/hh203953%28v=office.14%29.aspx <br /> Public Sub ConditionalFormatting(sheetDataName As String, rangeDataCells As String) <br /> Dim rng As Range <br /> Set rng = Worksheets(sheetDataName).Range(rangeDataCells) '"B2:AY51" <br /> rng.FormatConditions.Delete <br /> <br /> ' Add a 2-color scale. <br /> Dim cs As ColorScale <br /> Set cs = rng.FormatConditions.AddColorScale(ColorScaleType:=3) <br /> <br /> ' Set the color of the lowest value, with a range up to <br /> ' the next scale criteria. The color should be red. <br /> With cs.ColorScaleCriteria(1) <br /> .Type = xlConditionValueLowestValue <br /> With .FormatColor <br /> .Color = &amp;H6B69F8 <br /> ' TintAndShade takes a value between -1 and 1. <br /> ' ' -1 is darkest, 1 is lightest. <br /> .TintAndShade = 0 <br /> End With <br /> End With <br /> <br /> ' At the 50th percentile, the color should be red/green. <br /> ' Note that you cannot set the Value property for all values of Type. <br /> With cs.ColorScaleCriteria(2) <br /> .Type = xlConditionValuePercentile <br /> .Value = 50 <br /> With .FormatColor <br /> .Color = &amp;H84EBFF <br /> .TintAndShade = 0 <br /> End With <br /> End With <br /> <br /> ' At the highest value, the color should be green. <br /> With cs.ColorScaleCriteria(3) <br /> .Type = xlConditionValueHighestValue <br /> With .FormatColor <br /> .Color = &amp;H7BBE63 <br /> .TintAndShade = 0 <br /> End With <br /> End With <br /> End Sub <br /> <br /> <br /> </code></span></strong></pre>
<pre class="scroll"><code class="cplusplus"><br /></code></pre>
<h1 class="scroll"><span style="color: #000080;">4&nbsp; Run simulations on HPC cluster with different number of cores</span></h1>
<p style="text-align: justify;"><span style="font-size: small;">Now that our Excel workbook (<strong>.xlsb</strong> file) contains&nbsp;the&nbsp;four modules <strong><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/3146.HPCExcelMacros.bas" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/3146.HPCExcelMacros.bas">HPCExcelMacros.bas</a>,</strong><strong>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/7752.HPCControlMacros.bas" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/7752.HPCControlMacros.bas">HPCControlMacros.bas</a>,&nbsp;</strong><strong><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/4885.WorkingFunctions.bas" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/4885.WorkingFunctions.bas">WorkingFunctions.bas</a>,&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/1106.PlottingGraph.bas" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/1106.PlottingGraph.bas">PlottingGraph.bas</a> </strong>and reference to HPC library (<strong>Microsoft_Hpc_Excel</strong>) is added, we are ready to run it on Windows HPC cluster. In the macro <strong><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/7752.HPCControlMacros.bas" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/7752.HPCControlMacros.bas">HPCControlMacros.bas</a> </strong>there is a&nbsp;constant:</span></p>
<p><span style="color: #ff0000; font-size: small;"><strong>Private Const HPC_JobTemplate</strong> </span></p>
<p style="text-align: justify;"><span style="font-size: small;">referring&nbsp;an&nbsp;HPC&nbsp;job template;&nbsp;by default this constant is set to&nbsp;empty ("") that means to use the default job template.</span><br /><span style="font-size: small;">Through the job template the HPC administrator can&nbsp;specify which resources (max job duration, maximum number of nodes, maximum number of cores, etc.) a specific HPC user&nbsp;is authorized&nbsp;to use&nbsp;for&nbsp;HPC job submission. </span><span style="font-size: small;">We want to evaluate the performance of our Excel worksheet running many times the same&nbsp; discrete Fresnel transform with&nbsp;same&nbsp;simulation input parameters,&nbsp;but with different number of HPC cores. for this purpose we create&nbsp;by the&nbsp;HPC management console different HPC job template each with different number of maximum number of usable cores:</span></p>
<p style="text-align: justify;"><span style="font-size: small;">Login&nbsp;with&nbsp;HPC administrator you see presence of default job template (Figure 3)</span></p>
<p>&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/4048.12_JobTemplate.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/4048.12_5F00_JobTemplate.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/4048.12_JobTemplate.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/4048.12_5F00_JobTemplate.jpg" alt="" width="468" height="226" border="0" /> </a></p>
<p>&nbsp;</p>
<p style="text-align: center;">Figure 3: default job template</p>
<p><span style="font-size: small;">The default job template is create at installation time and it does not set any limitation on resources available in the system.</span></p>
<p><span style="font-size: small;">To define new job templates, click on "<strong>New&hellip;"</strong> in the action pane (Figure 3); a job template wizard drive you to set few parameters (Figure 4)&nbsp;&nbsp;</span></p>
<p style="text-align: center;">&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/4520.13_JobTemplate.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/4520.13_5F00_JobTemplate.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/4520.13_JobTemplate.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/4520.13_5F00_JobTemplate.jpg" alt="" width="464" height="260" border="0" /></a></p>
<p style="text-align: center;">&nbsp;Figure 4: job template wizard</p>
<p><span style="font-size: small;">&nbsp;After specifying job template name click on <strong>Next</strong> button</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/6327.14_JobTemplate.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/6327.14_5F00_JobTemplate.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/6327.14_JobTemplate.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/6327.14_5F00_JobTemplate.jpg" alt="" width="460" height="296" border="0" /></a></p>
<p style="text-align: center;">Figure 5: limitation of how long a job can run in the HPC cluster</p>
<p><span style="font-size: small;">We do not specify any limitation on maximum amount of time a job can run in our HPC cluster (Figure 3).</span><br /><span style="font-size: small;">Next steps in the job template wizard is to set the priority of job; we do not have interest in our test in contention of simultaneous jobs so we left the Priority to Normal default).</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/6215.15_JobTemplate.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/6215.15_5F00_JobTemplate.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/6215.15_JobTemplate.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/6215.15_5F00_JobTemplate.jpg" alt="" width="465" height="256" border="0" /></a></p>
<p style="text-align: center;">Figure 6: job priority set to Normal</p>
<p>&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/1524.16_JobTemplate.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/1524.16_5F00_JobTemplate.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/1524.16_JobTemplate.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/1524.16_5F00_JobTemplate.jpg" alt="" width="484" height="270" border="0" /></a></p>
<p style="text-align: center;">Figure 7: option to set a constraint on project name</p>
<p>&nbsp;<span style="font-size: small;">Last step in job template creation is the node group; default node group &ldquo;<strong>ComputeNodes</strong>&rdquo; include in our case EXCN001 and EXCN002 (Figure 8)</span></p>
<p>&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/3173.17_JobTemplate.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/3173.17_5F00_JobTemplate.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/3173.17_JobTemplate.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/3173.17_5F00_JobTemplate.jpg" alt="" width="468" height="272" border="0" /> </a></p>
<p style="text-align: center;">Figure 8: node group</p>
<p style="text-align: justify;">&nbsp;<span style="font-size: small;">At the end of wizard procedure the new job template appears in the list (Figure 9)</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/3718.19_JobTemplate.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/3718.19_5F00_JobTemplate.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/3718.19_JobTemplate.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/3718.19_5F00_JobTemplate.jpg" alt="" width="455" height="199" border="0" /></a></p>
<p style="text-align: center;">&nbsp;Figure 9: list of job templates</p>
<p>We need to set in the job template the maximum number of cores; right click-on job template and choose &ldquo;Edit&hellip;&rdquo; (Figure 10)&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/1212.20_JobTemplate.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/1212.20_5F00_JobTemplate.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/1212.20_JobTemplate.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/1212.20_5F00_JobTemplate.jpg" alt="" width="470" height="196" border="0" /></a></p>
<p style="text-align: center;">&nbsp;Figure 10: edit the new job template</p>
<p>&nbsp;In the job template Editor click on Add button and select &ldquo;<strong>Maximum Cores</strong>&rdquo; (Figure 11)&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/5078.21_JobTemplate.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/5078.21_5F00_JobTemplate.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/5078.21_JobTemplate.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/5078.21_5F00_JobTemplate.jpg" alt="" width="415" height="417" border="0" /></a></p>
<p style="text-align: center;">Figure 11: Maximum number of cores</p>
<p style="text-align: justify;">In the Max Value set the value two; in this case when the use will submit a job specifying the job template named &ldquo;<strong>JobTemplate2Cores</strong>&rdquo; it can be used no more than two cores (Figure 12).&nbsp;</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/6116.22_JobTemplate.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/6116.22_5F00_JobTemplate.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/6116.22_JobTemplate.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/6116.22_5F00_JobTemplate.jpg" alt="" width="412" height="416" border="0" />&nbsp;</a>Figure 12: job template with maximum two cores</p>
<p>We have as shortcut &ldquo;Copy&rdquo; to create a duplicate job template (Figure 13)</p>
<p>&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/2860.23_JobTemplate.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/2860.23_5F00_JobTemplate.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/2860.23_JobTemplate.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/2860.23_5F00_JobTemplate.jpg" alt="" width="397" height="164" border="0" /> </a></p>
<p style="text-align: center;">&nbsp;Figure 13: copy operation to duplicate the job template</p>
<p>Editing the new copied template we can set the right name and the new max value (Figure 14)</p>
<p style="text-align: center;">&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/7268.24_JobTemplate.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/7268.24_5F00_JobTemplate.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/7268.24_JobTemplate.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/7268.24_5F00_JobTemplate.jpg" alt="" width="424" height="392" border="0" />&nbsp;</a>Figure 14: job template with maximum 4 cores</p>
<p>Repeating the procedure we have following list of job templates</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/7367.25_JobTemplate.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/7367.25_5F00_JobTemplate.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/7367.25_JobTemplate.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/7367.25_5F00_JobTemplate.jpg" alt="" width="415" height="293" border="0" /> </a></p>
<p style="text-align: center;">Figure 15: list o of job templates</p>
<p>&nbsp;A short description of job templates is reported in the Table 1:</p>
<ul>
<li><strong>JobTemplate2Cores</strong>: Maximum number of usable cores=2</li>
<li><strong>JobTemplate4Cores</strong>: Maximum number of usable cores=4</li>
<li><strong>JobTemplate8Cores</strong>: Maximum number of usable cores=8</li>
<li><strong>JobTemplate10Cores</strong>: Maximum number of usable cores=10</li>
<li><strong>JobTemplate12Cores</strong>: Maximum number of usable cores=12</li>
<li><strong>Default</strong>: it is the default job template create in installation procedure. tis job template allocate all&nbsp;available cores&nbsp;(in our case 16 cores because we have two XL Azure IaaS VMs)</li>
</ul>
<p>To run all simulations we consider a circular pinhole in the plane z=0 with radius R (Figure 16) and we fix the input parameters:</p>
<p>&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/2705.pinhole.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/2705.pinhole.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/2705.pinhole.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/2705.pinhole.jpg" alt="" width="206" height="184" border="0" /> </a></p>
<p style="text-align: center;">&nbsp;Figure 16: pinhole in the plane z=0</p>
<p><span style="font-family: courier new,courier;"><strong>R </strong>= 0.005m (radius of circular pinhole in the plane z=0)</span></p>
<p><span style="font-family: courier new,courier;"><strong>N<sub>x</sub></strong> = 128 (number of samples in Lx segment)</span></p>
<p><span style="font-family: courier new,courier;"><strong>N<sub>y</sub></strong> = 128 (number of samples in Ly segment)</span></p>
<p><span style="font-family: courier new,courier;"><strong>L<sub>x</sub></strong> = 0.002 m (segment centered around x axis)</span></p>
<p><span style="font-family: courier new,courier;"><strong>L<sub>y</sub></strong> = 0.002 m (segment centered around y axis)</span></p>
<p><span style="font-family: courier new,courier;"><strong>N<sub>p</sub></strong> = 128(number of samples in Lp segment)</span></p>
<p><span style="font-family: courier new,courier;"><strong>N<sub>q</sub></strong> = 128 (number of segment in Lq segment)</span></p>
<p><span style="font-family: courier new,courier;"><strong>L<sub>p</sub></strong> = 0.005 m (segment centered around the p axis)</span></p>
<p><span style="font-family: courier new,courier;"><strong>L<sub>q</sub></strong> = 0.005 m (segment centered around the q axis)</span></p>
<p><span style="font-family: courier new,courier;"><strong>z</strong> = 0.25 m</span></p>
<p><span style="font-family: courier new,courier;"><span style="font-family: symbol;"><strong>l </strong></span>= </span><span style="font-family: courier new,courier;">6.94x10-7 m (light length)</span></p>
<p><span style="font-family: courier new,courier;"><strong>V<sub>0</sub></strong> = 10 (electromagnetic field value on the plane (p,q,z=0))</span></p>
<p>In Figure 17 is shown the outcome of simulation for the diffraction field of a circular pinhole.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/3107.32_OutcomeSimulation.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/3107.32_5F00_OutcomeSimulation.jpg">&nbsp;<img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/3107.32_OutcomeSimulation.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/3107.32_5F00_OutcomeSimulation.jpg" alt="" width="615" height="344" border="0" /> </a></p>
<p style="text-align: center;">&nbsp;Figure 17: outcome of simulation</p>
<p>&nbsp;</p>
<p>The Sheet1 has few buttons&nbsp;to&nbsp;change the orientation&nbsp;and prospective.&nbsp;</p>
<p style="text-align: center;">Though the submission of same job with different job templates, we have the chart with elapsed times (Figure 18)<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/5381.30_ElapsedTimes.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/5381.30_5F00_ElapsedTimes.jpg">&nbsp;<img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/5381.30_ElapsedTimes.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/5381.30_5F00_ElapsedTimes.jpg" alt="" width="471" height="255" border="0" />&nbsp;</a>Figure 18: elapsed times with different job templates</p>
<p>&nbsp;</p>
<p style="text-align: justify;">The chart seems strongly non linear mostly due to the initial value with 2 cores; excluding the values with 2 cores and 4 cores and re-plotting we have the new chart:</p>
<p style="text-align: center;"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/7345.31_ElapsedTimes.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/7345.31_5F00_ElapsedTimes.jpg" alt="" width="483" height="267" border="0" />&nbsp;Figure 19: elapsed times with different scale factor</p>
<p>&nbsp;</p>
<p style="text-align: justify;">The chart in Figure 19 points out a good behavior with strong reduction of elapsed time when the number of available cores increase. Charts in Figure 18-Figure 19&nbsp;describe the&nbsp;behavior of Excel workbook&nbsp;with block in HPC_Partition&nbsp;equal to 50. it is useful to compare performance of Excel workbook with different block sizes; chart in Figure&nbsp;20 shows the simulation elapsed time for block size equal to 50 vs block size equal to 5.</p>
<p style="text-align: justify;">With low number of cores 2,4,8 there is no much difference in block size; influence of block size appears in HPC job&nbsp;with larger number of cores. A larger block size reduce traffic between the client and HPC head node carry on a better efficiency in CPU usage (with larger&nbsp;block size every single <strong>HpcServiceHost.exe</strong> process waits&nbsp;less time).</p>
<p>&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/1565.32_ElapsedTimes.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/1565.32_5F00_ElapsedTimes.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/1565.32_ElapsedTimes.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/1565.32_5F00_ElapsedTimes.jpg" alt="" width="570" height="288" border="0" /> </a></p>
<p style="text-align: center;">&nbsp;&nbsp;Figure 20: simulation elapsed times with different block size</p>
<p>HPC heatmap in&nbsp; Figure 21-Figure 24 give an rough idea of CPU utilization and cores allocation&nbsp;with different job templates.</p>
<p>&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/5342.29_Job_16Cores.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/5342.29_5F00_Job_5F00_16Cores.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/5342.29_Job_16Cores.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/5342.29_5F00_Job_5F00_16Cores.jpg" alt="" width="530" height="196" border="0" /> </a></p>
<p style="text-align: center;">&nbsp;Figure 21: HPC heatmap when runs the job with 16 cores</p>
<p>&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/2654.28_Job_12Cores.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/2654.28_5F00_Job_5F00_12Cores.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/2654.28_Job_12Cores.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/2654.28_5F00_Job_5F00_12Cores.jpg" alt="" width="516" height="224" border="0" /></a></p>
<p style="text-align: center;">Figure 20: HPC heatmap when runs a job with 12 cores</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/0412.27_Job_10Cores.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/0412.27_5F00_Job_5F00_10Cores.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/0412.27_Job_10Cores.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/0412.27_5F00_Job_5F00_10Cores.jpg" alt="" width="535" height="215" border="0" /></a></p>
<p style="text-align: center;">Figure 23: HPC heatmap when runs the job with 10 cores</p>
<p>&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/5344.26_Job_04Cores.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/5344.26_5F00_Job_5F00_04Cores.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/5344.26_Job_04Cores.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/5344.26_5F00_Job_5F00_04Cores.jpg" alt="" width="537" height="188" border="0" /> </a></p>
<p style="text-align: center;">&nbsp;Figure 24: HPC heatmap when runs the job with 4 cores</p>
<p>&nbsp;</p>
<p>Here you have all elements to write your Excel workbook and runs on HPC cluster in Azure IaaS VMs; enjoy it!</p>
<p>&nbsp;</p>
<p><br /> <span style="font-size: large;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/8625.Fresnel.xlsb" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/8625.Fresnel.xlsb"> <img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part4/5658.Excel.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part4/5658.Excel.jpg" alt="" border="0" />Fresnel.xlsb</a> &nbsp;</span><br /><span style="font-size: large;">Fresnel simulation</span></p>
<p>&nbsp;</p>
<h1><span style="font-size: small;"><span style="font-size: large;"><strong><span style="font-size: small;"><span style="font-size: large;"><strong><span style="font-size: small;">click here to <span style="font-size: large;"><strong><a href="http://blogs.msdn.com/b/faber/archive/2013/07/04/running-parallel-excel-on-windows-hpc-2008-r2-hosted-in-windows-azure-iaas-vms-part-3.aspx">Move to&nbsp;previous blog-Part3</a></strong></span></span></strong></span></span></strong></span></span></h1>
<h1>&nbsp;</h1>]]></content:encoded>
    </item>
    <item>
      <title>Running parallel Excel on Windows HPC 2008 R2 hosted in Windows Azure IaaS VMs: Part 3</title>
      <link>https://docs.microsoft.com/archive/blogs/faber/running-parallel-excel-on-windows-hpc-2008-r2-hosted-in-windows-azure-iaas-vms-part-3</link>
      <pubDate>Thu, 04 Jul 2013 02:28:00 GMT</pubDate>
      <dc:creator><![CDATA[faberspot]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/faber/2013/07/04/running-parallel-excel-on-windows-hpc-2008-r2-hosted-in-windows-azure-iaas-vms-part-3/</guid>
      <description><![CDATA[click here to Move to next blog-Part4
click here to Move to&nbsp;previous...]]></description>
      <content:encoded><![CDATA[<h1><span style="font-size: small;"><span style="font-size: large;"><strong><span style="font-size: small;">click here to <span style="font-size: large;"><strong><a href="http://blogs.msdn.com/b/faber/archive/2013/07/11/running-parallel-excel-on-windows-hpc-2008-r2-hosted-in-windows-azure-iaas-vms-part-4.aspx">Move to next blog-Part4</a></strong></span></span></strong></span></span></h1>
<h1><span style="font-size: small;"><span style="font-size: large;"><strong><span style="font-size: small;"><span style="font-size: large;"><strong><span style="font-size: small;">click here to <span style="font-size: large;"><strong><a href="http://blogs.msdn.com/b/faber/archive/2013/06/25/running-parallel-excel-on-windows-hpc-2008-r2-hosted-in-windows-azure-iaas-vms-part-2.aspx">Move to&nbsp;previous blog-Part2</a></strong></span></span></strong></span></span></strong></span></span></h1>
<h1>&nbsp;<span style="color: #000080;">1&nbsp;Introduction</span></h1>
<p style="text-align: justify;"><span style="font-size: small;">In previous part of my blog (Part2), I have presented a basic Excel workbook, running a multiplication table&nbsp;in parallel on HPC cluster. We saw the usage of HPC macros framework (<strong><span style="color: #0000ff;">HPC_GetVersion</span>, <span style="color: #0000ff;">HPC_Initialize</span>, <span style="color: #0000ff;">HPC_Partition</span>, </strong></span><span style="font-size: small;"><strong><span style="color: #0000ff;">HPC_Execute</span>, <span style="color: #0000ff;">HPC_Merge</span>, <span style="color: #0000ff;">HPC_Finalize </span></strong>and <span style="color: #0000ff;"><strong>HPC_ExecutionError</strong></span>) called at specific point by the <em><strong>HPC Services for Excel client library</strong></em> during a HPC cluster calculation.</span></p>
<p style="text-align: justify;"><span style="font-size: small;">In the example examined, the outcome&nbsp;was the execution in parallel of multiplication values in <strong>Egress_Table</strong> cells. Our code strategy to pass data between HPC macros has been the usage of array of Variant with size equal to three, <strong>Dim data(2) As Variant </strong>having following elements:</span></p>
<ul>
<li style="text-align: justify;"><span style="font-size: small;"><span style="color: #ff0000;"><strong>data(0)</strong></span>: contains the row index of the <strong>Egress_Table</strong></span></li>
<li style="text-align: justify;"><span style="font-size: small;"><span style="color: #ff0000;"><strong>data(1)</strong></span>: contains the column index of the <strong>Egress_Table</strong></span></li>
<li style="text-align: justify;"><span style="font-size: small;"><span style="color: #ff0000;"><strong>data(2)</strong></span>: it is the value of the cell (data(0), data(1)) in <strong>Egress_Table&nbsp;</strong>which value&nbsp;is&nbsp;the product&nbsp;equal to "row value"&nbsp;times "column value"&nbsp;times&nbsp;"fix number stored in B1 cell".</span></li>
</ul>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part3/6087.01_Naming.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part3/6087.01_5F00_Naming.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part3/6087.01_Naming.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part3/6087.01_5F00_Naming.jpg" alt="" width="769" height="373" border="0" /> </a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure1: data array to set value in a specific cell of Egress_Table</span></p>
<p style="text-align: justify;">&nbsp;<span style="font-size: small;">We saw as <strong>HPC_Partition</strong> is a VBA macro responsible of split the total computation in individual calculation step; in our previous example we&nbsp;used <strong>HPC_Partition </strong>to segment the total number of cells in <strong>Egress_Table&nbsp; [</strong></span><span style="font-size: small;">26 rows &nbsp;(D2:D27) and 11 columns (E1:O1)] in single cell. Here I want to use different criteria to slit data in <strong>HPC_Partition</strong>, using a block of cells instead a single cell.</span></p>
<p>&nbsp;</p>
<h1><span style="color: #000080;">2&nbsp;&nbsp;How to partition data in blocks</span></h1>
<p style="text-align: justify;"><span style="font-size: small;">In our new Excel workbook the structure of &ldquo;<strong>Sheet1</strong>&rdquo; (cells naming,&nbsp;meaning of cells, buttons, size of table, etc.) is kept unchanged compare with previous example (Part2).&nbsp;</span><span style="font-size: small;">Logic of execution of Excel workbook on the HPC cluster is still executed through two VBA modules:</span></p>
<ul>
<li style="text-align: justify;"><span style="font-size: small;"><strong><span style="font-size: medium;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part3/8132.HPCControlMacros.bas" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part3/8132.HPCControlMacros.bas">HPCControlMacros.bas</a></span>: </strong>a set of VBA macros contains the &ldquo;control&rdquo; functions; this module is unchanged respect to the equivalent module in previous example (<a href="http://blogs.msdn.com/b/faber/archive/2013/06/25/running-parallel-excel-on-windows-hpc-2008-r2-hosted-in-windows-azure-iaas-vms-part-2.aspx">http://blogs.msdn.com/b/faber/archive/2013/06/25/running-parallel-excel-on-windows-hpc-2008-r2-hosted-in-windows-azure-iaas-vms-part-2.aspx</a>)</span></li>
<li style="text-align: justify;"><span style="font-size: small;"><strong><span style="font-size: medium;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part3/4667.HPCExcelMacros.bas" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part3/4667.HPCExcelMacros.bas">HPCExcelMacros.bas</a></span>: </strong>it contains all macro framework functions; compare with the equivalent module in previous example (Part2) we have some changes&nbsp;in algorithms to&nbsp;partition data in blocks.</span></li>
</ul>
<p style="text-align: justify;"><span style="font-size: small;">We proceed&nbsp;on how is implemented the new algorithm in <strong>HPCExcelMacros.bas; </strong>most of&nbsp;changes are done&nbsp;in &nbsp;<strong>HPC_Partition</strong>.</span></p>
<p style="text-align: justify;"><span style="font-size: small;">We use couple of new variables to manage the block of data:</span></p>
<p style="text-align: justify; padding-left: 30px;"><span style="font-family: courier new,courier; font-size: small;"><strong>Public Const SingleBlock As Integer= 3</strong></span></p>
<p style="text-align: justify; padding-left: 30px;"><span style="font-family: courier new,courier; font-size: small;"><strong>Public Const NumBlocks As&nbsp;Integer = 7</strong></span></p>
<p style="text-align: justify; padding-left: 30px;"><span style="font-family: courier new,courier; font-size: small;"><strong>Public Const SizeVector As&nbsp;Integer = NumBlocks * SingleBlock</strong></span></p>
<p style="text-align: justify; padding-left: 30px;"><span style="font-family: courier new,courier; font-size: small;"><strong><span style="font-size: small;"><strong>Dim data(SizeVector) As Variant</strong></span></strong></span></p>
<p><span style="font-size: small;">where:</span></p>
<ul>
<li style="text-align: justify;"><span style="font-size: small;"><strong><span style="font-family: courier new,courier;">Single block</span></strong> is the size of array of a single block</span></li>
<li style="text-align: justify;"><span style="font-size: small;"><span style="font-family: courier new,courier;"><strong>NumBlocks</strong></span> is the number of elements of Egress_Table we want to partition in single turn</span></li>
<li style="text-align: justify;"><span style="font-size: small;"><strong><span style="font-family: courier new,courier;">SizeVector</span></strong> is the size of array <span style="color: #ff0000;"><strong>data()</strong></span></span></li>
</ul>
<p style="text-align: justify;"><span style="font-size: small;">&nbsp;In Figure 2 is shown a case with number of contiguous cells block equal to 3 (<strong><span style="font-family: courier new,courier;">NumBlocks=3</span></strong>)</span></p>
<p>&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part3/7455.02_BlockSize.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part3/7455.02_5F00_BlockSize.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part3/7455.02_BlockSize.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part3/7455.02_5F00_BlockSize.jpg" alt="" width="685" height="329" border="0" /> </a></p>
<p style="text-align: center;"><span style="font-size: small;">&nbsp;Figure 2: flowchart with pseudo-code</span></p>
<p style="text-align: justify;"><span style="font-size: small;">In Figure&nbsp;3 and Figure 4&nbsp;is reported the&nbsp;flowchart with pseudo-code to slit up the <strong>Egress_Table</strong> cells in blocks of cells.</span></p>
<p>&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part3/6740.03_PseudoCode.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part3/6740.03_5F00_PseudoCode.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part3/6740.03_PseudoCode.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part3/6740.03_5F00_PseudoCode.jpg" alt="" width="814" height="512" border="0" /> </a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 3: flowchart with pseudo-code</span></p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part3/6087.04_PseudoCode.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part3/6087.04_5F00_PseudoCode.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part3/6087.04_PseudoCode.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part3/6087.04_5F00_PseudoCode.jpg" alt="" width="629" height="387" border="0" /> </a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 4: flowchart with VB statements</span></p>
<p>&nbsp;</p>
<p><span style="font-size: small;">Short description of variables i<span style="font-size: small;">n Figure 3 and Figure 4&nbsp;flowcharts</span>:</span></p>
<ul>
<li>
<div style="padding-left: 30px;"><span style="font-size: small;"><span style="font-family: courier new,courier;"><strong>IndexBlock</strong></span> is a counter (Integer) that we use to increase number of cell in a single&nbsp;block; this counter is between <span style="font-family: courier new,courier;"><strong>[0,&nbsp;NumBlock-1</strong></span>] for a total number of NumBlock elements.</span></div>
</li>
<li>
<div style="padding-left: 30px;"><span style="font-size: small;"><span style="font-family: courier new,courier;"><strong>IndexRow</strong></span> is&nbsp; counter (Integer) to identify the number of row in the <span style="font-family: courier new,courier;"><strong>Egress_Table</strong></span></span></div>
</li>
<li>
<div style="padding-left: 30px;"><span style="font-size: small;"><span style="font-family: courier new,courier;"><strong>indexCol</strong></span> is a counter (Integer) to identify the number of column in the <span style="font-family: courier new,courier;"><strong>Egress_Table</strong></span></span></div>
</li>
<li>
<div style="padding-left: 30px;"><span style="font-size: small;"><span style="font-family: courier new,courier;"><strong>NumRows </strong></span>is&nbsp; the total number of rows in the <span style="font-family: courier new,courier;"><strong><span style="font-family: courier new,courier;"><strong>Egress_Table</strong></span></strong></span></span></div>
</li>
<li>
<div style="padding-left: 30px;"><span style="font-size: small;"><span style="font-family: courier new,courier;"><strong>NumCols </strong></span>is&nbsp; the total number of columns in the <span style="font-family: courier new,courier;"><strong><span style="font-family: courier new,courier;"><strong><span style="font-family: courier new,courier;"><strong>Egress_Table</strong></span></strong></span></strong></span></span></div>
</li>
</ul>
<p><span style="font-size: small;">&nbsp;</span><span style="font-size: small;"><span style="font-size: small;">Now we can draw a more detailed&nbsp;view with VBA statements </span>(Figure 5-Figure 6)</span>&nbsp;&nbsp;</p>
<p>&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part3/2843.05_Code.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part3/2843.05_5F00_Code.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part3/2843.05_Code.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part3/2843.05_5F00_Code.jpg" alt="" width="763" height="542" border="0" /> </a></p>
<p>&nbsp;</p>
<p style="text-align: center;"><span style="font-size: small;">Figure 5: flowchart with VB statements</span></p>
<p style="text-align: justify;">&nbsp;<span style="font-size: small;">In <span style="color: #000080;"><strong>HPC_INIT</strong></span> the content of <span style="font-family: courier new,courier;"><strong>Egress_table</strong></span> is deleted through the statement: <span style="font-family: courier new,courier;"><strong>Range("Egress_Table".ClearContents</strong></span></span></p>
<p>&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part3/7411.06_Code.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part3/7411.06_5F00_Code.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part3/7411.06_Code.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part3/7411.06_5F00_Code.jpg" alt="" width="684" height="461" border="0" /> </a></p>
<p style="text-align: center;">&nbsp;<span style="font-size: small;">Figure 6: flowchart for <strong>HPC_EXECUTION</strong> and <strong>HPC_MERGE</strong></span></p>
<p style="text-align: justify;"><span style="font-size: small;">The calculation will be completed when we&rsquo;ve reached the end of the table.&nbsp; We can do that by incrementing the row and column numbers as we move through the table.&nbsp; Whenever we reach the end of a column, we move to the next column.&nbsp; When we&rsquo;ve </span><span style="font-size: small;">passed the last column, the table (Egress_Table)&nbsp; is finished and we want the function to return Null.</span></p>
<p style="text-align: justify;"><span style="font-size: small;">Respect to algorithm of multiplication table described in Part2, processing of Egress_Table values is here execute by column.</span></p>
<p>&nbsp;</p>
<h1>&nbsp;<span style="color: #000080;">4&nbsp;HPCExcelMacros.bas</span></h1>
<pre class="scroll"><code class="cplusplus"><strong><span style="font-size: x-small;">Attribute VB_Name = "HPCExcelMacros" </span></strong><br /> <br /><strong><span style="font-size: x-small;"> '========================================================== </span></strong><br /><strong><span style="font-size: x-small;"> ' This is a skeleton macro file for using the HPC/Excel </span></strong><br /><strong><span style="font-size: x-small;"> ' VBA macros with an HPC cluster. </span></strong><br /><strong><span style="font-size: x-small;"> ' </span></strong><br /><strong><span style="font-size: x-small;"> ' Be sure to add references to the required component: </span></strong><br /><strong><span style="font-size: x-small;"> ' Microsoft_Hpc_Excel </span></strong><br /><strong><span style="font-size: x-small;"> ' using the VBA editor menu Tools -&gt; References. </span></strong><br /><strong><span style="font-size: x-small;"> '========================================================== </span></strong><br /> <br /><strong><span style="font-size: x-small;"> Option Explicit </span></strong><br /> <br /><strong><span style="font-size: x-small;"> '========================================================== </span></strong><br /><strong><span style="font-size: x-small;"> ' Section 1: Variables and constants </span></strong><br /><strong><span style="font-size: x-small;"> '========================================================== </span></strong><br /><strong><span style="font-size: x-small;"> Dim indexRow As Integer </span></strong><br /><strong><span style="font-size: x-small;"> Dim indexCol As Integer </span></strong><br /> <br /><strong><span style="font-size: x-small;"> Dim CalculationComplete As Boolean </span></strong><br /><strong><span style="font-size: x-small;"> Dim StartTime As Double </span></strong><br /><strong><span style="font-size: x-small;"> Dim FinishTime As Double </span></strong><br /> <br /><strong><span style="font-size: x-small;"> Public NumRows As Integer </span></strong><br /><strong><span style="font-size: x-small;"> Public NumCols As Integer </span></strong><br /><strong><span style="font-size: x-small;"> Public CounterStatus As Integer </span></strong><br /> <br /> <br /><strong><span style="font-size: x-small;"> Public Const SingleBlock As Integer = 3 </span></strong><br /><strong><span style="font-size: x-small;"> Public Const NumBlocks As Integer = 3 </span></strong><br /><strong><span style="font-size: x-small;"> Public Const SizeVector As Integer = NumBlocks * SingleBlock </span></strong><br /> <br /><strong><span style="font-size: x-small;"> '========================================================== </span></strong><br /><strong><span style="font-size: x-small;"> ' Section 2: HPC Calculation Macros </span></strong><br /><strong><span style="font-size: x-small;"> '========================================================== </span></strong><br /> <br /><strong><span style="font-size: x-small;"> '---------------------------------------------------------- </span></strong><br /><strong><span style="font-size: x-small;"> ' HPC_GetVersion returns the version of the macro framework </span></strong><br /><strong><span style="font-size: x-small;"> ' implemented in the workbook. That ensures that future </span></strong><br /><strong><span style="font-size: x-small;"> ' versions of the HPC Excel components will always be able </span></strong><br /><strong><span style="font-size: x-small;"> ' to run this workbook. </span></strong><br /><strong><span style="font-size: x-small;"> ' </span></strong><br /><strong><span style="font-size: x-small;"> ' We've implemented version 1.0 of the macro framework, </span></strong><br /><strong><span style="font-size: x-small;"> ' so we return the string "1.0". </span></strong><br /><strong><span style="font-size: x-small;"> '---------------------------------------------------------- </span></strong><br /><strong><span style="font-size: x-small;"> Public Function HPC_GetVersion() </span></strong><br /> <br /><strong><span style="font-size: x-small;"> HPC_GetVersion = "1.0" </span></strong><br /> <br /><strong><span style="font-size: x-small;"> End Function </span></strong><br /> <br /><strong><span style="font-size: x-small;"> '---------------------------------------------------------- </span></strong><br /><strong><span style="font-size: x-small;"> ' HPC_Initialize will be called when the client starts </span></strong><br /><strong><span style="font-size: x-small;"> ' a calculation. Put any pre-calculation steps in this </span></strong><br /><strong><span style="font-size: x-small;"> ' function. </span></strong><br /><strong><span style="font-size: x-small;"> '---------------------------------------------------------- </span></strong><br /><strong><span style="font-size: x-small;"> Public Function HPC_Initialize() </span></strong><br /><strong><span style="font-size: x-small;"> NumCols = 1 </span></strong><br /><strong><span style="font-size: x-small;"> indexRow = 1 </span></strong><br /><strong><span style="font-size: x-small;"> indexCol = 1 </span></strong><br /> <br /><strong><span style="font-size: x-small;"> CounterStatus = 0 </span></strong><br /><strong><span style="font-size: x-small;"> CalculationComplete = False </span></strong><br /> <br /><strong><span style="font-size: x-small;"> Range("Egress_Table").ClearContents </span></strong><br /> <br /><strong><span style="font-size: x-small;"> NumRows = Range("MyRows").Count </span></strong><br /><strong><span style="font-size: x-small;"> NumCols = Range("MyCols").Count </span></strong><br /><strong><span style="font-size: x-small;"> StartTime = Timer </span></strong><br /> <br /><strong><span style="font-size: x-small;"> End Function </span></strong><br /> <br /><strong><span style="font-size: x-small;"> '---------------------------------------------------------- </span></strong><br /><strong><span style="font-size: x-small;"> ' HPC_Partition is used to collect required data for a </span></strong><br /><strong><span style="font-size: x-small;"> ' single calculation step (or iteration). Whatever data </span></strong><br /><strong><span style="font-size: x-small;"> ' is returned from this function will be passed to the </span></strong><br /><strong><span style="font-size: x-small;"> ' HPC_Execute macro, running on the HPC compute nodes. </span></strong><br /><strong><span style="font-size: x-small;"> ' </span></strong><br /><strong><span style="font-size: x-small;"> ' When all calculation steps have been completed, return </span></strong><br /><strong><span style="font-size: x-small;"> ' "Null" from this function to end the calculation. </span></strong><br /><strong><span style="font-size: x-small;"> '---------------------------------------------------------- </span></strong><br /><strong><span style="font-size: x-small;"> Public Function HPC_Partition() As Variant </span></strong><br /><strong><span style="font-size: x-small;"> Dim data(SizeVector) As Variant </span></strong><br /><strong><span style="font-size: x-small;"> Dim indexBlock As Integer </span></strong><br /> <br /><strong><span style="font-size: x-small;"> For indexBlock = 0 To (NumBlocks - 1) </span></strong><br /><strong><span style="font-size: x-small;"> If indexCol &gt; NumCols Then </span></strong><br /><strong><span style="font-size: x-small;"> indexCol = 1 </span></strong><br /><strong><span style="font-size: x-small;"> indexRow = indexRow + 1 </span></strong><br /><strong><span style="font-size: x-small;"> End If </span></strong><br /> <br /><strong><span style="font-size: x-small;"> If indexRow &gt; NumRows Then </span></strong><br /><strong><span style="font-size: x-small;"> ' return null to indicate the end of the calculation </span></strong><br /><strong><span style="font-size: x-small;"> HPC_Partition = Null </span></strong><br /><strong><span style="font-size: x-small;"> ' and exit the function now, we can skip the rest </span></strong><br /><strong><span style="font-size: x-small;"> Exit Function </span></strong><br /><strong><span style="font-size: x-small;"> End If </span></strong><br /> <br /><strong><span style="font-size: x-small;"> data(0 + indexBlock * SingleBlock) = indexRow </span></strong><br /><strong><span style="font-size: x-small;"> data(1 + indexBlock * SingleBlock) = indexCol </span></strong><br /> <br /><strong><span style="font-size: x-small;"> If ((indexRow = NumRows) And (indexCol = NumCols)) Then </span></strong><br /><strong><span style="font-size: x-small;"> indexCol = indexCol + 1 </span></strong><br /><strong><span style="font-size: x-small;"> Exit For </span></strong><br /><strong><span style="font-size: x-small;"> End If </span></strong><br /> <br /><strong><span style="font-size: x-small;"> ' move to the next column </span></strong><br /><strong><span style="font-size: x-small;"> indexCol = indexCol + 1 </span></strong><br /><strong><span style="font-size: x-small;"> Next </span></strong><br /><strong><span style="font-size: x-small;"> HPC_Partition = data </span></strong><br /><strong><span style="font-size: x-small;"> End Function </span></strong><br /> <br /><strong><span style="font-size: x-small;"> '---------------------------------------------------------- </span></strong><br /><strong><span style="font-size: x-small;"> ' HPC_Execute performs a single calculation step (or iteration). </span></strong><br /><strong><span style="font-size: x-small;"> ' The input data will match whatever was returned from the HPC_Partition function, above. </span></strong><br /><strong><span style="font-size: x-small;"> ' </span></strong><br /><strong><span style="font-size: x-small;"> ' The return value from this function should be the results of the calculation; those results will be </span></strong><br /><strong><span style="font-size: x-small;"> ' passed to the HPC_Merge macro, running on the desktop. </span></strong><br /><strong><span style="font-size: x-small;"> '---------------------------------------------------------- </span></strong><br /><strong><span style="font-size: x-small;"> Public Function HPC_Execute(data As Variant) As Variant </span></strong><br /><strong><span style="font-size: x-small;"> Dim rws As Integer </span></strong><br /><strong><span style="font-size: x-small;"> Dim cols As Integer </span></strong><br /><strong><span style="font-size: x-small;"> Dim multiplyFactor As Integer </span></strong><br /><strong><span style="font-size: x-small;"> Dim rngCols As Range </span></strong><br /><strong><span style="font-size: x-small;"> Dim rngRows As Range </span></strong><br /><strong><span style="font-size: x-small;"> Dim indexBlock As Integer </span></strong><br /> <br /><strong><span style="font-size: x-small;"> multiplyFactor = ActiveSheet.Range("Factor").Value </span></strong><br /> <br /><strong><span style="font-size: x-small;"> Set rngCols = ActiveSheet.Range("MyCols") </span></strong><br /><strong><span style="font-size: x-small;"> Set rngRows = ActiveSheet.Range("MyRows") </span></strong><br /> <br /><strong><span style="font-size: x-small;"> For indexBlock = 0 To (((UBound(data)) / SingleBlock) - 1) </span></strong><br /><strong><span style="font-size: x-small;"> ' (rws, cols): number of row and column of the specific cell in Egress Table range </span></strong><br /><strong><span style="font-size: x-small;"> rws = data(0 + indexBlock * SingleBlock) </span></strong><br /><strong><span style="font-size: x-small;"> cols = data(1 + indexBlock * SingleBlock) </span></strong><br /><strong><span style="font-size: x-small;"> data(2 + indexBlock * SingleBlock) = rngRows(rws, 1).Value * rngCols(1, cols).Value * multiplyFactor </span></strong><br /><strong><span style="font-size: x-small;"> Next </span></strong><br /> <br /><strong><span style="font-size: x-small;"> HPC_Execute = data ' return value from the function </span></strong><br /><strong><span style="font-size: x-small;"> End Function </span></strong><br /> <br /><strong><span style="font-size: x-small;"> '---------------------------------------------------------- </span></strong><br /><strong><span style="font-size: x-small;"> ' HPC_Merge is called after a single calculation step (or iteration) is complete; </span></strong><br /><strong><span style="font-size: x-small;"> ' the input data will match whatever was returned from the HPC_Execute function, above. </span></strong><br /><strong><span style="font-size: x-small;"> ' </span></strong><br /><strong><span style="font-size: x-small;"> ' Use this function to store results: insert results into </span></strong><br /><strong><span style="font-size: x-small;"> ' the spreadsheet, write to a database, write a text file, or anything else. </span></strong><br /><strong><span style="font-size: x-small;"> '---------------------------------------------------------- </span></strong><br /><strong><span style="font-size: x-small;"> Public Function HPC_Merge(data As Variant) </span></strong><br /><strong><span style="font-size: x-small;"> Dim indexBlock As Integer </span></strong><br /><strong><span style="font-size: x-small;"> Dim i As Integer </span></strong><br /><strong><span style="font-size: x-small;"> Dim j As Integer </span></strong><br /> <br /><strong><span style="font-size: x-small;"> ' MsgBox "data size: " &amp; UBound(data) </span></strong><br /> <br /><strong><span style="font-size: x-small;"> Application.ScreenUpdating = False </span></strong><br /><strong><span style="font-size: x-small;"> For indexBlock = 0 To (((UBound(data)) / SingleBlock) - 1) </span></strong><br /> <br /><strong><span style="font-size: x-small;"> Range("Egress_Table").Cells(data(0 + indexBlock * SingleBlock), data(1 + indexBlock * SingleBlock)).Value = data(2 + indexBlock * SingleBlock) </span></strong><br /><strong><span style="font-size: x-small;"> i = CInt(data(0 + indexBlock * SingleBlock)) </span></strong><br /><strong><span style="font-size: x-small;"> j = CInt(data(1 + indexBlock * SingleBlock)) </span></strong><br /><strong><span style="font-size: x-small;"> If (i = NumRows) And (j = NumCols) Then </span></strong><br /><strong><span style="font-size: x-small;"> Call UpdateStatus </span></strong><br /><strong><span style="font-size: x-small;"> Application.ScreenUpdating = True </span></strong><br /> <br /><strong><span style="font-size: x-small;"> Exit For </span></strong><br /><strong><span style="font-size: x-small;"> End If </span></strong><br /><strong><span style="font-size: x-small;"> Call UpdateStatus </span></strong><br /><strong><span style="font-size: x-small;"> Next </span></strong><br /> <br /><strong><span style="font-size: x-small;"> Application.ScreenUpdating = True </span></strong><br /> <br /><strong><span style="font-size: x-small;"> End Function </span></strong><br /> <br /><strong><span style="font-size: x-small;"> '---------------------------------------------------------- </span></strong><br /><strong><span style="font-size: x-small;"> ' HPC_Finalize is called after the last calculation step </span></strong><br /><strong><span style="font-size: x-small;"> ' (or iteration) is complete. </span></strong><br /><strong><span style="font-size: x-small;"> ' Use this funtion for any post-processing steps you want to run after the calculation. </span></strong><br /><strong><span style="font-size: x-small;"> ' </span></strong><br /><strong><span style="font-size: x-small;"> ' The function here cleans up the HPC client object, to close the session and end the calculation. </span></strong><br /><strong><span style="font-size: x-small;"> '---------------------------------------------------------- </span></strong><br /><strong><span style="font-size: x-small;"> Public Function HPC_Finalize() </span></strong><br /> <br /><strong><span style="font-size: x-small;"> FinishTime = Timer </span></strong><br /><strong><span style="font-size: x-small;"> CalculationComplete = True </span></strong><br /><strong><span style="font-size: x-small;"> Application.ScreenUpdating = True </span></strong><br /> <br /><strong><span style="font-size: x-small;"> Call UpdateStatus </span></strong><br /> <br /><strong><span style="font-size: x-small;"> ' Clean up the calculation. It's a good idea to </span></strong><br /><strong><span style="font-size: x-small;"> ' leave this here, even if you make changes to this function. </span></strong><br /><strong><span style="font-size: x-small;"> ' The function we call here is in the "HPCControlMacros" module. </span></strong><br /> <br /><strong><span style="font-size: x-small;"> CleanUpClusterCalculation </span></strong><br /> <br /><strong><span style="font-size: x-small;"> End Function </span></strong><br /> <br /><strong><span style="font-size: x-small;"> '---------------------------------------------------------- </span></strong><br /><strong><span style="font-size: x-small;"> ' HPC_ExecutionError is called when there is any error in </span></strong><br /><strong><span style="font-size: x-small;"> ' the calculation. </span></strong><br /><strong><span style="font-size: x-small;"> ' </span></strong><br /><strong><span style="font-size: x-small;"> ' The function here shows a pop-up error message. You </span></strong><br /><strong><span style="font-size: x-small;"> ' can modify this to display the error in a different </span></strong><br /><strong><span style="font-size: x-small;"> ' way (for example, in the Excel status bar). </span></strong><br /><strong><span style="font-size: x-small;"> '---------------------------------------------------------- </span></strong><br /><strong><span style="font-size: x-small;"> Public Function HPC_ExecutionError(errorMessage As String, errorContents As String) </span></strong><br /> <br /><strong><span style="font-size: x-small;"> MsgBox errorMessage &amp; vbCrLf &amp; vbCrLf &amp; errorContents </span></strong><br /> <br /><strong><span style="font-size: x-small;"> End Function </span></strong><br /> <br /><strong><span style="font-size: x-small;"> Sub UpdateStatus() </span></strong><br /> <br /><strong><span style="font-size: x-small;"> Dim statusMessage As String </span></strong><br /><strong><span style="font-size: x-small;"> If Not CalculationComplete Then </span></strong><br /><strong><span style="font-size: x-small;"> CounterStatus = CounterStatus + 1 </span></strong><br /><strong><span style="font-size: x-small;"> statusMessage = "Calculated " &amp; CounterStatus &amp; "/" &amp; (NumRows * NumCols) </span></strong><br /><strong><span style="font-size: x-small;"> Else </span></strong><br /><strong><span style="font-size: x-small;"> statusMessage = "Calculated " &amp; CounterStatus &amp; "/" &amp; (NumRows * NumCols) </span></strong><br /><strong><span style="font-size: x-small;"> statusMessage = statusMessage &amp; "; completed in " &amp; FormatNumber(FinishTime - StartTime) &amp; "s" </span></strong><br /><strong><span style="font-size: x-small;"> End If </span></strong><br /><strong><span style="font-size: x-small;"> Application.StatusBar = statusMessage </span></strong><br /><strong><span style="font-size: x-small;"> ActiveSheet.Range("percentageCompletion").Value = CounterStatus / (NumRows * NumCols) </span></strong><br /><strong><span style="font-size: x-small;"> End Sub</span></strong> <br /> <br /> </code></pre>
<p><code class="cplusplus"><br /> </code><code class="cplusplus">&nbsp;</code></p>
<h1><span style="color: #000080;">&nbsp;5</span><span style="color: #000080;">&nbsp;HPCControlMacros.bas</span></h1>
<p>&nbsp;</p>
<pre class="scroll"><code class="cplusplus"><strong><span style="font-size: x-small;">Attribute VB_Name = "HPCControlMacros" </span></strong><br /> <br /><strong><span style="font-size: x-small;"> '========================================================== </span></strong><br /><strong><span style="font-size: x-small;"> ' This is a skeleton macro file for using the HPC/Excel </span></strong><br /><strong><span style="font-size: x-small;"> ' VBA macros with an HPC cluster. </span></strong><br /><strong><span style="font-size: x-small;"> ' </span></strong><br /><strong><span style="font-size: x-small;"> ' Be sure to add references to the required component: </span></strong><br /><strong><span style="font-size: x-small;"> ' </span></strong><br /><strong><span style="font-size: x-small;"> ' Microsoft_Hpc_Excel </span></strong><br /><strong><span style="font-size: x-small;"> ' </span></strong><br /><strong><span style="font-size: x-small;"> ' using the VBA editor menu Tools -&gt; References. </span></strong><br /><strong><span style="font-size: x-small;"> '========================================================== </span></strong><br /> <br /><strong><span style="font-size: x-small;"> Option Explicit </span></strong><br /> <br /><strong><span style="font-size: x-small;"> '========================================================== </span></strong><br /><strong><span style="font-size: x-small;"> ' Section 1: Variables and constants </span></strong><br /><strong><span style="font-size: x-small;"> '========================================================== </span></strong><br /> <br /><strong><span style="font-size: x-small;"> '---------------------------------------------------------- </span></strong><br /><strong><span style="font-size: x-small;"> ' This is the cluster scheduler, or head node. Fill in </span></strong><br /><strong><span style="font-size: x-small;"> ' the hostname of your cluster scheduler. </span></strong><br /><strong><span style="font-size: x-small;"> '---------------------------------------------------------- </span></strong><br /><strong><span style="font-size: x-small;"> Private Const HPC_ClusterScheduler = "exhn001" </span></strong><br /> <br /><strong><span style="font-size: x-small;"> '---------------------------------------------------------- </span></strong><br /><strong><span style="font-size: x-small;"> ' This is a network share used to store a temporary copy </span></strong><br /><strong><span style="font-size: x-small;"> ' of the workbook. Make sure that the directory exists, </span></strong><br /><strong><span style="font-size: x-small;"> ' that you have write access to the directory, and that </span></strong><br /><strong><span style="font-size: x-small;"> ' the compute nodes in the cluster have read access. </span></strong><br /><strong><span style="font-size: x-small;"> '---------------------------------------------------------- </span></strong><br /><strong><span style="font-size: x-small;"> Private Const HPC_NetworkShare = "\\exhn001\share" </span></strong><br /> <br /><strong><span style="font-size: x-small;"> '---------------------------------------------------------- </span></strong><br /><strong><span style="font-size: x-small;"> ' Optionally, use a job template on the cluster. See the </span></strong><br /><strong><span style="font-size: x-small;"> ' HPC Server documentation for more about job templates. </span></strong><br /><strong><span style="font-size: x-small;"> ' Fill in the name of the template you want to use, or </span></strong><br /><strong><span style="font-size: x-small;"> ' leave this empty ("") to use the default job template. </span></strong><br /><strong><span style="font-size: x-small;"> '---------------------------------------------------------- </span></strong><br /><strong><span style="font-size: x-small;"> Private Const HPC_JobTemplate = "" </span></strong><br /> <br /><strong><span style="font-size: x-small;"> '---------------------------------------------------------- </span></strong><br /><strong><span style="font-size: x-small;"> ' This object is our client for connecting to the HPC </span></strong><br /><strong><span style="font-size: x-small;"> ' cluster and running calculations. </span></strong><br /><strong><span style="font-size: x-small;"> '---------------------------------------------------------- </span></strong><br /><strong><span style="font-size: x-small;"> Private HPCExcelClient As IExcelClient </span></strong><br /> <br /> <br /><strong><span style="font-size: x-small;"> '========================================================== </span></strong><br /><strong><span style="font-size: x-small;"> ' Section 2: Control Functions </span></strong><br /><strong><span style="font-size: x-small;"> '========================================================== </span></strong><br /> <br /><strong><span style="font-size: x-small;"> '---------------------------------------------------------- </span></strong><br /><strong><span style="font-size: x-small;"> ' This is the main calculation function, which connects </span></strong><br /><strong><span style="font-size: x-small;"> ' to the client object and runs a calculation. The method </span></strong><br /><strong><span style="font-size: x-small;"> ' can run both desktop and cluster calculations, controlled </span></strong><br /><strong><span style="font-size: x-small;"> ' by the function parameter "CalculateOnDesktop". </span></strong><br /><strong><span style="font-size: x-small;"> ' </span></strong><br /><strong><span style="font-size: x-small;"> ' You'll see below two functions that run calculations </span></strong><br /><strong><span style="font-size: x-small;"> ' by calling this method, with the parameter set for either </span></strong><br /><strong><span style="font-size: x-small;"> ' cluster or desktop calculation. </span></strong><br /><strong><span style="font-size: x-small;"> '---------------------------------------------------------- </span></strong><br /><strong><span style="font-size: x-small;"> Private Sub CalculateWorkbook(CalculateOnDesktop As Boolean) </span></strong><br /> <br /><strong><span style="font-size: x-small;"> Dim HPCWorkbookPath As String </span></strong><br /> <br /><strong><span style="font-size: x-small;"> On Error GoTo ErrorHandler </span></strong><br /> <br /><strong><span style="font-size: x-small;"> ' Create a new excelCient instance per session </span></strong><br /><strong><span style="font-size: x-small;"> Set HPCExcelClient = New ExcelClient </span></strong><br /> <br /><strong><span style="font-size: x-small;"> ' Initialize the excel client object with the current workbook </span></strong><br /><strong><span style="font-size: x-small;"> HPCExcelClient.Initialize ActiveWorkbook </span></strong><br /> <br /><strong><span style="font-size: x-small;"> If CalculateOnDesktop = False Then </span></strong><br /> <br /><strong><span style="font-size: x-small;"> ' We need a copy of the file on the network, so it's accessible </span></strong><br /><strong><span style="font-size: x-small;"> ' by the cluster compute nodes. Save a temporary copy to the </span></strong><br /><strong><span style="font-size: x-small;"> ' share directory. </span></strong><br /> <br /><strong><span style="font-size: x-small;"> HPCWorkbookPath = HPC_NetworkShare &amp; Application.PathSeparator &amp; ActiveWorkbook.name </span></strong><br /> <br /><strong><span style="font-size: x-small;"> ActiveWorkbook.SaveCopyAs HPCWorkbookPath </span></strong><br /> <br /><strong><span style="font-size: x-small;"> ' Create a cluster session with the desired options. Here, we're </span></strong><br /><strong><span style="font-size: x-small;"> ' just using the scheduler name and (optionally) a job template. </span></strong><br /> <br /><strong><span style="font-size: x-small;"> If HPC_JobTemplate &lt;&gt; "" Then </span></strong><br /><strong><span style="font-size: x-small;"> HPCExcelClient.OpenSession headNode:=HPC_ClusterScheduler, remoteWorkbookPath:=HPCWorkbookPath, jobTemplate:=HPC_JobTemplate </span></strong><br /><strong><span style="font-size: x-small;"> Else </span></strong><br /><strong><span style="font-size: x-small;"> HPCExcelClient.OpenSession headNode:=HPC_ClusterScheduler, remoteWorkbookPath:=HPCWorkbookPath </span></strong><br /><strong><span style="font-size: x-small;"> End If </span></strong><br /> <br /><strong><span style="font-size: x-small;"> End If </span></strong><br /> <br /><strong><span style="font-size: x-small;"> ' Run on local machine or cluster as chosen in workbook </span></strong><br /><strong><span style="font-size: x-small;"> HPCExcelClient.Run CalculateOnDesktop </span></strong><br /><strong><span style="font-size: x-small;"> Exit Sub </span></strong><br /> <br /><strong><span style="font-size: x-small;"> ErrorHandler: </span></strong><br /><strong><span style="font-size: x-small;"> ' Notify user of error and clean up any allocated resources </span></strong><br /><strong><span style="font-size: x-small;"> MsgBox Prompt:=Err.Description, Title:="HPC Calculation Error" </span></strong><br /><strong><span style="font-size: x-small;"> If Not HPCExcelClient Is Nothing Then </span></strong><br /><strong><span style="font-size: x-small;"> HPCExcelClient.Dispose </span></strong><br /><strong><span style="font-size: x-small;"> End If </span></strong><br /><strong><span style="font-size: x-small;"> End Sub </span></strong><br /> <br /><strong><span style="font-size: x-small;"> '---------------------------------------------------------- </span></strong><br /><strong><span style="font-size: x-small;"> ' This is a public method for running a calculation on the </span></strong><br /><strong><span style="font-size: x-small;"> ' desktop. It uses the "CalculateWorkbook" function, above, </span></strong><br /><strong><span style="font-size: x-small;"> ' and sets the "Desktop" parameter to True. </span></strong><br /><strong><span style="font-size: x-small;"> '---------------------------------------------------------- </span></strong><br /><strong><span style="font-size: x-small;"> Public Sub CalculateWorkbookOnDesktop() </span></strong><br /><strong><span style="font-size: x-small;"> CalculateWorkbook (True) </span></strong><br /><strong><span style="font-size: x-small;"> End Sub </span></strong><br /> <br /><strong><span style="font-size: x-small;"> '---------------------------------------------------------- </span></strong><br /><strong><span style="font-size: x-small;"> ' This is a public method for running a calculation on the </span></strong><br /><strong><span style="font-size: x-small;"> ' cluster. It uses the "CalculateWorkbook" function, above, </span></strong><br /><strong><span style="font-size: x-small;"> ' and sets the "Desktop" parameter to False. </span></strong><br /><strong><span style="font-size: x-small;"> '---------------------------------------------------------- </span></strong><br /><strong><span style="font-size: x-small;"> Public Sub CalculateWorkbookOnCluster() </span></strong><br /><strong><span style="font-size: x-small;"> CalculateWorkbook (False) </span></strong><br /><strong><span style="font-size: x-small;"> End Sub </span></strong><br /> <br /><strong><span style="font-size: x-small;"> '---------------------------------------------------------- </span></strong><br /><strong><span style="font-size: x-small;"> ' This method is used to clean up a calculation after it's </span></strong><br /><strong><span style="font-size: x-small;"> ' finished; here, we're closing the cluster session so we </span></strong><br /><strong><span style="font-size: x-small;"> ' don't waste resources. </span></strong><br /><strong><span style="font-size: x-small;"> '---------------------------------------------------------- </span></strong><br /><strong><span style="font-size: x-small;"> Public Sub CleanUpClusterCalculation() </span></strong><br /> <br /><strong><span style="font-size: x-small;"> On Error Resume Next </span></strong><br /><strong><span style="font-size: x-small;"> HPCExcelClient.CloseSession </span></strong><br /><strong><span style="font-size: x-small;"> HPCExcelClient.Dispose </span></strong><br /><strong><span style="font-size: x-small;"> On Error GoTo 0 </span></strong><br /> <br /><strong><span style="font-size: x-small;"> End Sub</span></strong> <br /> <br /> </code></pre>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><br />&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part3/6864.MultiplicationTable_byGroupColumns.xlsb" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part3/6864.MultiplicationTable_5F00_byGroupColumns.xlsb"> <img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part3/0383.Excel.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part3/0383.Excel.jpg" alt="" border="0" /> <strong><span style="font-size: medium;">MultiplicationTable_byGroupColumns.xlsb</span></strong></a>&nbsp;<br /><em><span style="font-size: medium;"> <strong><span style="font-size: small;">Excel workbook enabled to run on Windows HPC</span></strong></span></em></p>
<p>&nbsp;</p>
<h1><span style="font-size: small;"><span style="font-size: large;"><strong><span style="font-size: small;">click here to <span style="font-size: large;"><strong><a href="http://blogs.msdn.com/b/faber/archive/2013/07/11/running-parallel-excel-on-windows-hpc-2008-r2-hosted-in-windows-azure-iaas-vms-part-4.aspx">Move to next blog-Part4</a></strong></span></span></strong></span></span></h1>
<h1><span style="font-size: small;"><span style="font-size: large;"><strong><span style="font-size: small;"><span style="font-size: large;"><strong><span style="font-size: small;">click here to <span style="font-size: large;"><strong><a href="http://blogs.msdn.com/b/faber/archive/2013/06/25/running-parallel-excel-on-windows-hpc-2008-r2-hosted-in-windows-azure-iaas-vms-part-2.aspx">Move to&nbsp;previous blog-Part2</a></strong></span></span></strong></span></span></strong></span></span></h1>
<h1>&nbsp;</h1>]]></content:encoded>
    </item>
    <item>
      <title>Running parallel Excel on Windows HPC 2008 R2 hosted in Windows Azure IaaS VMs: Part 2</title>
      <link>https://docs.microsoft.com/archive/blogs/faber/running-parallel-excel-on-windows-hpc-2008-r2-hosted-in-windows-azure-iaas-vms-part-2</link>
      <pubDate>Tue, 25 Jun 2013 10:20:00 GMT</pubDate>
      <dc:creator><![CDATA[faberspot]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/faber/2013/06/25/running-parallel-excel-on-windows-hpc-2008-r2-hosted-in-windows-azure-iaas-vms-part-2/</guid>
      <description><![CDATA[click here to Move to next blog-Part3
click here to Move to&nbsp;previous...]]></description>
      <content:encoded><![CDATA[<h1 style="text-align: justify;"><span style="font-size: small;"><span style="font-size: large;"><strong><span style="font-size: small;">click here to <span style="font-size: large;"><strong><a href="http://blogs.msdn.com/b/faber/archive/2013/07/04/running-parallel-excel-on-windows-hpc-2008-r2-hosted-in-windows-azure-iaas-vms-part-3.aspx">Move to next blog-Part3</a></strong></span></span></strong></span></span></h1>
<h1><span style="font-size: small;"><span style="font-size: large;"><strong><span style="font-size: small;"><span style="font-size: large;"><strong><span style="font-size: small;">click here to <span style="font-size: large;"><strong><a href="http://blogs.msdn.com/b/faber/archive/2013/06/14/running-parallel-excel-on-windows-hpc-2008-r2-hosted-in-windows-azure-iaas-vms.aspx">Move to&nbsp;previous blog-Part1</a></strong></span></span></strong></span></span></strong></span></span></h1>
<h1 style="text-align: justify;">&nbsp;</h1>
<h1 style="text-align: justify;"><span style="color: #000080;">1&nbsp;Introduction</span></h1>
<p style="text-align: justify;"><span style="font-size: small;">In first part of my blog <span style="font-size: medium;"><strong><a href="http://blogs.msdn.com/b/faber/archive/2013/06/14/running-parallel-excel-on-windows-hpc-2008-r2-hosted-in-windows-azure-iaas-vms.aspx">blog Part1</a></strong></span> I have discussed the step-by-step procedure to create a Windows HPC cluster in Azure IaaS VMs; here I assume that you already have an HPC cluster up and running in Azure it </span><span style="font-size: small;">can be used &nbsp;to run a basic Excel workbook on multiple cluster nodes. Execution of Excel on Windows HPC is based on HPC Services for Excel which</span><span style="font-size: small;">&nbsp;uses a Service-Oriented Architecture (SOA) infrastructure to run Excel jobs on a cluster (For more information, see the documentation &ldquo;<strong>How HPC Services for Excel Work&rdquo;</strong>: &nbsp;<a href="http://technet.microsoft.com/en-us/library/ff877825%28v=ws.10%29.aspx">http://technet.microsoft.com/en-us/library/ff877825%28v=ws.10%29.aspx</a> ). </span><span style="font-size: small;">HPC Services for Excel includes &ldquo;ready-made&rdquo; SOA clients and SOA services that enable developers </span><span style="font-size: small;">to quickly modify workbooks to run on a cluster. </span><span style="font-size: small;">HPC Services for Excel includes a client/service framework specifically designed to be used from Excel on the desktop.&nbsp; There are two important parts (see Figure 1) to this framework:</span></p>
<ul>
<li><span style="font-size: small;"><strong>a client library</strong>, which is installed on the user&rsquo;s desktop;</span></li>
<li><span style="font-size: small;"><strong>a service library</strong>, which is installed on the cluster compute nodes.&nbsp;</span></li>
</ul>
<p>&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/7002.01_HPCServices_for_Excel.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/7002.01_5F00_HPCServices_5F00_for_5F00_Excel.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/7002.01_HPCServices_for_Excel.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/7002.01_5F00_HPCServices_5F00_for_5F00_Excel.jpg" alt="" width="593" height="324" border="0" /> </a></p>
<p style="text-align: center;">&nbsp;<span style="font-size: small;">Figure 1: architecture of HPC Services for Excel</span></p>
<p style="text-align: justify;"><span style="font-size: small;"><strong>Microsoft.Hpc.Excel.ExcelDriver</strong>: provides a wrapper around the Excel <strong>Primary Interop Assembly </strong>(PIA) interface that enables managed code to interact with a Microsoft Office application's COM-based Microsoft.Hpc.Excel.ExcelDriver, which allows a user to open a workbook, launch an Excel process, and invoke a macro. </span><span style="font-size: small;"><strong>Microsoft.Hpc.Excel.ExcelDriver</strong> exposes a COM interface and a .NET API.</span></p>
<p><span style="font-size: small;">HPC Services for Excel supports two mechanism:</span></p>
<ul>
<li><span style="font-size: small;"><strong><em>offloading workbooks</em></strong><em> to the cluster. </em>In offloading workbook, each Excel 2010 instance runs an independent calculation or iteration of the same workbook with a different dataset.<em></em></span></li>
<li><span style="font-size: small;"><strong><em>offloading UDFs</em></strong><em> to the cluster</em>; In offloading UDFs only the UDFs runs on HPC compute nodes.</span></li>
</ul>
<p><span style="font-size: small;">In this blog I show </span><span style="font-size: small;">how to create a very basic example of Excel offloading workbook.</span></p>
<p>&nbsp;</p>
<h1><span style="color: #000080;">2&nbsp;HPC macro in Excel</span></h1>
<p style="text-align: justify;"><span style="font-size: small;">The most important concept to understand in developing </span><span style="font-size: small;">workbooks for HPC Services for Excel, and using the macro framework, is <em>asynchronous calculation</em>.&nbsp;</span><span style="font-size: small;">A typical Excel application runs <em>synchronously</em>.&nbsp; That happens </span><span style="font-size: small;">for example when you press a button to run a macro, and the macro executes some </span><span style="font-size: small;">VBA (Visual Basic for Applications) code; you expect that the macros will run </span><span style="font-size: small;">from beginning to end, and then complete.</span></p>
<p><span style="font-size: small;">The <em>asynchronous</em> programming </span><span style="font-size: small;">model is a little different.&nbsp; In this </span><span style="font-size: small;">model, you write VBA functions, but you do not call them directly.&nbsp; Instead, a client library &ndash; code that&rsquo;s </span><span style="font-size: small;">installed with HPC Services for Excel &ndash; will call your VBA functions.</span></p>
<p><span style="font-size: small;">To support HPC Services for Excel has been create the macro </span><span style="font-size: small;">framework that consists of a set of seven VBA macros that you can include in </span><span style="font-size: small;">your workbook:</span></p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="144">
<p><span style="font-size: medium;"><strong>HPC_GetVersion</strong></span></p>
</td>
<td valign="top" width="442">
<p style="text-align: justify;"><span style="font-size: small;">Return the version of the macro framework used to run calculations on an HPC cluster. </span><span style="font-size: small;">It tells the HPC libraries which version of <span style="font-size: small;">the macro framework the workbook contains. </span></span></p>
<p style="text-align: justify;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;">The macro framework described in this document is version 1.0, so the <strong>HPC_GetVersion</strong> macro must return the </span><span style="font-size: small;">string &ldquo;1.0&rdquo;.&nbsp;</span></span></span></p>
<p style="text-align: justify;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;">The <strong>HPC_GetVersion </strong></span><span style="font-size: small;">macro is important because it will allow the workbook to run with any future </span><span style="font-size: small;">version of Windows HPC Server.&nbsp; Even if </span><span style="font-size: small;">the default macro structure changes in future releases, as long as the <strong>HPC_GetVersion </strong>macro returns &ldquo;1.0&rdquo;, the </span><span style="font-size: small;">HPC libraries will be able to execute this workbook on a Windows HPC Cluster.</span></span></span></span></p>
</td>
</tr>
<tr>
<td valign="top" width="144">
<p><span style="font-size: medium;"><strong>HPC_Initialize</strong></span></p>
</td>
<td valign="top" width="442">
<p style="text-align: justify;"><span style="font-size: small;">Perform any pre-calculation or initialization steps.</span></p>
<p style="text-align: justify;"><span style="font-size: small;">When you run a calculation for an Excel workbook on an HPC </span><span style="font-size: small;">cluster, the client library first calls the <a href="http://msdn.microsoft.com/en-us/library/gg520855(v=vs.85).aspx"><strong>HPC_GetVersion</strong></a> macro, and then it</span><span style="font-size: small;">&nbsp;calls the <strong>HPC_Initialize</strong> macro.</span></p>
<p style="text-align: justify;"><span style="font-size: small;">Implement this macro to perform the initialization tasks </span><span style="font-size: small;">that are necessary for the entire calculation, such as resetting counter </span><span style="font-size: small;">variables, clearing old results from the spreadsheet, turning off the display </span><span style="font-size: small;">of updates to the workbook during the calculation, and opening external </span><span style="font-size: small;">resources such as log files or database connections.</span></p>
<p><span style="font-size: small;">(<span style="color: #000080;"><strong>HPC_Initialize </strong></span></span><span style="font-size: small;"><span style="color: #000080;">is executed on the client&rsquo;s desktop</span>)</span></p>
</td>
</tr>
<tr>
<td valign="top" width="144">
<p><span style="font-size: medium;"><strong>HPC_Partition</strong></span></p>
</td>
<td valign="top" width="442">
<p><span style="font-size: small;">Collect required parameters for a single calculation step</span></p>
<p style="text-align: justify;"><span style="font-size: small;">This macro represents the partition stage of that </span><span style="font-size: small;">framework. The framework implements an iterative calculation model for the </span><span style="font-size: small;">workbook, where different calculation steps are performed on different nodes</span><br /><span style="font-size: small;">&nbsp; in the HPC cluster. The partition stage of the framework establishes how the</span><span style="font-size: small;">&nbsp;overall calculation is split into individual calculation steps.</span></p>
<p><span style="font-size: small;">When the last calculation step is </span><span style="font-size: small;">complete, this macro should return <strong>Null.</strong></span></p>
<p><span style="font-size: small;">(<span style="color: #000080;"><strong>HPC_Partition </strong></span></span><span style="font-size: small;"><span style="color: #000080;">is executed on the client&rsquo;s desktop</span>)</span></p>
</td>
</tr>
<tr>
<td valign="top" width="144">
<p><span style="font-size: medium;"><strong>HPC_Execute</strong></span></p>
</td>
<td valign="top" width="442">
<p><span style="font-size: small;">Perform one calculation step, as part of a larger overall </span><span style="font-size: small;">calculation</span></p>
<p><span style="font-size: small;">(<span style="color: #ff0000;"><strong>HPC_Execute</strong> is </span></span><span style="font-size: small;"><span style="color: #ff0000;">executed on HPC nodes</span>)</span></p>
</td>
</tr>
<tr>
<td valign="top" width="144">
<p><span style="font-size: medium;"><strong>HPC_Merge</strong></span></p>
</td>
<td valign="top" width="442">
<p><span style="font-size: small;">Process the results of a single calculation step</span></p>
<p><span style="font-size: small;">(<span style="color: #000080;"><strong>HPC_Merge</strong> is executed </span></span><span style="font-size: small;"><span style="color: #000080;">on the client&rsquo;s desktop</span>)</span></p>
</td>
</tr>
<tr>
<td valign="top" width="144">
<p><span style="font-size: medium;"><strong>HPC_Finalize</strong></span></p>
</td>
<td valign="top" width="442">
<p><span style="font-size: small;">Perform any post-calculation processing</span></p>
<p><span style="font-size: small;">(<span style="color: #000080;"><strong>HPC_Finalize </strong></span></span><span style="font-size: small;"><span style="color: #000080;">is executed on the client&rsquo;s desktop</span>)</span></p>
</td>
</tr>
<tr>
<td valign="top" width="144">
<p><span style="font-size: medium;"><strong>HPC_ExecutionError</strong></span></p>
</td>
<td valign="top" width="442">
<p><span style="font-size: small;">Handle errors arising from the calculation</span></p>
<p style="text-align: justify;"><span style="font-size: small;"><span style="font-size: small;"><strong>HPC_ExecutionError</strong>, </span><span style="font-size: small;">is only used when the calculation encounters some error.&nbsp; If so, this macro is called and you can add </span><span style="font-size: small;">some error handling code &ndash; for example, you might show a pop-up dialog to the </span><span style="font-size: small;">user warning them of the error.</span></span></p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p><span style="font-size: small;">Each macro has a specific purpose in the macro framework, and each will be called by the HPC Services for Excel client library during a cluster calculation at a specific point.&nbsp;</span><br /><span style="font-size: small;">A typical calculation runs in the cluster in a workflow:</span></p>
<p>&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/3817.02_HPCmacroFrameworkFlow.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/3817.02_5F00_HPCmacroFrameworkFlow.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/3817.02_HPCmacroFrameworkFlow.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/3817.02_5F00_HPCmacroFrameworkFlow.jpg" alt="" width="386" height="388" border="0" /> </a></p>
<p align="center">&nbsp;<span style="font-size: small;">Figure 2: macro framework workflow</span></p>
<p><span style="font-size: small;">Workflow of calculation happens in following order:</span></p>
<ol>
<li>
<div style="text-align: justify;"><span style="font-size: small;">When a cluster calculation runs, first the </span><span style="font-size: small;">client library calls the <strong>HPC_Initialize </strong></span><span style="font-size: small;">macro, used to handle any required initialization; for example, you might want </span><span style="font-size: small;">to clear out old results from your spreadsheet.</span></div>
</li>
<li>
<div style="text-align: justify;"><span style="font-size: small;">Next, the calculation runs through three macros: </span><span style="font-size: small;"><strong>HPC_Partition</strong>, <strong>HPC_Execute</strong>, and <strong>HPC_Merge</strong>.&nbsp; In the diagram above, these are shown as a</span><br /><span style="font-size: small;">loop.&nbsp; <strong>That is not really what happens during a calculation, but logically you can think of this as a loop</strong>. First of </span><span style="font-size: small;">all the client library calls <strong>HPC_Partition </strong></span><span style="font-size: small;">designed to collect any data required for a single calculation step.&nbsp; For example, if you want to calculate a set </span><span style="font-size: small;">of rows one by one, <strong>HPC_Partition </strong></span><span style="font-size: small;">might return the row number for a single step: first row 1, then row 2, and so </span><span style="font-size: small;">on.</span></div>
</li>
<li>
<div style="text-align: justify;"><span style="font-size: small;">Next, the <strong>HPC_Execute </strong></span><span style="font-size: small;">macro is called.&nbsp; This macro runs the </span><span style="font-size: small;">actual calculation. When the calculation runs, the workbook will be copied to </span><span style="font-size: small;">the cluster compute nodes and the <strong>HPC_Execute </strong></span><span style="font-size: small;">macro will be run on one of the compute nodes. <strong>HPC_Execute</strong> will return the result of the calculation: for example, </span><span style="font-size: small;">it might return the last cell in the row which is the end result of a longer </span><span style="font-size: small;">calculation.</span></div>
</li>
<li>
<div style="text-align: justify;"><span style="font-size: small;">After <strong>HPC_Execute</strong>, </span><span style="font-size: small;">the client library will call <strong>HPC_Merge</strong>.&nbsp; Whatever <strong>HPC_Execute </strong></span><span style="font-size: small;">has calculated will be sent to <strong>HPC_Merge</strong>.</span></div>
</li>
<li>
<div style="text-align: justify;"><span style="font-size: small;">The <strong>HPC_Merge </strong></span><span style="font-size: small;">macro is designed to take those results and return them to the spreadsheet </span><span style="font-size: small;">running on your desktop.&nbsp; In the <strong>HPC_Merge</strong> macro, you might insert the </span><span style="font-size: small;">calculation results back into your spreadsheet, or you might write them to a </span><span style="font-size: small;">log file.</span></div>
</li>
</ol>
<p style="text-align: justify;"><span style="font-size: small;">These three macros &ndash; <strong>HPC_Partition</strong>, </span><span style="font-size: small;"><strong>HPC_Execute</strong>, and <strong>HPC_Merge</strong> &ndash; will be called multiple </span><span style="font-size: small;">times, once for each step in your calculation, until the entire calculation is </span><span style="font-size: small;">complete.&nbsp; These macros implement the <em>iterative </em>calculation model. The macros </span><span style="font-size: small;">might be called many times during a single workbook calculation, but each time </span><span style="font-size: small;">they are called represents a single calculation step, or <em>iteration</em>.</span></p>
<p style="text-align: justify;"><span style="font-size: small;">After the last calculation step has completed, </span><span style="font-size: small;">the client library will call <strong>HPC_Finalize</strong>.&nbsp; You can use this macro to perform any </span><span style="font-size: small;">post-calculation processing: for example, you might want to find the average of </span><span style="font-size: small;">all the previous calculation steps by using another VBA macro.</span></p>
<p style="text-align: justify;"><span style="font-size: small;">In the diagram above, the <strong>HPC_Execute</strong> macro is highlighted in red to indicate that actually this </span><span style="font-size: small;">macro runs on the cluster compute nodes. All the other macros run on the </span><span style="font-size: small;">desktop, in Excel on user&rsquo;s workstation.</span></p>
<p style="text-align: justify;"><span style="font-size: small;">It&rsquo;s important to understand this, because it has some </span><span style="font-size: small;">implications for how workbooks use and manage data during the calculation.&nbsp; The three main calculation macros &ndash; <strong>HPC_Partition</strong>, <strong>HPC_Execute</strong>, and <strong>HPC_Merge</strong></span><br /><span style="font-size: small;">&ndash; pass data back and forth during the calculation process.&nbsp; In a typical VBA application, there are lots </span><span style="font-size: small;">of ways to share data between different macros.&nbsp;</span><br /><span style="font-size: small;">For example, you can use global variables in your VBA code, or write </span><span style="font-size: small;">values into spreadsheet cells.&nbsp; But when </span><span style="font-size: small;">we&rsquo;re running the calculation on an HPC cluster, we need to send data between </span><span style="font-size: small;">the macros running on the desktop, and the <strong>HPC_Execute </strong></span><span style="font-size: small;">macro running on the compute nodes.&nbsp;</span></p>
<p style="text-align: justify;"><span style="font-size: small;">For that reason, any data we need to run the calculation </span><span style="font-size: small;">must be sent from the <strong>HPC_Partition </strong></span><span style="font-size: small;">macro to the <strong>HPC_Execute</strong> macro </span><span style="font-size: small;">directly.&nbsp; We do this by using the <em>return value</em> from the <strong>HPC_Partition</strong> macro.&nbsp; That return value becomes the <em>argument </em>(or<em> parameter</em>) to the <strong>HPC_Execute </strong></span><span style="font-size: small;">function.&nbsp; So data will pass directly </span><span style="font-size: small;">between these two macros, and you can pass any value or set of values (as an </span><span style="font-size: small;">Array) between these macros. But again, you can&rsquo;t use global variables or the </span><span style="font-size: small;">spreadsheet cells to pass information between the two macros because when it </span><span style="font-size: small;">runs on the cluster, there are actually multiple copies of the workbook running </span><span style="font-size: small;">at the same time &ndash; one on the desktop, and one (or more) on the cluster compute </span><span style="font-size: small;">nodes.</span></p>
<p style="text-align: justify;"><span style="font-size: small;">In the same way, when the calculation in <strong>HPC_Execute</strong> is complete, it will return </span><span style="font-size: small;">a result as the return value of the macro function.&nbsp; That result becomes the argument (or </span><span style="font-size: small;">parameter) to the next macro, <strong>HPC_Merge</strong>.&nbsp; Once again, any results you want to return &ndash;</span><span style="font-size: small;">the results of the calculation &ndash; must be sent in this way, as the return value </span><span style="font-size: small;">of the function.</span></p>
<p>&nbsp;<span style="font-size: small;">To simplify the process, two skeleton&rdquo; macro files are included&nbsp;in </span><span style="font-size: small;">this article&nbsp;that you can import into your Excel </span><span style="font-size: small;">workbook (see 3.5 paragraph).</span>&nbsp;</p>
<p align="center">&nbsp;</p>
<h1><span style="color: #000080;">3&nbsp;&nbsp;How to build an Excel workbook to run on HPC cluster</span></h1>
<p><span style="font-size: small;">In this section we build an simple workbook to run on HPC cluster. </span><span style="font-size: small;">I assume that you have a Windows HPC cluster installed in Azure IaaS VMs (see Part1 of my post), so the following environment is ready to go:</span></p>
<ol>
<li><span style="font-size: small;">A Windows HPC 2008 R2 cluster (&ldquo;Enterprise edition&rdquo;) installed and configured.</span></li>
<li><span style="font-size: small;">Excel 2010 installed on the cluster compute nodes.</span></li>
<li><span style="font-size: small;">A network share folder (i.e. on the HPC head node).</span></li>
<li><span style="font-size: small;">Excel 2010 and the Windows HPC Pack 2008 R2 client utilities installed on user&rsquo;s desktop &nbsp;(in my setup this client runs in one Windows Azure IaaS VM attached to the same VNET of HPC cluster)</span></li>
</ol>
<p>&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/3731.03_HPC_topology.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/3731.03_5F00_HPC_5F00_topology.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/3731.03_HPC_topology.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/3731.03_5F00_HPC_5F00_topology.jpg" alt="" width="683" height="332" border="0" /> </a></p>
<p style="text-align: center;">&nbsp;<span style="font-size: small;">Figure 3: HPC cluster topology</span>&nbsp;in Azure IaaS VMs</p>
<h2><span style="color: #000080;">3.1&nbsp;&nbsp;Enable Developer tab on Excel workbook&nbsp;</span></h2>
<p><span style="font-size: small;">On the user&rsquo;s desktop (in our topology exhpclient) open Excel and enable<strong> Develop tab</strong></span></p>
<ol>
<li><span style="font-size: small;">Click the <strong>File</strong> tab on the Excel ribbon</span></li>
<li><span style="font-size: small;">Click <strong>Options</strong>.&nbsp;</span></li>
<li><span style="font-size: small;">In the Excel options dialog, select <strong>Customize Ribbon</strong> on the left.&nbsp;</span></li>
<li><span style="font-size: small;">Check the box next to <strong>Developer</strong> and click <strong>OK</strong> to close the dialog.</span></li>
</ol>
<p style="text-align: center;">&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/5670.04_ExcelDeveloperTab.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/5670.04_5F00_ExcelDeveloperTab.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/5670.04_ExcelDeveloperTab.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/5670.04_5F00_ExcelDeveloperTab.jpg" alt="" width="590" height="379" border="0" />&nbsp;</a>&nbsp;<span style="font-size: small;">Figure 4: enable Developer tab in Excel</span></p>
<p>&nbsp;</p>
<h2><span style="color: #000080;">3.2&nbsp;&nbsp;&nbsp;Create a new workbook (with extension .xlsb)</span></h2>
<p><span style="font-size: small;">Because the new Excel workbook have to include macros, it need to save it as binary workbook (extension file <strong>.XLSB</strong>) -Figure 5</span></p>
<p style="text-align: center;">&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/6471.05_ExcelBinaryWorkbook.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/6471.05_5F00_ExcelBinaryWorkbook.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/6471.05_ExcelBinaryWorkbook.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/6471.05_5F00_ExcelBinaryWorkbook.jpg" alt="" width="554" height="345" border="0" />&nbsp;</a><span style="font-size: small;">Figure 5: create a new Excel binary workbook</span></p>
<h2><span style="color: #000080;">3.3&nbsp;&nbsp;Enable Developer tab on Excel workbook</span></h2>
<p><span style="font-size: small;">Make following actions on "Sheet1" (Figure 6):</span></p>
<ul>
<li><span style="font-size: small;"><strong>A1 cell</strong>: insert the text &ldquo;<strong>Multiplication Factor</strong>&rdquo;</span></li>
<li><span style="font-size: small;"><strong>B1 cell</strong>: insert the text &ldquo;<strong>Percentage completion</strong>&rdquo;&nbsp; </span></li>
<li><span style="font-size: small;"><strong>E1:O11 </strong>cells: insert a sequence of integer [1,11] </span></li>
<li><span style="font-size: small;"><span style="font-size: small;"><strong>D2:D27 </strong>cells<strong>: </strong>insert a sequence of integer </span>[1,26]&nbsp; </span></li>
<li><span style="font-size: small;"><strong>E2:O27 </strong>cells:&nbsp;change background color in Yellow </span></li>
</ul>
<p>&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/4628.06_DefineSheet.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/4628.06_5F00_DefineSheet.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/4628.06_DefineSheet.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/4628.06_5F00_DefineSheet.jpg" alt="" width="609" height="360" border="0" /> </a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 6: sequence of integers in a row and </span><span style="font-size: small;">column</span></p>
<p style="text-align: justify;"><span style="font-size: small;">Set the conditional formatting for the cells E2:O27 (Figure 7)</span>&nbsp;</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/1464.07_ConditionalFormatting.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/1464.07_5F00_ConditionalFormatting.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/1464.07_ConditionalFormatting.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/1464.07_5F00_ConditionalFormatting.jpg" alt="" width="598" height="348" border="0" />&nbsp;</a><span style="font-size: small;">Figure 7: set the conditional formatting in yellow cells</span></p>
<h2><span style="color: #000080;">3.4&nbsp;&nbsp;Naming of cells</span></h2>
<p style="text-align: justify;"><span style="font-size: small;">Naming in Excel is useful because leaves possibility to reference cells by name in the VBA code.</span></p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/5873.08_Naming.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/5873.08_5F00_Naming.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/5873.08_Naming.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/5873.08_5F00_Naming.jpg" alt="" width="583" height="131" border="0" />&nbsp;</a><span style="font-size: small;">Figure 8: open the Name Manager</span></p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/2627.09_Naming.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/2627.09_5F00_Naming.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/2627.09_Naming.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/2627.09_5F00_Naming.jpg" alt="" width="520" height="374" border="0" />&nbsp;</a><span style="font-size: small;">Figure 9: initially Name Manager is empty</span></p>
<p>&nbsp;</p>
<p><span style="font-size: small;">In our Excel worksheet, we define file cell names: <strong>Factor</strong>, <strong>percentageCompletion</strong>, <strong>MyCols</strong>, <strong>MyRows</strong>, <strong>Egress_Table (</strong>Figure 10<strong></strong><strong>-</strong>Figure14<strong></strong><strong>)</strong></span></p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/4174.10_Naming.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/4174.10_5F00_Naming.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/4174.10_Naming.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/4174.10_5F00_Naming.jpg" alt="" width="347" height="231" border="0" />&nbsp;</a><span style="font-size: small;">Figure 10:Egress_Table cells name</span></p>
<p style="text-align: center;">&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/0042.11_Naming.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/0042.11_5F00_Naming.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/0042.11_Naming.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/0042.11_5F00_Naming.jpg" alt="" width="319" height="179" border="0" />&nbsp;</a><span style="font-size: small;">Figure 11: Factor cell name</span>&nbsp;</p>
<p style="text-align: center;">&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/2703.12_Naming.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/2703.12_5F00_Naming.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/2703.12_Naming.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/2703.12_5F00_Naming.jpg" alt="" width="328" height="184" border="0" />&nbsp;</a><span style="font-size: small;">Figure 12:MyCols cells name</span></p>
<p style="text-align: center;">&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/3348.13_Naming.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/3348.13_5F00_Naming.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/3348.13_Naming.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/3348.13_5F00_Naming.jpg" alt="" width="357" height="184" border="0" />&nbsp;</a><span style="font-size: small;">Figure 13: MyRows cells name</span>&nbsp;</p>
<p style="text-align: center;">&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/4745.14_Naming.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/4745.14_5F00_Naming.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/4745.14_Naming.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/4745.14_5F00_Naming.jpg" alt="" width="335" height="188" border="0" />&nbsp;</a><span style="font-size: small;">Figure 14: percentageCompletion cell name</span></p>
<p><span style="font-size: small;">After defining names, Name Manager appears as in Figure 15</span>&nbsp;</p>
<p style="text-align: center;">&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/2045.15_Naming.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/2045.15_5F00_Naming.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/2045.15_Naming.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/2045.15_5F00_Naming.jpg" alt="" width="470" height="419" border="0" />&nbsp;</a><span style="font-size: small;">Figure 15: List of naming assigned to cells</span></p>
<p><span style="font-size: small;">In Figure 16 is reported the positioning of cells in Sheet1 with related names.</span></p>
<p style="text-align: center;">&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/6888.16_Naming.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/6888.16_5F00_Naming.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/6888.16_Naming.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/6888.16_5F00_Naming.jpg" alt="" width="634" height="422" border="0" />&nbsp;</a><span style="font-size: small;">Figure 16: positioning of cells names in Excel sheet1</span></p>
<h2><span style="color: #000080;">3.5&nbsp;Import the skeleton files</span></h2>
<p><span style="font-size: small;">To get started,&nbsp;download two basic &ldquo;skeleton&rdquo; macro files:</span></p>
<ul>
<li><span style="font-size: small;"><strong><span style="font-size: large;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/3681.HPCExcelMacros.bas" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/3681.HPCExcelMacros.bas">HPCExcelMacros.bas</a> </span>: </strong>contains all macro framework functions (the functions described in the section above) designated to support parallel execution.&nbsp; These macros are used by the HPC Services for Excel client library during the calculation.</span></li>
<li><span style="font-size: small;"><strong><span style="font-size: large;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/7633.HPCControlMacros.bas" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/7633.HPCControlMacros.bas">HPCControlMacros.bas</a></span> : </strong>a set of VBA macros contains the &ldquo;control&rdquo; functions</span></li>
</ul>
<p>&nbsp;<span style="font-size: small;">After&nbsp;downloading of macro files, you need to import these macros modules:</span></p>
<p><span style="font-size: small;">1. On the <strong>Developer </strong>tab of the ribbon, click <strong>Visual Basic </strong>to open the VBA editor.&nbsp;</span></p>
<p><span style="font-size: small;">2. In the VBA editor, right-click <strong>VBA Project </strong>at the top of the tree view and then click <strong>Import File</strong>.</span>&nbsp;</p>
<p>&nbsp;</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/4846.17_ImportVBAmacros.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/4846.17_5F00_ImportVBAmacros.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/4846.17_ImportVBAmacros.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/4846.17_5F00_ImportVBAmacros.jpg" alt="" width="450" height="342" border="0" />&nbsp;</a><span style="font-size: small;">Figure 17: import VBA files</span></p>
<p><span style="font-size: small;">3. In the dialog box, select the file &ldquo;<strong>HPC Excel Macros.bas</strong>&rdquo; and click <strong>OK</strong>.&nbsp;</span><span style="font-size: small;">That adds the first macro file to your project, and it will be available in the <strong>Modules</strong> folder of the VBA project window.</span></p>
<p><span style="font-size: small;">4. Repeat </span><span style="font-size: small;">steps 1-3 to import &ldquo;<strong>HPC Control Macros.bas</strong>&rdquo; and then click <strong>OK</strong>.&nbsp; That adds the second macro file to your </span><span style="font-size: small;">project.&nbsp;</span></p>
<p style="text-align: center;">&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/4705.18_ImportVBAmacros.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/4705.18_5F00_ImportVBAmacros.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/4705.18_ImportVBAmacros.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/4705.18_5F00_ImportVBAmacros.jpg" alt="" width="404" height="321" border="0" />&nbsp;</a><span style="font-size: small;">Figure 18: select VBA to be imported</span></p>
<p><span style="font-size: small;">5. Verify that these two macro files appear in the VBA project window:</span></p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/4251.19_ImportVBAmacros.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/4251.19_5F00_ImportVBAmacros.jpg">&nbsp;<img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/4251.19_ImportVBAmacros.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/4251.19_5F00_ImportVBAmacros.jpg" alt="" width="506" height="351" border="0" />&nbsp;</a><span style="font-size: small;">Figure 19: check presence <strong>HPCControlMacros</strong> and <strong>HPCExcelMacros</strong> in the worksheet</span></p>
<p><span style="font-size: small;">Details on <strong>HPCControlMacros </strong>and <strong>HPCExcelMacros</strong> are discussed later.</span></p>
<h2><span style="color: #000080;">3.6&nbsp;&nbsp;Adding a button that runs the workbook locally</span></h2>
<p><span style="font-size: small;">To add a button that runs the workbook locally</span></p>
<p><span style="font-size: small;">1. With your Excel workbook open, click the <strong>Developer</strong> tab on the ribbon.&nbsp;</span></p>
<p><span style="font-size: small;">2. On the <strong>Developer </strong>tab, click <strong>Insert</strong> and then select the button control &ndash; the first control in the list.</span></p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/6786.20_InsetButtoms.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/6786.20_5F00_InsetButtoms.jpg">&nbsp;<img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/6786.20_InsetButtoms.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/6786.20_5F00_InsetButtoms.jpg" alt="" width="592" height="266" border="0" />&nbsp;</a><span style="font-size: small;">Figure 20: insert form button in Sheet1</span></p>
<p style="text-align: justify;"><br /><span style="font-size: small;">After you&rsquo;ve clicked the button, draw a rectangle somewhere on the spreadsheet to insert the button in that location. </span><span style="font-size: small;">After you position the button, the Assign Macro dialog box appears.</span>&nbsp;&nbsp;</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/4812.21_InsetButtoms.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/4812.21_5F00_InsetButtoms.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/4812.21_InsetButtoms.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/4812.21_5F00_InsetButtoms.jpg" alt="" width="460" height="331" border="0" />&nbsp;</a><span style="font-size: small;">Figure 21: association of <strong>CalculateWorkbookOnDesktop</strong> to the Button1</span></p>
<h2><span style="color: #000080;">3.7&nbsp;&nbsp;Adding a button that runs the workbook on the cluster</span></h2>
<p style="text-align: justify;"><span style="font-size: small;">Repeating the steps done before, you can add a second button (Button2) used to run the Excel Workbook on the cluster. After you position the button, the Assign Macro dialog box appears (Figure 22)</span>&nbsp;&nbsp;</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/3414.22_InsetButtoms.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/3414.22_5F00_InsetButtoms.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/3414.22_InsetButtoms.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/3414.22_5F00_InsetButtoms.jpg" alt="" width="464" height="318" border="0" />&nbsp;</a><span style="font-size: small;">Figure 22: association of <strong>CalculateWorkbookOnCluster </strong>to the Button2</span></p>
<p><span style="font-size: small;">Give to the buttons a better shape,</span>&nbsp;</p>
<p style="text-align: center;">&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/0576.23_InsetButtoms.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/0576.23_5F00_InsetButtoms.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/0576.23_InsetButtoms.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/0576.23_5F00_InsetButtoms.jpg" alt="" width="477" height="340" border="0" />&nbsp;</a><span style="font-size: small;">Figure 23: specify font for the Buttom1</span></p>
<p><span style="font-size: small;">Change the name of Buttom1, form &ldquo;Button1&rdquo; to &ldquo;<strong>Run Local</strong>&rdquo; (Figure 24)</span></p>
<p style="text-align: center;">&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/6787.24_InsetButtoms.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/6787.24_5F00_InsetButtoms.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/6787.24_InsetButtoms.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/6787.24_5F00_InsetButtoms.jpg" alt="" width="329" height="316" border="0" />&nbsp;</a><span style="font-size: small;">Figure 24: change the name of the Button1 to <strong>Run Local</strong></span></p>
<h2><span style="color: #000080;">3.8&nbsp;&nbsp;&nbsp;Add reference to HPC library</span></h2>
<p style="text-align: justify;"><span style="font-size: small;">To run Excel on the HPC cluster it is required that you add a reference to the HPC library in the VBA editor&ndash; that&rsquo;s the client library.&nbsp;</span></p>
<p style="text-align: justify;"><span style="font-size: small;">1. In the VBA editor window, click <strong>Tools</strong>, and then click <strong>References</strong> to open the project references dialog box.&nbsp;</span></p>
<p style="text-align: center;">&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/8875.25_EnableReferenceHPC.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/8875.25_5F00_EnableReferenceHPC.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/8875.25_EnableReferenceHPC.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/8875.25_5F00_EnableReferenceHPC.jpg" alt="" width="477" height="257" border="0" />&nbsp;</a><span style="font-size: small;">Figure 25: Tools -&gt; References</span></p>
<p style="text-align: justify;"><span style="font-size: small;">2. In the list of available references, scroll down until you find <strong>Microsoft_Hpc_Excel</strong> and select the </span><span style="font-size: small;">check box next to it.&nbsp; When you&rsquo;ve checked the box the dialog should look like this:</span>&nbsp;</p>
<p style="text-align: center;">&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/0882.26_EnableReferenceHPC.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/0882.26_5F00_EnableReferenceHPC.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/0882.26_EnableReferenceHPC.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/0882.26_5F00_EnableReferenceHPC.jpg" alt="" width="428" height="296" border="0" />&nbsp;</a><span style="font-size: small;">Figure 26: flag reference to Microsf_HPC_Excel</span></p>
<p><span style="font-size: small;">3. Click <strong>OK </strong>to close the project references dialog.</span></p>
<h2><span style="color: #000080;">3.9&nbsp;&nbsp;&nbsp;Set cluster scheduler name and shared folder in HPCControlMacros</span></h2>
<p style="text-align: justify;"><span style="font-size: small;">In the <strong>HPCControlMacros </strong>module we set a few values to tell Excel how to contact the cluster: the cluster scheduler and the shared folder:</span></p>
<ol>
<li style="text-align: justify;"><span style="font-size: small;">For the <strong>cluster scheduler</strong>, use the name of your cluster head node &ndash; this is the computer name that you would use on the network.&nbsp;You can use a fully-qualified name (for example, headnode.mynetwork.com), but that&rsquo;s not necessary if you&rsquo;re in the same domain.</span></li>
<li style="text-align: justify;"><span style="font-size: small;">For the <strong>shared folder</strong>, use the full path to the share folder. The desktop user must have write access to this share folder; and the cluster compute nodes must have read access to the folder.</span></li>
</ol>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="611">
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>'&nbsp;Private Const HPC_ClusterScheduler = "HEADNODE_NAME"</strong></span></p>
<p align="left"><span style="color: #ff0000; font-family: courier new,courier; font-size: small;"><strong>Private Const HPC_ClusterScheduler = "exhn001"</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: small;"><strong>'</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>'&nbsp;This is a network share used to store a temporary copy</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>' of the workbook.&nbsp; Make sure that the directory exists,</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>' that you have write access to the directory, and that</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>' the compute nodes in the cluster have read access.</strong></span></p>
<p align="left"><span style="font-family: courier new,courier; font-size: x-small;"><strong>' Private Const HPC_NetworkShare = <a href="file://\\PATH\TO\SHARE\DIRECTORY">\\PATH\TO\SHARE\DIRECTORY</a></strong></span></p>
<p align="left"><span style="color: #ff0000; font-family: courier new,courier; font-size: small;"><strong>Private Const HPC_NetworkShare = <a href="file://\\exhn001\share">\\exhn001\share</a></strong></span></p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<h2><span style="color: #000080;">3.10&nbsp; Defining the calculations in the macro framework</span></h2>
<p><span style="font-size: small;">The <strong>HPCControlMacros </strong>module </span><span style="font-size: small;">contains the macro framework for the calculation. In Figure 27 </span><span style="font-size: small;">is reported the workflow with pseudo-code.</span></p>
<p style="text-align: center;">&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/0451.27_HPCmacroFrameworkFlow.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/0451.27_5F00_HPCmacroFrameworkFlow.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/0451.27_HPCmacroFrameworkFlow.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/0451.27_5F00_HPCmacroFrameworkFlow.jpg" alt="" width="815" height="507" border="0" /> </a> &nbsp;<span style="font-size: small;">Figure 27: flowchart with pseudo-code</span></p>
<p>Below the meaning of some variables used in Figure 27:</p>
<p><span style="font-size: small;"><strong>NumRows</strong> is the total number of rows in <strong>Egress_Table</strong></span></p>
<p><span style="font-size: small;"><strong>NumCols</strong> is the total number of column in <strong>Egress_Table</strong></span></p>
<p><span style="font-size: small;"><strong>IndexRow</strong> is&nbsp; counter (Integer) to identify the number of row in the <strong>Egress_Table</strong></span></p>
<p><span style="font-size: small;"><strong>indexCol</strong> is a counter (Integer) to identify the number of column in the <strong>Egress_Table</strong></span></p>
<p><span style="font-size: small;">From&nbsp;flowchart analysis&nbsp;is evident that in<strong>&nbsp;HPC_Partition&nbsp;</strong>slit up&nbsp;of&nbsp;data&nbsp;happens by columns; in next example (Part3)&nbsp;use&nbsp;a data&nbsp;partition data by rows.</span></p>
<p><span style="font-size: small;">In Figure 28 </span><span style="font-size: small;">is shown a more detailed view of workflow with VBA statements</span></p>
<p>&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/3683.28_HPCmacroFrameworkFlow.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/3683.28_5F00_HPCmacroFrameworkFlow.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/3683.28_HPCmacroFrameworkFlow.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/3683.28_5F00_HPCmacroFrameworkFlow.jpg" alt="" width="743" height="562" border="0" /> </a></p>
<p style="text-align: center;">&nbsp;&nbsp;<span style="font-size: small;">Figure 28: flowchart with VB statements</span></p>
<p style="text-align: justify;"><span style="font-size: small;">All the macros in the HPC framework use the Variant data </span><span style="font-size: small;">type for inputs and outputs.&nbsp; The Variant </span><span style="font-size: small;">type can be any primitive type (integer, long, double, string) or an Array of </span><span style="font-size: small;">these types.&nbsp; We need to include both the </span><span style="font-size: small;">row and column, so we can use an Array. </span><span style="font-size: small;">The other thing we need to do in the <strong>HPC_Partition</strong> macro is figure out when the calculation is </span><span style="font-size: small;">complete.&nbsp; In this case, the calculation </span><span style="font-size: small;">will be complete when we&rsquo;ve reached the end of the table.&nbsp; We can do that by incrementing the row and</span><br /><span style="font-size: small;">column numbers as we move through the table.&nbsp;</span><br /><span style="font-size: small;">Whenever we reach the end of a column, we move to the next column.&nbsp; When we&rsquo;ve passed the last column, the table </span><span style="font-size: small;">(Egress_Table)&nbsp; is finished and we want </span><span style="font-size: small;">the function to return Null.</span></p>
<p style="text-align: justify;"><span style="font-size: small;">In our case <strong>data</strong> is defined in HPC_Partition as an array of 3 </span><span style="font-size: small;">elements variant:</span></p>
<p style="padding-left: 30px;"><strong><span style="font-size: small;">Dim data(2) As Variant</span></strong></p>
<p><span style="font-size: small;">where:</span></p>
<ul>
<li style="text-align: justify;"><span style="font-size: small;"><span style="color: #ff0000;"><strong>data(0)</strong></span>: </span><span style="font-size: small;">contains the row index of the <strong>Egress_Table</strong></span></li>
<li style="text-align: justify;"><span style="font-size: small;"><span style="color: #ff0000;"><strong>data(1)</strong></span>: </span><span style="font-size: small;">contains the column index of the <strong>Egress_Table</strong></span></li>
<li style="text-align: justify;"><span style="font-size: small;"><span style="color: #ff0000;"><strong>data(2)</strong></span>: </span><span style="font-size: small;">contains the value in the cell (data(0), data(1)) of the <strong>Egress_Table</strong></span></li>
</ul>
<p style="text-align: justify;"><span style="font-size: small;">So to review, the <strong>HPC_Partition </strong>macro has two purposes: it collects parameters necessary for a single </span><span style="font-size: small;">calculation (here that&rsquo;s the row and column number); and when the calculation </span><span style="font-size: small;">is complete it signals that by returning Null.&nbsp;</span><br /><span style="font-size: small;">In the function we have created it does that by stepping through the </span><span style="font-size: small;">table, first by row and then by column, and when it&rsquo;s passed the last column, </span><span style="font-size: small;">it returns Null to indicate that the table is complete.</span></p>
<p>&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/8562.29_data.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/8562.29_5F00_data.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/8562.29_data.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/8562.29_5F00_data.jpg" alt="" width="634" height="335" border="0" /> </a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 29: data array to set value in a cell of Egress_Table</span></p>
<h2><span style="color: #000080;">3.11&nbsp; What happens when a workbook runs on the cluster</span></h2>
<p style="text-align: justify;"><span style="font-size: small;">When you click the button &ldquo;Run HPC&rdquo;, it calls the macro <strong>CalculateWorkbookOnCluster</strong>.&nbsp; That macro uses the client library to start a cluster calculation with the settings you provided for the cluster head node and share directory.</span></p>
<p style="text-align: justify;"><span style="font-size: small;">When the calculation starts, the HPC Services for Excel client code takes over.</span></p>
<ol>
<li style="text-align: justify;"><span style="font-size: small;">First, the client library will create a cluster &ldquo;session&rdquo;, used to manage the calculation.&nbsp;That takes a few seconds, and after you click the button you&rsquo;ll notice a few seconds&rsquo; delay.</span></li>
<li style="text-align: justify;"><span style="font-size: small;">Next the client library will call the <strong>HPC_Initialize</strong> macro. That happens on </span><span style="font-size: small;">the desktop. In this workbook, that macro set the initial value of few internal counters; and empties the Egress_Table cells in the &ldquo;Sheet1&rdquo;.&nbsp; So when you click the button, first you&rsquo;ll see the delay as the session is created; and then you&rsquo;ll see Egress_Table cells are cleared.&nbsp; That&rsquo;s the <strong>HPC_Initialize</strong> macro.</span></li>
<li style="text-align: justify;"><span style="font-size: small;">Next, the client library will start calling the <strong>HPC_Partition</strong> macro.&nbsp; This also happens on the desktop.&nbsp; In our code, the <strong>HPC_Partition</strong> macro increments the counter and returns the counter value.&nbsp; Every time this macro returns a value &ndash; until it returns Null, on the last call &ndash; the client library will send a request to the HPC scheduler.</span></li>
<li style="text-align: justify;"><span style="font-size: small;">When the scheduler receives one of these requests, it will forward the request to one of the cluster compute nodes for processing.&nbsp; When the compute node receives the request, it will start Excel, load the workbook, and then call the <strong>HPC_Execute</strong> macro. This is the <strong>HPC_Execute</strong> macro we have in our workbook, but when the calculation runs on the cluster, the <strong>HPC_Execute</strong> macro is actually run on the compute nodes &ndash; unlike all the other macros.&nbsp; That&rsquo;s why we&rsquo;re passing data array from one macro to another.&nbsp; Information flows from one macro to the next, but as data is passed from the <strong>HPC_Partition</strong> macro to the <strong>HPC_Execute </strong>macro, it is sent from the desktop, through the HPC scheduler, and to one of the compute nodes.&nbsp;</span></li>
<li style="text-align: justify;"><span style="font-size: small;">After one of the compute nodes runs the <strong>HPC_Execute</strong> macro, when the macro is completed the result of the calculation &ndash; the value returned from the <strong>HPC_Execute</strong> macro &ndash; is sent back to the scheduler, and then returned to the client library on the desktop.&nbsp; When the client library receives the calculation result, it will call the <strong>HPC_Merge </strong>macro on the desktop.&nbsp; So once again you can think of information flowing from one macro (<strong>HPC_Execute</strong>) to the next (<strong>HPC_Merge</strong>), but this is happening over the network: from the workbook running on the compute node to the workbook running on the desktop.</span></li>
</ol>
<p style="text-align: justify;"><span style="font-size: small;">It&rsquo;s important to understand that these macro function calls</span><span style="font-size: small;">&ndash; each of the calls to <strong>HPC_Partition</strong>, </span><span style="font-size: small;">as we send data to the cluster, and each of the calls to <strong>HPC_Merge</strong>, as data is received &ndash; happen asynchronously.&nbsp; That is, when a calculation is sent to the </span><span style="font-size: small;">cluster the client library will not wait (or block) until that particular </span><span style="font-size: small;">calculation is complete before it sends the next one.&nbsp; If the <strong>HPC_Partition </strong></span><span style="font-size: small;">macro is very fast, it&rsquo;s possible that all calculation requests will be sent </span><span style="font-size: small;">before any one of those requests is completed.</span></p>
<p style="text-align: justify;"><span style="font-size: small;">It&rsquo;s also worth noting that as the results come back from </span><span style="font-size: small;">the cluster &ndash; and the <strong>HPC_Merge </strong>macro is called in our workbook &ndash; they might not come back in the same order </span><span style="font-size: small;">that we sent them.&nbsp; That&rsquo;s because as </span><span style="font-size: small;">each request is sent to the cluster, the scheduler will forward it to one </span><span style="font-size: small;">particular compute node.&nbsp; The compute </span><span style="font-size: small;">node will calculate the request, using the <strong>HPC_Execute </strong></span><span style="font-size: small;">macro in the workbook, and then send back the result.&nbsp; But for a number of reasons, one compute node </span><span style="font-size: small;">might run more slowly or more quickly than another compute node; and if that </span><span style="font-size: small;">happens, results might be returned in a different order.</span></p>
<p>&nbsp;</p>
<h2><span style="color: #000080;">3.12&nbsp; Assign a value to the multiplication factor</span></h2>
<p style="text-align: justify;"><span style="font-size: small;">In the cell B1, specify the multiplication factor used for the calculation (Figure 30)</span>&nbsp;</p>
<p style="text-align: center;">&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/3187.30_MultiplicationFactor.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/3187.30_5F00_MultiplicationFactor.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/3187.30_MultiplicationFactor.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/3187.30_5F00_MultiplicationFactor.jpg" alt="" width="462" height="291" border="0" />&nbsp;</a><span style="font-size: small;">Figure 30: multiplication factor</span></p>
<p>&nbsp;</p>
<p><span style="font-size: small;">Now the worksheet is ready to run locally or in the Azure HPC cluster. </span></p>
<p><span style="font-size: small;">In Figure 31 is shown the job run in the cluster when the button &ldquo;Run HPC&rdquo; is pushed.</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/6177.31_HPCJob.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/6177.31_5F00_HPCJob.jpg">&nbsp;<img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/6177.31_HPCJob.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/6177.31_5F00_HPCJob.jpg" alt="" width="624" height="408" border="0" /> </a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 31: job executed on the HPC cluster</span></p>
<p><span style="font-size: small;">The HPC heatmap in the HPC management console shows CPU and cores allocation to run the Excel&nbsp; job.</span></p>
<p style="text-align: center;">&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/7674.32_HPCJob.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/7674.32_5F00_HPCJob.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/7674.32_HPCJob.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/7674.32_5F00_HPCJob.jpg" alt="" width="620" height="370" border="0" />&nbsp;</a><span style="font-size: small;">Figure 32: HPC heat Map</span></p>
<p style="text-align: center;">&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/4762.33_HPCJob.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/4762.33_5F00_HPCJob.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/4762.33_HPCJob.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/4762.33_5F00_HPCJob.jpg" alt="" width="622" height="494" border="0" />&nbsp;</a><span style="font-size: small;">Figure 33: list of successful HPC calls in the job</span></p>
<p style="text-align: justify;"><span style="font-size: small;">In Windows HPC a single job is divided into individual tasks, and those tasks are sent to the cluster for calculation. It is the </span><span style="font-size: small;">responsibility of the HPC Scheduler (the Head Node) to distribute these tasks to the Compute Nodes for processing. In our case we have 286 calls (one for </span><span style="font-size: small;">every <strong>Egress_Table</strong> cell) with a total of 16 tasks (each task runs one HPCServiceHost.exe). To be more efficient as possible, every task run in a single core.</span></p>
<p>&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/1376.34_HPCJob.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/1376.34_5F00_HPCJob.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/1376.34_HPCJob.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/1376.34_5F00_HPCJob.jpg" alt="" width="581" height="498" border="0" /> </a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 34: Excel job is composed of multiple tasks</span></p>
<p><span style="font-size: small;">Our HPC cluster has 16 cores (eight for every compute nodes) </span><span style="font-size: small;">so all the 289 tasks are served from the 16 cores</span></p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/8512.35_HPCJob.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/8512.35_5F00_HPCJob.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/8512.35_HPCJob.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/8512.35_5F00_HPCJob.jpg" alt="" width="579" height="483" border="0" />&nbsp;</a><span style="font-size: small;">Figure 35: </span><span style="font-size: small;">first task of Excel job run on first compute node EXCN001</span></p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/8306.36_HPCJob.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/8306.36_5F00_HPCJob.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/8306.36_HPCJob.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/8306.36_5F00_HPCJob.jpg" alt="" width="591" height="450" border="0" />&nbsp;</a><span style="font-size: small;">Figure 36: </span><span style="font-size: small;">second task of the Excel job run on the second compute node EXCN002</span></p>
<p style="text-align: center;">&nbsp;&nbsp;&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/7183.37__HPCJob.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/7183.37_5F005F00_HPCJob.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/7183.37__HPCJob.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/7183.37_5F005F00_HPCJob.jpg" alt="" width="598" height="340" border="0" />&nbsp;</a><span style="font-size: small;">Figure 37: </span><span style="font-size: small;">Allocate Nodes give the cores number allocated to run the job</span></p>
<p style="text-align: justify;"><span style="font-size: small;">The HPC cluster define automatically some environment </span><span style="font-size: small;">variables to run the Excel job (Figure </span><span style="font-size: small;">38); </span><span style="font-size: small;">you see the service name <strong>Microsoft.Hpc.Excel.ExcelService </strong></span><span style="font-size: small;">and the Excel workbook <strong>MulitplicationTable.xlsb </strong></span><span style="font-size: small;">copied on the shared folder (<a href="file:///\\exhn001\share">\\exhn001\share</a>) </span><span style="font-size: small;">required to run on the HPC cluster</span>&nbsp;</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/2335.38_HPCJob.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/2335.38_5F00_HPCJob.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/2335.38_HPCJob.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/2335.38_5F00_HPCJob.jpg" alt="" width="575" height="356" border="0" />&nbsp;</a><span style="font-size: small;">Figure 38: environment variable to run the job</span></p>
<p><span style="font-size: small;">When computation run on HPC, results might be returned in a </span><span style="font-size: small;">different order (Figure 39)</span></p>
<p style="text-align: center;">&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/1803.39_HPCJob.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/1803.39_5F00_HPCJob.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/1803.39_HPCJob.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/1803.39_5F00_HPCJob.jpg" alt="" width="647" height="434" border="0" />&nbsp;</a><span style="font-size: small;">Figure 39: </span><span style="font-size: small;">when computation run on HPC, result returns to the desktop in different order</span></p>
<p><span style="font-size: small;">You see how Excel -Sheet1 looks like after completing </span><span style="font-size: small;">computation in Figure 40</span></p>
<p>&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/3513.40_HPCJob.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/3513.40_5F00_HPCJob.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/3513.40_HPCJob.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/3513.40_5F00_HPCJob.jpg" alt="" width="625" height="426" border="0" /> </a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 40: how look like the multiplication </span><span style="font-size: small;">table at the end of running</span></p>
<p style="text-align: justify;">&nbsp;</p>
<p><br /> <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/7713.MultiplicationTable.xlsb" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/7713.MultiplicationTable.xlsb"> <img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2_5F00_Part2/3835.Excel.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2_5F00_Part2/3835.Excel.jpg" alt="" border="0" /> <strong><span style="font-size: medium;">MultiplicationTable.xlsb</span></strong></a>&nbsp;<br /><em><span style="font-size: medium;"><strong><span style="font-size: small;">Excel workbook enabled to run on Windows HPC</span></strong>.</span></em></p>
<h1>&nbsp;</h1>
<h1><span style="font-size: small;"><span style="font-size: large;"><strong><span style="font-size: small;">click here to <span style="font-size: large;"><strong><a href="http://blogs.msdn.com/b/faber/archive/2013/07/04/running-parallel-excel-on-windows-hpc-2008-r2-hosted-in-windows-azure-iaas-vms-part-3.aspx">Move to next blog-Part3</a></strong></span></span></strong></span></span></h1>
<h1><span style="font-size: small;"><span style="font-size: large;"><strong><span style="font-size: small;"><span style="font-size: large;"><strong><span style="font-size: small;">click here to <span style="font-size: large;"><strong><a href="http://blogs.msdn.com/b/faber/archive/2013/06/14/running-parallel-excel-on-windows-hpc-2008-r2-hosted-in-windows-azure-iaas-vms.aspx">Move to&nbsp;previous blog-Part1</a></strong></span></span></strong></span></span></strong></span></span></h1>
<h1>&nbsp;</h1>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Running parallel Excel on Windows HPC 2008 R2 hosted in Windows Azure IaaS VMs: Part 1</title>
      <link>https://docs.microsoft.com/archive/blogs/faber/running-parallel-excel-on-windows-hpc-2008-r2-hosted-in-windows-azure-iaas-vms-part-1</link>
      <pubDate>Fri, 14 Jun 2013 01:26:00 GMT</pubDate>
      <dc:creator><![CDATA[faberspot]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/faber/2013/06/14/running-parallel-excel-on-windows-hpc-2008-r2-hosted-in-windows-azure-iaas-vms-part-1/</guid>
      <description><![CDATA[click here to Move to next blog-Part2&nbsp;
1&nbsp; Introduction
This blog is the first episode of...]]></description>
      <content:encoded><![CDATA[<h1><span style="font-size: small;"><span style="font-size: large;"><strong><span style="font-size: small;">click here to <span style="font-size: large;"><strong><a href="http://blogs.msdn.com/b/faber/archive/2013/07/04/running-parallel-excel-on-windows-hpc-2008-r2-hosted-in-windows-azure-iaas-vms-part-2.aspx">Move to next blog-Part2</a></strong></span></span></strong></span></span>&nbsp;</h1>
<h1><span style="color: #000080;">1&nbsp; Introduction</span></h1>
<p style="text-align: justify;"><span style="font-size: small;">This blog is the first episode of a series on parallel Excel on Windows HPC, hosted in Windows Azure IaaS VMs. In the Part 1 described in this post is presented a guide to create a HPC cluster running in Windows Azure; following posts will be more related&nbsp;to&nbsp;build and&nbsp;run Excel workbooks in Windows HPC. The word &ldquo;cluster&rdquo; means different things in different contexts. With Windows HPC (High Performance Computing) Server, a cluster is a group of machines&mdash;physical or virtual &mdash;that act in a unified way to run parallel applications. In other terms, Windows HPC consists of several Windows servers networked together where each server in the cluster performs one or more specific tasks, under the coordination of unique administration. A Windows HPC cluster is based on two components: Windows Server OS and Microsoft HPC PACK (middleware). The HPC Pack is the set of software components which allows transforming a bunch independent hosts in HPC cluster.</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/8032.0A_HPC_SW.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/8032.0A_5F00_HPC_5F00_SW.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/8032.0A_HPC_SW.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/8032.0A_5F00_HPC_5F00_SW.jpg" alt="" width="529" height="188" border="0" /></a></p>
<p style="text-align: justify;"><span style="font-size: small;">In HPC cluster Windows OS and HPC Pack work together in tandem;&nbsp;associated with Windows 2008 R2 OS we have HPC Pack 2008 R2&nbsp;&nbsp;in different Service Pack:</span></p>
<ul>
<li>
<div style="text-align: justify;"><span style="font-family: courier new,courier; font-size: small;">HPC Pack 2008 R2&nbsp;&nbsp;&nbsp;&nbsp; : release <strong>3.0.2369.0</strong></span></div>
</li>
<li>
<div style="text-align: justify;"><span style="font-family: courier new,courier; font-size: small;">HPC Pack 2008 R2 -SP1: release <strong>3.1.3267.0</strong></span></div>
</li>
<li>
<div style="text-align: justify;"><span style="font-family: courier new,courier; font-size: small;">HPC Pack 2008 R2 -SP2: release <strong>3.2.3716.0</strong></span></div>
</li>
<li>
<div style="text-align: justify;"><span style="font-family: courier new,courier; font-size: small;">HPC Pack 2008 R2 -SP3: release <strong>3.3.3950.0</strong></span></div>
</li>
<li>
<div style="text-align: justify;"><span style="font-family: courier new,courier; font-size: small;">HPC Pack 2008 R2 -SP4: release <strong>3.4.4169.0</strong></span></div>
</li>
</ul>
<p style="text-align: justify;"><span style="font-size: small;">In installation of HPC Pack the administrator specifies the role of every host belonging to the HPC cluster:</span></p>
<ul>
<li style="text-align: justify;"><span style="font-size: small;"><strong>Head node</strong>: the entire cluster is managed by the head node (master of cluster); it handles scheduling, resource control and healthy. The head node software performs two primary functions:</span>
<ul>
<li><span style="font-size: small;"><strong>Job scheduling</strong>, which includes accepting jobs submitted by users, assigning those jobs to compute nodes, and monitoring their execution progress.&nbsp; The cluster&rsquo;s administrator can specify different scheduling policies based on job priorities and other factors.&nbsp;</span></li>
<li><span style="font-size: small;"><strong>Cluster&nbsp; management</strong>,&nbsp; which&nbsp; provides tools&nbsp; that let a&nbsp; cluster&nbsp; administrator&nbsp; create&nbsp; a&nbsp; cluster,&nbsp; monitor&nbsp; the cluster&rsquo;s operation, and run reports that summarize the cluster&rsquo;s behavior over a period of time.</span></li>
</ul>
</li>
</ul>
<ul>
<li style="text-align: justify;"><span style="font-size: small;"><strong>Compute Nodes</strong>: a set of multiple hosts to run jobs and SOA services applications.</span></li>
<li style="text-align: justify;"><span style="font-size: small;"><strong>Broker Node</strong>: SOA applications rely on a broker node to pass requests to services running on a cluster's compute. Broker node can run on the head node or on different node of HPC cluster.</span></li>
</ul>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/0675.0B_HPC_flow.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/0675.0B_5F00_HPC_5F00_flow.jpg"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/0675.0B_HPC_flow.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/0675.0B_5F00_HPC_5F00_flow.jpg" alt="" width="621" height="220" border="0" /></a></p>
<p style="text-align: justify;"><span style="font-size: small;">A Windows HPC cluster runs in a Windows Active Directory domain; this lets to integrate security and account management checking rights and identity of the user&nbsp;wants to run a parallel application.</span></p>
<p><span style="font-size: small;"><strong>Offloading Excel workbook calculation on Windows HPC cluster</strong></span></p>
<p style="text-align: justify;"><span style="font-size: small;">Microsoft Office Excel is a critical tool for business; as calculations and models become more complex, they require increasing amounts of time to execute on a desktop/laptop. One solution to reduce time of complex calculation in Excel workbook is to use Windows HPC Server 2008 R2 to scale up Office Excel 2010 calculations across multiple nodes in a Windows HPC cluster in parallel.</span></p>
<p style="text-align: justify;"><span style="font-size: small;">Windows HPC Pack includes a HPC Services for Excel able to offload calculations to a Windows HPC cluster. Through HPC Services for Excel multiple instance of same Excel 2010 workbook can run on Windows HPC cluster, where each instance runs an independent calculation or iteration of the same workbook with a different dataset. Many complex and long-running workbooks run <em>iteratively</em>&mdash;that is, they perform a single calculation many times over different sets of input data. These workbooks might include intensive mathematical calculations contained in multiple worksheets, or they might contain complex Microsoft Visual Basic for Applications (VBA) functions.</span></p>
<p style="text-align: justify;"><span style="font-size: small;">To run offloading Excel workbook on Windows HPC cluster is required installation of Office Excel 2010, in every node of the HPC cluster.</span></p>
<p><span style="line-height: 130%; font-size: small; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: AR-SA; mso-bidi-language: AR-SA;">This paper describes the steps required to create an Windows HPC 2008 R2 cluster running in Windows Azure IaaS VMs and the sequence to install Excel 2010 on Windows HPC cluster. In Annex are shown few Azure powershell scripts to delete and recreate all HPC cluster running in Azure IaaS VMs.</span></p>
<h1><span style="color: #000080;">2&nbsp; </span><span style="color: #000080;">HPC topology and naming</span></h1>
<p style="text-align: justify;"><span style="font-size: small;">First is described HPC topology, name convention, IP address to acquire an overall view of environment that we want to achieve. To keep the guide as simple as possible document use extensively screenshots that allows to repeat quickly the installation procedure without reading explanation and details. Structure of document respect the sequences of steps to drive the reader to a correct installation; with exceptions of few initial steps in Azure management portal required to prepare IaaS VMs, installation procedure of HPC Pack remains the same of the on-premises procedure.</span></p>
<p style="text-align: justify;"><span style="font-size: small;">In Figure 1 is shown the HPC cluster topology, IP Address and naming used to build the environment in Windows Azure</span>.</p>
<p style="text-align: center;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/8171.01_HPC_topology.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/8171.01_5F00_HPC_5F00_topology.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/8171.01_HPC_topology.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/8171.01_5F00_HPC_5F00_topology.jpg" alt="" width="721" height="338" border="0" /></a><br />Figure 1: HPC cluster topology</p>
<p style="text-align: justify;"><span style="font-size: small;">HPC cluster in created with 5 Windows Azure IaaS VMs:</span></p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="116">
<p><span style="background-color: #ffffff;"><strong>HPC Role</strong></span></p>
</td>
<td valign="top" width="94">
<p><span style="background-color: #ffffff;"><strong>OS</strong></span></p>
</td>
<td valign="top" width="90">
<p align="left"><span style="background-color: #ffffff;"><strong>HPC PACK version</strong></span></p>
</td>
<td valign="top" width="102">
<p><span style="background-color: #ffffff;"><strong>hostname</strong></span></p>
</td>
<td valign="top" width="96">
<p><span style="background-color: #ffffff;"><strong>IP Address</strong></span></p>
</td>
<td valign="top" width="121">
<p><span style="background-color: #ffffff;"><strong>Azure IaaS VM size</strong></span></p>
</td>
</tr>
<tr>
<td valign="top" width="116">
<p>Head Node (master)</p>
</td>
<td valign="top" width="94">
<p>Windows 2008 R2</p>
</td>
<td valign="top" width="90">
<p align="left">HPC PACK 2008R2-SP4</p>
</td>
<td valign="top" width="102">
<p>exhn001</p>
</td>
<td valign="top" width="96">
<p>10.1.1.4/24</p>
</td>
<td valign="top" width="121">
<p align="left">#2 Cores (Medium)</p>
</td>
</tr>
<tr>
<td valign="top" width="116">
<p>Compute Node (slave)</p>
</td>
<td valign="top" width="94">
<p>Windows 2008 R2</p>
</td>
<td valign="top" width="90">
<p align="left">HPC PACK 2008R2-SP4</p>
</td>
<td valign="top" width="102">
<p>excn001</p>
</td>
<td valign="top" width="96">
<p>10.1.1.5/24</p>
</td>
<td valign="top" width="121">
<p align="left">#8 Cores (Extra Large)</p>
</td>
</tr>
<tr>
<td valign="top" width="116">
<p>Compute Node (slave)</p>
</td>
<td valign="top" width="94">
<p>Windows 2008 R2</p>
</td>
<td valign="top" width="90">
<p align="left">HPC PACK 2008R2-SP4</p>
</td>
<td valign="top" width="102">
<p>excn002</p>
</td>
<td valign="top" width="96">
<p>10.1.1.6/24</p>
</td>
<td valign="top" width="121">
<p align="left">#8 Cores (Extra Large)</p>
</td>
</tr>
<tr>
<td valign="top" width="116">
<p>HPC client</p>
</td>
<td valign="top" width="94">
<p>Windows 2008 R2</p>
</td>
<td valign="top" width="90">
<p align="left">HPC PACK 2008R2-SP4</p>
</td>
<td valign="top" width="102">
<p>exhpclient001</p>
</td>
<td valign="top" width="96">
<p>10.1.1.7/24</p>
</td>
<td valign="top" width="121">
<p align="left">#2 Cores (Medium)</p>
</td>
</tr>
</tbody>
</table>
<p style="text-align: justify;"><span style="font-size: small;">HPC PACK 2008 R2-SP4 is the last version of Windows HPC PACK running on Windows 2008 R2 OS. The HPC head node in our configuration plays a double role: it is the Windows root domain controller and it works as master of HPC cluster. Configuration with AD DC and HPC head node collapsed in the same Azure VM works&nbsp;good in testing environment, but in production environment is strongly recommended to have roles running in different VMs, to maintain roles decoupled&nbsp;for security and consistency reasons.</span></p>
<p><span style="font-size: small;">During the deployment phase public IP address (VIP) are automatically assigned to each Azure IaaS VM (Figure 2).</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/2047.02_HPC_VIPs.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/2047.02_5F00_HPC_5F00_VIPs.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/2047.02_HPC_VIPs.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/2047.02_5F00_HPC_5F00_VIPs.jpg" alt="" width="679" height="290" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 2: mapping private IP address and public VIP</span></p>
<p><span style="font-size: small;">Here the list of steps described in the paper:</span></p>
<ul>
<li><span style="font-size: small;">Definite a new Affinity Group (named &ldquo;<strong>hpcaffinity</strong>&rdquo;) [3.1]</span></li>
<li><span style="font-size: small;">Define an Azure&nbsp;Virtual Network associated with the Affinity Group [3.2]</span></li>
<li><span style="font-size: small;">Create a Major network (named &ldquo;<strong>hpcMjorNet</strong>&rdquo;)</span></li>
<li><span style="font-size: small;">Create a subnet (named &ldquo;<strong>hpcSubNet</strong>&rdquo;)</span></li>
<li><span style="font-size: small;">Define a DNS for the VNET (named &ldquo;<strong>hpcdns</strong>&rdquo;)</span></li>
<li><span style="font-size: small;">Define a Storage account associate with Affinity Group (named &ldquo;<strong>exhpcstore</strong>&rdquo;) [3.3]</span></li>
<li><span style="font-size: small;">Create a new Azure IaaS VM, to run&nbsp; HPC head node connected to the <strong>hpcSubNet</strong> [3.4]</span></li>
<li><span style="font-size: small;">Promote the head node (exhn001) as forest root domain with integrated DNS[3.6]</span></li>
<li><span style="font-size: small;">Install windows HPC Pack 2008 R2-SP4 with head node role [4.1]</span></li>
<li><span style="font-size: small;">Configure the HPC cluster Network[4.1.1]</span></li>
<li><span style="font-size: small;">Add the Administrator of the HPC cluster [4.1.2]</span></li>
<li><span style="font-size: small;">Define a Node template to join a compute node to the HPC cluster [4.1.4]</span></li>
<li><span style="font-size: small;">Create three new Azure IaaS VMs: two Azure VMs for Compute Nodes and one Azure VM for the HPC client [3.5]</span></li>
<li><span style="font-size: small;">Promote head domain as Windows forest root domain [3.6]</span></li>
<li><span style="font-size: small;">Join the HPC Compute Nodes and the HPC client node to the Windows AD domain controller [3.7]</span></li>
<li><span style="font-size: small;">Install the HPC Pack on the HPC head node [4.1]</span></li>
<li><span style="font-size: small;">Define the HPC cluster topology [4.1.1]</span></li>
<li><span style="font-size: small;">Create a HPC Node Template to join Compute Node to the HPC cluster [4.1.4]</span></li>
<li><span style="font-size: small;">Add the compute nodes to the HPC cluster through HPC node template [4.2]</span></li>
<li><span style="font-size: small;">Change&nbsp;all compute nodes online</span></li>
<li><span style="font-size: small;">Specify the HPC sys parameters to customize HPC heat map</span></li>
<li><span style="font-size: small;">Create a shared folder on the head node [5]</span></li>
<li><span style="font-size: small;">Copy the Excel 2010 installation binary on the shared folder [6.1]</span></li>
<li><span style="font-size: small;">Generate file to execute an unattended Excel 2010 installation [6.2]</span></li>
<li><span style="font-size: small;">Run the Excel 20120 unattended installation on all HPC nodes (head node, compute nodes, HPC client)</span></li>
<li><span style="font-size: small;">Use the windows Azure powershell to remove/recreate the HPC cluster in IaaS VMs</span></li>
</ul>
<p>&nbsp;</p>
<h1><span style="color: #000080;">3&nbsp; </span><span style="color: #000080;">Azure setup</span></h1>
<p style="text-align: justify;"><span style="font-size: small;">In this chapter is shown all the preparation procedure in Windows Azure Management portal.</span></p>
<h2><span style="color: #000080;">3.1&nbsp;&nbsp; </span><span style="color: #000080;">Azure Affinity Group</span></h2>
<p style="text-align: justify;"><span style="font-size: small;">First operation in Azure Management portal is the creation of an affinity group. Affinity group is a logical group that allows to group the services that need to work together in order to achieve optimal performance.</span><br /><span style="font-size: small;">When you create an affinity group, it lets Windows Azure know to keep all of the services that belong to your affinity group running at the same data center cluster, reducing latency and increasing performance.&nbsp;</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/0456.03_HPC_AffinityGroup.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/0456.03_5F00_HPC_5F00_AffinityGroup.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/0456.03_HPC_AffinityGroup.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/0456.03_5F00_HPC_5F00_AffinityGroup.jpg" alt="" width="508" height="365" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 3: add a new affinity group</span></p>
<p><span style="font-size: small;">In definition of an Affinity Group an Azure datacenter Region needs to be specified (Figure 4)</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/8688.04_HPC_DefineAffinityGroup.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/8688.04_5F00_HPC_5F00_DefineAffinityGroup.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/8688.04_HPC_DefineAffinityGroup.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/8688.04_5F00_HPC_5F00_DefineAffinityGroup.jpg" alt="" width="342" height="232" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 4: define affinity group&nbsp;</span></p>
<p style="text-align: justify;"><span style="font-size: small;">Referencing the affinity group "<strong>hpcAffinity</strong>" we are sure that all related resources&nbsp;will run in West Europe Azure datacenter.&nbsp;</span></p>
<h2><span style="color: #000080;">3.2&nbsp;&nbsp;</span> <span style="color: #000080;">Azure VNET</span></h2>
<p style="text-align: justify;"><span style="font-size: small;">Creation of HPC cluster in Azure IaaS VMs requires a network segment to allow intercommunication between different HPC nodes; virtual segment in Azure is named as Azure Virtual Network (VNET).</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/0825.05_HPC_AzureVNET.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/0825.05_5F00_HPC_5F00_AzureVNET.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/0825.05_HPC_AzureVNET.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/0825.05_5F00_HPC_5F00_AzureVNET.jpg" alt="" width="497" height="270" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 5: add an Azure Virtual Network</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/2451.06_HPC_AzureVNET.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/2451.06_5F00_HPC_5F00_AzureVNET.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/2451.06_HPC_AzureVNET.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/2451.06_5F00_HPC_5F00_AzureVNET.jpg" alt="" width="352" height="260" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 6: association of affinity group to the VNET</span></p>
<p style="text-align: justify;"><span style="font-size: small;">We associate&nbsp;with the Azure VNET a major network 10.1.0.0/16 and a subnet 10.1.1.0/24 (Figure 7)</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/1854.07_HPC_AzureVNET.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/1854.07_5F00_HPC_5F00_AzureVNET.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/1854.07_HPC_AzureVNET.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/1854.07_5F00_HPC_5F00_AzureVNET.jpg" alt="" width="430" height="224" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 7: define major network and subnet associated&nbsp;with the Azure VNET</span></p>
<p style="text-align: justify;">Specify as DNS server for the Azure VNET (Figure 8); as general criteria naming resolution on the VNET is optional but presence of DNS server is required every time a domain controller is attached to the Azure VNET.</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/3146.08_HPC_AzureVNET.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/3146.08_5F00_HPC_5F00_AzureVNET.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/3146.08_HPC_AzureVNET.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/3146.08_5F00_HPC_5F00_AzureVNET.jpg" alt="" width="409" height="240" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 8: define a DNS server for the Azure VNET</span></p>
<p style="text-align: justify;"><span style="font-size: small;">If you create an Azure Virtual Network (VNET), name resolution will not work unless you provide your own DNS Server and set it up to allow dynamic updates. You cannot use public DNS Services to provide DNS name resolution for Windows Azure Virtual Network. To have a correct naming resolution you must start without VMs in attach to the VNET, because you cannot change DNS Server IP Address once VNet has running Virtual Machines in it.</span></p>
<ul>
<li><span style="font-size: small;">Create the VNET as usual (and its subnets)</span></li>
<li><span style="font-size: small;">Provide DNS Server address. Set this address to be 10.1.1.4 (.4 <span style="color: #000080;"><em>will always be the first IP Address assigned in a given SubNet of your VNET!!</em></span>)</span></li>
<li><span style="font-size: small;">On that&nbsp; VNET, create the first VM with Windows Server. That VM will get 10.1.1.4 IP Address</span></li>
<li><span style="font-size: small;">Promote the VM as Active Directory root domain (AD DC), adding the DNS Server Role to the virtual machine</span></li>
<li><span style="font-size: small;">DO NOT SET STATIC IP ADDRESS OF THIS MACHINE!</span></li>
<li><span style="font-size: small;">Create rest of the VMs as usual (with dynamic IP address on network interface)</span></li>
</ul>
<p style="text-align: justify;"><span style="font-size: small;">Things to be aware of:</span></p>
<ul>
<ul>
<li><span style="font-size: small;"><strong>Never assign static IP Addresses</strong> to any IaaS VM in Windows Azure: they must have DHCP allocated IP Addresses</span></li>
<li><span style="font-size: small;">Be careful to <strong>first create the AD DC&nbsp; with DNS Role</strong>, so that it gets .4 IP Address</span></li>
<li><span style="font-size: small;"><strong>Your DNS VM will preserve its IP Address</strong> (.4) as long as you do not DELETE it.</span></li>
</ul>
</ul>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/5224.09_HPC_AzureVNET.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/5224.09_5F00_HPC_5F00_AzureVNET.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/5224.09_HPC_AzureVNET.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/5224.09_5F00_HPC_5F00_AzureVNET.jpg" alt="" width="409" height="240" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 9: successful creation of Azure VNET</span></p>
<h2><span style="color: #000080;">3.3&nbsp;&nbsp; Create a storage account in the Affinity Group</span></h2>
<p style="text-align: justify;"><span style="font-size: small;">The Virtual Disks of Azure IaaS VM are stored in Azure Storage blobs, therefore we define an Azure Storage account (Figure 10).</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/8688.10_HPC_AzureStorageAccount.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/8688.10_5F00_HPC_5F00_AzureStorageAccount.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/8688.10_HPC_AzureStorageAccount.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/8688.10_5F00_HPC_5F00_AzureStorageAccount.jpg" alt="" width="394" height="252" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 10: add a new Azure Storage account</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/3146.11_HPC_AzureStorageAccount.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/3146.11_5F00_HPC_5F00_AzureStorageAccount.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/3146.11_HPC_AzureStorageAccount.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/3146.11_5F00_HPC_5F00_AzureStorageAccount.jpg" alt="" width="536" height="197" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 11: define public URL per the storage account and geo-replication option</span></p>
<p style="text-align: justify;"><span style="font-size: small;">With geo-replication, Windows Azure Storage keeps your data durable in two locations (primary and secondary) of the same Azure Region. The secondary location is automatically determined based on the location of the primary.</span></p>
<h2><span style="color: #000080;">3.4&nbsp;&nbsp; </span><span style="color: #000080;">Create the IaaS VM to host the HPC head node</span></h2>
<p style="text-align: justify;"><span style="font-size: small;">&nbsp;To create the IaaS VM, on the Azure management portal select <strong>Virtual Machines</strong> and click-on "<strong>CREATE A VIRTUAL MACHINE</strong>"&nbsp;</span><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/0044.12_HPC_IaaS_VM.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/0044.12_5F00_HPC_5F00_IaaS_5F00_VM.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/0044.12_HPC_IaaS_VM.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/0044.12_5F00_HPC_5F00_IaaS_5F00_VM.jpg" alt="" width="383" height="245" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 12: add a new Azure IaaS VM</span></p>
<p>&nbsp;<span style="font-size: small;">Select the option "<strong>FROM GALLERY</strong>" to start the VM from the list of predefined image create by Microsoft (Figure 13)</span><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/2553.13_HPC_IaaS_VM.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/2553.13_5F00_HPC_5F00_IaaS_5F00_VM.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/2553.13_HPC_IaaS_VM.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/2553.13_5F00_HPC_5F00_IaaS_5F00_VM.jpg" alt="" width="452" height="188" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 13: take the image from Azure VMs library</span></p>
<p style="text-align: justify;">&nbsp;<span style="font-size: small;">Choose the "<strong>Windows Server 2008 R2 SP1</strong>" image (Figure 14)</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/4477.14_HPC_IaaS_VM.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/4477.14_5F00_HPC_5F00_IaaS_5F00_VM.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/4477.14_HPC_IaaS_VM.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/4477.14_5F00_HPC_5F00_IaaS_5F00_VM.jpg" alt="" width="409" height="240" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 14: selection of OS image to be used in the installation</span></p>
<p>&nbsp;<span style="font-size: small;">Specify the hostname and the size of the VM (Figure 15)&nbsp;</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/1205.15_HPC_IaaS_VM.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/1205.15_5F00_HPC_5F00_IaaS_5F00_VM.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/1205.15_HPC_IaaS_VM.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/1205.15_5F00_HPC_5F00_IaaS_5F00_VM.jpg" alt="" width="391" height="351" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 15: define hostname, administration password and size of the IaaS VM</span></p>
<p>&nbsp;<span style="font-size: small;">In the last step of wizard, specify public URL name (field DNS name), the Azure Storage Account (exhpcstore) used to store VM Hard Disk and the subnet (hpcNet) where VM need to be connected.</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/6567.16_HPC_IaaS_VM.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/6567.16_5F00_HPC_5F00_IaaS_5F00_VM.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/6567.16_HPC_IaaS_VM.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/6567.16_5F00_HPC_5F00_IaaS_5F00_VM.jpg" alt="" width="417" height="290" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 16: <span style="line-height: 130%; font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: AR-SA; mso-bidi-language: AR-SA; mso-bidi-font-size: 12.0pt;">define parameter for the VM</span></span></p>
<p><span style="font-size: small;">At the end of deployment, the HPC head node VM is in <strong>Running</strong> (Figure 17).</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/8512.17_HPC_IaaS_VM.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/8512.17_5F00_HPC_5F00_IaaS_5F00_VM.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/8512.17_HPC_IaaS_VM.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/8512.17_5F00_HPC_5F00_IaaS_5F00_VM.jpg" alt="" width="572" height="188" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 17: head node VM in running status</span></p>
<h2><span style="color: #000080;">3.5&nbsp;&nbsp; </span><span style="color: #000080;">Create the IaaS VMs to host compute nodes and client</span></h2>
<p style="text-align: justify;"><span style="font-size: small;">Every IaaS VM use a page blob to store own virtual hard disk. From performance prospective, every storage account has a max number of I/O per seconds. To avoid exceeding I/O limit in single storage account we can distribute different Virtual Disks in different Azure Storage accounts; the approach allow to distribute I/O on different Azure Storage Account.</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/1425.18_HPC_StorageAccounts.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/1425.18_5F00_HPC_5F00_StorageAccounts.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/1425.18_HPC_StorageAccounts.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/1425.18_5F00_HPC_5F00_StorageAccounts.jpg" alt="" width="409" height="240" border="0" /></a></p>
<p align="center">&nbsp;</p>
<p style="text-align: center;"><span style="font-size: small;">Figure 18: usage of multiple storage account to distribute I/O load</span></p>
<p><span style="font-size: small;">To create HPC Compute Nodes (excn001, excn002) and HPC client (exhpclient001) we can use the procedure described in paragraphs 3.3 and 3.4</span></p>
<p><span style="font-size: small;">In Figure 19 we have the view of all Azure IaaS VMs.</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/7585.19_HPC_IaaS_VM.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/7585.19_5F00_HPC_5F00_IaaS_5F00_VM.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/7585.19_HPC_IaaS_VM.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/7585.19_5F00_HPC_5F00_IaaS_5F00_VM.jpg" alt="" width="533" height="212" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 19: view of all IaaS VMs</span></p>
<p>&nbsp;</p>
<h2><span style="color: #000080;">3.6&nbsp;&nbsp; </span><span style="color: #000080;">Add root domain controller role</span></h2>
<p><span style="font-size: small;">Via RDP, login as local Administrator account in the HPC Head Node, open Server Manager and add a new Windows 2008R2 Role:</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/2626.20_HPC_IaaS_VM.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/2626.20_5F00_HPC_5F00_IaaS_5F00_VM.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/2626.20_HPC_IaaS_VM.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/2626.20_5F00_HPC_5F00_IaaS_5F00_VM.jpg" alt="" width="572" height="252" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 20: on the HPC head node add a new Windows Role</span></p>
<p style="text-align: justify;"><span style="font-size: small;">In the&nbsp;Server Role list choose "<strong>Active Directory Domain Services</strong>" (Figure 21)</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/7840.21_HPC_DC.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/7840.21_5F00_HPC_5F00_DC.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/7840.21_HPC_DC.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/7840.21_5F00_HPC_5F00_DC.jpg" alt="" width="388" height="332" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 21: add Windows Role for AD Domain Controller election</span></p>
<p><span style="font-size: small;">Open the command line and run the command <strong>dcpromo /adv</strong> (see Figure 22) to promote the node as AD domain controller.</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/3443.22_HPC_DC.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/3443.22_5F00_HPC_5F00_DC.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/3443.22_HPC_DC.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/3443.22_5F00_HPC_5F00_DC.jpg" alt="" width="348" height="112" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 22: command to promote domain controller</span></p>
<p>&nbsp;</p>
<p><span style="font-size: small;">Select the option to create a new Active Directory root forest domain (as shown in Figure 23).</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/0317.24_HPC_DC.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/0317.24_5F00_HPC_5F00_DC.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/0317.24_HPC_DC.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/0317.24_5F00_HPC_5F00_DC.jpg" alt="" width="476" height="224" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 23: option to promote a root domain</span></p>
<p>&nbsp;</p>
<p style="text-align: justify;"><span style="font-size: small;">Specify <strong>exhpc.net</strong> as FQDN for the&nbsp;root domain (Figure 24)</span><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/0317.24_HPC_DC.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/0317.24_5F00_HPC_5F00_DC.jpg" alt="" width="444" height="200" border="0" />&nbsp;</p>
<p style="text-align: center;"><span style="font-size: small;">Figure 24: FQDN for the root forest domain</span></p>
<p><span style="font-size: small;">Specify as forest function level "<strong>Windows Server 2008 R2</strong>" (Figure 25)</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/2262.25_HPC_DC.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/2262.25_5F00_HPC_5F00_DC.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/2262.25_HPC_DC.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/2262.25_5F00_HPC_5F00_DC.jpg" alt="" width="452" height="269" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 25: forest functional level</span></p>
<p><span style="font-size: small;">Add the DNS role to the Domain Controller</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/5824.26_HPC_DC.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/5824.26_5F00_HPC_5F00_DC.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/5824.26_HPC_DC.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/5824.26_5F00_HPC_5F00_DC.jpg" alt="" width="460" height="272" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 26: add DNS server to the domain controller</span></p>
<p><span style="font-size: small;">At the end of the procedure Role, wizard asks for server reboot.</span></p>
<h2><span style="color: #000080;">3.7&nbsp;&nbsp;</span> <span style="color: #000080;">Join the compute nodes and the client to the domain controller</span></h2>
<p style="text-align: justify;"><span style="font-size: small;">Via RDP connect as administrator to every compute node, and join the node to the Windows root domain (exhn001), with FQDN: <strong>exhpc.net</strong></span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/5466.27_HPC_DC.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/5466.27_5F00_HPC_5F00_DC.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/5466.27_HPC_DC.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/5466.27_5F00_HPC_5F00_DC.jpg" alt="" width="504" height="348" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 27: joining excn001 and excn002 to the exhpc windows domain</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/6523.28_HPC_NodesJoin.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/6523.28_5F00_HPC_5F00_NodesJoin.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/6523.28_HPC_NodesJoin.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/6523.28_5F00_HPC_5F00_NodesJoin.jpg" alt="" width="292" height="168" border="0" /></a>&nbsp;</p>
<p style="text-align: center;"><span style="font-size: small;">Figure 28: join nodes to the domain controller exhn001</span></p>
<p style="text-align: justify;"><span style="font-size: small;">&nbsp;At this stage we have all&nbsp;Azure IaaS VMs joined to the same AD root domain.&nbsp;</span></p>
<h1><span style="color: #000080;">4&nbsp; </span><span style="color: #000080;">Windows HPC 2008 R2 PACK installation</span></h1>
<p style="text-align: justify;"><span style="font-size: small;">Here is described the procedure to install the Windows HPC 2008 R2 PACK.</span></p>
<h2><span style="color: #000080;">4.1&nbsp;&nbsp;</span> <span style="color: #000080;">Configure the HPC head node</span></h2>
<p style="text-align: justify;"><span style="font-size: small;">Login to the head node as domain administrator and run <strong>seup.exe</strong> of &ldquo;<strong><span style="text-decoration: underline;">HPC PACK 2008 R2 &ndash;SP4"</span></strong> software package, therefore select the HPC Pack 2008 R2 Enterprise package (Figure 29).</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/1401.29_HPC_PACK.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/1401.29_5F00_HPC_5F00_PACK.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/1401.29_HPC_PACK.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/1401.29_5F00_HPC_5F00_PACK.jpg" alt="" width="420" height="364" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 29: installation HPC Pack 2008 R2 Enterprise Edition on the head node</span></p>
<p style="text-align: justify;"><span style="font-size: small;">Specify the HPC role you want to install; as first role we install the head node (Figure 30).</span><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/1016.30_HPC_PACK.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/1016.30_5F00_HPC_5F00_PACK.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/1016.30_HPC_PACK.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/1016.30_5F00_HPC_5F00_PACK.jpg" alt="" width="428" height="368" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 30: option to install the head node</span></p>
<p><span style="font-size: small;">In installation of HPC&nbsp;head node you need to&nbsp;set the HPC databases. SQL Server Database can be installed&nbsp;as two&nbsp;alternative options: locally on the head node or on Remote SQL server (Figure 31)</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/7752.31_HPC_PACK.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/7752.31_5F00_HPC_5F00_PACK.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/7752.31_HPC_PACK.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/7752.31_5F00_HPC_5F00_PACK.jpg" alt="" width="407" height="319" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 31: option to install HPC databases on the head node</span></p>
<p style="text-align: justify;"><span style="font-size: small;">List of SW components required to install HPC Pack on the head node (Figure 32)</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/3731.32_HPC_PACK.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/3731.32_5F00_HPC_5F00_PACK.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/3731.32_HPC_PACK.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/3731.32_5F00_HPC_5F00_PACK.jpg" alt="" width="407" height="343" border="0" /></a></p>
<p>&nbsp;<span style="font-size: small;">Figure 32: list of SW components required for the HPC head node</span></p>
<p style="text-align: justify;"><span style="font-size: small;">After installing HPC Pack we can begin with the head node configuration using the HPC Cluster Manager Console. In Figure 33 is shown the HPC version</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/2703.33_HPC_PACK.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/2703.33_5F00_HPC_5F00_PACK.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/2703.33_HPC_PACK.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/2703.33_5F00_HPC_5F00_PACK.jpg" alt="" width="310" height="148" border="0" /></a></p>
<p style="text-align: center;">Figure 33: software version of windows HPC Pack 2008 R2-SP4</p>
<h3><span style="color: #000080;">4.1.1&nbsp;&nbsp;&nbsp;</span> <span style="color: #000080;">Configure the HPC cluster network</span></h3>
<p><span style="font-size: small;">After installing HPC Pack open the Windows HPC cluster manager console, a <strong>To-do List </strong>appears.</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/1423.34_HPC_PACK.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/1423.34_5F00_HPC_5F00_PACK.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/1423.34_HPC_PACK.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/1423.34_5F00_HPC_5F00_PACK.jpg" alt="" width="401" height="271" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 34: select Configure your network in the To-do List</span></p>
<p style="text-align: justify;"><span style="font-size: small;">Click-on &ldquo;<strong>Configure your network</strong>&rdquo; and choice the topology classified as Topology #5: &ldquo;<strong>All nodes only on an enterprise network</strong>&rdquo; (Figure 35).</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/3527.35_HPC_PACK.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/3527.35_5F00_HPC_5F00_PACK.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/3527.35_HPC_PACK.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/3527.35_5F00_HPC_5F00_PACK.jpg" alt="" width="527" height="360" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 35: choice topology 5 for the HPC grid</span></p>
<p><span style="font-size: small;">Select which NIC connected to the Azure VNET (Figure 36)</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/7737.36_HPC_PACK.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/7737.36_5F00_HPC_5F00_PACK.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/7737.36_HPC_PACK.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/7737.36_5F00_HPC_5F00_PACK.jpg" alt="" width="462" height="324" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 36: select Virtual NIC on the head node</span></p>
<p><span style="font-size: small;">Virtual network in Azure is isolated (not accessible in internet) therefore we can disable&nbsp;Firewall filtering on every&nbsp;HPC node&nbsp;(Figure 37)</span></p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/5460.37_HPC_PACK.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/5460.37_5F00_HPC_5F00_PACK.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/5460.37_HPC_PACK.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/5460.37_5F00_HPC_5F00_PACK.jpg" alt="" width="556" height="368" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 37: group policy to disable the Windows firewall on all HPC nodes</span></p>
<p>&nbsp;</p>
<h3><span style="color: #000080;">4.1.2&nbsp;&nbsp;&nbsp; </span><span style="color: #000080;">Configure the administrator credential to manage the HPC cluster</span></h3>
<p><span style="font-size: small;">Next step to proceed in the HPC installation is the setting of administrator of HPC cluster credentials (Figure 38); this&nbsp;AD DC account&nbsp;is used for:</span></p>
<ul>
<li><span style="font-size: small;">installing the operating system, applications on HPC nodes,</span></li>
<li><span style="font-size: small;">adding HPC nodes to the Active Directory domain,</span></li>
<li><span style="font-size: small;">running HPC diagnostic tests on the cluster nodes</span>.</li>
</ul>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/7851.38_HPC_PACK.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/7851.38_5F00_HPC_5F00_PACK.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/7851.38_HPC_PACK.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/7851.38_5F00_HPC_5F00_PACK.jpg" alt="" width="468" height="368" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 38: insert credential to administer the HPC cluster</span></p>
<p style="text-align: justify;"><span style="font-size: small;">When Installation Credentials dialog box appears, type the user name, including the domain (DOMAIN\User). If the administrator password is changed later, the new credentials must be provided again, otherwise some operations and tests will fail.</span></p>
<h3><span style="color: #000080;">4.1.3&nbsp;&nbsp;&nbsp; </span><span style="color: #000080;">Configuring naming assignment</span></h3>
<p style="text-align: justify;"><span style="font-size: small;">A naming convention is required for compute nodes booting up&nbsp;from baremental &ndash;PXE boot (Figure 39).</span></p>
<p style="text-align: justify;"><span style="font-size: small;">This information is mandatory to proceed but it is not used in our setup because all OS of HPC compute nodes are manually installed.</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/communityserver/blogs/components/weblogfiles/5732.39_HPC_PACK.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/5732.39_5F00_HPC_5F00_PACK.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/5732.39_HPC_PACK.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/5732.39_5F00_HPC_5F00_PACK.jpg" alt="" width="428" height="364" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 39: assign a naming convention to deploy compute nodes with baremental installation</span></p>
<h3>4.1.4&nbsp;&nbsp;&nbsp; <span style="color: #000080;">Add a node template</span></h3>
<p style="text-align: justify;"><span style="font-size: small;">Now is time to create an HPC node template to define a list of policies to be applied on&nbsp;new compute node to success joining a new HPC compute node to the cluster.. In the <strong>To-do List</strong> click on <strong>Create a</strong> <strong>Node template </strong>(fig40)<strong>;</strong>&nbsp;a wizard&nbsp;helps to right configure the list of policies.</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/5432.40_HPC_PACK.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/5432.40_5F00_HPC_5F00_PACK.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/5432.40_HPC_PACK.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/5432.40_5F00_HPC_5F00_PACK.jpg" alt="" width="507" height="378" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 40: specify a name for the new node template</span></p>
<p><span style="font-size: small;">Our goal is to create a node template that can be used to deploy compute nodes with OS&nbsp;already been installed; for this reason choice the option in node template &ldquo;<strong>Without operating system</strong>&rdquo; (Figure 41)</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/3414.41_HPC_PACK.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/3414.41_5F00_HPC_5F00_PACK.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/3414.41_HPC_PACK.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/3414.41_5F00_HPC_5F00_PACK.jpg" alt="" width="577" height="344" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 41: specify the type of node template</span></p>
<p style="text-align: justify;"><span style="font-size: small;">We do not include&nbsp;any&nbsp;windows update/patches in the policy (further updates and fixes can be done later) (Figure 42)</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/2728.42_HPC_PACK.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/2728.42_5F00_HPC_5F00_PACK.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/2728.42_HPC_PACK.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/2728.42_5F00_HPC_5F00_PACK.jpg" alt="" width="647" height="286" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 42: no updates are included in the node template</span></p>
<p>&nbsp;<span style="font-size: small;">Completion of <strong>Deployment To-do-List</strong>&nbsp;(Figure 43) gives&nbsp;fully access to all options of HPC Management Console.&nbsp;</span><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/4503.43_HPC_PACK.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/4503.43_5F00_HPC_5F00_PACK.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/4503.43_HPC_PACK.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/4503.43_5F00_HPC_5F00_PACK.jpg" alt="" width="668" height="308" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 43: HPC Management console after completing node template</span></p>
<p>&nbsp;</p>
<p><span style="font-size: small;">To customize the HPC Heat Map, goes to &ldquo;<strong>Node Management</strong>&rdquo;, select the head node right click-on mouse and choose &ldquo;<strong>Customize Tab&hellip;</strong>&rdquo; (Figure 44)</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/8540.44_HPC_PACK.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/8540.44_5F00_HPC_5F00_PACK.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/8540.44_HPC_PACK.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/8540.44_5F00_HPC_5F00_PACK.jpg" alt="" width="504" height="227" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 44: heat map Customize Tab</span></p>
<p style="text-align: justify;"><span style="font-size: small;">We can monitor in real time up to three system parameters (Figure 45)</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/0576.45_HPC_PACK.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/0576.45_5F00_HPC_5F00_PACK.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/0576.45_HPC_PACK.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/0576.45_5F00_HPC_5F00_PACK.jpg" alt="" width="407" height="388" border="0" /></a></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 45: HPC system parameters included in Heat Map monitoring</span></p>
<p>&nbsp;</p>
<h2><span style="font-size: small;"><span style="color: #000080;">4.2&nbsp;&nbsp; </span><span style="color: #000080;">Add a Compute Node to the Windows HPC cluster</span></span></h2>
<p style="text-align: justify;"><span style="font-size: small;">After creation of Node template, we&nbsp;are ready&nbsp;to install Windows HPC pack on every the compute node.&nbsp; Login&nbsp;in compute node with domain administrator account and run <strong>setup.exe</strong> in &ldquo;<strong><span style="text-decoration: underline;">HPC PACK 2008 R2 Enterprise</span></strong>&rdquo; package to start the installation on the compute node role. Select the option to install <strong>HPC Pack 2008 R2 Enterprise </strong>package.</span></p>
<p style="text-align: center;"><span style="font-size: small;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/1588.46_HPC_PACK.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/1588.46_5F00_HPC_5F00_PACK.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/1588.46_HPC_PACK.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/1588.46_5F00_HPC_5F00_PACK.jpg" alt="" width="425" height="365" border="0" /></a>&nbsp;Figure 46: HPC Pack 2008 R2 Enterprise to install the compute node</span></p>
<p>&nbsp;</p>
<p style="text-align: justify;"><span style="font-size: small;">therefore the option to join the new compute node&nbsp;to an existing &nbsp;HPC cluster&nbsp; (Figure 47)</span></p>
<p style="text-align: center;"><span style="font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/1680.47_HPC_PACK.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/1680.47_5F00_HPC_5F00_PACK.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/1680.47_HPC_PACK.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/1680.47_5F00_HPC_5F00_PACK.jpg" alt="" width="428" height="344" border="0" /></a>&nbsp;Figure 47: option to join a new compute node to a cluster</span></p>
<p><span style="font-size: small;">&nbsp;in the list of available head node select exhn001(Figure 48)</span></p>
<p style="text-align: center;"><span style="font-size: small;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/2260.48_HPC_PACK.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/2260.48_5F00_HPC_5F00_PACK.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/2260.48_HPC_PACK.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/2260.48_5F00_HPC_5F00_PACK.jpg" alt="" width="433" height="224" border="0" /></a></span><span style="font-size: small;">&nbsp;Figure 48: select in the list box the name of the head node</span></p>
<p style="text-align: justify;" align="center"><span style="font-size: small;">Proceed with the installation of all software component required to create the HCP compute node role.</span></p>
<p><span style="font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/3782.49_HPC_PACK.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/3782.49_5F00_HPC_5F00_PACK.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/3782.49_HPC_PACK.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/3782.49_5F00_HPC_5F00_PACK.jpg" alt="" width="430" height="276" border="0" /></a></span></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 49: stat the installation SW components on the compute node</span></p>
<p>&nbsp;</p>
<p style="text-align: justify;"><span style="font-size: small;">At the end of HPC PACK installation on compute node,&nbsp;the node&nbsp;appears automatically in the HPC Management console with <strong>Node State</strong> and <strong>Node Heath</strong> in <strong>Unknown</strong> state (Figure 50);&nbsp;<strong>Unknown</strong> state&nbsp;is normal because the head node doesn't yet applied the policies required to admit the compute node in the cluster.</span></p>
<p><span style="font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/6712.50_HPC_PACK.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/6712.50_5F00_HPC_5F00_PACK.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/6712.50_HPC_PACK.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/6712.50_5F00_HPC_5F00_PACK.jpg" alt="" width="700" height="164" border="0" /></a></span></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 50: new compute node appears in in unknown state in the HPC management console</span></p>
<p>&nbsp;</p>
<h2><span style="font-size: small;"><span style="color: #000080;">4.2.1&nbsp;&nbsp;</span> <span style="color: #000080;">Assign a node template to the compute node</span></span></h2>
<p style="text-align: justify;"><span style="font-size: small;">Select the node in <strong>Unknown state</strong> and&nbsp; click-on &ldquo;<strong>Assign a node template</strong>&rdquo;&nbsp; (Figure 51)</span></p>
<p><span style="font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/4555.51_HPC_PACK.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/4555.51_5F00_HPC_5F00_PACK.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/4555.51_HPC_PACK.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/4555.51_5F00_HPC_5F00_PACK.jpg" alt="" width="500" height="336" border="0" /></a></span></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 51: assign a specific node template to a node in unknown state</span></p>
<p><span style="font-size: small;">Specify the node template called <strong>ComputeNodeTemplate </strong>(that we have created before); in the&nbsp;&ldquo;<strong>Provisioning Log</strong>&rdquo; tab you can monitor progress of applying Node Template to the compute node. At the end of operation&nbsp;the new compute nodes&nbsp;is joint to the HPC cluster in <strong>OFFLINE </strong>state (that means that nodes cannot receive jobs). Select the compute node, right-click with mouse and choice &ldquo;<strong>BRING ONLINE</strong>&rdquo; to move the compute node in <strong>ONLINE </strong>state. Repeating the same operation for all compute nodes we have the HPC cluster up and running (Figure 52).</span></p>
<p><span style="font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/8228.52_HPC_PACK.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/8228.52_5F00_HPC_5F00_PACK.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/8228.52_HPC_PACK.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/8228.52_5F00_HPC_5F00_PACK.jpg" alt="" width="691" height="130" border="0" /></a></span></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 52: HPC grid after joining all compute nodes to the head node</span></p>
<p>&nbsp;</p>
<p><span style="font-size: small;"><strong><em>NOTE</em></strong></span></p>
<p style="text-align: justify;"><span style="font-size: small;">In production is good practice to de-assign the role of compute node to the head node leaving to the head node&nbsp;the primary goal to execute management tasks and monitor only. Select the head node, move the node in&nbsp;OFFLINE state, right click on mouse and select &ldquo;<strong>Role</strong>&rdquo;, therefore <span style="text-decoration: underline;">deselect</span> the &ldquo;<strong>Compute Node</strong>&rdquo; option (Figure 53).&nbsp;</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/4338.53_HPC_PACK.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/4338.53_5F00_HPC_5F00_PACK.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/4338.53_HPC_PACK.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/4338.53_5F00_HPC_5F00_PACK.jpg" alt="" width="449" height="252" border="0" /></a></p>
<p align="center"><span style="font-size: small;">Figure 53: change role on the head node</span></p>
<p style="text-align: justify;"><span style="font-size: small;">&nbsp;After applying of node template, the two compute node (excn001, excn002) are joined to the cluster and the Heat Map is able to show system parameters (Figure 54)</span></p>
<p><span style="font-size: small;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/2146.54_HPC_PACK.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/2146.54_5F00_HPC_5F00_PACK.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/2146.54_HPC_PACK.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/2146.54_5F00_HPC_5F00_PACK.jpg" alt="" width="522" height="281" border="0" /></a></span></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 54: HPC heat map</span></p>
<h1 align="left"><span style="font-size: x-large;"><span style="color: #000080;">5&nbsp;</span> <span style="color: #000080;">Create a shared folder on the head node</span></span></h1>
<p style="text-align: justify;"><span style="font-size: small;">To run parallel workloads is required to have a shared folder accessible to HPC head node and all HPC compute nodes; this shared folder can be created for example on the head node. In our setup we create a folder named share with change the folder properties in Shared, so any compute node can access in.</span></p>
<h1 align="left"><span style="font-size: x-large;"><span style="color: #000080;">6&nbsp; </span><span style="color: #000080;">Custom installation of Excel 2010</span></span></h1>
<p align="left"><span style="font-size: small;">In order to run Excel workbooks on the HPC&nbsp;luster you must install Excel 2010 in every HPC node. Executing remote UDFs does not run Excel on the cluster&rsquo;s compute nodes and therefore does not require this step. Office 2010 has great support for doing all kinds of customized unattended installations. You can find detailed documentation on TechNet at: <a href="http://technet.microsoft.com/en-us/library/ee656739.aspx">http://technet.microsoft.com/en-us/library/ee656739.aspx</a></span></p>
<p><span style="font-size: small;">Below a step-by-step guideline for Excel custom installation.</span></p>
<h2 align="left"><span style="font-size: small;">6.1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000080;">Copy the Office 2010 installation to a shared directory</span></span></h2>
<p class="Default"><span style="font-size: small;">First, copy the Office 2010 setup to a network install point where all the compute nodes can access it. The head node is usually convenient for this i.e. <a href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/'">\\exhn001\share\Office2010\</a></span></p>
<h2 align="left"><span style="font-size: small;">6.2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000080;">&nbsp;Create a procedure to execute Excel 2010 unattended installation</span></span></h2>
<p style="text-align: justify;" align="left"><span style="font-size: small;">Next, we will customize the installation so only Excel is installed and the process is completely unattended.</span></p>
<ol>
<li style="text-align: justify;"><span style="font-size: small;">From the share you created, run &ldquo;<strong>setup /admin</strong>&rdquo; (Figure 55). This will bring up&nbsp;&nbsp;the Office Customization Tool.&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/7206.55_HPC_Office.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/7206.55_5F00_HPC_5F00_Office.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/7206.55_HPC_Office.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/7206.55_5F00_HPC_5F00_Office.jpg" alt="" width="324" height="128" border="0" /></a></span></li>
</ol>
<p style="text-align: center;"><span style="font-size: small;">Figure 55:&nbsp;&nbsp;Run setup in administrative mode</span></p>
<ol start="2">
<li style="text-align: justify;"><span style="font-size: small;">Select &ldquo;<strong>Create a</strong> <strong>new Setup customization</strong> <strong>file for the following product</strong> (Figure 56):</span></li>
</ol>
<p><span style="font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/7331.56_HPC_Office.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/7331.56_5F00_HPC_5F00_Office.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/7331.56_HPC_Office.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/7331.56_5F00_HPC_5F00_Office.jpg" alt="" width="465" height="268" border="0" /></a></span></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 56&nbsp;:&nbsp;create a new custom setup</span></p>
<p>&nbsp;</p>
<ol>
<li style="text-align: justify;"><span style="font-size: small;"><strong>Licensing and User interface</strong> &ndash; Type in your volume license key here. Also check the box to accept the EULA and change the &ldquo;<strong>Display level</strong>&rdquo; to <strong>Basic</strong> (or &ldquo;<strong>None</strong>&rdquo;) (see Figure 57)</span></li>
</ol>
<p><span style="font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/8231.57_HPC_Office.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/8231.57_5F00_HPC_5F00_Office.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/8231.57_HPC_Office.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/8231.57_5F00_HPC_5F00_Office.jpg" alt="" width="484" height="316" border="0" /></a></span></p>
<p class="Default" style="text-align: center;"><span style="font-size: small;">Figure 57:&nbsp;accept the license agreement</span></p>
<p class="Default" style="text-align: justify;">&nbsp;</p>
<ol start="4">
<li style="text-align: justify;"><span style="font-size: small;"><strong>Features\Set feature installation states</strong> &ndash; We only want Excel, so change everything else to Not Available. Also, under Excel Add-ins, change the add-ins to be either <strong>Run from My Computer</strong> or <strong>Not Available (</strong>Figure 58<strong></strong><strong>)</strong>. If you are going to be running any VBA macros you need to install Visual Basic for Applications under the <strong>Office Shared Features</strong> (Figure 59).</span></li>
</ol>
<p><span style="font-size: small;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/3644.58_HPC_Office.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/3644.58_5F00_HPC_5F00_Office.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/3644.58_HPC_Office.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/3644.58_5F00_HPC_5F00_Office.jpg" alt="" width="484" height="332" border="0" /></a></span></p>
<p style="text-align: center;" align="left"><span style="font-size: small;">&nbsp;Figure 58:&nbsp;change all non Excel features to &ldquo;Not Available&rdquo;</span></p>
<p><span style="font-size: small;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/3051.59_HPC_Office.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/3051.59_5F00_HPC_5F00_Office.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/3051.59_HPC_Office.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/3051.59_5F00_HPC_5F00_Office.jpg" alt="" width="519" height="337" border="0" /></a></span></p>
<p style="text-align: center;" align="left"><span style="font-size: small;">&nbsp;Figure 59:&nbsp;install Visual Basic for Applications under Office Shared Features</span></p>
<p class="Default">&nbsp;</p>
<ol start="5">
<li style="text-align: justify;"><span style="font-size: small;">In<strong> Office Security Settings</strong>, add the shared directory to the Trusted List. (Figure 60)</span></li>
</ol>
<p><span style="font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/3718.60_HPC_Office.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/3718.60_5F00_HPC_5F00_Office.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/3718.60_HPC_Office.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/3718.60_5F00_HPC_5F00_Office.jpg" alt="" width="600" height="580" border="0" /></a></span></p>
<p style="text-align: center;" align="left"><span style="font-size: small;">&nbsp;Figure 60:&nbsp;&nbsp;&nbsp;Specify a trusted shared directory</span></p>
<ol start="6">
<li style="text-align: justify;"><span style="font-size: small;"><strong>Office Security Settings </strong>in the group<strong> Default Security Settings, </strong>select &nbsp;&ldquo;<strong>Microsoft Access &ndash; Allowed trusted locations options</strong>&rdquo; and click <strong>Modify</strong>. Then in the dropdown submenu select &ldquo;<strong>Allow trusted location that are NOT on user&rsquo;s computer</strong>&rdquo; (Figure 61)</span></li>
</ol>
<p><span style="font-size: small;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/5344.61_HPC_Office.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/5344.61_5F00_HPC_5F00_Office.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/5344.61_HPC_Office.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/5344.61_5F00_HPC_5F00_Office.jpg" alt="" width="635" height="289" border="0" /></a></span></p>
<p style="text-align: center;" align="left"><span style="font-size: small;">&nbsp;Figure 61:&nbsp;&nbsp;allow trusted locations that are not in local computer</span></p>
<ol start="7">
<li style="text-align: justify;"><span style="font-size: small;"><strong>Office Security Settings </strong>in the group<strong> Default Security Settings, </strong>select &ldquo;<strong>Microsoft Access &ndash; application Add-ins warning options</strong>&rdquo; and click <strong>Modify</strong>. Then in the dropdown submenu select &ldquo;<strong>Enable all installed Application Add-ins (application default)</strong>&rdquo; (Figure 62)</span></li>
</ol>
<p><span style="font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/4213.62_HPC_Office.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/4213.62_5F00_HPC_5F00_Office.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/4213.62_HPC_Office.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/4213.62_5F00_HPC_5F00_Office.jpg" alt="" width="553" height="256" border="0" /></a></span></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 62:&nbsp;Enable all installed Application Add-ins</span></p>
<p>&nbsp;</p>
<ol start="8">
<li style="text-align: justify;"><span style="font-size: small;"><strong>Office Security Settings </strong>in the group<strong> Default Security Settings, </strong>select &ldquo;<strong>Microsoft Access &ndash; VBA macro warning options</strong>&rdquo; and click <strong>Modify</strong>. Then in the dropdown submenu select &ldquo;<strong>No security check for VBA macro (not recommended, code in all documents can run)</strong>&rdquo;. If you are going to be running any VBA macros on your HPC cluster, this setup will disable the security popup (Figure 63).</span></li>
</ol>
<p><span style="font-size: small;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/7635.63_HPC_Office.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/7635.63_5F00_HPC_5F00_Office.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/7635.63_HPC_Office.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/7635.63_5F00_HPC_5F00_Office.jpg" alt="" width="476" height="268" border="0" /></a></span></p>
<p style="text-align: center;" align="left"><span style="font-size: small;">Figure 63:&nbsp;No security check for VBA macros</span></p>
<p>&nbsp;</p>
<p style="text-align: justify;" align="left"><span style="font-size: small;">In Figure 64&nbsp;are shown&nbsp;the options for Excel default security settings:</span></p>
<p><span style="font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/8171.64_HPC_Office.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/8171.64_5F00_HPC_5F00_Office.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/8171.64_HPC_Office.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/8171.64_5F00_HPC_5F00_Office.jpg" alt="" width="497" height="136" border="0" /></a></span></p>
<p style="text-align: center;"><span style="font-size: small;">Figure 64:&nbsp;Default security options for Excel 2010</span></p>
<ol start="9">
<li style="text-align: justify;"><span style="font-size: small;">Select <strong>File</strong> and <strong>Save as</strong> (Figure 65) in the menu to save the result as <strong>ExcelOnly.msp</strong> in the Updates directory (Figure 66).</span></li>
</ol>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/0143.65_HPC_Office.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/0143.65_5F00_HPC_5F00_Office.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/0143.65_HPC_Office.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/0143.65_5F00_HPC_5F00_Office.jpg" alt="" width="444" height="212" border="0" /></a></p>
<p style="text-align: center;" align="left">Figure 65:&nbsp;Save the customization in a file</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/0647.66_HPC_Office.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/0647.66_5F00_HPC_5F00_Office.jpg"> <img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/WinHPC2008R2/0647.66_HPC_Office.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-WinHPC2008R2/0647.66_5F00_HPC_5F00_Office.jpg" alt="" width="500" height="293" border="0" /></a></p>
<p style="text-align: center;">Figure 66:&nbsp;Store the custom file in &ldquo;Office2010\Updates&rdquo; directory</p>
<p align="left">&nbsp;</p>
<p align="left"><span style="font-size: small;">When you run setup.exe from your share, it will automatically apply your customizations from ExcelOnly.msp, which allows the execution to be unattended and install Excel.</span></p>
<p align="left"><span style="font-size: small;">You have now different options to install Excel 2010 on compute nodes:</span></p>
<ol>
<li><span style="font-size: small;">You can now run clusrun by the following command:</span></li>
</ol>
<p style="text-align: left;"><span style="font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #0000ff;"><strong><span style="background-color: #ffffff;">clusrun </span></strong></span><strong><span style="background-color: #ffffff;"><a href="file://\\<headnode>\<officeshare>\setup.exe">\\&lt;headnode&gt;\&lt;officeshare&gt;\setup.exe</a></span></strong></span></p>
<p><span style="font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2. You can also add the&nbsp;command to your compute node template</span></p>
<p align="left"><span style="font-size: small;">Note: Installing Excel on a large number of compute nodes from an individual share will result in a bottleneck. In that scenario, performing installation in multiple batches is recommended.</span><br /><span style="font-size: small;">The following example shows how to do this in multiple batches:</span></p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="626">
<p align="left"><span style="font-size: small;"><strong><span style="font-family: courier new,courier;">clusrun /all \\&lt;headnode&gt;\&lt;officeshare&gt;\setup.exe /adminfile \\&lt;headnode&gt;\&lt;officeshare&gt; \Updates\ExcelOnly.msp</span></strong></span></p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<h1>7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000080;">ANNEX: Azure POWERSHELL to temporary remove/recreate IaaS VMs</span></h1>
<p style="text-align: justify;"><span style="font-size: small;">All Azure resources are billed on consumption; customers might have interest to remove the entire installation when do not use the cluster for long time. Operation of temporary remove the entire HPC cluster in Azure can be done actually through Azure Powershell.</span></p>
<h2 style="text-align: justify;"><span style="font-size: small;">7.1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000080;">Remove all IaaS VMs via Azure powershell</span></span></h2>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="626">
<p align="center"><span style="color: #0000ff;"><strong>exHPC_Delete.ps1</strong></span></p>
</td>
</tr>
<tr>
<td valign="top" width="626">
<p align="left"><strong><span style="font-family: courier new,courier;"># List of VMs to be deleted <br />$array = @("exhn001", "excn001","excn002","exclient01")<br />#<br /># ----- Set the Azure subscription where VMs run<br />$Subscription = "Windows AzureDemo1"<br />#<br /># ---Select the Azure subscription<br />Select-AzureSubscription &ndash;SubscriptionName $Subscription<br /># ---Get the current path <br />$currPath=(Get-Location).providerpath<br />#<br />foreach ($element in $array)<br />{<br />&nbsp;&nbsp; $vmName= $element<br />&nbsp;&nbsp; $serviceName = $element<br />&nbsp;&nbsp; $pathLocal = "$currPath\$vmName"+"-netconfig.xml"<br />&nbsp;&nbsp; Write-Host&nbsp; "folder to store network config file:" $pathLocal -foregroundcolor green <br />&nbsp;&nbsp; #<br />&nbsp;&nbsp; #<br />&nbsp;&nbsp; Stop-AzureVM -ServiceName $serviceName -Name $vmName -Stayprovisioned<br />&nbsp;&nbsp; Export-AzureVM -ServiceName $serviceName -Name $vmName -Path $pathLocal<br />&nbsp;&nbsp; Remove-AzureVM -ServiceName $serviceName -Name $vmName<br />}</span></strong></p>
</td>
</tr>
</tbody>
</table>
<p align="left">&nbsp;</p>
<p style="text-align: justify;" align="left"><span style="font-size: small;">Running these Azure powershell script generates on local folder one XML file for every VM;&nbsp;below and example of&nbsp;XML file for exhn001&nbsp;:</span></p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="626">
<p align="center"><strong>exhn001-config.xml</strong></p>
</td>
</tr>
<tr>
<td valign="top" width="626">
<p align="left"><span style="font-size: xx-small;"><strong><span style="font-family: courier new,courier;">&lt;?xml version="1.0" encoding="utf-8"?&gt;</span></strong></span><br /><span style="font-size: xx-small;"><strong><span style="font-family: courier new,courier;">&lt;PersistentVM xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>" xmlns:xsd="<a href="http://www.w3.org/2001/XMLSchema">http://www.w3.org/2001/XMLSchema</a>"&gt;</span></strong></span><br /><span style="font-size: xx-small;"><strong><span style="font-family: courier new,courier;">&nbsp; &lt;ConfigurationSets&gt;</span></strong></span><br /><span style="font-size: xx-small;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; &lt;ConfigurationSet xsi:type="NetworkConfigurationSet"&gt;</span></strong></span><br /><span style="font-size: xx-small;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ConfigurationSetType&gt;NetworkConfiguration&lt;/ConfigurationSetType&gt;</span></strong></span><br /><span style="font-size: xx-small;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;InputEndpoints&gt;</span></strong></span><br /><span style="font-size: xx-small;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;InputEndpoint&gt;</span></strong></span><br /><span style="font-size: xx-small;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;LocalPort&gt;3389&lt;/LocalPort&gt;</span></strong></span><br /><span style="font-size: xx-small;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Name&gt;RemoteDesktop&lt;/Name&gt;</span></strong></span><br /><span style="font-size: xx-small;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Port&gt;49524&lt;/Port&gt;</span></strong></span><br /><span style="font-size: xx-small;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Protocol&gt;tcp&lt;/Protocol&gt;</span></strong></span><br /><span style="font-size: xx-small;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Vip&gt;168.63.31.249&lt;/Vip&gt;</span></strong></span><br /><span style="font-size: xx-small;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/InputEndpoint&gt;</span></strong></span><br /><span style="font-size: xx-small;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/InputEndpoints&gt;</span></strong></span><br /><span style="font-size: xx-small;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;SubnetNames&gt;</span></strong></span><br /><span style="font-size: xx-small;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;hpcNet&lt;/string&gt;</span></strong></span><br /><span style="font-size: xx-small;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/SubnetNames&gt;</span></strong></span><br /><span style="font-size: xx-small;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; &lt;/ConfigurationSet&gt;</span></strong></span><br /><span style="font-size: xx-small;"><strong><span style="font-family: courier new,courier;">&nbsp; &lt;/ConfigurationSets&gt;</span></strong></span><br /><span style="font-size: xx-small;"><strong><span style="font-family: courier new,courier;">&nbsp; &lt;DataVirtualHardDisks /&gt;</span></strong></span><br /><span style="font-size: xx-small;"><strong><span style="font-family: courier new,courier;">&nbsp; &lt;OSVirtualHardDisk&gt;</span></strong></span><br /><span style="font-size: xx-small;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; &lt;HostCaching&gt;ReadWrite&lt;/HostCaching&gt;</span></strong></span><br /><span style="font-size: xx-small;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; &lt;DiskName&gt;exhn001-exhn001-0-20130328165336&lt;/DiskName&gt;</span></strong></span><br /><span style="font-size: xx-small;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; &lt;SourceImageName&gt;a699494373c04fc0bc8f2bb1389d6106__Win2k8R2SP1-Datacenter-201302.01-en.us-30GB.vhd&lt;/SourceImageName&gt;</span></strong></span><br /><span style="font-size: xx-small;"><strong><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; &lt;OS&gt;Windows&lt;/OS&gt;</span></strong></span><br /><span style="font-size: xx-small;"><strong><span style="font-family: courier new,courier;">&nbsp; &lt;/OSVirtualHardDisk&gt;</span></strong></span><br /><span style="font-size: xx-small;"><strong><span style="font-family: courier new,courier;">&nbsp; &lt;RoleName&gt;exhn001&lt;/RoleName&gt;</span></strong></span><br /><span style="font-size: xx-small;"><strong><span style="font-family: courier new,courier;">&nbsp; &lt;RoleSize&gt;Medium&lt;/RoleSize&gt;</span></strong></span><br /><span style="font-size: xx-small;"><strong><span style="font-family: courier new,courier;">&nbsp; &lt;RoleType&gt;PersistentVMRole&lt;/RoleType&gt;</span></strong></span><br /><span style="font-size: xx-small;"><strong><span style="font-family: courier new,courier;">&lt;/PersistentVM&gt;</span></strong></span></p>
</td>
</tr>
</tbody>
</table>
<p align="left">&nbsp;</p>
<h2>7.2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000080;">Recreate all HPC cluster via Azure powershell</span></h2>
<p style="text-align: justify;"><span style="font-size: small;">Below Azure powershell script to rebuild all HPC cluster. This script works only if the affinity group, Azure VNET, azure storage accounts, and page blob storage associated with the VMs and output of configuration (created in previous step) are not removed.</span></p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="626">
<p align="center"><span style="color: #0000ff;"><strong>exHPC_Create.ps1</strong></span></p>
</td>
</tr>
<tr>
<td valign="top" width="626">
<p align="left"><strong><span style="font-family: courier new,courier;"># ========= Create VMs from .VHD in blob storage and network configuration file<br /># =========<br /># -----&nbsp; List of VMs to be created<br />$array = @("exhn001", "excn001","excn002","exclient01")<br />#<br /># Reference existing Azure VNET<br />$networkName = "HPCMajorNet"<br />#<br /># ----- Set the Azure subscription and the storage accounts where are <br /># ----- located the.VHD of VMs you want to bring up and running. <br />$subscriptionName = "Windows AzureDemo1"<br />#<br />Select-AzureSubscription &ndash;SubscriptionName $subscriptionName <br /># ----- Get the current path <br />$currPath=(Get-Location).providerpath<br />#<br />foreach ($element in $array)<br />{<br />&nbsp;&nbsp; $vmName= $element<br />&nbsp;&nbsp; $serviceName =$element<br />&nbsp;&nbsp; $pathNetConfig = "$currPath\$vmName"+"-netconfig.xml"<br />&nbsp;&nbsp; Write-Host&nbsp; "folder to store network config file:" $pathNetConfig -foregroundcolor yellow <br />&nbsp;&nbsp; #<br />&nbsp;&nbsp; #<br />&nbsp;&nbsp; $vmConfig = Import-AzureVM -Path $pathNetConfig<br />&nbsp;&nbsp; New-AzureVM -ServiceName $serviceName -VMs $vmConfig -VNetName $networkName<br />&nbsp;&nbsp; #<br />&nbsp;&nbsp; # Wait for the head node VM to be fully provisioned. <br />&nbsp;&nbsp; # Since the new Azure VM takes a long time to provision,&nbsp; <br />&nbsp;&nbsp; # the while loop continues to poll the new VM until <br />&nbsp;&nbsp; # it is ready for use<br />&nbsp;&nbsp; if ($element -eq "exhn001")<br />&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; do {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Start-Sleep -Seconds 15<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $VMStatus = Get-AzureVM -ServiceName $serviceName -Name $vmName<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; write-host "Waiting for " $VMStatus.Name "... Current Status = " $VMStatus.InstanceStatus<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } while ($VMStatus.InstanceStatus -ne "ReadyRole")<br />&nbsp;&nbsp;&nbsp; }<br />}</span></strong></p>
</td>
</tr>
</tbody>
</table>
<p align="left">&nbsp;</p>
<h1>&nbsp;</h1>
<h1><span style="font-size: small;"><span style="font-size: large;"><strong><span style="font-size: small;">click here to <span style="font-size: large;"><strong><a href="http://blogs.msdn.com/b/faber/archive/2013/07/04/running-parallel-excel-on-windows-hpc-2008-r2-hosted-in-windows-azure-iaas-vms-part-3.aspx">Move to next blog-Part1</a></strong></span></span></strong></span></span>&nbsp;</h1>
<p align="left">&nbsp;</p>
<p align="left">&nbsp;</p>
<h1><span style="color: #000080;">8&nbsp; </span><span style="color: #000080;">Glossary</span></h1>
<table style="width: 353px; height: 372px;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="83">
<p><strong>&nbsp;AD DC</strong></p>
</td>
<td valign="top" width="539">
<p>Active Directory Domain Controller&nbsp;</p>
</td>
</tr>
<tr>
<td valign="top" width="83">
<p><strong>CN</strong></p>
</td>
<td valign="top" width="539">
<p>Compute Node</p>
</td>
</tr>
<tr>
<td valign="top" width="83">
<p><strong>FQDN</strong></p>
</td>
<td valign="top" width="539">
<p>Fully Qualify Doman Name</p>
</td>
</tr>
<tr>
<td valign="top" width="83">
<p><strong>IaaS</strong></p>
</td>
<td valign="top" width="539">
<p>Infrastructure as a Service&nbsp;(Azure)</p>
</td>
</tr>
<tr>
<td valign="top" width="83">
<p><strong>HN</strong></p>
</td>
<td valign="top" width="539">
<p>Head Node (HPC)</p>
</td>
</tr>
<tr>
<td valign="top" width="83">
<p><strong>HPC</strong></p>
</td>
<td valign="top" width="539">
<p>High Performance Computing</p>
</td>
</tr>
<tr>
<td valign="top" width="83">
<p><strong>NIC</strong></p>
</td>
<td valign="top" width="539">
<p>Network Interface Card</p>
</td>
</tr>
<tr>
<td valign="top" width="83">
<p><strong>UDF</strong></p>
</td>
<td valign="top" width="539">
<p>User Definition Function (Excel)</p>
</td>
</tr>
<tr>
<td valign="top" width="83">
<p><strong>VM</strong></p>
</td>
<td valign="top" width="539">
<p>Virtual Machine</p>
</td>
</tr>
</tbody>
</table>
<h1>9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000080;">Reference</span></h1>
<table style="width: 632px;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="632">
<p><strong><em>Windows HPC server 2008 R2 manual:</em></strong></p>
<p><a href="http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&amp;FamilyID=ba743d35-03e2-4a0f-9b49-d1bd90d75275">http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&amp;FamilyID=ba743d35-03e2-4a0f-9b49-d1bd90d75275</a></p>
<p>online version: <a href="http://technet.microsoft.com/en-us/library/ee783547(WS.10).aspx">http://technet.microsoft.com/en-us/library/ee783547(WS.10).aspx</a></p>
</td>
</tr>
<tr>
<td valign="top" width="632">
<p><strong><em>Windows HPC Server 2008 R2 Command Reference</em></strong></p>
<p align="left"><a href="http://technet.microsoft.com/en-us/library/cc972841(WS.10).aspx">http://technet.microsoft.com/en-us/library/cc972841(WS.10).aspx</a></p>
</td>
</tr>
<tr>
<td valign="top" width="632">
<p><strong><em>Windows HPC Server 2008 R2-Technet portal</em></strong></p>
<p align="left"><a href="http://technet.microsoft.com/en-us/hpc/default.aspx">http://technet.microsoft.com/en-us/hpc/default.aspx</a></p>
</td>
</tr>
<tr>
<td valign="top" width="632">
<p align="left"><strong><em>Deploying a Windows HPC Server 2008 R2 Cluster with Remote Databases Step-by-Step Guide</em></strong></p>
<p align="left"><a href="http://technet.microsoft.com/en-us/library/ee783551(WS.10).aspx">http://technet.microsoft.com/en-us/library/ee783551(WS.10).aspx</a></p>
</td>
</tr>
<tr>
<td valign="top" width="632">
<p align="left"><strong><em>Windows HPC Server Developers --Forum</em></strong></p>
<p align="left"><a href="http://social.microsoft.com/forums/en-US/windowshpcdevs/threads/">http://social.microsoft.com/forums/en-US/windowshpcdevs/threads/</a></p>
</td>
</tr>
<tr>
<td valign="top" width="632">
<p align="left"><strong><em>Microsoft HPC Pack 2008 SDK and HPC Pack 2008 R2 SDK </em></strong></p>
<p align="left"><a href="http://msdn.microsoft.com/en-us/library/cc853440(v=VS.85).aspx">http://msdn.microsoft.com/en-us/library/cc853440(v=VS.85).aspx</a><br />&nbsp;</p>
</td>
</tr>
</tbody>
</table>
<p align="left">&nbsp;</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Elastic collisions of balls</title>
      <link>https://docs.microsoft.com/archive/blogs/faber/elastic-collisions-of-balls</link>
      <pubDate>Wed, 09 Jan 2013 12:47:00 GMT</pubDate>
      <dc:creator><![CDATA[faberspot]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/faber/2013/01/09/elastic-collisions-of-balls/</guid>
      <description><![CDATA[Elastic collisions of multiple balls is not a trivial effect. Apparently this subject seems only...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: small;">Elastic collisions of multiple balls is not a trivial effect. Apparently this subject seems only related to physics but collision between objects is simulated in gaming. To run collision of balls we need to understand physics laws.</span></p>
<p style="text-align: justify;"><span style="font-size: small;">Consider two spherical rigid objects, denoted by subscripts 1 and 2, one of mass <em>m</em><sub>1</sub> and the other of mass <em>m</em><sub>2</sub>. Let's set things up so these two balls are approaching each other along the line joining their centers, a recipe for a head on collision. Let these balls not be rotating or vibrating; the motion is purely translation. Under these conditions, we may choose a reference frame, which is one dimensional, with the objects on the x-axis. We consider an isolated system, in other words a system where external forces are absent (nothing affects spheres in the stage). A perfectly <a href="http://hyperphysics.phy-astr.gsu.edu/hbase/elacol.html#c4">elastic collision</a> is defined as one in which there is no loss of <a href="http://hyperphysics.phy-astr.gsu.edu/hbase/ke.html#ke">kinetic energy</a> in the collision; the conservation laws say in an elastic collision total kinetic energy is the same before and after the collision and total momentum remains constant throughout the collision. Applying the conservation of linear momentum to this situation, we have:</span></p>
<p><span style="font-family: courier new,courier; font-size: small;"><em>m</em><sub>1</sub><em>v</em><sub>1</sub> + <em>m</em><sub>2</sub><em>v</em><sub>2</sub> = <em>m</em><sub>1</sub><em>u</em><sub>1</sub> + <em>m</em><sub>2</sub><em>u</em><sub>2</sub></span></p>
<p><span style="font-size: small;">where <em>v</em> is the initial velocity of each object before the collision and u is the final velocity of each object after the collision and m is the mass of the object. The conservation of kinetic energy gives us the equation</span></p>
<p><span style="font-family: courier new,courier; font-size: small;"><em>m</em><sub>1</sub><em>v</em><sub>1</sub><sup>2 </sup>/2 + <em>m</em><sub>2</sub><em>v</em><sub>2</sub><sup>2 </sup>/2 = <em>m</em><sub>1</sub><em>u</em><sub>1</sub><sup>2 </sup>/2 + <em>m</em><sub>2</sub><em>u</em><sub>2</sub><sup>2 </sup>/2</span></p>
<p><span style="font-size: small;">These two equations can rewritten as:</span></p>
<ul>
<li><span style="font-size: small;">momentum equation:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-family: courier new,courier;"><em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m</em><sub>1</sub> (<em>v</em><sub>1</sub> - <em>u</em><sub>1</sub>) = <em>m</em><sub>2</sub> (<em>u</em><sub>2</sub> - <em>v</em><sub>2</sub>)&nbsp;&nbsp;</span></span></li>
<li><span style="font-size: small;">conservation of kinetic energy:<span style="font-family: courier new,courier;"><em> m</em><sub>1</sub> (<em>v</em><sub>1</sub><sup>2</sup> - <em>u</em><sub>1</sub><sup>2</sup>) = <em>m</em><sub>2</sub> (<em>u</em><sub>2</sub><sup>2</sup> - <em>v</em><sub>2</sub><sup>2</sup>)</span></span></li>
</ul>
<p style="text-align: justify;"><span style="font-size: small;">As long as the difference between final and initial velocities is not zero for either object (meaning a collision actually happens), we may divide the second equation by the first one, which yields:</span></p>
<p><span style="font-family: courier new,courier; font-size: small;"><em>v</em><sub>1</sub> + <em>u</em><sub>1</sub> = <em>u</em><sub>2</sub> + <em>v</em><sub>2</sub> or <em>v</em><sub>1</sub> - <em>v</em><sub>2</sub> = <em>u</em><sub>2</sub> - <em>u</em><sub>1</sub></span></p>
<p style="text-align: justify;"><span style="font-size: small;">In other words in a one-dimensional elastic collision, the relative velocity of approach before the collision equals the relative velocity of separation after collision. To get the final velocities in terms of the initial velocities and the masses, we would solve the last equation above for <em>u</em><sub>2</sub>, plug that into the momentum equation, and solve to get:</span></p>
<p><span style="font-family: courier new,courier;"><span style="font-size: small;"><em>u</em><sub>1</sub></span><span style="font-size: small;"> = <em>v</em><sub>1</sub> (<em>m</em><sub>1</sub>-<em>m</em><sub>2</sub>)/(<em>m</em><sub>1</sub>+<em>m</em><sub>2</sub>) + <em>v</em><sub>2</sub> (2 <em>m</em><sub>2</sub>)/(<em>m</em><sub>1</sub> + <em>m</em><sub>2</sub>)<br /><em>u</em><sub>2</sub> = <em>v</em><sub>1</sub> (2 <em>m</em><sub>1</sub>) /(<em>m</em><sub>1</sub>+<em>m</em><sub>2</sub>) + <em>v</em><sub>2</sub> (<em>m</em><sub>2</sub> - <em>m</em><sub>1</sub>)/ (<em>m</em><sub>2</sub> + <em>m</em><sub>1</sub>)</span></span></p>
<p style="text-align: justify;"><span style="font-size: small;">Let start out with two spheres moving in the plane to have a collision</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/1325.figure01.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/1325.figure01.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/1325.figure01.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/1325.figure01.jpg" alt="" width="343" height="231" border="0" /></a></p>
<p align="center"><em><span style="color: #44546a;"><span style="font-family: Calibri;">Figure 1: angles in collision</span></span></em></p>
<p style="text-align: justify;"><span style="font-size: small;">Also in bi-dimensional collision, we ignore every energy losses due to friction and rotation. The physical laws (the conservation of momentum and conservation of kinetic energy) are invariant for changing of Cartesian coordinate system, so we can apply a transformation and consider a new standard x&rsquo;-y&rsquo; coordinate system (Figure 2), where the x-axis lies along the collision line, and the y-axis is perpendicular to that.&nbsp; In this new Cartesian coordinate system is easier to understand what happens.</span><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/5226.figure02.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/5226.figure02.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/5226.figure02.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/5226.figure02.jpg" alt="" width="342" height="253" border="0" /></a></p>
<p align="center"><em><span style="color: #44546a; font-family: Calibri;">Figure </span></em><em><span style="color: #44546a;"><span style="font-family: Calibri;">2: new Cartesian coordinate system</span></span></em></p>
<p style="text-align: justify;"><span style="font-size: small;">The Figure 3 shows the new vector components of velocities, in the new Cartesian coordinate system where the x-axis lies along the collision line, and the y-axis is perpendicular to that.</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/0743.figure03.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/0743.figure03.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/0743.figure03.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/0743.figure03.jpg" alt="" width="584" height="243" border="0" /></a></p>
<p align="center"><em><span style="color: #44546a; font-family: Calibri;">Figure </span></em><em><span style="color: #44546a;"><span style="font-family: Calibri;">3: x and y velocity components in the new coordinate system</span></span></em></p>
<p style="text-align: justify;"><span style="font-size: small;">In the new Cartesian coordinate system the velocities components of spheres along x,y&rsquo;-axis are:</span></p>
<p><span style="font-family: courier new,courier;">v&rsquo;1x = v1*cos(<span style="font-family: symbol;">q</span>1-<span style="font-family: symbol;">F</span>)</span></p>
<p><span style="font-family: courier new,courier;">v&rsquo;1y = v1*sin(<span style="font-family: symbol;">q</span>1- <span style="font-family: symbol;">F</span>)</span></p>
<p><span style="font-family: courier new,courier;">v&rsquo;2x = v2*cos(<span style="font-family: symbol;">q</span>2- <span style="font-family: symbol;">F</span>)</span></p>
<p><span style="font-family: courier new,courier;">v&rsquo;2y = v2*sin(<span style="font-family: symbol;">q</span>2- <span style="font-family: symbol;">F</span>)</span></p>
<p style="text-align: justify;"><span style="font-size: small;">In the case of the two spheres, the velocity components involved are the components resolved along the line of centers during the contact. Consequently, the components of velocity perpendicular to the line of centers will be unchanged during the impact. </span><span style="font-size: small;">The new x velocities in our new coordinate system follows the same outcome of collision 1D, and the y-components do not change.</span></p>
<pre><span style="font-family: courier new,courier; font-size: small;">u&rsquo;1x = ((m1-m2)*v&rsquo;1x+(m2+m2)*v&rsquo;2x)/(m1+m2)</span></pre>
<pre><span style="font-family: courier new,courier; font-size: small;">u&rsquo;2x = ((m1+m1)*v&rsquo;1x+(m2-m1)*v&rsquo;2x)/(m1+m2)</span></pre>
<pre><span style="font-family: courier new,courier; font-size: small;">u&rsquo;1y = v&rsquo;1y&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <em>(the y velocity of sphere 1 will not be changed)</em></span></pre>
<pre><span style="font-family: courier new,courier; font-size: small;">u&rsquo;2y = v&rsquo;2y&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (<em>the y velocity of sphere 2 will not be changed)</em></span></pre>
<p style="text-align: justify;"><span style="font-size: small;">The Figure 4 shows the x-velocities inversion, after the collision</span></p>
<p style="text-align: justify;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/6786.figure04.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/6786.figure04.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/6786.figure04.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/6786.figure04.jpg" alt="" width="578" height="263" border="0" /></a></p>
<p align="center"><em><span style="color: #44546a; font-family: Calibri;">Figure </span></em><em><span style="color: #44546a;"><span style="font-family: Calibri;">4: velocities components in new Cartesian coordinate system</span></span></em></p>
<p style="text-align: justify;"><span style="font-size: small;">We have determined the 'after collision' velocities, but we have to transform the components back to the initial x-y reference frame.</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/3058.figure05.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/3058.figure05.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/3058.figure05.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/3058.figure05.jpg" alt="" width="605" height="262" border="0" /></a></p>
<p align="center"><em><span style="color: #44546a;"><span style="font-family: Calibri;">Figure 5: changing back to new initial Coordinate system (Ref)</span></span></em>&nbsp;</p>
<p style="text-align: justify;" align="center"><span style="font-size: small;">Analysis of velocity components in the original Cartesian coordinate system can be done through graphical approach; in Figure 6, Figure 7, Figure 8 and Figure 9 are shown the x, y components of velocities after the collision and the related magnitudes.</span><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/5773.figure06.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/5773.figure06.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/5773.figure06.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/5773.figure06.jpg" alt="" width="357" height="301" border="0" /></a></p>
<p align="center"><em><span style="color: #44546a; font-family: Calibri;">Figure </span></em><em><span style="color: #44546a;"><span style="font-family: Calibri;">6: x-component of&nbsp;velocity after collision of sphere 1 in initial coordinate system </span></span></em></p>
<p style="text-align: justify;" align="center">&nbsp;</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/8726.figure07.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/8726.figure07.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/8726.figure07.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/8726.figure07.jpg" alt="" width="381" height="315" border="0" /></a></p>
<p align="center"><em><span style="color: #44546a; font-family: Calibri;">Figure </span></em><em><span style="color: #44546a;"><span style="font-family: Calibri;">7: y-component of velocity after collision of sphere 1 in initial coordinate system</span></span></em></p>
<p align="center"><em></em>&nbsp;</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/4111.figure08.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/4111.figure08.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/4111.figure08.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/4111.figure08.jpg" alt="" width="382" height="260" border="0" /></a></p>
<p align="center"><em><span style="color: #44546a; font-family: Calibri;">Figure </span></em><em><span style="color: #44546a;"><span style="font-family: Calibri;">8: x-component of velocity after collision of sphere 2 in initial coordinate system</span></span></em></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/0550.figure09.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/0550.figure09.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/0550.figure09.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/0550.figure09.jpg" alt="" width="391" height="285" border="0" /></a></p>
<p style="text-align: justify;" align="center">&nbsp;</p>
<p align="center"><em><span style="color: #44546a; font-family: Calibri;">Figure </span></em><em><span style="color: #44546a;"><span style="font-family: Calibri;">9: y-component of velocity after collision of sphere 2 in initial coordinate system</span></span></em></p>
<pre><span style="font-size: small;"><span style="font-family: Courier New;">u1x = u&rsquo;1x * cos(</span><span style="font-family: symbol;">F</span><span style="font-family: Courier New;">)+ u&rsquo;1y * cos(</span><span style="font-family: symbol;">p</span><span style="font-family: Courier New;">/2+ </span><span style="font-family: symbol;">F</span><span style="font-family: Courier New;">)</span></span></pre>
<pre><span style="font-size: small;"><span style="font-family: Courier New;">u1y = u&rsquo;1x * sin(<span style="font-family: symbol;">F</span></span><span style="font-family: Courier New;">)+ u&rsquo;1y * sin(<span style="font-family: symbol;">p</span></span><span style="font-family: Courier New;">/2+ <span style="font-family: symbol;">F</span></span><span style="font-family: Courier New;">)</span></span></pre>
<pre><span style="font-size: small;"><span style="font-family: Courier New;">u2x = u&rsquo;2x * cos(<span style="font-family: symbol;">F</span></span><span style="font-family: Courier New;">)+ u&rsquo;2y * cos(<span style="font-family: symbol;">p</span></span><span style="font-family: Courier New;">/2+ <span style="font-family: symbol;">F</span></span><span style="font-family: Courier New;">)</span></span></pre>
<pre><span style="font-size: small;"><span style="font-family: Courier New;">u2y = u&rsquo;2x * sin(<span style="font-family: symbol;">F</span></span><span style="font-family: Courier New;">)+ u&rsquo;2y * sin(<span style="font-family: symbol;">p</span></span><span style="font-family: Courier New;">/2+ <span style="font-family: symbol;">F</span></span><span style="font-family: Courier New;">)</span></span></pre>
<p><span style="font-size: small;">Considering the trigonometric properties of sin() and cos() functions, we have:</span></p>
<pre><span style="font-family: Courier New;">u1x = u&rsquo;1x * cos(</span><span style="font-family: symbol;">F</span><span style="font-family: Courier New;">)- u&rsquo;1y * sin(<span style="font-family: symbol;">F</span></span><span style="font-family: Courier New;">)</span></pre>
<pre><span style="font-family: Courier New;">u1y = u&rsquo;1x * sin(<span style="font-family: symbol;">F</span></span><span style="font-family: Courier New;">)+ u&rsquo;1y * cos(<span style="font-family: symbol;">F</span></span><span style="font-family: Courier New;">)</span></pre>
<pre><span style="font-family: Courier New;">u2x = u&rsquo;2x * cos(<span style="font-family: symbol;">F</span></span><span style="font-family: Courier New;">)- u&rsquo;2y * sin(<span style="font-family: symbol;">F</span></span><span style="font-family: Courier New;">)</span></pre>
<pre><span style="font-family: Courier New;">u2y = u&rsquo;2x * sin(<span style="font-family: symbol;">F</span></span><span style="font-family: Courier New;">)+ u&rsquo;2y * cos(<span style="font-family: symbol;">F</span></span><span style="font-family: Courier New;">)</span></pre>
<p style="text-align: justify;"><span style="font-size: small;">Same outcome can be achieved by mathematical approach. In fact, translation from Cartesian coordinate system Ref&rsquo; to Ref can be execute by counterclockwise rotation matrix M</span><span style="font-size: small;">(<span style="font-family: symbol;">F</span>) :</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/7633.Formula01.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/7633.Formula01.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/7633.Formula01.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/7633.Formula01.jpg" alt="" width="244" height="48" border="0" /></a></p>
<p><span style="font-size: small;">Executing matrix multiplication produce the result:</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/2620.Formula02.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/2620.Formula02.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/2620.Formula02.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/2620.Formula02.jpg" alt="" width="273" height="50" border="0" /></a></p>
<p style="text-align: justify;"><span style="font-size: small;">In other words, to do a perfectly elastic collision between the balls we only need to consider the component of the velocity that is in the direction of the collision. The other component (tangent to the collision) will stay the same for both balls. We can get the collision components by creating a unit vector pointing in the direction from one ball to the other, then taking the dot product with the velocity vectors of the balls. We can then plug these components into a 1D perfectly elastic collision equation. </span><span style="font-size: small;">In our project we introduce a class named Ball containing all elementary information needed to identify the ellipse in canvas control and physical parameters (position, mass, velocity) for describing motion:&nbsp;</span></p>
<p><span style="font-family: courier new,courier;">public class Ball </span><br /><span style="font-family: courier new,courier;">{ </span><br /><span style="font-family: courier new,courier;">&nbsp; public Ellipse ellip = new Ellipse(); // Ellipse object&nbsp;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;public double r; // circle radius </span><br /><span style="font-family: courier new,courier;">&nbsp; public double m; // mass of the ball&nbsp;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;public Vector p; // position vector </span><br /><span style="font-family: courier new,courier;">&nbsp; public Vector v; // velocity vector </span><br /><span style="font-family: courier new,courier;">}</span></p>
<p style="text-align: justify;"><span style="font-size: small;">Starting animation is triggered from on-click button named &ldquo;<strong>Start</strong>&rdquo;:</span></p>
<p><span style="font-family: courier new,courier;">private void StartButton_Click(object sender, RoutedEventArgs e) </span><br /><span style="font-family: courier new,courier;">{ </span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; // remove EventHandler from Rendering event, if exists </span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; CompositionTarget.Rendering -= new EventHandler(RenderFrame); </span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; // change the label of button from "Start" to "Stop" </span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; StopContinueButton.Content = "Stop"; </span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; // clean all Ellipse object from canvas, if it exists </span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; CleanBalls(); </span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; // Assign the correct number of circles to be controlled </span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; TotNumCircles = tmpTotalNumCircles; </span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; // Resizing of correct number of array of Ball class </span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; // Number of array elements is defined from variable TotNumCircles </span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; Array.Resize(ref balls, TotNumCircles); </span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; // it draws all ellipses in canvas, with circle distribution </span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; StartDraw(); </span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; // set an EventHandler on rendering event, with RenderFrame as callback function </span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; CompositionTarget.Rendering += new EventHandler(RenderFrame); </span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; StopContinueButton.IsEnabled = true; </span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; flagStopContinue = true; </span><br /><span style="font-family: courier new,courier;">}</span></p>
<p style="text-align: justify;"><span style="font-size: small;">In &nbsp;Figure 10 is reported a flow diagram for on-click on <strong>Start</strong> button</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/4760.figure10.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/4760.figure10.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/4760.figure10.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/4760.figure10.jpg" alt="" width="237" height="493" border="0" /></a></p>
<p align="center"><em><span style="color: #44546a; font-family: Calibri;">Figure </span></em><em><span style="color: #44546a;"><span style="font-family: Calibri;">10: flow executed by click-on Start button event</span></span></em></p>
<p style="text-align: justify;" align="center">&nbsp;<span style="font-size: small;">Code and diagram are mostly self-explain; we just give some insight on how works the logic of project.</span></p>
<p style="text-align: justify;">At beginning of running a method <strong>StartDraw()</strong> draws circles in the canvas; &nbsp;<strong>StartDraw()</strong> uses a basic Mathematical function to dispose all circles around the center of canvas, avoiding overlaps:</p>
<p><span style="font-family: courier new,courier;">// R: radius to position the balls in circles from center of canvas control</span><br /><span style="font-family: courier new,courier;">double R;</span><br /><span style="font-family: courier new,courier;">// R0: initial value of radius to position circles from center of canvas to the edges</span><br /><span style="font-family: courier new,courier;">double R0 = 80d;</span><br /><span style="font-family: courier new,courier;">// theta: angle to distribute the balls in canvas, avoiding overlap</span><br /><span style="font-family: courier new,courier;">double theta = 0;</span><br /><span style="font-family: courier new,courier;">// initial value of angle of radius R</span><br /><span style="font-family: courier new,courier;">double theta_old = -1 * Math.PI;</span><br /><span style="font-family: courier new,courier;">double m = 0d;</span><br /><span style="font-family: courier new,courier;">R = R0;</span><br /><span style="font-family: courier new,courier;">theta = (k == 0) ? Math.Atan2(3 * balls[k].r, R) : Math.Atan2(2 * balls[k].r + 2 * balls[k - 1].r, R);</span><br /><span style="font-family: courier new,courier;">theta = theta + theta_old;</span><br /><span style="font-family: courier new,courier;">m = Convert.ToInt32(theta / (2 * Math.PI));</span><br /><span style="font-family: courier new,courier;">R = R0 + (R0 / 2) * m;</span><br /><span style="font-family: courier new,courier;">theta_old = theta;</span><br /><span style="font-family: courier new,courier;">balls[k].v = rnd1.Next(minSpeed, maxSpeed) * new Vector(Math.Cos(theta), Math.Sin(theta));</span><br /><span style="font-family: courier new,courier;">balls[k].p = startVector + new Vector(R * Math.Cos(theta), R * Math.Sin(theta));</span><br /><span style="font-family: courier new,courier;">balls[k].ellip.SetValue(Canvas.LeftProperty, balls[k].p.X - balls[k].r);</span><br /><span style="font-family: courier new,courier;">balls[k].ellip.SetValue(Canvas.TopProperty, balls[k].p.Y - balls[k].r);</span><br /><span style="font-family: courier new,courier;">canv.Children.Add(balls[k].ellip);</span></p>
<p>&nbsp;</p>
<p style="text-align: justify;"><span style="font-size: small;">On completion of <strong>StartDraw()</strong> all balls[k] (k=0,1,2,&hellip;. TotNumCircles) are drawn in the canvas in fix position (Figure 11).</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/0451.figure11.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/0451.figure11.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/0451.figure11.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/0451.figure11.jpg" alt="" width="443" height="375" border="0" /></a></p>
<p align="center"><em><span style="color: #44546a; font-family: Calibri;">Figure </span></em><em><span style="color: #44546a;"><span style="font-family: Calibri;">11: initial position of all ellipses in the canvas</span></span></em></p>
<p style="text-align: justify;" align="center">&nbsp;<span style="font-size: small;">The <strong>System.Windows.Media.CompositionTarget</strong> static class is the engine of balls animation and it represents the display surface on which our application is drawn. </span><span style="font-size: small;">Every time the <strong>CompositionTarget</strong> class raises the <strong>Rendering</strong> event, notifies any event handlers that a frame has been rendered. To create the &nbsp;animation we attach to the&nbsp; <strong>Rendering</strong> event an event handler:</span></p>
<p style="text-align: justify;" align="center"><span style="color: #0000cc;"><strong><span style="font-family: courier new,courier; font-size: small;">CompositionTarget.Rendering += new EventHandler(RenderFrame);</span></strong></span></p>
<p style="text-align: justify;"><span style="font-family: arial,helvetica,sans-serif; font-size: small;">The callback function <strong>RenderFrame()</strong> is called every time the <strong>Rendering</strong> event is fired from <strong>CompositionTarget</strong>; in &nbsp;Figure 11 is shown the flow for RenderFrame() method. </span></p>
<p>&nbsp;&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/5488.figure12.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/5488.figure12.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/5488.figure12.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/5488.figure12.jpg" alt="" border="0" /></a></p>
<p align="center"><em><span style="color: #44546a; font-family: Calibri;">Figure </span></em><em><span style="color: #44546a;"><span style="font-family: Calibri;">12: main flow of the program</span></span></em></p>
<p style="text-align: justify;" align="center">&nbsp;<span style="font-size: small;">RenderFrame() has a main loop for scanning all elements of array of Ball class for two actions:</span>&nbsp;</p>
<ul>
<li style="text-align: justify;"><span style="font-size: small;">increase the position of the ellipse a step forward with magnitude specified in Vector velocity (<strong>v</strong>), to make an effect of animation:</span></li>
</ul>
<p style="text-align: justify; padding-left: 60px;"><strong><span style="font-family: courier new,courier; font-size: small;">balls[j].p = balls[j].p + balls[j].v;</span></strong></p>
<ul>
<li>
<div style="text-align: justify;" align="center"><span style="font-size: small;">verify that the ellipse does not intersect the edges of canvas. If the ellipse oversteps the boundary of canvas, it is applied an inversion of the velocity component orthogonal to the edge (see Figure 12)&nbsp;</span></div>
</li>
</ul>
<p style="text-align: justify;" align="center">&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/8407.figure13.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/8407.figure13.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/8407.figure13.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/8407.figure13.jpg" alt="" width="585" height="246" border="0" /></a></p>
<p style="text-align: justify;" align="center">&nbsp;</p>
<p align="center"><em><span style="color: #44546a; font-family: Calibri;">Figure </span></em><em><span style="color: #44546a;"><span style="font-family: Calibri;">13: inversion of velocity component orthogonal to the edge of canvas</span></span></em></p>
<p style="text-align: justify;"><span style="font-family: arial,helvetica,sans-serif; font-size: small;">Inside the main loop of the RenderFrame() method exists a further loop which makes two cascade &nbsp;checks:</span></p>
<ul>
<li>
<div style="text-align: justify;" align="center"><span style="font-size: small;">First check runs through the <strong>colliding()</strong> method, to establish if the specific ball doesn&rsquo;t intercept with any others.&nbsp; <strong>colliding()</strong> method accepts as input parameters two Balls class and return a boolean equal true in case of interception between two balls (i.e. balls[i] and&nbsp; balls[j]). To detect collision between two balls, is enough&nbsp;verify the distance between their centers is less than the sum of their radii. Given two circles (x0, y0, R0) and (x1,y1,R1), condition of interception follows the formula:</span></div>
</li>
</ul>
<p style="padding-left: 60px;"><span style="font-family: courier new,courier; font-size: small;">ABS(R0-R1) &lt;= SQRT((x0-x1)^2+(y0-y1)^2) &lt;= (R0+R1)</span></p>
<ul>
<li style="text-align: justify;"><span style="font-size: small;">Second check runs through <strong>resolveCollision();</strong> this last methods runs only if the <strong>colliding()</strong> methods detect an interception between balls. <strong>resolveCollision()</strong> method contains physics laws to control velocities of balls after collision and one algorithm based on Minimum Translation Distance (mtd) technique, to push balls apart in case of balls intersecting. Checking for collisions between balls happens through internal loop, created with start value that skips redundant checks:</span></li>
<ul>
<li style="text-align: justify;"><span style="font-size: small;">if you have to check if ball 1 collides with ball 2 then you don't need to check if ball 2 collides with ball 1.</span></li>
<li style="text-align: justify;"><span style="font-size: small;">it skips checking for collisions with itself</span></li>
</ul>
</ul>
<p style="text-align: justify;"><span style="font-size: small;">Below the colliding() routine.</span></p>
<p style="text-align: justify;" align="center"><span style="font-family: courier new,courier;">public bool colliding(Ball _ball1, Ball _ball2)</span><br /><span style="font-family: courier new,courier;">{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; double r1 = _ball1.r;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; double r2 = _ball2.r;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; double dist = (_ball1.p - _ball2.p).Length;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; if (dist &gt; (r1 + r2))</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; {</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // No solutions, the circles are too far apart.&nbsp; </span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return false;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; }</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; else if (dist &lt;= r1 + r2)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; {</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // One circle contains the other.</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return true;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; }</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; else if ((dist == 0) &amp;&amp; (r1 == r2))</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; {</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // the circles coincide.</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return true;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; }</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; else return true;</span><br /><span style="font-family: courier new,courier;">}</span></p>
<p>&nbsp;</p>
<p><span style="font-family: courier new,courier;">public void resolveCollision(Ball _ball1, Ball _ball2)</span><br /><span style="font-family: courier new,courier;">{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; double collisionision_angle = Math.Atan2((_ball2.p.Y - _ball1.p.Y), (_ball2.p.X - _ball1.p.X));&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; double speed1 = _ball1.v.Length;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; double speed2 = _ball2.v.Length;</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp; double direction_1 = Math.Atan2(_ball1.v.Y, _ball1.v.X);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; double direction_2 = Math.Atan2(_ball2.v.Y, _ball2.v.X);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; double new_xspeed_1 = speed1 * Math.Cos(direction_1 - collisionision_angle);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; double new_yspeed_1 = speed1 * Math.Sin(direction_1 - collisionision_angle);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; double new_xspeed_2 = speed2 * Math.Cos(direction_2 - collisionision_angle);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; double new_yspeed_2 = speed2 * Math.Sin(direction_2 - collisionision_angle);</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp; double final_xspeed_1 = ((_ball1.m - _ball2.m) * new_xspeed_1 + (_ball2.m + _ball2.m) * new_xspeed_2) / (_ball1.m + _ball2.m);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; double final_xspeed_2 = ((_ball1.m + _ball1.m) * new_xspeed_1 + (_ball2.m - _ball1.m) * new_xspeed_2) / (_ball1.m + _ball2.m);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; double final_yspeed_1 = new_yspeed_1;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; double final_yspeed_2 = new_yspeed_2;</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp; double cosAngle = Math.Cos(collisionision_angle);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; double sinAngle = Math.Sin(collisionision_angle);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; _ball1.v.X = cosAngle * final_xspeed_1 - sinAngle * final_yspeed_1;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; _ball1.v.Y = sinAngle * final_xspeed_1 + cosAngle * final_yspeed_1;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; _ball2.v.X = cosAngle * final_xspeed_2 - sinAngle * final_yspeed_2;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; _ball2.v.Y = sinAngle * final_xspeed_2 + cosAngle * final_yspeed_2;</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp; Vector pos1 = new Vector(_ball1.p.X, _ball1.p.Y);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; Vector pos2 = new Vector(_ball2.p.X, _ball2.p.Y);</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp; // get the mtd</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; Vector posDiff = pos1 - pos2;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; double d = posDiff.Length;</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp; // minimum translation distance to push balls apart after intersecting</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; Vector mtd = posDiff * (((_ball1.r + _ball2.r) - d) / d);</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp; // resolve intersection --</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; // computing inverse mass quantities</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; double im1 = 1 / _ball1.m;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; double im2 = 1 / _ball2.m;</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp; // push-pull them apart based off their mass</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; pos1 = pos1 + mtd * (im1 / (im1 + im2));</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; pos2 = pos2 - mtd * (im2 / (im1 + im2));</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; _ball1.p = pos1;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; _ball2.p = pos2;</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp; if (((_ball1.p.X + _ball1.r) &gt;= canv.Width) | ((_ball1.p.X - _ball1.r) &lt;= 0))</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _ball1.v.X = -1 * _ball1.v.X;</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp; if (((_ball1.p.Y + _ball1.r) &gt;= canv.Height) | ((_ball1.p.Y - _ball1.r) &lt;= 0))</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _ball1.v.Y = -1 * _ball1.v.Y;</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;if (((_ball2.p.X + _ball2.r) &gt;= canv.Width) | ((_ball2.p.X - _ball2.r) &lt;= 0))</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_ball2.v.X = -1 * _ball2.v.X;</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; if (((_ball2.p.Y + _ball2.r) &gt;= canv.Height) | ((_ball2.p.Y - _ball2.r) &lt;= 0))</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_ball2.v.Y = -1 * _ball2.v.Y;</span></p>
<p style="text-align: justify;" align="center"><span style="font-family: courier new,courier;">&nbsp;}</span></p>
<p style="text-align: justify;" align="center">&nbsp;<span style="font-size: small;">Here the code for <strong>RenderFrameFrame()</strong> method.</span></p>
<p><span style="font-family: courier new,courier;">public void RenderFrame(object sender, System.EventArgs e)</span><br /><span style="font-family: courier new,courier;">{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; for (int j = 0; j &lt; TotNumCircles; j++)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; {</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp; balls[j].p.X = balls[j].p.X + balls[j].v.X;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp; balls[j].p.Y = balls[j].p.Y + +balls[j].v.Y;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; balls[j].p = balls[j].p + balls[j].v;</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ((balls[j].p.X + balls[j].r) &gt;= canv.Width)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; balls[j].v.X = -1 * balls[j].v.X;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; balls[j].p.X = canv.Width - balls[j].r;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ((balls[j].p.X - balls[j].r) &lt;= 0)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; balls[j].v.X = -1 * balls[j].v.X;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; balls[j].p.X = balls[j].r;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ((balls[j].p.Y + balls[j].r) &gt;= canv.Height)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; balls[j].v.Y = -1 * balls[j].v.Y;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; balls[j].p.Y = canv.Height - balls[j].r;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ((balls[j].p.Y - balls[j].r) &lt;= 0)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; balls[j].v.Y = -1 * balls[j].v.Y;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; balls[j].p.Y = balls[j].r;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Canvas.SetLeft(balls[j].ellip, balls[j].p.X - balls[j].r);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Canvas.SetTop(balls[j].ellip, balls[j].p.Y - balls[j].r);</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int k = j + 1; k &lt; TotNumCircles; k++)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (colliding(balls[j], balls[k]))</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TextBoxCollision.Text = "Collision pair: " + j.ToString() + "-" + k.ToString();</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; resolveCollision(balls[k], balls[j]);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; }</span><br /><span style="font-family: courier new,courier;">}</span></p>
<p style="text-align: center;"><strong><span style="color: #0000cc; font-size: medium;">&nbsp;Porting to Windows Store Apps</span></strong></p>
<p style="text-align: justify;"><span style="font-size: small;">You might be interest to evaluate porting of the project to Windows Store Apps; effort is actually minimal, and the structure of project require few minor changes. </span><span style="font-size: small;">The <strong>System.Windows.Media.CompositionTarget</strong> class needs to be replaced in Windows StoreApps with <strong>Windows.UI.Xaml.Media.CompositionTarget</strong>&nbsp;&nbsp; class that represents the composited display surface of the application. The Rendering event occurs when the core rendering process renders a frame. </span><span style="font-size: small;">Missing&nbsp;&nbsp;<strong>System.Windows.Vector</strong> class in Windows StoreApps can be overcome creating our own Vector class:</span></p>
<p><span style="font-family: courier new,courier;">public class Vector</span><br /><span style="font-family: courier new,courier;">{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; private double _x, _y;</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; public Vector(double x, double y) { _x = x; _y = y; }</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp; public double X</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; {</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; get { return _x; }</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set { _x = value; }</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; }</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp; public double Y</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; {</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; get { return _y; }</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set { _y = value; }</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; }</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp; public static Vector operator +(Vector v1, Vector v2)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; {</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return new Vector(v1.X + v2.X, v1.Y + v2.Y);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; }</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; public static Vector operator -(Vector v1, Vector v2)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; {</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return new Vector(v1.X - v2.X, v1.Y - v2.Y);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; }</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; public static Vector operator *(Vector v1, double scale)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; {</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return new Vector(v1.X * scale, v1.Y * scale);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; }</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; public static Vector operator *( double scale, Vector v1)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; {</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return new Vector(v1.X * scale, v1.Y * scale);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; }</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; public double Length</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp; {</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; get { return ((double)Math.Sqrt(X * X + Y * Y)); }</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (value &lt; 0)</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; throw new ArgumentOutOfRangeException("value", value, </span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "The magnitude of a Vector must be a positive value greater than 0");</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; }</span><br /><span style="font-family: courier new,courier;">}</span></p>
<p style="text-align: justify;"><span style="font-size: small;">In the Vector class the operator * should accept interchanging in the order of operands; this properties can be achieve through two methods: one method for the sequence (vector, double) and the other for the sequence (double, vector). </span><span style="font-size: small;">In our project the variable <span style="font-family: courier new,courier;"><strong>TotNumCircles</strong></span> controls the total number of ellipses to be animated in canvas control. At runtime the user can change the variable T<span style="font-family: courier new,courier;"><strong>otNumCircles</strong></span> through&nbsp; a slider. Simultaneously the value of variable has to be shown to the UI through a Textbox. A correct implementation requires that Textbox control always shows the current value of the variable &nbsp;<span style="font-family: courier new,courier;"><strong>TotNumCircles</strong></span>, or in other words TextBox value has to be always alignment with slider&rsquo;s value. Data binding can be used either between UI-elements or to bind CLR-objects and UI-elements together. To achieve the right constrain we bind the TextBox&rsquo;s Text-property to Slider&rsquo;s value. Using as data binding TwoWay, when we change the sliders value the TextBox&rsquo;s Text-property will be updated as well. If we type a value into the TextBox the slider will be updated as well. Below the relative fragment of <strong>MainPage.xaml</strong>:</span></p>
<p style="text-align: justify;"><span style="font-family: courier new,courier;"><strong><span style="font-size: small;">.....</span></strong></span></p>
<p>&nbsp;<span style="font-family: courier new,courier;">&lt;Slider Name="<em>SliderTotalBalls</em>" Minimum="10" Maximum="100" &nbsp;TickFrequency="1" &nbsp;ValueChanged="Slider_ValueChanged" /&gt;</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&lt;TextBox Name="TextBoxTotNumBalls" Text="{<span style="color: #ff0000;"><strong>Binding ElementName</strong></span>=<em>SliderTotalBalls</em>, <span style="color: #ff0000;"><strong>Path</strong></span>=Value, <span style="color: #ff0000;"><strong>Mode</strong></span>=TwoWay}" /&gt;</span></p>
<p><span style="font-family: courier new,courier;"><span style="font-family: courier new,courier;"><strong><span style="font-size: small;">.....</span></strong></span></span></p>
<p style="text-align: justify;"><span style="font-size: small;">To complete our porting in Windows Store apps, we apply two last changes:</span></p>
<ul>
<li><span style="font-size: small;"><span style="color: #0000cc;"><strong>System.Windows.RoutedPropertyChangedEventArgs</strong>&nbsp;</span> class needs to be replaced with <span style="color: #0000cc;"><strong>Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs</strong></span></span></li>
<li><span style="font-size: small;"><span style="color: #0000cc;"><strong>System.Windows.Media.Brushes </strong></span>needs to be replaced with <span style="color: #0000cc;"><strong>Windows.UI.Colors</strong></span></span></li>
</ul>
<p style="padding-left: 30px;"><strong><span style="font-family: Calibri; font-size: small;">&nbsp;</span></strong><span style="font-size: small;">i.e.&nbsp;&nbsp;&nbsp; </span></p>
<p style="padding-left: 30px;"><span style="font-size: small;"><span style="font-family: courier new,courier;">balls[k].ellip.Fill =<strong>System.Windows.Media.Brushes.Blue</strong>; </span></span></p>
<p style="padding-left: 30px;"><span style="font-size: small;">is replaced in Windows Store App with:&nbsp; <span style="font-family: courier new,courier;">balls[k].ellip.Fill = <strong>SolidColorBrush(Windows.UI.Colors.Blue);</strong></span></span></p>
<p style="text-align: justify;">[View:https://www.youtube.com/watch?v=8_z9_SIjMAs]&nbsp;</p>
<p style="text-align: justify;"><span style="font-size: small;">You can download the Visual Studio 2012 projects here:</span></p>
<p style="padding-left: 30px;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/7652.BallsCollisionFrameBased.zip" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/7652.BallsCollisionFrameBased.zip"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/4606.zip.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/4606.zip.gif" alt="" border="0" /> BallsCollisionFrameBased.zip</a>&nbsp;<br /> <strong><em>Frame-based project</em></strong>.</p>
<p style="padding-left: 30px;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/4617.BallsCollisionTimerBased.zip" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/4617.BallsCollisionTimerBased.zip"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/4606.zip.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/4606.zip.gif" alt="" border="0" /> AnimationSpinningCircles_FrameBased.zip</a>&nbsp;<br /> <em><strong>Timer-based project.</strong></em></p>
<p style="padding-left: 30px;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/7853.BallsCollisionFrameBasedWin8.zip" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/7853.BallsCollisionFrameBasedWin8.zip"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/09/BallsCollision/4606.zip.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-09-BallsCollision/4606.zip.gif" alt="" border="0" /> SpinningCircles_FrameBasedWin8.zip</a>;<br /> <em><strong>Windows Store App Frame-based project.</strong></em></p>
<h2><span style="color: #0000cc; font-size: medium;"><span style="font-family: Calibri;">Reference</span></span></h2>
<p>&nbsp;Ball to Ball Collision - Detection and Handling:&nbsp; <a href="http://stackoverflow.com/questions/345838/ball-to-ball-collision-detection-and-handling">http://stackoverflow.com/questions/345838/ball-to-ball-collision-detection-and-handling</a></p>
<p>The physics of an elastic collision: Part I&nbsp;&nbsp; <a href="http://www.director-online.com/buildArticle.php?id=460">http://www.director-online.com/buildArticle.php?id=460</a></p>
<p>The Physics of an Elastic Collision (Part 2) <a href="http://www.director-online.com/buildArticle.php?id=532">http://www.director-online.com/buildArticle.php?id=532</a></p>
<p>Central&nbsp;and Eccentric&nbsp;Collisions&nbsp;of Balls <a href="http://physics-animations.com/Physics/English/par_txt.htm">http://physics-animations.com/Physics/English/par_txt.htm</a></p>]]></content:encoded>
    </item>
  </channel>
</rss>