Channels ▼

Gastón Hillar

Dr. Dobb's Bloggers

Multicore Programming Possibilities with Windows Azure SDK 1.3

February 11, 2011

You can use your parallelized algorithms that exploit modern multicore microprocessors in Windows Azure. Since the release of Microsoft Azure SDK v1.2, you can use .NET Framework 4 as the target framework for any of your cloud-targeted projects. The newest Windows Azure SDK version is 1.3 and you can take advantage of Parallel Extensions with this SDK.When Microsoft launched Windows Azure, almost a year ago, you had to use .NET Framework 3.5 or earlier versions as the target framework for any of your cloud-targeted projects. Remember that Microsoft launched Windows Azure before Visual Studio 2010 RTM. Thus, you will find many Windows Azure sample applications that use .NET Framework 3.5 as the target framework. You can change the target framework for an existing cloud-targeted project from previous .NET Framework versions to .NET Framework 4, and you will have access to Parallel Extensions.

If you right-click on an existing cloud-targeted project in the Solution Explorer, in Visual Studio 2010, and then you go to the Application page, you will see .NET Framework 4 as one of the available options in the Target framework dropdown list.

.NET Framework 4 is available as a Target framework for your cloud-targeted projects with Windows Azure SDK 1.3 installed.

The entry point for a Windows Azure Worker Role is the Run() method and it's already famous infinite loop that processes messages in the queue and calls the Thread.Sleep method. You can reduce the time required to process compute-bound messages by using Parallel Extensions to take advantage of the available cores. Then, you can select the target VM (short for Virtual Machine) size according to the desired response time for each request and your budget. Windows Azure allows you to scale from 1 to 8 cores. You can use your Parallel Extensions knowledge to design and code a Worker Role that scales as the VM size increases. Each worker can run code optimized to take advantage of multicore. However, one of the problems with the Windows Azure Platform is that the ExtraLarge VM size is twice the price of the Large VM size. The former provides 8 cores and the latter 4 cores. You shouldn't expect your algorithm to achieve linear speedup when you change the VM size from Large to ExtraLarge. You can check the different VM sizes in the "How to Configure Virtual Machine Sizes" MSDN documentation article. The lowest price ExtraSmall VM size shares the CPU cores with others and it is still in Beta version.

I received dozens of e-mails with similar questions about the relationship between Windows Azure and Parallel Extensions. Developers and architects have many doubts about the usage of Parallel Extension with Azure projects. You can use Parallel Extensions to create efficient algorithms that scale as the number of cores available in the target VM increase. If you need a better response time in a compute-intensive algorithm prepared to take advantage of multicore, you just need to select a target VM with more cores. Of course, you also have to pay more money for the new VM size. Your code should be as efficient as possible because you want to take full advantage of the cores that you're paying for. If you create an efficient service or building block component that scales with the VM size, you can submit it to the new Windows Azure Marketplace.

The Windows Azure VM Role is still in Beta version. However, this new role provides an excellent opportunity to move a server image to the cloud. Applications that already take advantage of multicore running on Windows Server 2008 R2 can run in the VM Role with the desired number of cores. If you don't have an octo-core CPU and you want to test scalability for an existing algorithm on Windows Server 2008 R2, you can create and deploy a VM Role. Then, you can select the desired VM size and you will be able to test the scalability from 1 to 8 cores. The VM Role is very helpful for developers that want to test scalability for parallelized algorithms and to make it simpler to move existing Windows applications to the cloud.

I do believe multicore programming is very important for Windows Azure and for any cloud-targeted project. Each VM size provides different number of cores and you pay for those cores. Many services will require multicore optimization and there is a great opportunity for Parallel Extensions to be extremely popular in Windows Azure projects.

Dennis Gannon and Dan Reed provide an excellent overview of the relationship between parallelism and the cloud in "Parallelism and the Cloud."

Amit Chatterjee wrote a very interesting article "Parallelism: In the Cloud, Cluster and Client." The article promotes Microsoft tools and languages. However, Amit's post provides an interesting explanation of the challenges in parallel computing and the complexity of modern IT solutions.

Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.
 


Video