Conventionally, HPC/Parallel problems can be roughly divided into the following
Parallel, these applications divides the input data into a number of
completely independent parts. The same computation is undertaken on each part.
And some kind of post processing after the computations is needed.
- Task Parallel, these are those jobs that its
functionality can be divided into many small tasks, each of which can be
executed on one CPU core. These tasks may need to communication or not all
There is another special kind of parallel problems(orthogonal to
Parallel, for these applications, little or no effort is required to
separate the problem into a number of small tasks that runs on one CPU core. No
or very lightweight post processing is needed. (no/little cooperation among task
and post processing)
Hpc SOA Programming Overview (from Microsoft)
Windows Hpc Server 2008, programming model for Embarrassingly
Parallel(especially web based) applications is referenced as SOA Model, in which, client send requests to
service broker, and service broker forward these requests to service instances.
Service instance never talks to each other, and communication among these
components are all service oriented(more specifically, WCF based).
Programming Model Workflow, from Microsoft]
is a detailed documentation on this topic, but in this article, I will demo a
SOA based PI(3.1415926535...) value calculation application using Monte Carlo method
in a real Windows Hpc Cluster.
When I say "real windows hpc cluster", I
1. The cluster has multiple nodes(6 nodes: 1 head, 1 broker, 4
2. This cluster has dedicated AD/Network, which is totally
different from client/dev machines and network env.
3. You use some server
called "Boundary Server" to access the Hpc Cluster. The boundary server has NICs
to connect with both cluster private network and corp/enterprise network.
You dev/debug your application on boundary server, not on cluster head node.(let
head node focus on job requests serving)
5. Your corp network domain account
is different from Hpc Cluster private network domain account.
6. In the
following sections, I assume the cluster environment is already correctly set
[These environment assumptions are more complex than those in , but
they are more similar to real production env.]
The Monte Carlo PI value
calculation contains two parts - the server part and client part.
The server part is a pure WCF service
define interface/contract and implement the interface. The core logic is listed
1. it's a .net/c# class library project, and it is a typical WCF
2. use local machine IP and current date time to hash
out a random seed number. This will make the whole process more random.
use .NET build-in random generator to generate a serial random number to do many
independent Monte Carlo experiments. The idea is generating a ranged random
point and see whether it is located within a circular area with some fixed
After the WCF service
implementation, you should deploy it to the Windows Hpc Cluster. This includes
1. Compose a service configuration file.(The PiCalcService.config
file is contained in the source code package,
see  for detailed fields explanation)
Copy Bin/Conf files to each compute node
To see whether the deployment is
1. go to StartMenu -> Hpc Pack -> Hpc Cluster Manager ->
Diagnostics -> Tests -> SOA -> SOA Service Configuration Report and run
2. Diagnostics -> Test Results. It will list the detailed
results of test in step 1. If your deployment is successful, the report will
tell you the service name/bin/interface/implementation and target
The other part of the solution is
the client application.
- It's both WCF client application and Hpc
1. It's a normal .Net/C# console/winform application,
which will call remote WCF service and Hpc scheduler service.
2. As normal
WCF client application, you should use svcutil tool to generate the wcf client
proxy class(async style is used here) and add it to your client application
developing SOA application, you should create session with Hpc cluster, get the
SOA broker service endpoint from the session and call WCF service from this
4. Your whole client logic looks like: create session, divide
computation task, send requests, collect the partial results from various
sub-tasks and compute the final result.
1. this is just the core logic, for full code,
see the source code package.
2. the serviceName is defined as the service
configuration file name without the .config extension. schedulerHost is defined
as the machine name of the head node of the Hpc cluster.
clusterHeadUser/clusterHeadPassword is used to login to head node to submit
jobs, while wcfClientUser/wcfClientPassword is used to login to compute node to
access WCF services, both of them should be explicitly set in a real cluster
environment. The two account are usually the same in most cluster environments,
but not the same as your domain account that is used to login corp
4. if "Can't find file - Microsoft.Hpc.Sheduler.Store.dll" exception
raised when running the client, install Windows HPC Pack Client Utilities. Only
Windows HPC Pack SDK is not enough for developing/running Hpc
5. it takes some time(about 1 minute in my env) to establish
session with Hpc cluster.
6. you can see the job status, node head map etc in
Hpc Cluster Manager while the application is running. The cluster manager is
also helpful for investigation when error encountered.
Application Console Output
You can increase the
exercise count to get more precise PI value, but it will consume more
full source code download
Some Personal Observations:
1. Windows Hpc
Cluster provides convenient management tools and utilities, which makes
deploying/managing middle-level(several hundreds of nodes) of computing cluster
2. Windows SOA programming model greatly simplified the
development process of some specific kind of Hpc applications.
3. Windows Hpc
build-in security feature add some complexity of the develop/deploy process and
potential performance downgrade occurs if large amount of data movement happens
among nodes. But these overhead results very little gains - dose security
problem really matter in a private computing cluster?
4. Hpc SOA programming
model is very similar to so called "web server farm" architecture. But as a
general programming platform, the head/broker node fail-over problems are not
solved in a very elegant and scalable way.
5. Windows Hpc scheduler is too
general purpose, too centralized, which making the session creation very very
time-consuming. This means that it takes SOA application much time to do init
6. Although it is called "SOA" and it uses popular "WCF" technology,
the Hpc SOA architecture is completely not suitable for web
applications(especially for scaling purpose). Microsoft describes the target
scenario as "interactive application", which mainly includes Monte Carlo
Problems, Ray Tracing, Excel Calculation Add-in and BLAST
Official SOA doc
jobs to head node in another AD
WCF services hosted on other nodes with specific client credentials(domain
 From Sequential to Parallel Code Using Windows Hpc (Doc,