<?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>Risman Adnan Mattotorang</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/risman/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/risman/feed.xml</link>
    <description>On Scientific and Parallel Computing</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:24:03 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Windows Azure Toolkit for Windows Phone</title>
      <link>https://docs.microsoft.com/archive/blogs/risman/windows-azure-toolkit-for-windows-phone</link>
      <pubDate>Sat, 04 Feb 2012 11:59:38 GMT</pubDate>
      <dc:creator><![CDATA[Mattotorang]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/risman/2012/02/04/windows-azure-toolkit-for-windows-phone/</guid>
      <description><![CDATA[Live from Nokia Lumia Code 24 hours event in Bandung. I’m still here with 800 developers who fight...]]></description>
      <content:encoded><![CDATA[<p>Live from Nokia Lumia Code 24 hours event in Bandung. I’m still here with 800 developers who fight to finish their apps with the rest of time – 7 hours to go for 24 hours record. As I had limited time before to talk more about Windows Phone and Azure, in this post I will cover more of it, specific on <a href="http://watwp.codeplex.com/">Windows Azure Toolkit for Windows Phone</a> (WATWP). WATWP provides Windows Phone Cloud Application project template for Visual Studio makes it easier for developers to create a Windows Phone application that relies on Windows Azure Storage and SQL Azure. You can download this toolkit on <a href="http://watwp.codeplex.com/">CodePlex</a> and install, but before that, you have to prepare dependency check then do installations for all required components showed below. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/2816.image_01CD32B5.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/2816.image_5F00_01CD32B5.png"><img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/5428.image_thumb_27'56.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/5428.image_5F00_thumb_5F00_27270056.png" width="319" height="239" /></a>&#160;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/6574.image_5C8F9CAE.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/6574.image_5F00_5C8F9CAE.png"><img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/3426.image_thumb_428BB6BF.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/3426.image_5F00_thumb_5F00_428BB6BF.png" width="387" height="238" /></a></p>  <p>WATWP provides Visual Studio template to create Azure backed end Windows Phone apps. Lets start to see its features, assuming you are not having Azure account yet. WATWP will prompt a dialog to choose cloud data storage mode of your application, on Windows Azure Storage, SQL Azure Storage or OData Service. In my case, I will show simple scenario using Windows Azure storage on Visual Studio Storage Emulator. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/2821.image_7285E273.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/2821.image_5F00_7285E273.png"><img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/4643.image_thumb_6DDFB1EC.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/4643.image_5F00_thumb_5F00_6DDFB1EC.png" width="334" height="181" /></a>&#160;&#160; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/4048.image_07A3C24F.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/4048.image_5F00_07A3C24F.png"><img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/1563.image_thumb_0F6BB4F1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/1563.image_5F00_thumb_5F00_0F6BB4F1.png" width="335" height="181" /></a></p>  <p>WATWP template that I used provides push notification services with two options of authentication mechanism – ASP.NET Membership or Azure ACS. I used the membership version in this walkthrough. Make sure that you do not have any Web site running in ports 443 and 10080 on your local IIS before continue. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/0804.image_51AEA767.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/0804.image_5F00_51AEA767.png"><img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/6648.image_thumb_230878B8.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/6648.image_5F00_thumb_5F00_230878B8.png" width="329" height="178" /></a>&#160;&#160; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/1856.image_714D5B62.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/1856.image_5F00_714D5B62.png"><img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/3681.image_thumb_5C7B62E2.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/3681.image_5F00_thumb_5F00_5C7B62E2.png" width="343" height="186" /></a></p>  <p>Just continue if you get certificate error until you get the landing ASP.NET page (administration page). To log into the Web application use the following credentials:    <br />    <br /><strong>User Name</strong>: admin     <br /><strong>Password</strong>:&#160; Passw0rd! (with a zero)     <br />    <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/6371.image_1D5A3287.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/6371.image_5F00_1D5A3287.png"><img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/8831.image_thumb_3645DCFF.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/8831.image_5F00_thumb_5F00_3645DCFF.png" width="333" height="194" /></a>&#160;&#160;&#160; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/6825.image_613DCB04.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/6825.image_5F00_613DCB04.png"><img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/6404.image_thumb_47596F08.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/6404.image_5F00_thumb_5F00_47596F08.png" width="337" height="196" /></a>    <br />    <br />Once you logged in, you will get the page that manage Azure Storage (Table, Queue and Blob) and Microsoft Push Notifications. Let see on the Windows Phone project solution – build and debug it. The app will redirect us to the log in page. If we click log on, that will open IE in the Windows Phone Emulator at <a href="http://127.0.0.1:10080/127.0.0.1.cer">http://127.0.0.1:10080/127.0.0.1.cer</a>. Once logged in Windows Phone emulator, you can enable push notification. </p> In order to consume the REST services over HTTPS in a Windows Phone device or in the Windows Phone Emulator, you need to use a trusted SSL certificate. If you do not have one, you can use a self-signed certificate, but you need to install it in the phone before consuming the services.  <br />Since the Computer Emulator always uses the 127.0.0.1 self-signed certificate, we need to install it in the Windows Phone Emulator before continuing with the next steps. If you leave the Windows Phone Emulator open, you do not need to install the certificate every time that you run the application. However, if you close the Windows Phone Emulator, you will have to install it again.  <p>   <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/7181.image_6D1F6F9E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/7181.image_5F00_6D1F6F9E.png"><img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/3823.image_thumb_296772E2.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/3823.image_5F00_thumb_5F00_296772E2.png" width="179" height="337" /></a>&#160; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/2500.image_4C5798B8.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/2500.image_5F00_4C5798B8.png"><img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/0871.image_thumb_52028C91.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/0871.image_5F00_thumb_5F00_52028C91.png" width="179" height="333" /></a>&#160; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/4784.image_620E08F0.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/4784.image_5F00_620E08F0.png"><img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/1856.image_thumb_7A0101E4.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/1856.image_5F00_thumb_5F00_7A0101E4.png" width="179" height="334" /></a>&#160;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/0844.image_6AA98BD6.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/0844.image_5F00_6AA98BD6.png"><img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/8004.image_thumb_1F264A20.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/8004.image_5F00_thumb_5F00_1F264A20.png" width="178" height="330" /></a>    <br />    <br />Once push notification enabled on Windows Phone (or emulator), the device will be connected to Microsoft Push Notification Service. You can logon the web administration to send notification messages. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/7673.image_0541EE24.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/7673.image_5F00_0541EE24.png"><img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/4532.image_thumb_7F5310BE.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/4532.image_5F00_thumb_5F00_7F5310BE.png" width="520" height="304" /></a>&#160;&#160;&#160;&#160;&#160; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/6064.image_428AA0BA.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/6064.image_5F00_428AA0BA.png"><img style="padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/0753.image_thumb_0E51A1CE.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/0753.image_5F00_thumb_5F00_0E51A1CE.png" width="163" height="303" /></a></p>  <p>You can also do Toast and Tile – where you can push notification from Administration page to device. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/2133.image_5F0F9069.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/2133.image_5F00_5F0F9069.png"><img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/5187.image_thumb_2C6F0F86.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/5187.image_5F00_thumb_5F00_2C6F0F86.png" width="700" height="374" /></a></p>  <p>Many more features on WAT-WP. Stay tune till the closing – 7 hours to go. I hope I can close our 24 hour session by explaining Windows Azure toolkit for WP !! Love and proud to all of you. You will get more info if you attend my session in the morning, I will show to to extend the WAT for your custom apps with Azure backend!. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/5125.image_64C5AA3A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/5125.image_5F00_64C5AA3A.png"><img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/8814.image_thumb_5F26C82F.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/8814.image_5F00_thumb_5F00_5F26C82F.png" width="703" height="364" /></a></p>  <p>&#160;</p>  <p>Keep wake up, stay tune!   <br><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/0652.image_56469A16.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/0652.image_5F00_56469A16.png"><img style="margin: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/5428.image_thumb_3C3DDE81.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/5428.image_5F00_thumb_5F00_3C3DDE81.png" width="244" height="128" /></a></br> </p>  <p>Cheers – Risman Adnan </p>]]></content:encoded>
    </item>
    <item>
      <title>Windows Phone 7 Video Smooth Streaming Client</title>
      <link>https://docs.microsoft.com/archive/blogs/risman/windows-phone-7-video-smooth-streaming-client</link>
      <pubDate>Fri, 03 Feb 2012 09:09:22 GMT</pubDate>
      <dc:creator><![CDATA[Mattotorang]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/risman/2012/02/03/windows-phone-7-video-smooth-streaming-client/</guid>
      <description><![CDATA[I will show a demo on Nokia Lumia Developer event tomorrow. If you missed that great event, you can...]]></description>
      <content:encoded><![CDATA[<p>I will show a demo on <a href="http://msdn.microsoft.com/id-id/hh801940">Nokia Lumia Developer event</a> tomorrow. If you missed that great event, you can follow this guidance for your self exploration on Windows Phone Smooth Streaming Client. Note that you will need the following tools to follow this walkthrough. You can use Microsoft <a href="http://www.microsoft.com/web/downloads/platform.aspx">Web Platform Installer 3.0</a>, to make your installation process easier than manually download one-by-one through different websites. In WPI 3.0, you have to install the following tools and server:     <br />    <br /><strong>Tools      <br /></strong>1. <a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;id=27570">Windows Phone SDK 7.1</a>    <br />2. Expression Encoder 4 SP2     <br />    <br /><strong>Server      <br /></strong>1. IIS Web Server. Install using Windows Control Panel – Windows Features.     <br />2. IIS 7 Recommended Configuration     <br />3. IIS Media Service 4.1     <br />4. IIS Smooth Streaming Client 1.5 (Update 2)     <br />    <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/6837.image_4E987AFD.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/6837.image_5F00_4E987AFD.png"><img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/0576.image_thumb_142CDF4F.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/0576.image_5F00_thumb_5F00_142CDF4F.png" width="538" height="373" /></a></p>  <p>To enable smooth streaming service in your IIS Web Server, you have to make sure that you have Media Service is installed.    <br />    <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/1638.image_7309BCE7.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/1638.image_5F00_7309BCE7.png"><img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/4760.image_thumb_6FC7AF32.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/4760.image_5F00_thumb_5F00_6FC7AF32.png" width="538" height="325" /></a></p>    <p>Once you installed both Server and Tools, you are ready to go with this walkthrough. There are 3 major steps you need to follow:    <br />1. Prepare encoded video using Expression Encoder     <br />2. Publish encoded video to IIS for HTTP access     <br />3. Create Windows Phone client video player     <br />    <br />Lets start with the step 1 to prepare the video using Expression Encoder.     <br />    <br /><strong>     <br />Prepare Encoded Video using Expression Encoder       <br /></strong>    <br /><a href="http://www.iis.net/download/SmoothStreaming">Smooth Streaming</a>, an IIS Media Services extension, enables adaptive streaming of media to Silverlight and other clients over HTTP. Smooth Streaming uses simple concept of delivering small content fragments (typically 2 seconds worth of video) and verifying that each has arrived within the appropriate time and played back at the expected quality level. If one fragment doesn't meet these requirements, the next fragment delivered will be at a somewhat lower quality level. Conversely, when conditions allow it, the quality of subsequent fragments will be at a higher level. To create Smooth Streaming presentations, the source content (video or audio) is encoded using Expression Encoder then content is delivered using a Smooth Streaming-enabled IIS web server. First, open you Expression encoder – choose Silverlight Project - then import your source video to Expression Encoder (in my case, wpVideo01.wmv). For Windows Phone client, you have to <strong>apply</strong> VC-1 IIS Smooth Streaming – SD 480p VBR - No bit rate encoding support for Windows Phone so far, but it may appear in future. After you apply, you can choose Thumbnail and your encoded job output location.     <br />    <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/0045.image_63960F3E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/0045.image_5F00_63960F3E.png"><img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/3386.image_thumb_68984CED.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/3386.image_5F00_thumb_5F00_68984CED.png" width="356" height="167" /></a>&#160;&#160; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/4331.image_7857E1F1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/4331.image_5F00_7857E1F1.png"><img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/2100.image_thumb_645E4F5B.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/2100.image_5F00_thumb_5F00_645E4F5B.png" width="441" height="165" /></a>    <br />    <br />If all is ready, then you can start encoding using Encode button. It will take some time to finish, depend to the size of encoded source and the capacity of your computer. After encoding process finished, Expression encoder will prompt you a landing page where you can test your video browser. It means, the presentation files of smooth streaming are ready at job output location. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/3264.image_6CFEA7E7.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/3264.image_5F00_6CFEA7E7.png"><img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/1273.image_thumb_634613E4.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/1273.image_5F00_thumb_5F00_634613E4.png" width="816" height="440" /></a></p>  <p>Here is the files generated by Expression Encoder. Default.html is the landing page for test, *.xap is Silverlight player template, IIS Smooth Streaming encoded files (fragmented videos with different bit rate), ISM and its configuration XML files. ISM is a XML file that contain stream index of video fragments. The manifest can be accessed through web browser <a href="http://localhost/[]/wpVideo01.ism/manifest">http://localhost/[]/wpVideo01.ism/manifest</a>. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/0284.image_5563A81C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/0284.image_5F00_5563A81C.png"><img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/3817.image_thumb_6E12CF5F.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/3817.image_5F00_thumb_5F00_6E12CF5F.png" width="411" height="277" /></a>&#160; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/7522.image_0CB9937E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/7522.image_5F00_0CB9937E.png"><img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/7028.image_thumb_30FE7800.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/7028.image_5F00_thumb_5F00_30FE7800.png" width="396" height="277" /></a></p>  <p>Now lets move to step #2 to publish the presentation files to IIS Web server. </p>  <p>   <br /><strong>Publish Encoded Video to IIS for HTTP Access      <br /></strong>    <br />We have to create Website or Web Application in IIS to host the presentation files. Go to IIS manager, right click on Default Website and add Application. Specify the Alias of your web application (NokiaDemo) and location of presentation files (Expression encoder job output location where video fragments and ISM file located). Test the manifest by access following URL: <a title="http://localhost/NokiaDemo/wpVideo01.ism/manifest" href="http://localhost/NokiaDemo/wpVideo01.ism/manifest">http://localhost/NokiaDemo/wpVideo01.ism/manifest</a> until you can read the manifest. You can also test the video in browser using the Default.html file given by Expression Encoder : <a title="http://localhost/NokiaDemo/Default.html" href="http://localhost/NokiaDemo/Default.html">http://localhost/NokiaDemo/Default.html</a>. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/5050.image_4DB7ED15.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/5050.image_5F00_4DB7ED15.png"><img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/8255.image_thumb_482930D7.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/8255.image_5F00_thumb_5F00_482930D7.png" width="812" height="255" /></a></p>  <p>If everything went well, you are ready to go with step #3, to create a video player. It will require your coding skill, little bit!.</p>  <p>   <br /><strong>Create Windows Phone Client Video Player      <br /></strong>    <br />The good news is, Microsoft already prepare framework and reusable components for you to utilize. Not build from zero. There are two options, using the <a href="http://www.iis.net/download/SmoothClient">IIS Smooth Streaming Client 1.5 APIs</a> (available on WPI 3.0 or <a href="http://www.iis.net/download/smoothclient">download here)</a> or using the Microsoft Media Platform: Player Framework (MMPPF) – an open source version. IIS Smooth Streaming Client 1.5 API is a core component of MMPPF.&#160; Both provide an easy-to-use interface for developers and designers to create rich Smooth Streaming experiences using the Microsoft Silverlight platform on Windows Phone device. If you prefer to use Smooth Streaming Client 1.5 APIs, you can download simple demo player here that utilized the DLLs. What I will show you in this post is using MMPPF, that you can download the source code version at <a href="http://smf.codeplex.com/">SMF Codeplex</a> site. While writing this post, I am using microsoft-smf-src-2.2011.1101.0. To compile from source codes, you can open SilverlightMediaFramework.Phone.sln file in Visual Studio then Rebuild the solution. You have a very nice sample application inside the solution, Microsoft.SilverlightMediaFramework.TestPhone, that accesses to 2 Channel9 video manifests:     <br />    <br /><a href="http://ecn.channel9.msdn.com/o9/content/smf/smoothcontent/bbbwp7/big">http://ecn.channel9.msdn.com/o9/content/smf/smoothcontent/bbbwp7/big</a> buck bunny.ism/manifest     <br /><a title="http://ecn.channel9.msdn.com/o9/content/smf/smoothcontent/edwp7/Elephants_Dream_1024-h264-st-aac.ism/manifest" href="http://ecn.channel9.msdn.com/o9/content/smf/smoothcontent/edwp7/Elephants_Dream_1024-h264-st-aac.ism/manifest">http://ecn.channel9.msdn.com/o9/content/smf/smoothcontent/edwp7/Elephants_Dream_1024-h264-st-aac.ism/manifest</a>&#160; <br />    <br />If you have internet connection, you can debug and test it in your Windows Phone emulator. Big Buck Bunny and Elephants Dream are Smooth Streaming while the Wildlife is a simple progressive download. You can experience the different between Smooth Streaming and Progressive download model from this sample application. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/5025.image_785FDFC0.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/5025.image_5F00_785FDFC0.png"><img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/1222.image_thumb_5627D43A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/1222.image_5F00_thumb_5F00_5627D43A.png" width="283" height="448" /></a>&#160;&#160;&#160; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/5826.image_19432C9B.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/5826.image_5F00_19432C9B.png"><img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/5582.image_thumb_770B2114.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/5582.image_5F00_thumb_5F00_770B2114.png" width="280" height="447" /></a>&#160;&#160;&#160; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/7635.image_4864F265.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/7635.image_5F00_4864F265.png"><img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/4118.image_thumb_61BCCFD2.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/4118.image_5F00_thumb_5F00_61BCCFD2.png" width="239" height="445" /></a></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/5076.image_0450E881.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/5076.image_5F00_0450E881.png"><img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/3005.image_thumb_3B772422.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/3005.image_5F00_thumb_5F00_3B772422.png" width="412" height="223" /></a>&#160;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/8875.image_67A38539.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/8875.image_5F00_67A38539.png"><img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/4150.image_thumb_650A2DAE.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/4150.image_5F00_thumb_5F00_650A2DAE.png" width="412" height="222" /></a></p>  <p>I’m going to show you how to create simple player using MMPPF for <strong>wpVideo01</strong> file that we already encoded and published in step #1-2. The result of your SMF compilation for Windows Phone will be located at wpbin directory. Create a Phone Silverlight Application in Visual Studio add reference to the following DLL:&#160; <br />    <br />- <strong>Microsoft.Web.Media.SmoothStreaming.dll     <br />- Microsoft.SilverlightMediaFramework.Core.Phone.dll      <br />- Microsoft.SilverlightMediaFramework.Plugins.Phone.dll      <br />- Microsoft.SilverlightMediaFramework.Utilities.Phone.dll      <br />- Microsoft.SilverlightMediaFramework.Compatibility.Phone.dll      <br />- Microsoft.SilverlightMediaFramework.Plugins.SmoothStreaming.Phone.dll      <br /></strong></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/8322.image_10AAD1DE.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/8322.image_5F00_10AAD1DE.png"><img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/6366.image_thumb_1BF3E61B.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/6366.image_5F00_thumb_5F00_1BF3E61B.png" width="279" height="328" /></a>&#160; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/8738.image_1E6CF20C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/8738.image_5F00_1E6CF20C.png"><img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/0486.image_thumb_1162EC2E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/0486.image_5F00_thumb_5F00_1162EC2E.png" width="537" height="328" /></a></p>  <p>Choose your Windows Phone OS version, in my case I’m using WP OS 7.1 (Mango). After project created, add reference to the DLLs. </p>  <p>&#160;&#160;&#160; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/6663.image_7E120FC1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/6663.image_5F00_7E120FC1.png"><img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/2553.image_thumb_7469A18B.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/2553.image_5F00_thumb_5F00_7469A18B.png" width="247" height="298" /></a>&#160; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/7416.image_5F97A90B.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/7416.image_5F00_5F97A90B.png"><img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/1524.image_thumb_43669E86.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/1524.image_5F00_thumb_5F00_43669E86.png" width="557" height="301" /></a></p>  <p>Add the following namespace into your MainPage.xaml file:</p>  <p><font color="#ff0000">xmlns:Core=&quot;clr-namespace:Microsoft.SilverlightMediaFramework.Core;assembly=Microsoft.SilverlightMediaFramework.Core.Phone&quot;      <br />xmlns:Media=&quot;clr-namespace:Microsoft.SilverlightMediaFramework.Core.Media;assembly=Microsoft.SilverlightMediaFramework.Core.Phone&quot;       <br />xmlns:ssme=&quot;clr-namespace:Microsoft.Web.Media.SmoothStreaming;assembly=Microsoft.Web.Media.SmoothStreaming&quot;</font></p>    <p>Then add a player on the page to play stream media by the following codes on content Grid.</p>  <p><font color="#ff0000">&lt;StackPanel Orientation=&quot;Vertical&quot;&gt;      <br />&#160;&#160;&#160; &lt;TextBlock Text=&quot;WP7 Smooth Streaming Demo&quot; Height=&quot;22&quot; Width=&quot;266&quot; FontSize=&quot;12&quot; Foreground=&quot;Blue&quot;/&gt;       <br />&#160;&#160;&#160; &lt;Core:SMFPlayer Name=&quot;strmPlayer&quot;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; HorizontalAlignment=&quot;Stretch&quot;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Margin=&quot;0&quot;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; VerticalAlignment=&quot;Stretch&quot;/&gt;       <br />&lt;/StackPanel&gt;</font></p>  <p>Last, you need to write some C# code on the MainPage.xaml.cs, to create a play list of streamed media and play in the player. </p>  <p><font color="#0000ff">using System;      <br />using Microsoft.Phone.Controls;       <br />using Microsoft.SilverlightMediaFramework.Core.Media;</font></p>  <p><font color="#0000ff">namespace Streaming      <br />{       <br />&#160;&#160;&#160; public partial class MainPage : PhoneApplicationPage      <br />&#160;&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Constructor       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; public MainPage()       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; InitializeComponent();       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; PlaylistItem item = new PlaylistItem();       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; item.MediaSource = new Uri(&quot;</font><a href="http://localhost/NokiaDemo/wpVideo01.ism/manifest&quot;);"><font color="#0000ff"><strong>http://localhost/NokiaDemo/wpVideo01.ism/manifest</strong>&quot;);</font></a>    <br /><font color="#0000ff">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; item.DeliveryMethod = Microsoft.SilverlightMediaFramework.Plugins.Primitives.DeliveryMethods.AdaptiveStreaming;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; strmPlayer.Playlist.Add(item);       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; strmPlayer.Play();       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</font></p>  <p><font color="#0000ff">&#160;&#160;&#160; }      <br />}</font></p>  <p>Make sure that you put the right MediaSource URI then you are done!.&#160;&#160; <br />    <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/2185.image_7FEE7756.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/2185.image_5F00_7FEE7756.png"><img style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/71/68/metablogapi/5238.image_thumb_37B095AD.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-71-68-metablogapi/5238.image_5F00_thumb_5F00_37B095AD.png" width="686" height="370" /></a></p>  <p>&#160;</p>  <p>I hope this walkthrough demo is useful for you. You can try many more features in the MMPPF by looking into the sample application. </p>  <p>&#160;</p>  <p>Cheers – Risman Adnan </p>]]></content:encoded>
    </item>
    <item>
      <title>Azure Talk in Vietnam</title>
      <link>https://docs.microsoft.com/archive/blogs/risman/azure-talk-in-vietnam</link>
      <pubDate>Sun, 09 Oct 2011 06:53:45 GMT</pubDate>
      <dc:creator><![CDATA[Mattotorang]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/risman/2011/10/09/azure-talk-in-vietnam/</guid>
      <description><![CDATA[This blog will live again.   I will be delivering 2 Azure developer talks in Hanoi and Saigon. Happy...]]></description>
      <content:encoded><![CDATA[<p>This blog will live again. </p>  <p>I will be delivering 2 Azure developer talks in Hanoi and Saigon. Happy to be there one more time.</p>  <p>Cheers - RAM</p>]]></content:encoded>
    </item>
    <item>
      <title>Physics e-Learning Portal - Envisioning</title>
      <link>https://docs.microsoft.com/archive/blogs/risman/physics-e-learning-portal-envisioning</link>
      <pubDate>Sat, 04 Apr 2009 03:22:09 GMT</pubDate>
      <dc:creator><![CDATA[Mattotorang]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/risman/2009/04/04/physics-e-learning-portal-envisioning/</guid>
      <description><![CDATA[I am working to help some of physicists who run KucingFisika, to design their future multimedia...]]></description>
      <content:encoded><![CDATA[<p>I am working to help some of physicists who run <a href="http://www.kucingfisika.com">KucingFisika</a>, to design their future multimedia e-learning site with Silverlight. From animation perspective, I am considering to use <a href="http://www.farseergames.com/">Farseer Physics Games</a> engine. You can see some demos from icons below. Please go to Codeplex to download <a href="http://www.codeplex.com/FarseerPhysics">Farseer Physics</a>.     <br />    <br /><a href="http://www.farseergames.com/Games/TireStorm/TireStorm.aspx"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="001" border="0" alt="001" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/001_3.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/001_3.jpg" width="168" height="150" /></a>&#160; <a href="http://www.farseergames.com/Games/WeAreBugs/WeAreBugs.aspx"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="002" border="0" alt="002" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/002_3.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/002_3.jpg" width="165" height="150" /></a>&#160; <a href="http://www.farseergames.com/Games/WaterDemo/WaterDemo.aspx"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="003" border="0" alt="003" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/003_3.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/003_3.jpg" width="172" height="150" /></a> </p>  <p>The next step for me is to develop end-to-end solution architecture in managing RIA based application like this. After looking around for design practices, I found that Microsoft .NET RIA Services is good as our base line. This is now available and you can <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=76bb3a07-3846-4564-b0c3-27972bcaabce&amp;displaylang=en">download</a> and later explore it like I do. In this post, I would like to encourage you to see that we can add additional scenarios, making RIA Services really applicable in limited bandwidth condition – <font color="#ff0000">adding offline feature</font>. From marketing point of view: </p>  <p><font color="#0000ff" size="1">Microsoft .NET RIA Services simplifies the traditional n-tier application pattern by bringing together the ASP.NET and Silverlight platforms. RIA Services provides a pattern to write application logic that runs on the mid-tier and controls access to data for queries, changes and custom operations. It also provides end-to-end support for common tasks such as data validation, authentication and roles by integrating with Silverlight components on the client and ASP.NET on the mid-tier.      <br /></font>    <br />From technical point of view (you can read more from its PDF documentation). It is a framework that provides patterns for writing LOB application logic and validation (by design). LOB applications use data that needs to flow across tiers. It may be created and used through basic <font color="#0000ff">CRUD</font> operations or it may be accessed through domain-specific custom operations in encapsulated form such as an approval operation. In an internet application, there is a trust boundary between the client and the mid-tier server. <font color="#0000ff"><font color="#ff0000">Hence, it is important to have a stylized way to express what resources are available to the client tier and what operations are permitted</font>.</font> In addition to defining the resources and operations, a developer needs to validate the data as it is created or updated. The validation needs to run on the presentation tier for giving immediate feedback to the user and on the mid-tier for ensuring that the rules defined for the application are enforced. Thus, there may be common validation across the tiers as well as tier-specific validations that need to be integrated with the resources and operations.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v01_2.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v01_2.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="v01" border="0" alt="v01" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v01_thumb.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v01_thumb.jpg" width="494" height="282" /></a> </p>  <p>Lets look at the anatomy of a common Web application compared to RIA. With a RIA, most of the presentation logic moves to the client to improve the UX and to make effective use of <strong><font color="#ff0000">local state</font></strong>. The result is additional work for the developer: defining a full-fledged services layer, new types and contracts to share etc. and continually evolving them as the app evolves on either end. <font color="#0000ff">A RIA isn't just a client app, but an &quot;Internet&quot; app that includes a server component</font>. This is where RIA Service guidance will give you values – end-to-end pattern for this additional work. But remember, there is no perfect design/pattern, we can always improve it based on our requirements. </p>  <p>&#160;</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v02_4.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v02_4.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="v02" border="0" alt="v02" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v02_thumb_1.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v02_thumb_1.jpg" width="350" height="146" /></a>&#160;&#160;&#160;&#160; <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v03_4.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v03_4.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="v03" border="0" alt="v03" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v03_thumb_1.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v03_thumb_1.jpg" width="350" height="146" /></a></p>  <p>The first part of RIA Services pattern is to write a <strong><font color="#0000ff">DomainService</font></strong> class. This represents your application domain, your application logic, or business logic, a set of operations – CRUD based or custom domain-specific, DAL specific, authorization and validation. A DomainService is optimized to be stateless - to respond to query requests and to change set processing requests. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v05_2.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v05_2.jpg"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="v05" border="0" alt="v05" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v05_thumb.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v05_thumb.jpg" width="476" height="181" /></a><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v06_2.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v06_2.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="v06" border="0" alt="v06" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v06_thumb.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v06_thumb.jpg" width="240" height="176" /></a> </p>  <p>The second part of the pattern is what we generate - the client-side data model - in a <strong><font color="#0000ff">DomainContext</font></strong> class. This class represents the view of what the client can see. It contains lists of objects, one for each type exposed to the client, and it contains a set of load methods that roughly correspond to the queries exposed on the service. These load methods can be used to load objects into the corresponding lists. The individual objects and lists track changes and raise change notifications. The DomainContext can extract all the changes, create a change set and submit it to the service for processing and committing. A DomainContext is optimized for taking advantage of the stateful environment and to be a well-behaved citizen in a binding-centric presentation technology such as Silverlight or WPF.</p>  <p><a href="http://www.nikhilk.net/NET-RIA-Services-Vision-Architecture.aspx">Nikhil Kothari</a> describe .NET RIA Services vision as <strong>RAD for RIA</strong>, which is I totally agreed and have the same sense.But there is one requirement here in Asia that we must consider – <font color="#ff0000">low bandwidth condition</font>. This will rise new scenario - <font color="#0000ff">offline-enabled RIA application</font><font color="#000000">, means that we need to add local storage scenario for the <font color="#0000ff"><strong>DomainContext</strong></font>.</font> The design challenges of all the offline-enabled applications are: </p>  <p>&#160;</p>  <p><strong><font color="#0000ff">How to isolate client data layer</font>       <br /></strong>    <br />What is actually the data layer in RIA? It that the API that server exposes to AJAX? <a href="http://code.google.com/apis/gears/architecture.html">Gears</a> provides a good vision on <strong><font color="#0000ff">Server Data Layer</font></strong> and <strong><font color="#0000ff">Local Data Layer</font></strong>, controlled by a <strong><font color="#0000ff">Data Switch</font></strong>. Gears propose JavaScript DB API with SQLite to enable local data storage. It is a good project to start with SQL Compact Edition, however, but an <strong>ActiveXObject</strong> should be created for SQL Compact Edition/SQL Express/ESENT. <strong><font color="#ff0000">Anyone interested here?</font></strong>     <br />    <br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v07_2.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v07_2.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="v07" border="0" alt="v07" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v07_thumb.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v07_thumb.jpg" width="500" height="203" /></a> </p>  <p><strong><font color="#0000ff">Offline strategy – what features need offline scenario</font></strong></p>  <p>This is the harder part for me, as closely related to our application scenarios. Some numerical calculation should be done at client side and its results should be store locally in order to feed parameters for responsive and dynamic GUI animation. You might think that you would always want to use the local store since it is faster. However, there are many practical reasons why you may want or need to access the data on server instead. For instance: </p>  <p>- Data may be so transient in nature that it makes no sense to cache it. I will use <a href="http://geeks.netindonesia.net/blogs/risman/archive/2009/04/04/project-velocity-answer-to-memcached.aspx">Project Velocity for cache</a> anyway.     <br />- Some Simulation's data makes sense only while online.     <br />- The App may choose to store only the most frequently accessed data.     <br />- Numerical computational and/or disk space requirements make it unfeasible to recreate the feature offline.     <br />    <br />Typically, the optimal solution is to use the local store as much as possible, since it's usually faster than a remote connection. However, the more work an application does locally, the more code you need to write to implement the feature locally and to synchronize the corresponding data. There is a cost/benefit tradeoff to consider, and some features may not be worthwhile to support locally. </p>  <p>   <br />In fact, .NET RIA Service provide ready to extend set of capability that I like. But, a lot of work should be done to make it work like I want. That is my problem though :). </p>  <p>&#160;</p>  <p><strong><font color="#0000ff">Application Modality</font></strong> </p>  <p>What is modality – feature to switch from online to offline states or vice versa. Modal applications usually indicated through some change in the UI. The user is made aware of the state and participates in switching states in some manner. Modeless applications attempt to transition seamlessly between online and offline states, without significant UI changes. The user does not need to participate in switching states, which the application does automatically. </p>  <p>In a modal application, when the application is online it communicates with the server. When it's offline, it uses the local store. Data must be <strong><font color="#0000ff">synchronized</font></strong> when the app switches between modes. The advantage of making a modal application is that it's “relatively simple” to implement and therefore a reasonable way to bootstrap the application to function offline. But some disadvantages are: The user must decide and remember to switch modes. Since the local store is not always up-to-date, it can't be used to improve the application's responsiveness when connected to the server. </p>  <p>&#160;</p>  <p><strong><font color="#0000ff">Data Synchronization</font></strong></p>  <p>What is the sync strategy for this kind of application? No matter which connection and modality strategy we use, the data in the local database will get out of sync with the server data. For example, local data and server data get out of sync when: </p>  <p>- The user makes changes while offline    <br />- Data is shared and can be changed by external parties     <br />- Data comes from an external source     <br />    <br />There are many approaches to synchronization and none are perfect for all situations. We have <strong><a href="http://www.microsoft.com/downloads/details.aspx?familyid=109DB36E-CDD0-4514-9FB5-B77D9CEA37F6&amp;displaylang=en">Microsoft Sync Framework</a></strong> and <strong><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=479F2216-E6F2-486F-80C9-2CFADE5082C1&amp;displaylang=en">Astroria Offline</a></strong> as candidates for reusable framework here (where I am still arguing). The most important thing for engineer to decide is manual or background synchronization. In manual sync user decides when to synchronize. It can be implemented simply by uploading all the old local data to the server, and then downloading a fresh copy from the server before going offline. In background sync, the application continuously synchronizes the data between the local data store and the server. This can be implemented by pinging the server every once in a while or better yet, letting the server push or stream data to the client. With Silverlight supports on WCF, this should be easy to implement. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v08_2.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v08_2.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="v08" border="0" alt="v08" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v08_thumb.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v08_thumb.jpg" width="500" height="204" /></a> </p>  <p>Well, the next step for me is to gather our detail requirements and see how current frameworks can help. I am still hacking the MSF, Astoria Offline, RIA Services, and Velocity. For sure, I will share with you if I found interesting things. </p>  <p>&#160;</p>  <p>Hope this helps!</p>  <p>&#160;</p>  <p>Cheers – RAM </p>]]></content:encoded>
    </item>
    <item>
      <title>MS-MPI with Visual Studio 2008</title>
      <link>https://docs.microsoft.com/archive/blogs/risman/ms-mpi-with-visual-studio-2008</link>
      <pubDate>Sun, 04 Jan 2009 05:24:10 GMT</pubDate>
      <dc:creator><![CDATA[Mattotorang]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/risman/2009/01/04/ms-mpi-with-visual-studio-2008/</guid>
      <description><![CDATA[This is a step-by-step guide for you to write MPI program using MS-MPI and Visual Studio 2008. I...]]></description>
      <content:encoded><![CDATA[<p>This is a step-by-step guide for you to write MPI program using MS-MPI and Visual Studio 2008. I want to introduce MS-MPI as many of my blog posts will be related to parallelism both shared memory and distributed in C/C++ and C#. You can use any OS to write, compile and test MPI program and in additional to that, and of course you also need:    <br />    <br />- <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=12887DA1-9410-4A59-B903-693116BFD30E&amp;displaylang=en">HPC Pack SDK 2008</a>     <br />- VC++ Compiler and IDE (<a href="http://www.microsoft.com/express/vc/">VC++ 2008 Express</a> is okay)     <br />    <br />What you have to know in this SDK is the location of MPI header and lib files. MPI header file (mpi.h) contains all the definitions of MPI types and operations, while the lib file is the main MPI libraries. By default HPC Pack SDK installation, it will be located at :     <br />    <br />C:\Program Files\Microsoft HPC Pack 2008 SDK\ in the Include and Lib folders.     <br />    <br />Once you able to locate MS-MPI header and lib files, you are ready to write and compile MPI program using Visual Studio 2008. Open VC++ 2008 and create an empty C++ project then follow these steps.     <br />    <br />1 – Create an Empty C++ Project     <br />    <br />&#160;<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI03_2.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI03_2.jpg"><img title="MPI03" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="459" alt="MPI03" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI03_thumb.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI03_thumb.jpg" width="640" border="0" /></a>     <br />    <br />2 – Change the Linker’s System configuration to CONSOLE(/SUBSYSTEM:CONSOLE)     <br />    <br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI04_2.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI04_2.jpg"><img title="MPI04" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="440" alt="MPI04" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI04_thumb.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI04_thumb.jpg" width="640" border="0" /></a>     <br />    <br />3 – Add Linker Additional Library Directories as following:     <br />    <br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI05_2.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI05_2.jpg"><img title="MPI05" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="469" alt="MPI05" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI05_thumb.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI05_thumb.jpg" width="640" border="0" /></a>     <br />    <br />4 – Add Linker’s Input Additional Dependencies. Type <strong>msmpi.lib</strong> to the list.     <br />    <br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI06_2.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI06_2.jpg"><img title="MPI06" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="437" alt="MPI06" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI06_thumb.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI06_thumb.jpg" width="640" border="0" /></a>     <br />    <br />5 – Add a C++ file to write your first MPI program and write the following codes as a test:     <br /></p>  <pre class="code"><span style="color: blue">#include</span><span style="color: #a31515">&lt;iostream&gt;
</span><span style="color: blue">#include</span><span style="color: #a31515">&lt;mpi.h&gt;
</span><span style="color: blue">using namespace </span>std;

<span style="color: blue">int </span>main(<span style="color: blue">int </span>argc, <span style="color: blue">char</span>** argv){

    <span style="color: blue">int </span>mynode, totalnodes;

    MPI_Init(&amp;argc, &amp;argv); 
    MPI_Comm_size(MPI_COMM_WORLD, &amp;totalnodes);
    MPI_Comm_rank(MPI_COMM_WORLD, &amp;mynode);
    
    cout &lt;&lt; <span style="color: #a31515">&quot;Hello world from process &quot; </span>&lt;&lt; mynode;
    cout &lt;&lt; <span style="color: #a31515">&quot; of &quot; </span>&lt;&lt; totalnodes &lt;&lt; endl;

    MPI_Finalize();
    <span style="color: blue">return </span>0;
}<br /><br /></pre>
6 – Add the location of header file to C++ Compiler property: 

<br />

<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI07_2.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI07_2.jpg"><img title="MPI07" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="440" alt="MPI07" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI07_thumb.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI07_thumb.jpg" width="640" border="0" /></a> 

<br />

<p>
  <br />7 – Build your first program and if no error found, you can test it by running MPIEXEC (MPI launcher) : 

  <br />

  <br /><strong><font color="#0000ff">mpiexec –n 10 MyMPIProject.exe 
      <br /></font></strong>

  <br />It will create 10 independent processes (you can say 10 nodes), without communication between nodes applied for now. I will discuss later about the inter-process communication inside MPI. The normal result of your program will be: 

  <br />

  <br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI08_2.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI08_2.jpg"><img title="MPI08" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="328" alt="MPI08" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI08_thumb.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI08_thumb.jpg" width="640" border="0" /></a> 

  <br />

  <br />Congratulation is you reach this stage. You are ready to learn deeper about MS-MPI!. 

  <br />

  <br />Cheers – RAM 

  </p>]]></content:encoded>
    </item>
    <item>
      <title>Books on MPI (and Windows)</title>
      <link>https://docs.microsoft.com/archive/blogs/risman/books-on-mpi-and-windows</link>
      <pubDate>Wed, 31 Dec 2008 00:55:32 GMT</pubDate>
      <dc:creator><![CDATA[Mattotorang]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/risman/2008/12/31/books-on-mpi-and-windows/</guid>
      <description><![CDATA[If you're serious about MPI, you'll need parallel computing background (mostly from scientific) and...]]></description>
      <content:encoded><![CDATA[<p>If you're serious about MPI, you'll need parallel computing background (mostly from scientific) and the official standard for understanding the fussy details of MPI APIs. There are many books about those two things in the market, if you go to Amazon and search for MPI keyword, you will get it all. Here is my recommendation:    <br />    <br /><strong><font color="#0000ff">Theoretical and Scientific Background </font></strong></p>  <table cellspacing="0" cellpadding="2" width="100%" border="0"><tbody>     <tr>       <td valign="top" width="35%"><a href="http://www.amazon.com/Parallel-Scientific-Computing-MPI-Implementation/dp/0521520800/ref=sr_1_5?ie=UTF8&amp;s=books&amp;qid=1230701903&amp;sr=1-5"><img title="BooksMPI04" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="240" alt="BooksMPI04" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/BooksonMPIandWindows_B4D8/BooksMPI04_3.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/BooksonMPIandWindows_B4D8/BooksMPI04_3.jpg" width="240" border="0" /></a> </td>        <td valign="top" width="35%"><a href="http://www.amazon.com/Art-Multiprocessor-Programming-Maurice-Herlihy/dp/0123705916/ref=sr_1_7?ie=UTF8&amp;s=books&amp;qid=1230701903&amp;sr=1-7"><img title="BooksMPI05" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="240" alt="BooksMPI05" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/BooksonMPIandWindows_B4D8/BooksMPI05_3.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/BooksonMPIandWindows_B4D8/BooksMPI05_3.jpg" width="240" border="0" /></a> </td>        <td valign="top" width="30%"><a href="http://www.amazon.com/Sourcebook-Parallel-Computing-Kaufmann-Architecture/dp/1558608710/ref=sr_1_9?ie=UTF8&amp;s=books&amp;qid=1230701903&amp;sr=1-9"><img title="BooksMPI06" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="240" alt="BooksMPI06" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/BooksonMPIandWindows_B4D8/BooksMPI06_3.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/BooksonMPIandWindows_B4D8/BooksMPI06_3.jpg" width="240" border="0" /></a> </td>     </tr>   </tbody></table>  <p></p>  <p>   <br /><strong><font color="#0000ff">For practical programmers </font></strong></p>  <table cellspacing="0" cellpadding="2" width="100%" border="0"><tbody>     <tr>       <td valign="top" width="35%"><a href="http://www.amazon.com/Using-MPI-Programming-Engineering-Computation/dp/0262571323/ref=sr_1_2?ie=UTF8&amp;s=books&amp;qid=1230701903&amp;sr=1-2"><img title="MPIBooks01" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="240" alt="MPIBooks01" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/BooksonMPIandWindows_B4D8/MPIBooks01_3.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/BooksonMPIandWindows_B4D8/MPIBooks01_3.jpg" width="240" border="0" /></a> </td>        <td valign="top" width="35%"><a href="http://www.amazon.com/MPI-Complete-Reference-2-set/dp/0262692163/ref=sr_1_3?ie=UTF8&amp;s=books&amp;qid=1230701903&amp;sr=1-3"><img title="BooksMPI02" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="240" alt="BooksMPI02" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/BooksonMPIandWindows_B4D8/BooksMPI02_3.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/BooksonMPIandWindows_B4D8/BooksMPI02_3.jpg" width="240" border="0" /></a> </td>        <td valign="top" width="30%"><a href="http://www.amazon.com/Parallel-Programming-MPI-Peter-Pacheco/dp/1558603395/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1230700698&amp;sr=1-1"><img title="BooksMPI01" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="240" alt="BooksMPI01" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/BooksonMPIandWindows_B4D8/BooksMPI01_3.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/BooksonMPIandWindows_B4D8/BooksMPI01_3.jpg" width="240" border="0" /></a> </td>     </tr>   </tbody></table>  <p>I always believe that bottom-up learning approach is the best way to learn programming. MPI is not really complex APIs, but you will not program in vacuum. Understanding about computer architecture and Windows APIs itself will be a great asset. For you who want to advance your native Win32 (Windows API), I would recommend my current readings:</p>  <table cellspacing="0" cellpadding="2" width="100%" border="0"><tbody>     <tr>       <td valign="top" width="35%"><a href="http://www.amazon.com/Windows-via-C-Pro-Developer/dp/0735624240/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1230702060&amp;sr=1-1"><img title="WIN01" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="238" alt="WIN01" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/BooksonMPIandWindows_B4D8/WIN01_7.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/BooksonMPIandWindows_B4D8/WIN01_7.jpg" width="184" border="0" /></a> </td>        <td valign="top" width="35%"><a href="http://www.amazon.com/Windows%C2%AE-Internals-Including-Windows-PRO-Developer/dp/0735625301/ref=sr_1_5?ie=UTF8&amp;s=books&amp;qid=1230702060&amp;sr=1-5"><img title="Win02" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="240" alt="Win02" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/BooksonMPIandWindows_B4D8/Win02_3.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/BooksonMPIandWindows_B4D8/Win02_3.jpg" width="240" border="0" /></a> </td>        <td valign="top" width="30%"><a href="http://www.amazon.com/Windows-Programming-Addison-Wesley-Microsoft-Technology/dp/0321256190/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1230702096&amp;sr=1-1"><img title="WIN03" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="240" alt="WIN03" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/BooksonMPIandWindows_B4D8/WIN03_3.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/BooksonMPIandWindows_B4D8/WIN03_3.jpg" width="240" border="0" /></a> </td>     </tr>   </tbody></table>  <p>   <br />I hope you enjoy MPI exploration like I do.     <br />    <br />Happy learning – RAM </p>]]></content:encoded>
    </item>
    <item>
      <title>MPI.NET – MPI for Managed Codes</title>
      <link>https://docs.microsoft.com/archive/blogs/risman/mpi-net-mpi-for-managed-codes</link>
      <pubDate>Tue, 30 Dec 2008 21:57:56 GMT</pubDate>
      <dc:creator><![CDATA[Mattotorang]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/risman/2008/12/30/mpi-net-mpi-for-managed-codes/</guid>
      <description><![CDATA[In this post, I would like to introduce you MPI.NET from Indiana University. You can download...]]></description>
      <content:encoded><![CDATA[<p>In this post, I would like to introduce you MPI.NET from Indiana University. You can download MPI.NET <a href="http://www.osl.iu.edu/research/mpi.net/software/">here</a> including its runtime, SDK and source codes then follow this post. You do not need to have a Windows cluster or even a multi-core/multi-processor workstation to develop MPI programs: you can use any desktop machine with Windows XP, Vista or Windows Server 200x to develop MPI programs with MPI.NET.     <br />    <br />In development, you will also need Visual Studio 2005/2008 and MS-MPI. Why MS-MPI? Because MPI.NET can only work with MS-MPI that you can get freely from <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=12887DA1-9410-4A59-B903-693116BFD30E&amp;displaylang=en">Microsoft HPC Pack 2008 SDK</a> (or Microsoft Compute Cluster Pack SDK). I prefer to use the HPC Pack 2008 SDK because it has newer version of MS-MPI (version 2). In order to use your future MPI.NET in a cluster, MPI.NET runtime must be installed on the cluster nodes.     <br />&#160; <br />Now let see a C# program to calculate PI with the following algorithm:     <br />    <br /><em>Inscribe a unit circle within a unit square, and then randomly throw darts within the unit square. The ratio of the number of darts that land within the circle to the number of darts that land within the square is the same as the ration of the area of the circle to the area of the square, and therefore can be used to compute PI.      <br /></em>    <br />Using this principle, the following <strong>sequential program</strong> computes an approximation of PI:&#160; </p>  <p><font color="#800000">using System; </font></p>  <p><font color="#800000">class SequentialPi      <br />{       <br />&#160;&#160;&#160; static void Main(string[] args)       <br />&#160;&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; int dartsPerProcessor = 10000;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Random random = new Random();       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; int dartsInCircle = 0;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; for (inti = 0; i&lt;dartsPerProcessor; ++i)       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; double x = (random.NextDouble() - 0.5) * 2;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; double y = (random.NextDouble() - 0.5) * 2;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (x * x + y * y &lt;= 1.0)       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ++dartsInCircle;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; } </font></p>  <p><font color="#800000">&#160;&#160;&#160;&#160;&#160;&#160;&#160; Console.WriteLine(&quot;Pi is approximately {0:F15}.&quot;,      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 4*(double)totalDartsInCircle/(double)dartsPerProcessor);       <br />&#160;&#160;&#160; }       <br />}       <br />      <br /></font></p>  <p><strong><font color="#0000ff">What MPI Can Do To Parallelize The Codes?        <br /></font></strong>    <br />In a message-passing system like MPI, different concurrently-executing “processes” communicate by sending/receiving messages from one to another over a network. Each of the MPI processes has its own, local program state that cannot be observed or modified by any other process except in response to a message.&#160; Most MPI programs are written with the <strong>Single Program, Multiple Data (SPMD)</strong> parallel model, where each of the processes is running the same program but working on a different part of the data. MPI allows us to launch the same program across many nodes with single command. Initially, each of the processes is identical, with one distinguishing characteristic: <strong>each process is assigned a rank, which uniquely identifies that process</strong>. The ranks of MPI processes are integer values from 0 to P-1, where P is the number of processes launched as part of the MPI program. MPI processes can query their rank, allowing different processes in the MPI program to have different behavior, and exchange messages with other processes in the same job via their ranks.     <br /></p>  <p>Now look on PI sequential program, the more darts we throw, the better the approximation to PI. To parallelize this program, we'll utilize MPI to run several processes, each of which will throw darts independently. <strong><font color="#0000ff">Once all of the processes have finished, we'll sum up the results (the total number of darts that landed inside the circle on all processes) to compute PI</font></strong>. The complete code for the parallel calculation of PI is as following:     <br />    <br /><font color="#800000">using System;      <br />using MPI;&#160; </font><font color="#008000">// add reference to message passing interface namespace before add this line</font></p>  <p><font color="#800000">class ParallelPI      <br />{       <br />&#160;&#160;&#160; static void Main(string[] args)       <br />&#160;&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; int dartsPerProcessor = 10000;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; using (new <strong><font color="#0000ff">MPI.Environment(ref args)</font></strong>)       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (args.Length &gt; 0)       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; dartsPerProcessor = Convert.ToInt32(args[0]);       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font color="#0000ff"><strong>Intracommunicator</strong></font> <font color="#0000ff"><strong>world</strong></font> = <strong><font color="#0000ff">Communicator.world</font></strong>;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Random random = new Random(5 * <strong><font color="#0000ff">world.Rank</font></strong>);       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; int dartsInCircle = 0;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; for (int i = 0; i &lt; dartsPerProcessor; ++i)       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; double x = (random.NextDouble() - 0.5) * 2;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; double y = (random.NextDouble() - 0.5) * 2;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (x * x + y * y &lt;= 1.0)       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ++dartsInCircle;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; } </font></p>  <p><font color="#800000">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (<strong><font color="#0000ff">world.Rank</font></strong> == 0)       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; int totalDartsInCircle = <strong><font color="#0000ff">world.Reduce</font></strong>&lt;int&gt;(dartsInCircle, Operation&lt;int&gt;.Add, 0);       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.Console.WriteLine(&quot;Pi is approximately {0:F15}.&quot;,       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 4*(double)totalDartsInCircle/(<strong><font color="#0000ff">world.Size</font></strong>*(double)dartsPerProcessor));       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; else       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <strong><font color="#0000ff">world.Reduce</font></strong>&lt;int&gt;(dartsInCircle, Operation&lt;int&gt;.Add, 0);       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }       <br />&#160;&#160;&#160; }       <br />}</font></p>  <p>1st step in MPI program is to initialize MPI environment by creating a new instance of <strong><font color="#0000ff">MPI.Environment</font></strong> within Main method, passing the new object a reference to our command-line arguments. The entire MPI program should be contained within the using statement, which guarantees that the MPI environment properly created and disposed. All valid MPI programs must both initialize and finalize the MPI environment. Reference to command-line arguments, args, is ok because some MPI implementations are permitted to use special arguments to pass state information in to the MPI initialization routines.     <br />    <br />After MPI environment initialized, then we can create <strong><font color="#0000ff">Communicator</font></strong> object.&#160; MPI communicators are the fundamental abstraction that permits communication among different MPI processes, and every non-trivial MPI program will make use of some communicators. Each communicator representations a self-contained communication space for some set of MPI processes. Any of the processes in that communicator can exchange messages with any other process in that communicator, without fear of those messages colliding with any messages being transmitted on a different communicator.     <br />    <br />The PI program above is very simple because we used basic skeleton of MPI program to separate the process from rank 0 and other ranks. The skeleton of giving one of the processes (which is often called the &quot;root&quot;, and is typically rank 0) a slightly different code path than all of the other processes is relatively common in MPI programs, which often need to perform some coordination or interaction with the user. Then there are two properties of communicators we used in our PI program: the rank of the process within the communicator, which identifies that process (<strong><font color="#0000ff">world.Rank</font></strong>), and the size of the communicator, which provides the number of processes in the communicator (<strong><font color="#0000ff">world.Size</font></strong>).     <br />    <br /><font color="#800000"><strong><font color="#0000ff">Intraommunicator world = Communicator.world;          <br /></font></strong>if (<strong><font color="#0000ff">world.Rank</font></strong> == 0)       <br />{       <br />&#160;&#160;&#160; <font color="#008000">// program for rank 0 (root process)        <br /></font>}       <br />else // not rank 0       <br />{       <br />&#160;&#160;&#160; <font color="#008000">// program for all other ranks</font>       <br />}       <br /></font></p> As mentioned before, to parallelize PI program, we used MPI to run several processes, each of which will throw darts independently. <strong>Once all of the processes have finished, we'll need to sum up the results. </strong>In MPI, there are several parallel reduction operations that combine the values provided by each of the processes into a single value that somehow sums up the results. The most basic reduction operation is the <strong><font color="#0000ff">Reduce collective</font></strong>, which combines the values provided by each of the processes and returns the result at the designated root process.&#160; We used <strong><font color="#0000ff">world.Reduce</font></strong>() in our PI program, which is reduce collective algorithm, to combine values stored in each process into a single value available at root process (rank 0) :   <br />  <br /><strong><font color="#0000ff">world.Reduce&lt;int&gt;(dartsInCircle, Operation&lt;int&gt;.Add, 0);      <br /></font></strong>  <p>   <br />Now we can compile PI program then try to run it using MPIEXEC launcher (inside HPC Pack 2008 or MPICH2). For example we want to run the codes in 10 processes, just type:     <br />    <br /><font color="#0000ff"><strong>MPIEXEC –n 10 ParallelPI.exe        <br /></strong></font></p>  <p>   <br />Cheers – RAM </p>]]></content:encoded>
    </item>
    <item>
      <title>MS-MPI and HPC Pack 2008 SDK</title>
      <link>https://docs.microsoft.com/archive/blogs/risman/ms-mpi-and-hpc-pack-2008-sdk</link>
      <pubDate>Tue, 30 Dec 2008 21:47:11 GMT</pubDate>
      <dc:creator><![CDATA[Mattotorang]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/risman/2008/12/30/ms-mpi-and-hpc-pack-2008-sdk/</guid>
      <description><![CDATA[The best known implementation of the MPI specification is the MPICH2 maintained by Argonne National...]]></description>
      <content:encoded><![CDATA[<p>The best known implementation of the MPI specification is the MPICH2 maintained by Argonne National Laboratory. MPICH2 is an open-source implementation of the MPI2 specification that is widely used on HPC clusters. MS-MPI is <strong>based on</strong> and <strong>designed for </strong>maximum compatibility with the MPICH2 reference implementation. It was shipped within <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=12887DA1-9410-4A59-B903-693116BFD30E&amp;displaylang=en">HPC Pack 2008 SDK</a>.     <br />    <br />The exceptions to compatibility with MPICH2 are on the <strong>job launch</strong> and <strong>job management </strong>side of MPICH2; the APIs are identical to MPICH2. MS-MPI exceptions to the MPICH2 implementation were necessary to meet the strict security requirements of Windows HPC Server 2008 (including integration to Active Directory and System Center Manager). MS-MPI includes a complete set of MPI2 functionality as implemented in MPICH2 with the exception of dynamic process spawn and publishing. In addition, MS-MPI supports lower latency, shared-memory communications. The shared-memory communications implementation, which has been completely rewritten for Windows HPC Server 2008, improves the overall efficiency of communications between cores—especially when an application is using both shared memory and networked communication—and reduces the CPU cost associated with message passing between cores. When combined with the new NetworkDirect MS-MPI interface and the new networking stack in Windows Server 2008, the result is a significantly more efficient HPC cluster.     <br />    <br />MS-MPI uses the Microsoft NetworkDirect protocol for maximum compatibility with high-performance networking hardware and maximum networking performance. MS-MPI can use any Ethernet connection that is supported by Windows Server 2008, as well as low-latency and high-bandwidth connections such as <strong>InfiniBand</strong>, <strong>10-Gigabit Ethernet</strong>, or <strong>Myrinet</strong>. Windows HPC Server 2008 also supports the use of any network connection that has either a NetworkDirect or Winsock Direct provider. Gigabit Ethernet provides a high-speed and cost-effective interconnect fabric, while InfiniBand, 10-Gigabit Ethernet, and Myrinet are ideal for latency-sensitive and high-bandwidth applications. The NetworkDirect protocol bypasses Windows Sockets (Winsock) and the TCP/IP stack, using Remote Direct Memory Access (RDMA) on supported hardware to improve performance and reduce CPU overhead.     <br />    <br /></p>  <table cellspacing="0" cellpadding="2" width="100%" border="0"><tbody>     <tr>       <td valign="top" align="left" width="50%">&#160;<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/MSMPIandHPCPack2008SDK_8936/MPI01_2.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSMPIandHPCPack2008SDK_8936/MPI01_2.jpg"><img title="MPI01" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="439" alt="MPI01" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/MSMPIandHPCPack2008SDK_8936/MPI01_thumb.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSMPIandHPCPack2008SDK_8936/MPI01_thumb.jpg" width="371" border="0" /></a></td>        <td valign="top" align="left" width="50%"><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=12887DA1-9410-4A59-B903-693116BFD30E&amp;displaylang=en"><img title="mshpcsdk_horz" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="72" alt="mshpcsdk_horz" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/MSMPIandHPCPack2008SDK_8936/mshpcsdk_horz_3.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSMPIandHPCPack2008SDK_8936/mshpcsdk_horz_3.jpg" width="245" border="0" /></a>          <br /><a href="http://resourcekit.windowshpc.net/Default.html"><img title="HPCKit" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="146" alt="HPCKit" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/MSMPIandHPCPack2008SDK_8936/HPCKit_3.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSMPIandHPCPack2008SDK_8936/HPCKit_3.jpg" width="245" border="0" /></a>&#160; <br />          <br /><a href="http://resourcekit.windowshpc.net/Default.html">HPC Kit 2008</a> is a great collection of technical documents, presentations and training for developer and IT Professionals. Everything you need to get started with Windows HPC Server 2008 in one convenient place. Download here. </td>     </tr>   </tbody></table>  <br />  <p>Windows HPC Server 2008 includes the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=12887DA1-9410-4A59-B903-693116BFD30E&amp;displaylang=en">Microsoft HPC Pack 2008 SDK</a> that currently contains:    <br />- MPIEXEC&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : MPI Application Launcher    <br />- SMPD&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : MPI Process Manager    <br />- MPISYNC&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : MPI Trace Clock Synchronizer    <br />- Microsoft.Hpc.VSDeployTool&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : MPI Deployment Tools for Visual Studio    <br />- ELT2CLOG and ETL2OTF&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : MPI ETL Trace Converter    <br />- MPI Scheduler API DLLs     <br />- MPI Header and Library Files for i386 and AMD64    <br />- Network Direct Service Provider Interface    <br />&#160; <br />We can use to Scheduler API to write client applications that interact with the job scheduler but note that we can use the SDK to schedule jobs on Microsoft HPC Server 2008 and later servers only; we cannot use this SDK to schedule jobs on Microsoft Compute Cluster Server 2003 (CCS).&#160;&#160;&#160; <br />    <br />Please start to download the HPC Kit 2008 and explore about parallel computing using MS-MPI. I will post more tutorial about parallelism on Microsoft platform in this MSDN community. Stay tuned!</p>  <p>   <br />Cheers – RAM </p>]]></content:encoded>
    </item>
    <item>
      <title>Introduction to MPI</title>
      <link>https://docs.microsoft.com/archive/blogs/risman/introduction-to-mpi</link>
      <pubDate>Tue, 30 Dec 2008 06:43:22 GMT</pubDate>
      <dc:creator><![CDATA[Mattotorang]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/risman/2008/12/30/introduction-to-mpi/</guid>
      <description><![CDATA[Message Passing Interface (MPI) is a portable programming model used widely on parallel computers,...]]></description>
      <content:encoded><![CDATA[<p>Message Passing Interface (MPI) is a portable programming model used widely on parallel computers, especially Scalable Parallel Computers (SPCs) with distributed memory, and on Networks of Workstations (NOWs). Many vendors have their own implementation of MPI, including Microsoft with its MSMPI, Intel, and HP. I am happy that Microsoft finally released Windows HPC Server 2008 with its MSMPI Sept 2008. </p>  <p>In this post, I would like to introduce you to MPI using <strong><a href="http://www.mcs.anl.gov/research/projects/mpich2/">MPICH2</a></strong> from Argonne National LAB before jumping into detail of MSMPI inside Windows HPC Server 2008. Learning directly from MPICH2 is good foundation for you because MPICH2 is distributed as source (open-source and free license) and has been tested on several platforms, including Windows (32 and 64 bit). MPICH2 documentations are freely available <a href="http://www.mcs.anl.gov/research/projects/mpich2/documentation/index.php?s=docs">here</a> too. My goals in this post is to explain you how to start with MPICH2 and create your first MPICH2 C++ program.&#160; <br />    <br />What you need to do is download and install MPICH2 first, then you will have all the header files (*.h), libraries (*.lib) and <strong>MPIEXEC.EXE</strong> to run jobs. Before you do that, please install the MPICH2 Process Manager by running <strong>SMPD.EXE –install</strong>. There are many other options for SMPD that you can learn from –help option. SMPD will be installed as Windows Services and you can manage it using SMPD.EXE tool itself or using services.msc.</p>  <p>The MPI-2 Standard describes MPIEXEC as a suggested way to run MPI programs. Sample form of a command to start an MPI job is MPIEXEC -n 32 [yourprogram], which means you want to start your program with 32 processes (providing an MPI COMM WORLD of size 32 inside the MPI application). The -configfile argument allows one to specify a file containing the specifications for process sets on separate lines in the file. This makes it unnecessary to have long command lines for MPIEXEC. Please refer to MPICH2 User Guide about all options of MPIEXEC. In Windows HPC 2008 Server, you will have nicer MPI launcher to help you run MPI programs.    <br />    <br />    <br /><strong><font color="#0000a0">Compiling MPICH2 Source Codes in Windows Server 2008        <br /></font></strong>    <br />Now lets learn how to compile the MPICH2 from its source codes. You will need Perl to do that because mpi.h and other header files will be generated automatically using Perl script. I am using Windows Server 2008 x64 with Visual Studio 2008 installed and ActivePerl. To enable you compile MPICH2 source codes, download and extract its source codes from <a href="http://www.mcs.anl.gov/research/projects/mpich2/">Argonne LAB</a>, then run a file called <strong>winconfigure.wsf</strong>. That script will generate required header files depend to your configuration. Once finished, open the visual studio solution project (*.sln) and try to compile. I believe you will find around 50 errors of:</p>  <p><strong><font color="#ff0000">_vsnprintf': attributes inconsistent with previous declaration&#160;&#160;&#160; </font></strong></p>  <p>in your first compilation, to solve it, please find the following config header (I’m using x64):</p>  <p><font color="#ff0000">..\MPICH2-1.0.8\src\include\win64\mpichconf.h      <br /></font>    <br />Then change the codes like below:</p>  <p><strong><font color="#ff0000">#if not defined(_MSC_VER) || defined(__MINGW32__)        <br /></font><font color="#800000">&#160;&#160; #define snprintf _snprintf        <br />&#160;&#160; #define vsnprintf _vsnprintf         <br /></font><font color="#ff0000">#endif</font></strong></p>  <p>   <br />If you are using 64 bit machine like me, make sure you change the include directory that contains mpich2conf.h in all projects properties (initially in win32 folder) then you can try to compile ch3sock, ch3shm, ch3sshm, ch3ssm, and ch3ib projects (release or debug). The last part of the compilation is doing a solution build with the Release or Debug configuration to build <strong>MPICEXEC</strong> and <strong>SMPD</strong>. The mpich2 dlls can be built to use shared memory communication, tcp socket communication, or both.     <br />    <br />- Select the ch3sockDebug or ch3sockRelease configurations to build the <strong>sockets</strong> only dlls.     <br />- Select the ch3shmDebug or ch3shmRelease configurations to build the <strong>shmem</strong> only dlls.     <br />- Select the ch3sshmDebug or ch3sshmRelease configurations to build the <strong>scalable shmem</strong> only dlls.     <br />- Select the ch3ssmDebug or ch3ssmRelease configurations to build the <strong>sockets+shmem</strong> dlls.     <br />- Select the ch3ibDebug or ch3ibRelease configurations to build the infiniband dlls. </p>  <p>   <br />I hope you are done with the compilation, now lets start to see the simplest MPI program to calculate pi value:     <br />    <br /><font color="#008000">// This is an interactive version of cpi</font>     <br /><font color="#800000">#include &quot;mpi.h&quot;      <br />#include &lt;stdio.h&gt;       <br />#include &lt;math.h&gt; </font></p>  <p><font color="#800000">double f(double); </font></p>  <p><font color="#800000">double f(double a)      <br />{       <br />&#160;&#160;&#160; return (4.0 / (1.0 + a*a));       <br />} </font></p>  <p><font color="#800000">int main(int argc,char *argv[])      <br />{       <br />&#160;&#160;&#160; int done = 0, n, myid, numprocs, i;       <br />&#160;&#160;&#160; double PI25DT = 3.141592653589793238462643;       <br />&#160;&#160;&#160; double mypi, pi, h, sum, x;       <br />&#160;&#160;&#160; double startwtime = 0.0, endwtime;       <br />&#160;&#160;&#160; int&#160; namelen;       <br />&#160;&#160;&#160; char processor_name[MPI_MAX_PROCESSOR_NAME]; </font></p>  <p><strong><font color="#0000ff">&#160;&#160;&#160; MPI_Init(&amp;argc,&amp;argv);        <br />&#160;&#160;&#160; MPI_Comm_size(MPI_COMM_WORLD,&amp;numprocs);         <br />&#160;&#160;&#160; MPI_Comm_rank(MPI_COMM_WORLD,&amp;myid);         <br />&#160;&#160;&#160; MPI_Get_processor_name(processor_name,&amp;namelen); </font></strong></p>  <p><font color="#800000">&#160;&#160;&#160; /*      <br />&#160;&#160;&#160; fprintf(stdout,&quot;Process %d of %d is on %s\n&quot;, myid, numprocs, processor_name);       <br />&#160;&#160;&#160; fflush(stdout);       <br />&#160;&#160;&#160; */ </font></p>  <p><font color="#800000">&#160;&#160;&#160; while (!done) {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (myid == 0) {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; fprintf(stdout, &quot;Enter the number of intervals: (0 quits) &quot;);       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; fflush(stdout);       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (scanf(&quot;%d&quot;,&amp;n) != 1) {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; fprintf( stdout, &quot;No number entered; quitting\n&quot; );       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; n = 0;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; startwtime = <font color="#0000ff"><strong>MPI_Wtime()</strong></font>;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; <strong><font color="#0000ff">MPI_Bcast(&amp;n, 1, MPI_INT, 0, MPI_COMM_WORLD);          <br /></font></strong>&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (n == 0)       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; done = 1;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; else {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; h&#160;&#160; = 1.0 / (double) n;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sum = 0.0;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; for (i = myid + 1; i &lt;= n; i += numprocs) {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; x = h * ((double)i - 0.5);       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sum += f(x);       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; mypi = h * sum;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; MPI_Reduce(&amp;mypi, &amp;pi, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD); </font></p>  <p><font color="#800000">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (myid == 0) {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; printf(&quot;pi is approximately %.16f, Error is %.16f\n&quot;,       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; pi, fabs(pi - PI25DT));       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; endwtime = <font color="#0000ff"><strong>MPI_Wtime()</strong>;         <br /></font>&#160;&#160;&#160;&#160;&#160;&#160;&#160; printf(&quot;wall clock time = %f\n&quot;, endwtime-startwtime);&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; fflush( stdout );       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }       <br />&#160;&#160;&#160; }       <br />&#160;&#160;&#160; <font color="#0000ff"><strong>MPI_Finalize();          <br /></strong></font>&#160;&#160;&#160; return 0;       <br />}</font></p>  <p>   <br />I will explain more about all the MPI codes in my in coming posting. For now, just try to install, compile and try your first MPI program (like cpi). Let me know if you have problem in compilation.     <br /></p>  <p>Cheers – RAM    </p>]]></content:encoded>
    </item>
    <item>
      <title>Parallel Programming with OpenMP</title>
      <link>https://docs.microsoft.com/archive/blogs/risman/parallel-programming-with-openmp</link>
      <pubDate>Sun, 28 Dec 2008 22:35:11 GMT</pubDate>
      <dc:creator><![CDATA[Mattotorang]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/risman/2008/12/28/parallel-programming-with-openmp/</guid>
      <description><![CDATA[OpenMP is the first parallel programming model (compiler directives and library routines) for shared...]]></description>
      <content:encoded><![CDATA[<p>OpenMP is the first parallel programming model (compiler directives and library routines) for shared memory multiprocessors. It was pioneered by SGI then becoming de-facto standard for parallelizing FORTRAN and C/C++ applications. Take a look on the official standard website of <a href="http://www.openmp.org">OpenMP</a> to get more information about this standard. In this post I will guide you more practically to use OpenMP in Microsoft Visual C++. </p>  <p>OpenMP uses <a href="http://www.llnl.gov/computing/tutorials/openMP">Fork-Join Model</a> of parallel execution. Every OpenMP program begins as a single process: called it <strong>master thread. </strong>The master thread will be executed sequentially until the first parallel region <strong>construct</strong> is encountered. Most of constructs in OpenMP are compiler directives, with the following structure:     <br />    <br /><font color="#0000ff">#pragma omp construct [clause [clause] …] </font></p>  <p>In C/C++ general code structure of the simplest OpenMP program is using omp.h directive and #pragma omp. You have to look on OpenMP documentation in MSDN library for complete construct options in MS VC++ then use <strong>/openmp</strong> option to compile your program. </p>  <blockquote>   <p><font color="#800000">#include &lt;omp.h&gt;        <br />#include &lt;iostream&gt;         <br />using namespace std; </font></p> </blockquote>  <blockquote>   <p><font color="#800000">int main ()&#160; { </font></p> </blockquote>  <blockquote>   <p><font color="#800000">int nthreads, tid; </font></p> </blockquote>  <blockquote>   <p><font color="#800000"><strong><font color="#008000">/* Fork a team of threads giving them their own copies of variables */            <br /></font></strong><font color="#0000ff">#pragma omp parallel private(tid)          <br /></font>&#160; {         <br />&#160; /* Obtain and print thread id */         <br />&#160; tid = omp_get_thread_num();         <br />&#160; cout &lt;&lt; &quot;Hello World from thread = &quot; &lt;&lt; tid &lt;&lt; endl;         <br />&#160; <strong><font color="#008000">/* Only master thread does this */ </font></strong>        <br />&#160; if (tid == 0)         <br />&#160;&#160;&#160; {         <br />&#160;&#160;&#160; nthreads = omp_get_num_threads();         <br />&#160;&#160;&#160; cout &lt;&lt; &quot;Number of threads = &quot; &lt;&lt; nthreads &lt;&lt; endl;         <br />&#160;&#160;&#160; } </font></p> </blockquote>  <blockquote>   <p><font color="#800000">&#160; }&#160; </font><font color="#008000"><strong>/* All threads join master thread and terminate */ </strong></font></p> </blockquote>  <blockquote>   <p><font color="#800000">} </font></p> </blockquote>  <p>Please remember to include omp.h because all function prototypes and types are there. Using OpenMP to parallelize an application is “not hard” as modifications to the original source program are often needed in just a few places. Moreover, one usually does not need to rewrite significant portions of the code. So In general, the effort of parallelizing a program with OpenMP goes mainly into identifying the parallelism, and not in reprogramming the code to implement that parallelism. Let me show you how to use OpenMP to parallelize a simple operation that realizes a very basic problem: multiplying an m x n matrix B with a vector c    <br />of length n, storing the result into a vector a of length m. Here is the formula:     <br />    <br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/ParallelProgrammingwithOpenMP_F98F/OpenMP03_2.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/ParallelProgrammingwithOpenMP_F98F/OpenMP03_2.jpg"><img title="OpenMP03" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="47" alt="OpenMP03" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/ParallelProgrammingwithOpenMP_F98F/OpenMP03_thumb.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/ParallelProgrammingwithOpenMP_F98F/OpenMP03_thumb.jpg" width="182" border="0" /></a> </p>  <p>The sequential codes will look like:</p>  <blockquote>   <p><font color="#800000">void multiplyer(int m, int n, double *a, double *b, double *c)        <br />{         <br />&#160;&#160;&#160; int i, j;         <br />&#160;&#160;&#160; for (i=0; i&lt;m; i++)         <br />&#160;&#160;&#160;&#160; {         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; a[i] = 0.0;         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; for (j=0; j&lt;n; j++) a[i] += b[i*n+j]*c[j];         <br />&#160;&#160;&#160; }         <br />}</font></p> </blockquote>  <p>Lets review the codes before parallelizing it. As you can see no two dotproducts compute the same element of the result vector and also the order in which the values for the elements a[i] for i = 1, . . . , m are calculated does not affect correctness of the answer. In other words, this problem can be parallelized over the index value i. </p>  <p>Data in an OpenMP program either is shared by the threads in a team, in which case all member threads will be able to access the same shared variable, or is    <br />private. For private case, each thread has its own copy of the data object, and hence the variable may have different values for different threads. In our case, we want each thread will access the same variable m,n,a,b,c, but each will have its own distinct variable i and j. A single #pragma (directive) is sufficient to parallelize the multiplyer.</p>  <blockquote>   <p><font color="#800000">void multiplyer(int m, int n, double *a, double *b, double *c)        <br />{         <br />&#160;&#160;&#160; int i, j;</font></p>    <p>&#160;&#160;&#160; <font color="#0000ff">#pragma omp parallel for default(none) shared(m,n,a,b,c) private(i,j)        <br /></font><font color="#800000">&#160;&#160;&#160; for (i=0; i&lt;m; i++)        <br />&#160;&#160;&#160;&#160; {         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; a[i] = 0.0;         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; for (j=0; j&lt;n; j++) a[i] += b[i*n+j]*c[j];         <br />&#160;&#160;&#160; }         <br />}</font></p> </blockquote>  <p>You can continue your OpenMP exploration by reading <a href="http://www.llnl.gov/computing/tutorials/openMP">this tutorial</a>. If you prefer to read books, I would like to recommend you the following books from MIT Press. I will post more about parallel computing later. </p>  <p><a href="http://www.amazon.com/Using-OpenMP-Programming-Engineering-Computation/dp/0262533022/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1230521555&amp;sr=1-1"><img title="OpenMP04" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="227" alt="OpenMP04" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/risman/WindowsLiveWriter/ParallelProgrammingwithOpenMP_F98F/OpenMP04_3.jpg" original-url="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/ParallelProgrammingwithOpenMP_F98F/OpenMP04_3.jpg" width="201" border="0" /></a>     <br />    <br />Cheers – RAM&#160; </p>]]></content:encoded>
    </item>
  </channel>
</rss>