<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Risman Adnan Mattotorang</title><subtitle type="html">On Scientific and Parallel Computing</subtitle><id>http://blogs.msdn.com/risman/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/risman/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/risman/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2008-09-22T23:53:38Z</updated><entry><title>Physics e-Learning Portal - Envisioning</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/risman/archive/2009/04/04/physics-e-learning-portal-envisioning.aspx" /><id>http://blogs.msdn.com/risman/archive/2009/04/04/physics-e-learning-portal-envisioning.aspx</id><published>2009-04-04T10:22:09Z</published><updated>2009-04-04T10:22:09Z</updated><content type="html">&lt;p&gt;I am working to help some of physicists who run &lt;a href="http://www.kucingfisika.com"&gt;KucingFisika&lt;/a&gt;, to design their future multimedia e-learning site with Silverlight. From animation perspective, I am considering to use &lt;a href="http://www.farseergames.com/"&gt;Farseer Physics Games&lt;/a&gt; engine. You can see some demos from icons below. Please go to Codeplex to download &lt;a href="http://www.codeplex.com/FarseerPhysics"&gt;Farseer Physics&lt;/a&gt;.     &lt;br /&gt;    &lt;br /&gt;&lt;a href="http://www.farseergames.com/Games/TireStorm/TireStorm.aspx"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="001" border="0" alt="001" src="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/001_3.jpg" width="168" height="150" /&gt;&lt;/a&gt;&amp;#160; &lt;a href="http://www.farseergames.com/Games/WeAreBugs/WeAreBugs.aspx"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="002" border="0" alt="002" src="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/002_3.jpg" width="165" height="150" /&gt;&lt;/a&gt;&amp;#160; &lt;a href="http://www.farseergames.com/Games/WaterDemo/WaterDemo.aspx"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="003" border="0" alt="003" src="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/003_3.jpg" width="172" height="150" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;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 &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=76bb3a07-3846-4564-b0c3-27972bcaabce&amp;amp;displaylang=en"&gt;download&lt;/a&gt; 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 – &lt;font color="#ff0000"&gt;adding offline feature&lt;/font&gt;. From marketing point of view: &lt;/p&gt;  &lt;p&gt;&lt;font color="#0000ff" size="1"&gt;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.      &lt;br /&gt;&lt;/font&gt;    &lt;br /&gt;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 &lt;font color="#0000ff"&gt;CRUD&lt;/font&gt; 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. &lt;font color="#0000ff"&gt;&lt;font color="#ff0000"&gt;Hence, it is important to have a stylized way to express what resources are available to the client tier and what operations are permitted&lt;/font&gt;.&lt;/font&gt; 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.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v01_2.jpg"&gt;&lt;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="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v01_thumb.jpg" width="494" height="282" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;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 &lt;strong&gt;&lt;font color="#ff0000"&gt;local state&lt;/font&gt;&lt;/strong&gt;. 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. &lt;font color="#0000ff"&gt;A RIA isn't just a client app, but an &amp;quot;Internet&amp;quot; app that includes a server component&lt;/font&gt;. 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. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v02_4.jpg"&gt;&lt;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="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v02_thumb_1.jpg" width="350" height="146" /&gt;&lt;/a&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;a href="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v03_4.jpg"&gt;&lt;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="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v03_thumb_1.jpg" width="350" height="146" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The first part of RIA Services pattern is to write a &lt;strong&gt;&lt;font color="#0000ff"&gt;DomainService&lt;/font&gt;&lt;/strong&gt; 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. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v05_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="v05" border="0" alt="v05" src="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v05_thumb.jpg" width="476" height="181" /&gt;&lt;/a&gt;&lt;a href="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v06_2.jpg"&gt;&lt;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="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v06_thumb.jpg" width="240" height="176" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The second part of the pattern is what we generate - the client-side data model - in a &lt;strong&gt;&lt;font color="#0000ff"&gt;DomainContext&lt;/font&gt;&lt;/strong&gt; 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.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.nikhilk.net/NET-RIA-Services-Vision-Architecture.aspx"&gt;Nikhil Kothari&lt;/a&gt; describe .NET RIA Services vision as &lt;strong&gt;RAD for RIA&lt;/strong&gt;, which is I totally agreed and have the same sense.But there is one requirement here in Asia that we must consider – &lt;font color="#ff0000"&gt;low bandwidth condition&lt;/font&gt;. This will rise new scenario - &lt;font color="#0000ff"&gt;offline-enabled RIA application&lt;/font&gt;&lt;font color="#000000"&gt;, means that we need to add local storage scenario for the &lt;font color="#0000ff"&gt;&lt;strong&gt;DomainContext&lt;/strong&gt;&lt;/font&gt;.&lt;/font&gt; The design challenges of all the offline-enabled applications are: &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font color="#0000ff"&gt;How to isolate client data layer&lt;/font&gt;       &lt;br /&gt;&lt;/strong&gt;    &lt;br /&gt;What is actually the data layer in RIA? It that the API that server exposes to AJAX? &lt;a href="http://code.google.com/apis/gears/architecture.html"&gt;Gears&lt;/a&gt; provides a good vision on &lt;strong&gt;&lt;font color="#0000ff"&gt;Server Data Layer&lt;/font&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;font color="#0000ff"&gt;Local Data Layer&lt;/font&gt;&lt;/strong&gt;, controlled by a &lt;strong&gt;&lt;font color="#0000ff"&gt;Data Switch&lt;/font&gt;&lt;/strong&gt;. 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 &lt;strong&gt;ActiveXObject&lt;/strong&gt; should be created for SQL Compact Edition/SQL Express/ESENT. &lt;strong&gt;&lt;font color="#ff0000"&gt;Anyone interested here?&lt;/font&gt;&lt;/strong&gt;     &lt;br /&gt;    &lt;br /&gt;&lt;a href="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v07_2.jpg"&gt;&lt;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="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v07_thumb.jpg" width="500" height="203" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font color="#0000ff"&gt;Offline strategy – what features need offline scenario&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;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: &lt;/p&gt;  &lt;p&gt;- Data may be so transient in nature that it makes no sense to cache it. I will use &lt;a href="http://geeks.netindonesia.net/blogs/risman/archive/2009/04/04/project-velocity-answer-to-memcached.aspx"&gt;Project Velocity for cache&lt;/a&gt; anyway.     &lt;br /&gt;- Some Simulation's data makes sense only while online.     &lt;br /&gt;- The App may choose to store only the most frequently accessed data.     &lt;br /&gt;- Numerical computational and/or disk space requirements make it unfeasible to recreate the feature offline.     &lt;br /&gt;    &lt;br /&gt;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. &lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;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 :). &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font color="#0000ff"&gt;Application Modality&lt;/font&gt;&lt;/strong&gt; &lt;/p&gt;  &lt;p&gt;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. &lt;/p&gt;  &lt;p&gt;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 &lt;strong&gt;&lt;font color="#0000ff"&gt;synchronized&lt;/font&gt;&lt;/strong&gt; 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. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font color="#0000ff"&gt;Data Synchronization&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;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: &lt;/p&gt;  &lt;p&gt;- The user makes changes while offline    &lt;br /&gt;- Data is shared and can be changed by external parties     &lt;br /&gt;- Data comes from an external source     &lt;br /&gt;    &lt;br /&gt;There are many approaches to synchronization and none are perfect for all situations. We have &lt;strong&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=109DB36E-CDD0-4514-9FB5-B77D9CEA37F6&amp;amp;displaylang=en"&gt;Microsoft Sync Framework&lt;/a&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=479F2216-E6F2-486F-80C9-2CFADE5082C1&amp;amp;displaylang=en"&gt;Astroria Offline&lt;/a&gt;&lt;/strong&gt; 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. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v08_2.jpg"&gt;&lt;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="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/3caf40684722.NETRIAServicesIsGoodEnough_BC55/v08_thumb.jpg" width="500" height="204" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;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. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Hope this helps!&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Cheers – RAM &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9531272" width="1" height="1"&gt;</content><author><name>Mattotorang</name><uri>http://blogs.msdn.com/members/Mattotorang.aspx</uri></author></entry><entry><title>MS-MPI with Visual Studio 2008</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/risman/archive/2009/01/04/ms-mpi-with-visual-studio-2008.aspx" /><id>http://blogs.msdn.com/risman/archive/2009/01/04/ms-mpi-with-visual-studio-2008.aspx</id><published>2009-01-04T13:24:10Z</published><updated>2009-01-04T13:24:10Z</updated><content type="html">&lt;p&gt;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:    &lt;br /&gt;    &lt;br /&gt;- &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=12887DA1-9410-4A59-B903-693116BFD30E&amp;amp;displaylang=en"&gt;HPC Pack SDK 2008&lt;/a&gt;     &lt;br /&gt;- VC++ Compiler and IDE (&lt;a href="http://www.microsoft.com/express/vc/"&gt;VC++ 2008 Express&lt;/a&gt; is okay)     &lt;br /&gt;    &lt;br /&gt;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 :     &lt;br /&gt;    &lt;br /&gt;C:\Program Files\Microsoft HPC Pack 2008 SDK\ in the Include and Lib folders.     &lt;br /&gt;    &lt;br /&gt;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.     &lt;br /&gt;    &lt;br /&gt;1 – Create an Empty C++ Project     &lt;br /&gt;    &lt;br /&gt;&amp;#160;&lt;a href="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI03_2.jpg"&gt;&lt;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="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI03_thumb.jpg" width="640" border="0" /&gt;&lt;/a&gt;     &lt;br /&gt;    &lt;br /&gt;2 – Change the Linker’s System configuration to CONSOLE(/SUBSYSTEM:CONSOLE)     &lt;br /&gt;    &lt;br /&gt;&lt;a href="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI04_2.jpg"&gt;&lt;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="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI04_thumb.jpg" width="640" border="0" /&gt;&lt;/a&gt;     &lt;br /&gt;    &lt;br /&gt;3 – Add Linker Additional Library Directories as following:     &lt;br /&gt;    &lt;br /&gt;&lt;a href="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI05_2.jpg"&gt;&lt;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="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI05_thumb.jpg" width="640" border="0" /&gt;&lt;/a&gt;     &lt;br /&gt;    &lt;br /&gt;4 – Add Linker’s Input Additional Dependencies. Type &lt;strong&gt;msmpi.lib&lt;/strong&gt; to the list.     &lt;br /&gt;    &lt;br /&gt;&lt;a href="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI06_2.jpg"&gt;&lt;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="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI06_thumb.jpg" width="640" border="0" /&gt;&lt;/a&gt;     &lt;br /&gt;    &lt;br /&gt;5 – Add a C++ file to write your first MPI program and write the following codes as a test:     &lt;br /&gt;&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;#include&lt;/span&gt;&lt;span style="color: #a31515"&gt;&amp;lt;iostream&amp;gt;
&lt;/span&gt;&lt;span style="color: blue"&gt;#include&lt;/span&gt;&lt;span style="color: #a31515"&gt;&amp;lt;mpi.h&amp;gt;
&lt;/span&gt;&lt;span style="color: blue"&gt;using namespace &lt;/span&gt;std;

&lt;span style="color: blue"&gt;int &lt;/span&gt;main(&lt;span style="color: blue"&gt;int &lt;/span&gt;argc, &lt;span style="color: blue"&gt;char&lt;/span&gt;** argv){

    &lt;span style="color: blue"&gt;int &lt;/span&gt;mynode, totalnodes;

    MPI_Init(&amp;amp;argc, &amp;amp;argv); 
    MPI_Comm_size(MPI_COMM_WORLD, &amp;amp;totalnodes);
    MPI_Comm_rank(MPI_COMM_WORLD, &amp;amp;mynode);
    
    cout &amp;lt;&amp;lt; &lt;span style="color: #a31515"&gt;&amp;quot;Hello world from process &amp;quot; &lt;/span&gt;&amp;lt;&amp;lt; mynode;
    cout &amp;lt;&amp;lt; &lt;span style="color: #a31515"&gt;&amp;quot; of &amp;quot; &lt;/span&gt;&amp;lt;&amp;lt; totalnodes &amp;lt;&amp;lt; endl;

    MPI_Finalize();
    &lt;span style="color: blue"&gt;return &lt;/span&gt;0;
}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;
6 – Add the location of header file to C++ Compiler property: 

&lt;br /&gt;

&lt;br /&gt;&lt;a href="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI07_2.jpg"&gt;&lt;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="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI07_thumb.jpg" width="640" border="0" /&gt;&lt;/a&gt; 

&lt;br /&gt;

&lt;p&gt;
  &lt;br /&gt;7 – Build your first program and if no error found, you can test it by running MPIEXEC (MPI launcher) : 

  &lt;br /&gt;

  &lt;br /&gt;&lt;strong&gt;&lt;font color="#0000ff"&gt;mpiexec –n 10 MyMPIProject.exe 
      &lt;br /&gt;&lt;/font&gt;&lt;/strong&gt;

  &lt;br /&gt;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: 

  &lt;br /&gt;

  &lt;br /&gt;&lt;a href="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI08_2.jpg"&gt;&lt;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="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSMPIwithVisualStudio2008_F3C8/MPI08_thumb.jpg" width="640" border="0" /&gt;&lt;/a&gt; 

  &lt;br /&gt;

  &lt;br /&gt;Congratulation is you reach this stage. You are ready to learn deeper about MS-MPI!. 

  &lt;br /&gt;

  &lt;br /&gt;Cheers – RAM 

  &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9271145" width="1" height="1"&gt;</content><author><name>Mattotorang</name><uri>http://blogs.msdn.com/members/Mattotorang.aspx</uri></author></entry><entry><title>Books on MPI (and Windows)</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/risman/archive/2008/12/31/books-on-mpi-and-windows.aspx" /><id>http://blogs.msdn.com/risman/archive/2008/12/31/books-on-mpi-and-windows.aspx</id><published>2008-12-31T08:55:32Z</published><updated>2008-12-31T08:55:32Z</updated><content type="html">&lt;p&gt;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:    &lt;br /&gt;    &lt;br /&gt;&lt;strong&gt;&lt;font color="#0000ff"&gt;Theoretical and Scientific Background &lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2" width="100%" border="0"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="35%"&gt;&lt;a href="http://www.amazon.com/Parallel-Scientific-Computing-MPI-Implementation/dp/0521520800/ref=sr_1_5?ie=UTF8&amp;amp;s=books&amp;amp;qid=1230701903&amp;amp;sr=1-5"&gt;&lt;img title="BooksMPI04" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="240" alt="BooksMPI04" src="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/BooksonMPIandWindows_B4D8/BooksMPI04_3.jpg" width="240" border="0" /&gt;&lt;/a&gt; &lt;/td&gt;        &lt;td valign="top" width="35%"&gt;&lt;a href="http://www.amazon.com/Art-Multiprocessor-Programming-Maurice-Herlihy/dp/0123705916/ref=sr_1_7?ie=UTF8&amp;amp;s=books&amp;amp;qid=1230701903&amp;amp;sr=1-7"&gt;&lt;img title="BooksMPI05" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="240" alt="BooksMPI05" src="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/BooksonMPIandWindows_B4D8/BooksMPI05_3.jpg" width="240" border="0" /&gt;&lt;/a&gt; &lt;/td&gt;        &lt;td valign="top" width="30%"&gt;&lt;a href="http://www.amazon.com/Sourcebook-Parallel-Computing-Kaufmann-Architecture/dp/1558608710/ref=sr_1_9?ie=UTF8&amp;amp;s=books&amp;amp;qid=1230701903&amp;amp;sr=1-9"&gt;&lt;img title="BooksMPI06" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="240" alt="BooksMPI06" src="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/BooksonMPIandWindows_B4D8/BooksMPI06_3.jpg" width="240" border="0" /&gt;&lt;/a&gt; &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;&lt;strong&gt;&lt;font color="#0000ff"&gt;For practical programmers &lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2" width="100%" border="0"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="35%"&gt;&lt;a href="http://www.amazon.com/Using-MPI-Programming-Engineering-Computation/dp/0262571323/ref=sr_1_2?ie=UTF8&amp;amp;s=books&amp;amp;qid=1230701903&amp;amp;sr=1-2"&gt;&lt;img title="MPIBooks01" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="240" alt="MPIBooks01" src="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/BooksonMPIandWindows_B4D8/MPIBooks01_3.jpg" width="240" border="0" /&gt;&lt;/a&gt; &lt;/td&gt;        &lt;td valign="top" width="35%"&gt;&lt;a href="http://www.amazon.com/MPI-Complete-Reference-2-set/dp/0262692163/ref=sr_1_3?ie=UTF8&amp;amp;s=books&amp;amp;qid=1230701903&amp;amp;sr=1-3"&gt;&lt;img title="BooksMPI02" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="240" alt="BooksMPI02" src="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/BooksonMPIandWindows_B4D8/BooksMPI02_3.jpg" width="240" border="0" /&gt;&lt;/a&gt; &lt;/td&gt;        &lt;td valign="top" width="30%"&gt;&lt;a href="http://www.amazon.com/Parallel-Programming-MPI-Peter-Pacheco/dp/1558603395/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1230700698&amp;amp;sr=1-1"&gt;&lt;img title="BooksMPI01" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="240" alt="BooksMPI01" src="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/BooksonMPIandWindows_B4D8/BooksMPI01_3.jpg" width="240" border="0" /&gt;&lt;/a&gt; &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;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:&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2" width="100%" border="0"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="35%"&gt;&lt;a href="http://www.amazon.com/Windows-via-C-Pro-Developer/dp/0735624240/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1230702060&amp;amp;sr=1-1"&gt;&lt;img title="WIN01" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="238" alt="WIN01" src="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/BooksonMPIandWindows_B4D8/WIN01_7.jpg" width="184" border="0" /&gt;&lt;/a&gt; &lt;/td&gt;        &lt;td valign="top" width="35%"&gt;&lt;a href="http://www.amazon.com/Windows%C2%AE-Internals-Including-Windows-PRO-Developer/dp/0735625301/ref=sr_1_5?ie=UTF8&amp;amp;s=books&amp;amp;qid=1230702060&amp;amp;sr=1-5"&gt;&lt;img title="Win02" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="240" alt="Win02" src="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/BooksonMPIandWindows_B4D8/Win02_3.jpg" width="240" border="0" /&gt;&lt;/a&gt; &lt;/td&gt;        &lt;td valign="top" width="30%"&gt;&lt;a href="http://www.amazon.com/Windows-Programming-Addison-Wesley-Microsoft-Technology/dp/0321256190/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1230702096&amp;amp;sr=1-1"&gt;&lt;img title="WIN03" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="240" alt="WIN03" src="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/BooksonMPIandWindows_B4D8/WIN03_3.jpg" width="240" border="0" /&gt;&lt;/a&gt; &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;   &lt;br /&gt;I hope you enjoy MPI exploration like I do.     &lt;br /&gt;    &lt;br /&gt;Happy learning – RAM &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9258119" width="1" height="1"&gt;</content><author><name>Mattotorang</name><uri>http://blogs.msdn.com/members/Mattotorang.aspx</uri></author></entry><entry><title>MPI.NET – MPI for Managed Codes</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/risman/archive/2008/12/31/mpi-net-mpi-for-managed-codes.aspx" /><id>http://blogs.msdn.com/risman/archive/2008/12/31/mpi-net-mpi-for-managed-codes.aspx</id><published>2008-12-31T05:57:56Z</published><updated>2008-12-31T05:57:56Z</updated><content type="html">&lt;p&gt;In this post, I would like to introduce you MPI.NET from Indiana University. You can download MPI.NET &lt;a href="http://www.osl.iu.edu/research/mpi.net/software/"&gt;here&lt;/a&gt; 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.     &lt;br /&gt;    &lt;br /&gt;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 &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=12887DA1-9410-4A59-B903-693116BFD30E&amp;amp;displaylang=en"&gt;Microsoft HPC Pack 2008 SDK&lt;/a&gt; (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.     &lt;br /&gt;&amp;#160; &lt;br /&gt;Now let see a C# program to calculate PI with the following algorithm:     &lt;br /&gt;    &lt;br /&gt;&lt;em&gt;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.      &lt;br /&gt;&lt;/em&gt;    &lt;br /&gt;Using this principle, the following &lt;strong&gt;sequential program&lt;/strong&gt; computes an approximation of PI:&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;font color="#800000"&gt;using System; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#800000"&gt;class SequentialPi      &lt;br /&gt;{       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; static void Main(string[] args)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; int dartsPerProcessor = 10000;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Random random = new Random();       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; int dartsInCircle = 0;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; for (inti = 0; i&amp;lt;dartsPerProcessor; ++i)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; double x = (random.NextDouble() - 0.5) * 2;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; double y = (random.NextDouble() - 0.5) * 2;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (x * x + y * y &amp;lt;= 1.0)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ++dartsInCircle;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; } &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#800000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Console.WriteLine(&amp;quot;Pi is approximately {0:F15}.&amp;quot;,      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 4*(double)totalDartsInCircle/(double)dartsPerProcessor);       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;}       &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font color="#0000ff"&gt;What MPI Can Do To Parallelize The Codes?        &lt;br /&gt;&lt;/font&gt;&lt;/strong&gt;    &lt;br /&gt;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.&amp;#160; Most MPI programs are written with the &lt;strong&gt;Single Program, Multiple Data (SPMD)&lt;/strong&gt; 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: &lt;strong&gt;each process is assigned a rank, which uniquely identifies that process&lt;/strong&gt;. 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.     &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;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. &lt;strong&gt;&lt;font color="#0000ff"&gt;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&lt;/font&gt;&lt;/strong&gt;. The complete code for the parallel calculation of PI is as following:     &lt;br /&gt;    &lt;br /&gt;&lt;font color="#800000"&gt;using System;      &lt;br /&gt;using MPI;&amp;#160; &lt;/font&gt;&lt;font color="#008000"&gt;// add reference to message passing interface namespace before add this line&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#800000"&gt;class ParallelPI      &lt;br /&gt;{       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; static void Main(string[] args)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; int dartsPerProcessor = 10000;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; using (new &lt;strong&gt;&lt;font color="#0000ff"&gt;MPI.Environment(ref args)&lt;/font&gt;&lt;/strong&gt;)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (args.Length &amp;gt; 0)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; dartsPerProcessor = Convert.ToInt32(args[0]);       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#0000ff"&gt;&lt;strong&gt;Intracommunicator&lt;/strong&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;strong&gt;world&lt;/strong&gt;&lt;/font&gt; = &lt;strong&gt;&lt;font color="#0000ff"&gt;Communicator.world&lt;/font&gt;&lt;/strong&gt;;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Random random = new Random(5 * &lt;strong&gt;&lt;font color="#0000ff"&gt;world.Rank&lt;/font&gt;&lt;/strong&gt;);       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; int dartsInCircle = 0;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; for (int i = 0; i &amp;lt; dartsPerProcessor; ++i)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; double x = (random.NextDouble() - 0.5) * 2;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; double y = (random.NextDouble() - 0.5) * 2;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (x * x + y * y &amp;lt;= 1.0)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ++dartsInCircle;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; } &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#800000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (&lt;strong&gt;&lt;font color="#0000ff"&gt;world.Rank&lt;/font&gt;&lt;/strong&gt; == 0)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; int totalDartsInCircle = &lt;strong&gt;&lt;font color="#0000ff"&gt;world.Reduce&lt;/font&gt;&lt;/strong&gt;&amp;lt;int&amp;gt;(dartsInCircle, Operation&amp;lt;int&amp;gt;.Add, 0);       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System.Console.WriteLine(&amp;quot;Pi is approximately {0:F15}.&amp;quot;,       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 4*(double)totalDartsInCircle/(&lt;strong&gt;&lt;font color="#0000ff"&gt;world.Size&lt;/font&gt;&lt;/strong&gt;*(double)dartsPerProcessor));       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; else       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;strong&gt;&lt;font color="#0000ff"&gt;world.Reduce&lt;/font&gt;&lt;/strong&gt;&amp;lt;int&amp;gt;(dartsInCircle, Operation&amp;lt;int&amp;gt;.Add, 0);       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;}&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;1st step in MPI program is to initialize MPI environment by creating a new instance of &lt;strong&gt;&lt;font color="#0000ff"&gt;MPI.Environment&lt;/font&gt;&lt;/strong&gt; 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.     &lt;br /&gt;    &lt;br /&gt;After MPI environment initialized, then we can create &lt;strong&gt;&lt;font color="#0000ff"&gt;Communicator&lt;/font&gt;&lt;/strong&gt; object.&amp;#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.     &lt;br /&gt;    &lt;br /&gt;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 &amp;quot;root&amp;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 (&lt;strong&gt;&lt;font color="#0000ff"&gt;world.Rank&lt;/font&gt;&lt;/strong&gt;), and the size of the communicator, which provides the number of processes in the communicator (&lt;strong&gt;&lt;font color="#0000ff"&gt;world.Size&lt;/font&gt;&lt;/strong&gt;).     &lt;br /&gt;    &lt;br /&gt;&lt;font color="#800000"&gt;&lt;strong&gt;&lt;font color="#0000ff"&gt;Intraommunicator world = Communicator.world;          &lt;br /&gt;&lt;/font&gt;&lt;/strong&gt;if (&lt;strong&gt;&lt;font color="#0000ff"&gt;world.Rank&lt;/font&gt;&lt;/strong&gt; == 0)       &lt;br /&gt;{       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#008000"&gt;// program for rank 0 (root process)        &lt;br /&gt;&lt;/font&gt;}       &lt;br /&gt;else // not rank 0       &lt;br /&gt;{       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#008000"&gt;// program for all other ranks&lt;/font&gt;       &lt;br /&gt;}       &lt;br /&gt;&lt;/font&gt;&lt;/p&gt; As mentioned before, to parallelize PI program, we used MPI to run several processes, each of which will throw darts independently. &lt;strong&gt;Once all of the processes have finished, we'll need to sum up the results. &lt;/strong&gt;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 &lt;strong&gt;&lt;font color="#0000ff"&gt;Reduce collective&lt;/font&gt;&lt;/strong&gt;, which combines the values provided by each of the processes and returns the result at the designated root process.&amp;#160; We used &lt;strong&gt;&lt;font color="#0000ff"&gt;world.Reduce&lt;/font&gt;&lt;/strong&gt;() 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) :   &lt;br /&gt;  &lt;br /&gt;&lt;strong&gt;&lt;font color="#0000ff"&gt;world.Reduce&amp;lt;int&amp;gt;(dartsInCircle, Operation&amp;lt;int&amp;gt;.Add, 0);      &lt;br /&gt;&lt;/font&gt;&lt;/strong&gt;  &lt;p&gt;   &lt;br /&gt;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:     &lt;br /&gt;    &lt;br /&gt;&lt;font color="#0000ff"&gt;&lt;strong&gt;MPIEXEC –n 10 ParallelPI.exe        &lt;br /&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;Cheers – RAM &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9257970" width="1" height="1"&gt;</content><author><name>Mattotorang</name><uri>http://blogs.msdn.com/members/Mattotorang.aspx</uri></author></entry><entry><title>MS-MPI and HPC Pack 2008 SDK</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/risman/archive/2008/12/31/ms-mpi-and-hpc-pack-2008-sdk.aspx" /><id>http://blogs.msdn.com/risman/archive/2008/12/31/ms-mpi-and-hpc-pack-2008-sdk.aspx</id><published>2008-12-31T05:47:11Z</published><updated>2008-12-31T05:47:11Z</updated><content type="html">&lt;p&gt;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 &lt;strong&gt;based on&lt;/strong&gt; and &lt;strong&gt;designed for &lt;/strong&gt;maximum compatibility with the MPICH2 reference implementation. It was shipped within &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=12887DA1-9410-4A59-B903-693116BFD30E&amp;amp;displaylang=en"&gt;HPC Pack 2008 SDK&lt;/a&gt;.     &lt;br /&gt;    &lt;br /&gt;The exceptions to compatibility with MPICH2 are on the &lt;strong&gt;job launch&lt;/strong&gt; and &lt;strong&gt;job management &lt;/strong&gt;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.     &lt;br /&gt;    &lt;br /&gt;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 &lt;strong&gt;InfiniBand&lt;/strong&gt;, &lt;strong&gt;10-Gigabit Ethernet&lt;/strong&gt;, or &lt;strong&gt;Myrinet&lt;/strong&gt;. 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.     &lt;br /&gt;    &lt;br /&gt;&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2" width="100%" border="0"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" align="left" width="50%"&gt;&amp;#160;&lt;a href="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSMPIandHPCPack2008SDK_8936/MPI01_2.jpg"&gt;&lt;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="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSMPIandHPCPack2008SDK_8936/MPI01_thumb.jpg" width="371" border="0" /&gt;&lt;/a&gt;&lt;/td&gt;        &lt;td valign="top" align="left" width="50%"&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=12887DA1-9410-4A59-B903-693116BFD30E&amp;amp;displaylang=en"&gt;&lt;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="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSMPIandHPCPack2008SDK_8936/mshpcsdk_horz_3.jpg" width="245" border="0" /&gt;&lt;/a&gt;          &lt;br /&gt;&lt;a href="http://resourcekit.windowshpc.net/Default.html"&gt;&lt;img title="HPCKit" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="146" alt="HPCKit" src="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSMPIandHPCPack2008SDK_8936/HPCKit_3.jpg" width="245" border="0" /&gt;&lt;/a&gt;&amp;#160; &lt;br /&gt;          &lt;br /&gt;&lt;a href="http://resourcekit.windowshpc.net/Default.html"&gt;HPC Kit 2008&lt;/a&gt; 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. &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;br /&gt;  &lt;p&gt;Windows HPC Server 2008 includes the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=12887DA1-9410-4A59-B903-693116BFD30E&amp;amp;displaylang=en"&gt;Microsoft HPC Pack 2008 SDK&lt;/a&gt; that currently contains:    &lt;br /&gt;- MPIEXEC&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : MPI Application Launcher    &lt;br /&gt;- SMPD&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : MPI Process Manager    &lt;br /&gt;- MPISYNC&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : MPI Trace Clock Synchronizer    &lt;br /&gt;- Microsoft.Hpc.VSDeployTool&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : MPI Deployment Tools for Visual Studio    &lt;br /&gt;- ELT2CLOG and ETL2OTF&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : MPI ETL Trace Converter    &lt;br /&gt;- MPI Scheduler API DLLs     &lt;br /&gt;- MPI Header and Library Files for i386 and AMD64    &lt;br /&gt;- Network Direct Service Provider Interface    &lt;br /&gt;&amp;#160; &lt;br /&gt;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).&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;    &lt;br /&gt;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!&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;Cheers – RAM &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9257960" width="1" height="1"&gt;</content><author><name>Mattotorang</name><uri>http://blogs.msdn.com/members/Mattotorang.aspx</uri></author></entry><entry><title>Introduction to MPI</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/risman/archive/2008/12/30/introduction-to-mpi.aspx" /><id>http://blogs.msdn.com/risman/archive/2008/12/30/introduction-to-mpi.aspx</id><published>2008-12-30T14:43:22Z</published><updated>2008-12-30T14:43:22Z</updated><content type="html">&lt;p&gt;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. &lt;/p&gt;  &lt;p&gt;In this post, I would like to introduce you to MPI using &lt;strong&gt;&lt;a href="http://www.mcs.anl.gov/research/projects/mpich2/"&gt;MPICH2&lt;/a&gt;&lt;/strong&gt; 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 &lt;a href="http://www.mcs.anl.gov/research/projects/mpich2/documentation/index.php?s=docs"&gt;here&lt;/a&gt; too. My goals in this post is to explain you how to start with MPICH2 and create your first MPICH2 C++ program.&amp;#160; &lt;br /&gt;    &lt;br /&gt;What you need to do is download and install MPICH2 first, then you will have all the header files (*.h), libraries (*.lib) and &lt;strong&gt;MPIEXEC.EXE&lt;/strong&gt; to run jobs. Before you do that, please install the MPICH2 Process Manager by running &lt;strong&gt;SMPD.EXE –install&lt;/strong&gt;. 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.&lt;/p&gt;  &lt;p&gt;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.    &lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;&lt;strong&gt;&lt;font color="#0000a0"&gt;Compiling MPICH2 Source Codes in Windows Server 2008        &lt;br /&gt;&lt;/font&gt;&lt;/strong&gt;    &lt;br /&gt;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 &lt;a href="http://www.mcs.anl.gov/research/projects/mpich2/"&gt;Argonne LAB&lt;/a&gt;, then run a file called &lt;strong&gt;winconfigure.wsf&lt;/strong&gt;. 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:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;_vsnprintf': attributes inconsistent with previous declaration&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;in your first compilation, to solve it, please find the following config header (I’m using x64):&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff0000"&gt;..\MPICH2-1.0.8\src\include\win64\mpichconf.h      &lt;br /&gt;&lt;/font&gt;    &lt;br /&gt;Then change the codes like below:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;#if not defined(_MSC_VER) || defined(__MINGW32__)        &lt;br /&gt;&lt;/font&gt;&lt;font color="#800000"&gt;&amp;#160;&amp;#160; #define snprintf _snprintf        &lt;br /&gt;&amp;#160;&amp;#160; #define vsnprintf _vsnprintf         &lt;br /&gt;&lt;/font&gt;&lt;font color="#ff0000"&gt;#endif&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;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 &lt;strong&gt;MPICEXEC&lt;/strong&gt; and &lt;strong&gt;SMPD&lt;/strong&gt;. The mpich2 dlls can be built to use shared memory communication, tcp socket communication, or both.     &lt;br /&gt;    &lt;br /&gt;- Select the ch3sockDebug or ch3sockRelease configurations to build the &lt;strong&gt;sockets&lt;/strong&gt; only dlls.     &lt;br /&gt;- Select the ch3shmDebug or ch3shmRelease configurations to build the &lt;strong&gt;shmem&lt;/strong&gt; only dlls.     &lt;br /&gt;- Select the ch3sshmDebug or ch3sshmRelease configurations to build the &lt;strong&gt;scalable shmem&lt;/strong&gt; only dlls.     &lt;br /&gt;- Select the ch3ssmDebug or ch3ssmRelease configurations to build the &lt;strong&gt;sockets+shmem&lt;/strong&gt; dlls.     &lt;br /&gt;- Select the ch3ibDebug or ch3ibRelease configurations to build the infiniband dlls. &lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;I hope you are done with the compilation, now lets start to see the simplest MPI program to calculate pi value:     &lt;br /&gt;    &lt;br /&gt;&lt;font color="#008000"&gt;// This is an interactive version of cpi&lt;/font&gt;     &lt;br /&gt;&lt;font color="#800000"&gt;#include &amp;quot;mpi.h&amp;quot;      &lt;br /&gt;#include &amp;lt;stdio.h&amp;gt;       &lt;br /&gt;#include &amp;lt;math.h&amp;gt; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#800000"&gt;double f(double); &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#800000"&gt;double f(double a)      &lt;br /&gt;{       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; return (4.0 / (1.0 + a*a));       &lt;br /&gt;} &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#800000"&gt;int main(int argc,char *argv[])      &lt;br /&gt;{       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; int done = 0, n, myid, numprocs, i;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; double PI25DT = 3.141592653589793238462643;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; double mypi, pi, h, sum, x;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; double startwtime = 0.0, endwtime;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; int&amp;#160; namelen;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; char processor_name[MPI_MAX_PROCESSOR_NAME]; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font color="#0000ff"&gt;&amp;#160;&amp;#160;&amp;#160; MPI_Init(&amp;amp;argc,&amp;amp;argv);        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; MPI_Comm_size(MPI_COMM_WORLD,&amp;amp;numprocs);         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; MPI_Comm_rank(MPI_COMM_WORLD,&amp;amp;myid);         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; MPI_Get_processor_name(processor_name,&amp;amp;namelen); &lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#800000"&gt;&amp;#160;&amp;#160;&amp;#160; /*      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; fprintf(stdout,&amp;quot;Process %d of %d is on %s\n&amp;quot;, myid, numprocs, processor_name);       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; fflush(stdout);       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; */ &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#800000"&gt;&amp;#160;&amp;#160;&amp;#160; while (!done) {      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (myid == 0) {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; fprintf(stdout, &amp;quot;Enter the number of intervals: (0 quits) &amp;quot;);       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; fflush(stdout);       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (scanf(&amp;quot;%d&amp;quot;,&amp;amp;n) != 1) {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; fprintf( stdout, &amp;quot;No number entered; quitting\n&amp;quot; );       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; n = 0;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; startwtime = &lt;font color="#0000ff"&gt;&lt;strong&gt;MPI_Wtime()&lt;/strong&gt;&lt;/font&gt;;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;strong&gt;&lt;font color="#0000ff"&gt;MPI_Bcast(&amp;amp;n, 1, MPI_INT, 0, MPI_COMM_WORLD);          &lt;br /&gt;&lt;/font&gt;&lt;/strong&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (n == 0)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; done = 1;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; else {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; h&amp;#160;&amp;#160; = 1.0 / (double) n;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sum = 0.0;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; for (i = myid + 1; i &amp;lt;= n; i += numprocs) {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; x = h * ((double)i - 0.5);       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sum += f(x);       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; mypi = h * sum;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; MPI_Reduce(&amp;amp;mypi, &amp;amp;pi, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD); &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#800000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (myid == 0) {      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; printf(&amp;quot;pi is approximately %.16f, Error is %.16f\n&amp;quot;,       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; pi, fabs(pi - PI25DT));       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; endwtime = &lt;font color="#0000ff"&gt;&lt;strong&gt;MPI_Wtime()&lt;/strong&gt;;         &lt;br /&gt;&lt;/font&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; printf(&amp;quot;wall clock time = %f\n&amp;quot;, endwtime-startwtime);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; fflush( stdout );       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#0000ff"&gt;&lt;strong&gt;MPI_Finalize();          &lt;br /&gt;&lt;/strong&gt;&lt;/font&gt;&amp;#160;&amp;#160;&amp;#160; return 0;       &lt;br /&gt;}&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;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.     &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;Cheers – RAM    &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9256977" width="1" height="1"&gt;</content><author><name>Mattotorang</name><uri>http://blogs.msdn.com/members/Mattotorang.aspx</uri></author></entry><entry><title>Parallel Programming with OpenMP</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/risman/archive/2008/12/29/parallel-programming-with-openmp.aspx" /><id>http://blogs.msdn.com/risman/archive/2008/12/29/parallel-programming-with-openmp.aspx</id><published>2008-12-29T06:35:11Z</published><updated>2008-12-29T06:35:11Z</updated><content type="html">&lt;p&gt;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 &lt;a href="http://www.openmp.org"&gt;OpenMP&lt;/a&gt; to get more information about this standard. In this post I will guide you more practically to use OpenMP in Microsoft Visual C++. &lt;/p&gt;  &lt;p&gt;OpenMP uses &lt;a href="http://www.llnl.gov/computing/tutorials/openMP"&gt;Fork-Join Model&lt;/a&gt; of parallel execution. Every OpenMP program begins as a single process: called it &lt;strong&gt;master thread. &lt;/strong&gt;The master thread will be executed sequentially until the first parallel region &lt;strong&gt;construct&lt;/strong&gt; is encountered. Most of constructs in OpenMP are compiler directives, with the following structure:     &lt;br /&gt;    &lt;br /&gt;&lt;font color="#0000ff"&gt;#pragma omp construct [clause [clause] …] &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;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 &lt;strong&gt;/openmp&lt;/strong&gt; option to compile your program. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font color="#800000"&gt;#include &amp;lt;omp.h&amp;gt;        &lt;br /&gt;#include &amp;lt;iostream&amp;gt;         &lt;br /&gt;using namespace std; &lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font color="#800000"&gt;int main ()&amp;#160; { &lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font color="#800000"&gt;int nthreads, tid; &lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font color="#800000"&gt;&lt;strong&gt;&lt;font color="#008000"&gt;/* Fork a team of threads giving them their own copies of variables */            &lt;br /&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font color="#0000ff"&gt;#pragma omp parallel private(tid)          &lt;br /&gt;&lt;/font&gt;&amp;#160; {         &lt;br /&gt;&amp;#160; /* Obtain and print thread id */         &lt;br /&gt;&amp;#160; tid = omp_get_thread_num();         &lt;br /&gt;&amp;#160; cout &amp;lt;&amp;lt; &amp;quot;Hello World from thread = &amp;quot; &amp;lt;&amp;lt; tid &amp;lt;&amp;lt; endl;         &lt;br /&gt;&amp;#160; &lt;strong&gt;&lt;font color="#008000"&gt;/* Only master thread does this */ &lt;/font&gt;&lt;/strong&gt;        &lt;br /&gt;&amp;#160; if (tid == 0)         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; nthreads = omp_get_num_threads();         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; cout &amp;lt;&amp;lt; &amp;quot;Number of threads = &amp;quot; &amp;lt;&amp;lt; nthreads &amp;lt;&amp;lt; endl;         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; } &lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font color="#800000"&gt;&amp;#160; }&amp;#160; &lt;/font&gt;&lt;font color="#008000"&gt;&lt;strong&gt;/* All threads join master thread and terminate */ &lt;/strong&gt;&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font color="#800000"&gt;} &lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;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    &lt;br /&gt;of length n, storing the result into a vector a of length m. Here is the formula:     &lt;br /&gt;    &lt;br /&gt;&lt;a href="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/ParallelProgrammingwithOpenMP_F98F/OpenMP03_2.jpg"&gt;&lt;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="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/ParallelProgrammingwithOpenMP_F98F/OpenMP03_thumb.jpg" width="182" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The sequential codes will look like:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font color="#800000"&gt;void multiplyer(int m, int n, double *a, double *b, double *c)        &lt;br /&gt;{         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; int i, j;         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; for (i=0; i&amp;lt;m; i++)         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; a[i] = 0.0;         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; for (j=0; j&amp;lt;n; j++) a[i] += b[i*n+j]*c[j];         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }         &lt;br /&gt;}&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;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. &lt;/p&gt;  &lt;p&gt;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    &lt;br /&gt;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.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font color="#800000"&gt;void multiplyer(int m, int n, double *a, double *b, double *c)        &lt;br /&gt;{         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; int i, j;&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#0000ff"&gt;#pragma omp parallel for default(none) shared(m,n,a,b,c) private(i,j)        &lt;br /&gt;&lt;/font&gt;&lt;font color="#800000"&gt;&amp;#160;&amp;#160;&amp;#160; for (i=0; i&amp;lt;m; i++)        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; a[i] = 0.0;         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; for (j=0; j&amp;lt;n; j++) a[i] += b[i*n+j]*c[j];         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }         &lt;br /&gt;}&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;You can continue your OpenMP exploration by reading &lt;a href="http://www.llnl.gov/computing/tutorials/openMP"&gt;this tutorial&lt;/a&gt;. 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. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.amazon.com/Using-OpenMP-Programming-Engineering-Computation/dp/0262533022/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1230521555&amp;amp;sr=1-1"&gt;&lt;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="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/ParallelProgrammingwithOpenMP_F98F/OpenMP04_3.jpg" width="201" border="0" /&gt;&lt;/a&gt;     &lt;br /&gt;    &lt;br /&gt;Cheers – RAM&amp;#160; &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9255311" width="1" height="1"&gt;</content><author><name>Mattotorang</name><uri>http://blogs.msdn.com/members/Mattotorang.aspx</uri></author></entry><entry><title>Working with Sharepoint in Vista</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/risman/archive/2008/10/02/working-with-sharepoint-in-vista.aspx" /><id>http://blogs.msdn.com/risman/archive/2008/10/02/working-with-sharepoint-in-vista.aspx</id><published>2008-10-02T12:01:49Z</published><updated>2008-10-02T12:01:49Z</updated><content type="html">&lt;p&gt;I followed the guidance from Bambo solutions to run WSS 3.0 SP1 with IIS 7.0 and SQL Server 2005 backend in my Vista machine. It works well, &lt;a href="http://community.bamboosolutions.com/blogs/bambooteamblog/archive/2008/05/21/how-to-install-windows-sharepoint-services-3-0-sp1-on-vista-x64-x86.aspx"&gt;you can follow it too within 15 minutes&lt;/a&gt;. For UI level customization, I use Sharepoint Designer which is available also for remote site customization. Look how it run in my vista machine below.    &lt;br /&gt;    &lt;br /&gt;To manage the operations and applications inside your Sharepoint farm, WSS shipped with web based Central Administration tools (you can also use SPAdmin tool) that you can use intuitively once you understood basic concepts of IIS, SP Farm, Web Application and Site Collections. Please consult to Sharepoint Documentation for further information. In my case, I use Central Administration to create one Web Application and one site collection.    &lt;br /&gt;    &lt;br /&gt;&lt;a href="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/WorkingwithSharepointinVista_E0B6/SP02_2.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="365" alt="SP02" src="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/WorkingwithSharepointinVista_E0B6/SP02_thumb.jpg" width="629" border="0" /&gt;&lt;/a&gt;    &lt;br /&gt;    &lt;br /&gt;To help me doing site customization, I use Sharepoint Designer (SD) to connect to all site resources and manipulate them visually. I just connected to my site using SD and did a simple manipulation to the title text of my site. Very easy and intuitive. I can manipulate contents of _catalog, _cts, _private, images, lists, etc using SD, without dealing directly with its physical location. &lt;a href="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/WorkingwithSharepointinVista_E0B6/SP01_2.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="354" alt="SP01" src="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/WorkingwithSharepointinVista_E0B6/SP01_thumb.jpg" width="632" border="0" /&gt;&lt;/a&gt;&amp;#160; &lt;br /&gt;Editing content with SD is like using other HTML IDE with property driven customization. For example:    &lt;br /&gt;&lt;a href="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/WorkingwithSharepointinVista_E0B6/SP05_2.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="182" alt="SP05" src="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/WorkingwithSharepointinVista_E0B6/SP05_thumb.jpg" width="639" border="0" /&gt;&lt;/a&gt;     &lt;br /&gt;    &lt;br /&gt;If you are curious to know where the physical location of those files, just open the IIS 7.0 and look there. It is not recommended to directly change something inside the physical directory as every things are managed logically in SD. I can use SD not only to change the existing content resources (CSS, ASPX, master pages, etc), but also to add custom content. Excellent!.     &lt;br /&gt;&lt;a href="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/WorkingwithSharepointinVista_E0B6/SP03_2.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="360" alt="SP03" src="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/WorkingwithSharepointinVista_E0B6/SP03_thumb.jpg" width="209" border="0" /&gt;&lt;/a&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;a href="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/WorkingwithSharepointinVista_E0B6/SP04_2.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="348" alt="SP04" src="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/WorkingwithSharepointinVista_E0B6/SP04_thumb.jpg" width="358" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;If you want to know more, on top of your Sharepoint Designer documentation, the following links are important:   &lt;br /&gt;    &lt;br /&gt;- &lt;a href="http://msdn.microsoft.com/en-us/library/bb149147.aspx"&gt;Sharepoint Designer Developer Reference&lt;/a&gt;    &lt;br /&gt;- &lt;a href="http://blogs.msdn.com/sharepointdesigner/"&gt;Microsoft Sharepoint Designer Team Blog&lt;/a&gt;&amp;#160; &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;Hope this helps!. &lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;Cheers, RAM&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8973241" width="1" height="1"&gt;</content><author><name>Mattotorang</name><uri>http://blogs.msdn.com/members/Mattotorang.aspx</uri></author></entry><entry><title>MSDN Nepal Beta Today</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/risman/archive/2008/09/29/msdn-nepal-beta-today.aspx" /><id>http://blogs.msdn.com/risman/archive/2008/09/29/msdn-nepal-beta-today.aspx</id><published>2008-09-28T21:44:00Z</published><updated>2008-09-28T21:44:00Z</updated><content type="html">&lt;P&gt;This is an early announcement for the release of MSDN &lt;A href="http://en.wikipedia.org/wiki/Nepal" mce_href="http://en.wikipedia.org/wiki/Nepal"&gt;NEPAL&lt;/A&gt;, online developer community for NEPAL. You can access its BETA version and take a look its nice face. Click to visit&amp;nbsp;&lt;A class="" href="http://msdnnepal.net/" mce_href="http://msdnnepal.net"&gt;MSDN NEPAL&lt;/A&gt;.&lt;BR&gt;&lt;BR&gt;&lt;A class="" title="Click to go to NEPAL" href="http://msdnnepal.net/" mce_href="http://msdnnepal.net"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=301 alt=Announcement01 src="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSDNNepalBetaToday_184C/Announcement01_thumb.jpg" width=460 border=0 mce_src="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/MSDNNepalBetaToday_184C/Announcement01_thumb.jpg"&gt;&lt;/A&gt; &lt;BR&gt;&lt;BR&gt;I do hope this community can bring new experiences for thousands developers in NEPAL. To learn Microsoft latest technologies and share it with others. &lt;/P&gt;
&lt;P&gt;&lt;BR&gt;Happy coding! &lt;BR&gt;&lt;BR&gt;Cheers, RAM &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8968149" width="1" height="1"&gt;</content><author><name>Mattotorang</name><uri>http://blogs.msdn.com/members/Mattotorang.aspx</uri></author></entry><entry><title>WPF and Silverlight Deep Dive Sessions</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/risman/archive/2008/09/23/wpf-and-silverlight-deep-dive-sessions.aspx" /><id>http://blogs.msdn.com/risman/archive/2008/09/23/wpf-and-silverlight-deep-dive-sessions.aspx</id><published>2008-09-23T05:02:26Z</published><updated>2008-09-23T05:02:26Z</updated><content type="html">&lt;p&gt;I will deliver this training at four cities in Asia:   &lt;br /&gt;    &lt;br /&gt;- &lt;strong&gt;Bangkok&lt;/strong&gt; on Sept 24-26, 2008    &lt;br /&gt;- &lt;strong&gt;Manila&lt;/strong&gt; on Oct 13-15, 2008    &lt;br /&gt;- &lt;strong&gt;Jakarta&lt;/strong&gt;, TBD around Nov, 2008    &lt;br /&gt;- &lt;strong&gt;Hanoi&lt;/strong&gt;, TBD around Dec, 2008&amp;#160; &lt;br /&gt;&lt;a href="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/WPFandSilverlightDeepDiveSessions_7EF6/phifinal_2.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="617" alt="phifinal" src="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/WPFandSilverlightDeepDiveSessions_7EF6/phifinal_thumb.jpg" width="421" border="0" /&gt;&lt;/a&gt;    &lt;br /&gt;    &lt;br /&gt;Unfortunately, I have limited time to prepare scientific related contents using WPF and Silverlight. I plan to do that, indeed. &lt;/p&gt;  &lt;p&gt;Stay tuned.    &lt;br /&gt;    &lt;br /&gt;Cheers - RAM&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8961818" width="1" height="1"&gt;</content><author><name>Mattotorang</name><uri>http://blogs.msdn.com/members/Mattotorang.aspx</uri></author></entry><entry><title>My PDC Pre-conference Session</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/risman/archive/2008/09/23/my-pdc-pre-conference-session.aspx" /><id>http://blogs.msdn.com/risman/archive/2008/09/23/my-pdc-pre-conference-session.aspx</id><published>2008-09-23T04:46:20Z</published><updated>2008-09-23T04:46:20Z</updated><content type="html">&lt;p&gt;I will attend &amp;quot;&lt;strong&gt;Concurrent, Multi-core Programming on Windows and .NET&lt;/strong&gt;&amp;quot; session at PDC, next month. This will be a great workshop for me, not only because of its great topics, but I will meet some folks behind these technologies.&lt;/p&gt;  &lt;h6&gt;Guru (s): David Callahan, Joe Duffy, Stephen Toub&lt;/h6&gt;  &lt;p&gt;&lt;em&gt;The leap from single-core to multi-core technology is altering computing as we know it, enabling increased productivity, powerful energy-efficient performance, and leading-edge advanced computing experiences. The good news is that Windows and .NET offer rich support for threading and synchronization to take advantage of these new platforms. This session, presented by David Callahan, Microsoft distinguished engineer, Joe Duffy, author of &amp;quot;Concurrent Programming on Windows&amp;#8221; (Addison-Wesley), and Stephen Toub, program manager lead for the Concurrency Development Platform team at Microsoft, will cover a broad range of topics, including mechanisms to create, coordinate, and synchronize among threads; best practices for concurrent libraries and apps; and techniques for improving scalability, including lock-free algorithms. Focus will be on .NET programming, including the next generation of parallel programming support within the Framework, but Windows internals and C++ nuggets will be discussed too. &lt;/em&gt;&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;Can't wait to see and learn from them soon.    &lt;br /&gt;    &lt;br /&gt;Cheers - Risman Adnan &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8961810" width="1" height="1"&gt;</content><author><name>Mattotorang</name><uri>http://blogs.msdn.com/members/Mattotorang.aspx</uri></author></entry><entry><title>Welcome to F#</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/risman/archive/2008/09/22/new-msdn-blog-welcome-to-f.aspx" /><id>http://blogs.msdn.com/risman/archive/2008/09/22/new-msdn-blog-welcome-to-f.aspx</id><published>2008-09-22T18:53:38Z</published><updated>2008-09-22T18:53:38Z</updated><content type="html">&lt;p&gt;&lt;font size="2"&gt;&lt;font face="Segoe Condensed"&gt;In this post, I will introduce you to F#, a multi-paradigm .NET programming language that already attracted my attention. Lets try by &lt;/font&gt;&lt;/font&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=61ad6924-93ad-48dc-8c67-60f7e7803d3c&amp;amp;displaylang=en"&gt;&lt;font face="Segoe Condensed" size="2"&gt;downloading&lt;/font&gt;&lt;/a&gt;&lt;font face="Segoe Condensed" size="2"&gt; and installing it. I am using Version 1.9.6.2 at the time of this posting. For you who wants to follow me in F# exploration, I strongly recommend you to download and print the &lt;/font&gt;&lt;a href="http://research.microsoft.com/fsharp/manual/spec.pdf"&gt;&lt;font face="Segoe Condensed" size="2"&gt;F# Language Specification&lt;/font&gt;&lt;/a&gt;&lt;font face="Segoe Condensed" size="2"&gt; and regularly visit &lt;/font&gt;&lt;a href="http://msdn.microsoft.com/en-us/fsharp/default.aspx"&gt;&lt;font face="Segoe Condensed" size="2"&gt;F# Official MSDN Website&lt;/font&gt;&lt;/a&gt;&lt;font face="Segoe Condensed" size="2"&gt;.      &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;a href="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/Welcometomynewblog_107AD/FS01_2.jpg"&gt;&lt;font face="Segoe Condensed" size="2"&gt;&lt;/font&gt;&lt;/a&gt;&lt;a href="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/Welcometomynewblog_107AD/FS01_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="270" alt="FS01" src="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/Welcometomynewblog_107AD/FS01_thumb.jpg" width="316" border="0" /&gt;&lt;/a&gt;&lt;/a&gt;&lt;/a&gt;&lt;font face="Segoe Condensed" size="2"&gt;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font face="Segoe Condensed" size="2"&gt;For you who already installed Visual Studio 2008, the F# installer will give you project templates for F# Application, Library and Tutorial. I am using VS 2008 Team Suite, and here is my VS 2008 looks like when I created new F# App project. Don't worry too much if you don't have VS 2008, you can use any text editor to write your codes then paste your code in MSR F# interactive console, &lt;strong&gt;fsi.exe&lt;/strong&gt;. &lt;/font&gt;&lt;a href="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/Welcometomynewblog_107AD/FS04_2.jpg"&gt;&lt;font face="Segoe Condensed" size="2"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="270" alt="FS04" src="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/Welcometomynewblog_107AD/FS04_thumb.jpg" width="387" border="0" /&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face="Segoe Condensed" size="2"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Segoe Condensed" size="2"&gt;VS 2008 provides compilation environment using MSBuild extension. You can find the definition F# extension at Microsoft.FSharp.Targets and FSharp.Build.dll at Program Files/MSBuild folder. What you need to do in VS 2008 is just create new F# App project, write codes, then build. Let start by simple equation:&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Segoe Condensed" size="2"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#0000ff"&gt;&lt;font size="1"&gt;&lt;font color="#008000"&gt;// Turn on the lightweight syntax          &lt;br /&gt;&lt;/font&gt;#light         &lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font size="1"&gt;&lt;font color="#008000"&gt;// Open .NET standard namespaces          &lt;br /&gt;&lt;/font&gt;open System         &lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font size="1"&gt;&lt;font color="#008000"&gt;// A very simple constant integer          &lt;br /&gt;&lt;/font&gt;let i1 = 1         &lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font size="1"&gt;&lt;font color="#008000"&gt;// A second very simple constant integer          &lt;br /&gt;&lt;/font&gt;let i2 = 2         &lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font size="1"&gt;&lt;font color="#008000"&gt;// Add two integers          &lt;br /&gt;&lt;/font&gt;let i3 = i1 + i2         &lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="1"&gt;&lt;font color="#008000"&gt;// Functions on integers&amp;#160; f(x) = 10*x*x - 15*x + 13        &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;let f x = 10*x*x - 15*x + 13 &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#0000ff"&gt;&lt;font size="1"&gt;&lt;font color="#008000"&gt;// The result of a simple computation          &lt;br /&gt;&lt;/font&gt;let result = f (i3 + 400) &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#0000ff"&gt;&lt;font size="1"&gt;&lt;font color="#008000"&gt;// Print an integer          &lt;br /&gt;&lt;/font&gt;printfn &amp;quot;Result = %d&amp;quot; result&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;font face="Segoe Condensed" size="2"&gt;   &lt;p&gt;     &lt;br /&gt;I believe you can easily understand above codes intuitively. The first line of the codes is an option to turn on F# lightweight syntax option. This option allows us to write code that looks and feels simpler by omitting recurring F# tokens such as, done, ; (semicolon), ;; (double semicolon), begin, and end. The option instructs F# compiler to use the indentation of F# code to determine where constructs start and finish. &lt;/p&gt;    &lt;p&gt;Writing function in functional language is very straight forward. In our case, I wrote f x (f space x) as a function of x. Then I can reuse f for any input values. I will not explain language aspect in this first post, but I will do it in some tutorial series later on. My current F# reading is:      &lt;br /&gt;&lt;a href="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/Welcometomynewblog_107AD/FS06_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="163" alt="FS06" src="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/Welcometomynewblog_107AD/FS06_thumb.jpg" width="118" border="0" /&gt;&lt;/a&gt;&amp;#160; &lt;a href="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/Welcometomynewblog_107AD/FS07_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="163" alt="FS07" src="http://blogs.msdn.com/blogfiles/risman/WindowsLiveWriter/Welcometomynewblog_107AD/FS07_thumb.jpg" width="89" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Good News.        &lt;br /&gt;&lt;/strong&gt;The F# and .NET libraries include support for parallel and asynchronous programming. One way to write these kinds of programs is to use F#-facing libraries such as F# Asynchronous Workflows. Also, we can combine F# Async Workflow with the Parallel Extension for .NET, to implement task parallelism, I/O parallelism and message passing agents.       &lt;br /&gt;      &lt;br /&gt;Stay tuned!. Lets make IT happen in NEPAL.&lt;/p&gt;    &lt;p&gt;Cheers, RAM     &lt;br /&gt;My other blogs : &lt;a href="http://blogs.msdn.com/risman"&gt;http://blogs.msdn.com/risman&lt;/a&gt; &lt;/p&gt; &lt;/font&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8961311" width="1" height="1"&gt;</content><author><name>Mattotorang</name><uri>http://blogs.msdn.com/members/Mattotorang.aspx</uri></author></entry></feed>