Sunday, January 11, 2009

Application models for Windows HPC Server 2008

There are two application models that you could use to write parallel programs that run on a Window HPC Server 2008 cluster.The first is the more classical MPI model. This model has been used for quite some time not only on the Windows platform but also on various other platforms like Linux and flavors of BSD. However in the 2008 version of Windows HPC Server some nice improvements were made that allow for 30% increase in effectiveness compared to the previous version (which I think was named Windows Compute Cluster 2003) which is very impressive.

If you want to know more about the MPI application model I recommend that you take a look at the Windows HPC Server 2008 - Using MS-MPI white paper and also watch that video on channel 9.

There is also the newly introduced WCF based, SOA application model which allows you to write your parallel applications using your favorite managed language (like for example C#) and WCF in Visual Studio.

Again, if you want to know more you can take a look at the Overview of Service-Oriented Architecture Programming Model and Runtime System for Windows HPC Server 2008 white paper and watch this video at channel 9.

There are also other white papers and more videos.

But how to decide which of the two models to use? Besides, of course your preference of C# over C, or WCF over MPI. Well, if your parallel algorithms are such that the worker processes need to communicate with one another you will most probably need to use the MPI model. However, if they are of the embarrassingly parallel kind you could take advantage of the new SOA model.

Monday, August 25, 2008

Importing ESRI Shapefile data in SQL Server 2008

Hi again. For my Imagine Cup project I needed GIS data about US cities so that I can make some interesting spatial queries. Actually finding the GIS data was the easy part. Moreover it was in a ESRI Shapefile format which has become standard for exporting/distributing GIS data.
So far, so good.
Now here comes the more interesting part - how do I import that Shapefile into SQL Server 2008. Fortunately, Morten Nielsen has made the very helpful SQL Server 2008 Spatial Tools. There were some problems with the SQL Server 2008 RC0 due to the change of (latitude, longitude) ordering. However, recently Morten updated his tools and now they work again (thank you Morten).

With these tools importing the Shapefile data into SQL Server 2008 is easy. You just connect to your SQL Server and then select the .shp file and some other options like the type of the geom field (in my case Geography), SRID, etc.

Here the magic SRID number means that the WGS 84 spatial reference system should be used.
You can easily see that by executing the following query:

select * from sys.spatial_reference_systems where spatial_reference_id = 4326





When you are ready, just press the "Upload to Database" button and wait a little.
And now after your ESRI Shapefile data is finally in your SQL Server 2008 you can do some interesting queries like for example:


declare @p geography
set @p = geography::STPointFromText('POINT(-121.7944 38.1172)', 4326)
select top(50) CITY_NAME, geom.STDistance(@p) as Distance, geom.STStartPoint().ToString() as StartPoint from USTowns order by Distance asc

That was all for now. I hope that I will be able to blog more often in the future.

Tuesday, August 12, 2008

Hello, world!

I know, I know that I should have started blogging long ago but I could not find time for this until now. I have been pretty busy with my work and my Imagine Cup project. My team "Atlas" competed in the Software Design category and we won The Engineering Excellence Achievement Award. Being in Paris for the Imagine Cup 2008 World Finals was an amazing experience. We even got the opportunity to chat with S. Somasegar (who by the way is a great guy) in person. We met lots of interesting people, saw lots of interesting things and even I managed to buy my new LEGO Technic set.
You can take a look at the blog of my team mate Boryana where she writes about her experience with the Imagine Cup competition.

So, now that things are now a bit more settled and I finally managed to find some time for my first blog post. From now on here I will post things that I found interesting. Mostly about programming, .NET, C#, technology, etc...you know...computer geek stuff.