For this type of correspondence…
Use this e-mail address…
Technical support.
cnumerics-support@microsoft.com
Product feedback, product documentation feedback, feature suggestions, and general observations.
cnumerics-feedback@microsoft.com
Specific issues observed with steps to recreate.
cnumerics-bugs@microsoft.com
This section includes the following topics:
Microsoft “Cloud Numerics” provides:
Feature
Description
A .NET solution to scale-out numerical and data-analytics applications to Windows Azure.
This lab solution enables you to:
Comprehensive math, array, and algorithm libraries.
These libraries include:
A distributed runtime library.
This runtime library features:
Ability to run distributed applications on a local development machine
This local distributed programming experience facilitates developing and running distributed applications that exercise the same code on your multi-core PC that would run on Windows Azure clusters.
A local programming experience has the following benefits:
A configuration utility, Visual Studio project template, and workflow for deploying applications to Windows Azure.
This utility enables you to make application deployment cluster configuration settings from the development machine, publish them to Windows Azure along with associated infrastructure and dependencies and submit your code as a job to be run on Windows Azure.
The following components comprise the “Cloud Numerics” lab:
The table that follows lists the "Cloud Numerics" Mathematical Libraries for .NET.
Namespace
Numerics.Math
Elementary mathematics methods, operators, query methods, transformations, array manipulators, and reductions.
Numerics.LinearAlgebra
Algorithms and techniques for matrix operations, decompositions, and solvers of systems of linear equations.
Numerics.Signal
Thresholds, windowing, filter design, impulse response filters, and transfer functions.
Numerics.Statistics
Probability density, probability distribution, statistical inference and regression, data processing, machine learning, and descriptive statistics functions.
Numerics.TimeSeries
Analysis, forecast, estimation, and moving average functions.
The table that follows lists the "Cloud Numerics" Distributed Array and Runtime Libraries for .NET.
Numerics
The Numerics namespace encapsulates the runtime engine. It includes initialization, shutdown, status, and basic primitive data types.
Numerics.Local
Local (non-distributed) n-dimensional arrays and array operations.
Numerics.Distributed
Distributed (locally or on Windows Azure) n-dimensional arrays and array operations.
Numerics.Distributed.IO
Reading and writing arrays to and from stable storage such as:
CSV files
Azure Blobs
Hadoop distributed file system sequences (HDFS)
“Cloud Numerics” has the following primary modes of use:
As outlined in the following figure:
Running locally using the Numerics.Runtime provides the following functionality:
To leverage the "Cloud Numerics" libraries and distributed array data while running locally:
1. Follow the steps to run a sample program in the Getting Started section titled Run a Distributed Application Locally.
2. Modify the sample program, or copy a distributed example over the sample program, build it, and run it.
3. View the pre-compiled, example programs in the Cloud Numerics API reference and in the Simple Examples section of this wiki.
4. See the blog post titled Using Data for tips and code examples helpful for working with, casting, and loading arrays.
As outlined in following figure:
Running "Cloud Numerics" projects on Windows Azure provides the following functionality:
To leverage the "Cloud Numerics" libraries using either serial or distributed array data while running on Azure:
1. Follow the steps to run a sample program in the Getting Started section titled Run a Distributed Application over an Azure Cluster.
3. View the pre-compiled, example programs in the Cloud Numerics function library reference help and in the section titled Simple Examples.
4. See the blog post titled Using Data for tips and example code helpful for working with, casting, and loading arrays, and creating arrays from Windows Azure blob storage.
This section contains the software and platform requirements for using the "Cloud Numerics" libraries for the following modes of use:
You must have one of the following operating systems installed on your local development system to use the "Cloud Numerics" Lab:
These requirements satisfy both:
To run code that uses “Cloud Numerics” libraries on the Windows Azure cloud, ensure that you have the following software installed on your local development machine. Portions of this software, which you will install locally, will be bundled up as part of the package you deploy to your Windows Azure cluster.
Required Software
Visual Studio 2010 (SP1 or later) Professional or Ultimate Edition x64
You develop your C# application and deploy your Azure package containing this application to the cloud using Visual Studio.
Windows Azure SDK 1.7 x64
The Windows Azure SDK installs the following pieces:
Important! For this lab release, you must install Windows Azure SDK to the default destination folder. The Windows Azure SDK installer fills in the “Install to” field with a directory path from your local development machine. This is considered the default destination folder.
Windows Azure HPC Scheduler SDK 1.7 x64
All jobs are run through the Windows Azure HPC Scheduler.
http://go.microsoft.com/fwlink/?LinkId=231893
Important! For this lab release, you must install the Windows Azure HPC Scheduler SDK to the default destination folder. The Windows Azure HPC Scheduler SDK installer fills in the “Install to” field with a directory path from your local development machine. This is considered the default destination folder.
Windows HPC Pack 2008 R2 with SP4 Client Utilities
http://go.microsoft.com/fwlink/?LinkId=231888
Important! For this lab release, you must install Windows HPC Pack 2008 with Client Utilities to the default destination folder. The Windows HPC Pack with Client Utilities installer fills in the “Install to” field with a directory path from your local development machine. This is considered the default destination folder.
Microsoft HPC Pack 2008 R2 MS-MPI with SP4 redistributable package:
http://go.microsoft.com/fwlink/?LinkId=231890
This section contains the additional environment-related requirements for using the "Cloud Numerics" libraries.
The following table lists the additional requirements you need to run your application using the “Cloud Numerics” distributed runtime libraries using the MPI-based local distributed libraries.
Item
A Windows Azure subscription
You need a Windows Azure Subscription to run your application in the cloud. You will begin to pay for Windows Azure time only when your cluster is deployed, using one or more cores, and in the created state.
Note! You can find instructions on how to get a Windows Azure subscription here:
http://msdn.microsoft.com/en-us/library/windowsazure/gg433024.aspx
An encrypted password certificate file.
In order to connect from your local development machine to Azure, you need to generate a .cer file and upload it to your Azure account. You can create this file using the "Cloud Numerics" Deployment Utility included in the “Cloud Numerics” lab product distribution. For details, refer to the section titled Run a Distributed Application over an Azure Cluster.
A gateway client
Depending on your site IT policy, you might need a gateway client in order to set up a connection with the Azure Storage service.
http://www.microsoft.com/en-us/server-cloud/forefront/threat-management-gateway-trial.aspx
After you satisfy the software and platform requirements, you can install the Microsoft codename “Cloud Numerics” software. Once you install the software to a local machine running Visual Studio, you can deploy and run the sample application supplied as part of the "Cloud Numerics" Visual Studio project deployment template.
The "Cloud Numerics" installer includes:
Once you are registered for the lab, you can download the software from:
http://connect.microsoft.com/
The registration confirmation e-mail contains a hyperlink to the latest “Cloud Numerics” lab distribution media. If you do not yet have a confirmation e-mail, you can get one by registering here.
After you satisfy the software and platform requirements, you can install the “Cloud Numerics” software.
To install the “Cloud Numerics” software:
1. Run the installer.
2. Accept the Microsoft Software License Terms.
3. Choose an installation directory.
4. Click the Install button on the Ready to Install screen. After you see the Installation Complete screen, restart your machine, and proceed to the next section titled Getting Started: Deploy and Run a Sample Application.
This section outlines the typical programming model and sequence for writing distributed applications.
You can develop, test, debug, and refine you application and algorithms on a local development system such as a many-processor or multi-core workstation or laptop. This is outlined in the Modes of Use section in the subsection titled Running a Distributed or Serial Application Locally (with Numerics Runtime).
Next, you must prepare your application to be run on Azure.
After you have created and compiled your "Cloud Numerics" project locally, you can switch to Azure simply by selecting a new Start Up Project and by providing your deployment and cluster information using the "Cloud Numerics" Deployment Utility. The "Cloud Numerics" Deployment Utility is detailed in the section titled Run a Distributed Application over an Azure Cluster.
The final step is to get your results data from blob storage, filter it, and visualize it using your favorite visualization tool such as Microsoft Excel.
You will need a Windows Azure subscription ID when you use the "Cloud Numerics" Deployment Utility to set up your cluster's deployment configuration. You can find instructions on how to get an Azure subscription here:
http://www.microsoft.com/windowsazure/offers/.
To get a free Windows Azure platform trial, navigate to http://www.microsoft.com/windowsazure/free-trial/ and sign up for the free trial service.
To get started with “Cloud Numerics” and its associated distribute runtime, you can:
To run your distributed application on a local multi-core machine, complete the steps detailed in this section.
To create a Visual Studio project of type Microsoft Cloud Numerics:
1. Open Visual Studio as Administrator.
2. From the File menu, select New Project.
The New Project window displays.
3. From the New Project window, click Visual C# in the Installed Templates pane, and then select Microsoft Cloud Numerics Application.
Solution Explorer displays a newly created project. By default, the project is named MSCloudNumericsProject.
4. For this step, you can either:
5. From the Visual Studio Build menu, select Build Solution.
6. From Solution Explorer in the Visual Studio IDE, right click the MsCloudNumericsApp subproject and select Set as Startup Project.
7. In Solution Explorer, right click MsCloudNumericsApp, choose Debug, and select Start New Instance.
A console window displays the sample application’s output.
In order to run you application locally on more than one processor core, use the following sequence of steps:
This section details the sequence for how to:
The following table outlines the steps for both deploying "Cloud Numerics" to a cluster and running your distributed application. This process is detailed in the subsections that follow.
Steps
Step 1: Get an Azure Subscription ID
You need an Azure Subscription ID to run your application in Windows Azure cloud.
Note! You can find instructions on how to get an Azure subscription in the section titled Get an Azure Subscription and Step 1: Get an Azure Subscription ID.
Step 2: Create a Numerics Project and Launch the Azure Deployment Utility
The Azure Deployment utility enables you to:
Step 4: Specify Cluster Sign on Information and Specify Number of Nodes
Specify your cluster characteristics such as the number of nodes to run on, or accept the default values.
Step 5: Manage Your SQL Azure Storage Service
Provide the username and password for an existing SQL Azure database or create a new database instance.
Step 6: Create, Configure, and Deploy a Numerics Cluster
After you fill in the required fields and choose settings from the various drop-down lists, you can use the Azure Deployment Utility to create, configure, and deploy a new "Cloud Numerics" cluster.
Step 8: Get Job Results Data
You can get results either through the Azure Deployment Utility or through the Azure Management Console. Results data on jobs run in Azure are output to Azure blob storage.
To get your Azure subscription ID:
1. Navigate to the following URL (https://windows.azure.com/) and sign in to your Windows Azure Management Portal.
2. In the left pane, click the Hosted Services, Storage Accounts & CDN tab.
3. In the Subscription and Services view (center pane) click your active subscription.
The main view displays.
4. In the Properties pane, scroll down and copy your Subscription ID. You will need your subscription ID to deploy and configure your Azure cluster.
5. Proceed to the next section titled Step 2: Create a Numerics Project and Launch the Azure Deployment.
To Launch the "Cloud Numerics" Deployment Utility:
Solution Explorer displays a newly created project named MSCloudNumericsProject.
4. For this step you can either:
5. From Solution Explorer in the Visual Studio IDE, right click the AppConfigure project and select Set as Startup Project.
6. Press the F5 key. (Please note, this might take a few minutes to build the deployment package.)
The "Cloud Numerics" Deployment Utility displays.
7. Proceed to the section titled Step 3: Configure Your Azure Service Account.
To configure your Azure service account from the "Cloud Numerics" Deployment Utility:
1. From the Azure Account tab, type in your Azure subscription ID you copied from the Azure Management Console.
2. Get a certificate (.cer) file for authentication of your remote machine with the Azure Management Console by either using an existing certificate file or by creating a new one. To get a certificate file, complete either of the following:
a. Change the default friendly name in the Certificate Name text field to a unique and easy-to-identify name that you will recognize later.
b. Browse to the directory where you want to create the certificate file and specify a name for the output file.
c. Click OK. Note! If an alert box warns you are changing the credentials list on your local development machine, click Yes to accept the change and save your newly-created certificate. Make a note of the directory path where your certificate is created.
c. Click OK.
3. Upload the certificate file you created or referenced in the previous step to Azure.
a. Navigate to the Windows Azure Platform portal at http://windows.azure.com, and sign in.
b. Click the Hosted Services, Storage Accounts, & CDN tab.
The main browser pane opens to the Deployment Health view.
c. On the navigation pane, click Management Certificates.
The management view for your active Azure subscription displays.
d. Click the Add Certificate icon.
The Add New Management Certificate dialog displays. Note! If the Add Certificate icon is grayed out indicating that it is not enabled, you might have reached the limit of certificates you can upload for this account. The default setting for this limit is 10. To work around this, you can delete a single certificate. This will make the Add Certificate icon active (not grayed out) and enable you to add your certificate.
The Add New Management Certificate dialog displays.
e. Browse to the place on your local development machine where you created the certificate (.cer) file, click Open to select it, and click OK in the Add New Management Certificate dialog to upload it to your Azure account.
You certificate has been uploaded to Azure. You can now continue filling out the fields in the Azure Account tab.
4. Add a service name to the Service Name text field.
You can add a service by either of the following:
5. Select a data center location for your Azure cluster.
6. Click Next.
The Cluster in Azure tab displays.
7. Proceed to the next section titled Step 4: Configure Your Cluster.
To configure your Azure cluster through the "Cloud Numerics" Deployment Utility:
1. From the Cluster in Azure tab, create a cluster administrator user name or enter an existing name by typing it into the Name text field.
2. To add or create a password for this administrator, type it into the Password text fields.
3. If you want a different number of head nodes from the default, type the number in the Head text field.
4. If you want a different number of compute nodes from the default, type the number in the Compute text field.
5. If you want a different number of administrative nodes from the default, type the number in the Web FrontEnd text field.
The SQL Azure Server tab displays.
7. Proceed to the next section titled Step 5: Manage Your SQL Azure Storage Service.
To manage your SQL Azure Storage Service through the "Cloud Numerics" Deployment Utility:
1. From the SQL Azure Server tab, complete either one of the following:
2. From the Database Server Credentials pane, complete either one of the following:
3. Click Next.
The Application Code tab displays.
4. Proceed to the next section titled Step 6: Create, Configure, and Deploy a Cloud Numerics Cluster.
After you fill in the necessary fields in the Azure Account, Cluster in Azure, and SQL Azure Server tabs, you can use the "Cloud Numerics" Deployment Utility to create, configure, and deploy a new "Cloud Numerics" Cluster. If you have previously deployed your cluster, do not attempt to redeploy over an existing cluster.
To create, configure, and deploy your cluster.
1. From the Deployment Actions frame of the "Cloud Numerics" Deployment Utility, click the Configure Cluster button to create and configure your Windows Azure cluster.
The status bar indicates the gradual progress of the configuration step. When it is finished, the Configuration complete” message displays.
2. Click the Deploy Cluster button to deploy the necessary services on your Azure HPC cluster. This step might take more than 10 minutes.
The status bar indicates the progress of the deployment. This step includes installing the necessary software on the Azure cluster nodes. When it is finished, the “Deployment complete” message displays.
This procedure lists how to submit a compiled .NET application as a job to be run on the Azure HPC Scheduler. It consists of the following parts:
To submit a job to be run on your Windows Azure cluster:
1. Specify a compiled application (.exe) to deploy to the cluster. For this application, you can specify the sample application provided with the "Cloud Numerics" project. You can find the project executable in your Visual Studio Projects directory.
If you used the default project name, the default directory path for this project executable is in your Visual Studio Projects directory.
C:\Users\<user_name>\Documents\Visual Studio 2010\Projects\MSCloudNumerics\MSCloudNumerics\MSCloudNumericsApp\bin\Debug\
2. From the Deployment Actions frame of the "Cloud Numerics" Deployment utility, click the Submit Job and View Status and Output button to submit the application and dependencies.
The status bar indicates the progress of the job submit step. When it is finished, the “Job successfully submitted” message displays.
You can also access Job status from either the:
To access job status and application console output from the Azure HPC Scheduler web portal.
1. In a web browser, navigate to https://<your service name>.cloudapp.net
The Windows Azure Sample Application page displays in your browser.
2. Click on Windows Azure HPC Scheduler Web Portal.
3. Enter your cluster user name and password when prompted. When the page loads, the Windows Azure HPC Scheduler Web Portal Displays. 4. Click My Jobs.. When the web page loads, you will see the jobs submitted to the cluster scheduler in a table with the following column headings.
5. Find your job in the Name column, and click on it. If you used the default name created for you in the "Cloud Numerics" project, the job name is MSCloudNumericsApp.exe. 6. Click the Tasks tab and then click on the link under the Command line column that begins with "mpiexec" and ends with your application name.
Job results display in the Output frame.
You can get your results data by:
You can download the Microsoft codename “Cloud Numerics” library and distributed runtime reference help to your local development machine from the Microsoft Connect portal (http://connect.microsoft.com/). The “Cloud Numerics” library and runtime reference pages are encapsulated in a single compiled HTML archive or .CHM file.
1. If you registered to participate in the Microsoft codename "Cloud Numerics" lab, sign in to the Microsoft Connect portal with your Windows Live ID. Otherwise, use this link to register. 2. Use a web browser such as Internet Explorer to navigate to the Microsoft codename "Cloud Numerics" documentation download page. If you already registered to participate in the lab, and you signed in to Microsoft Connect, you can use this URL.
http://connect.microsoft.com/site1267/Downloads/DownloadDetails.aspx?DownloadID=40550
The Microsoft Connect download page appears.
3. Download the package to your local development machine.
4. Read the README.txt file.
5. Double click the .CHM file to open it with Windows Help Viewer.
The “Cloud Numerics” library function help file displays.
This section outlines how to convert an existing C# Visual Studio application to use the "Cloud Numerics" distributed runtime by adding the necessary library references, calls to initialize a runtime session, and calls to create distributed data within your project and application.
To convert an existing C# project to use the "Cloud Numerics" Runtime:
1. From the Add Reference dialog in Visual Studio, browse to the following “Cloud Numerics” DLLs and add them to your project. (By default, these DLLs are installed in C:\Program Files\Microsoft Numerics\v0.1\Bin)
Microsoft.Numerics.DenseArrays Microsoft.Numerics.Distributed.IO Microsoft.Numerics.Distributed.DenseArrays Microsoft.Numerics.ManagedArrayImpl Microsoft.Numerics.Math Microsoft.Numerics.Runtime Microsoft.Numerics.Signal Microsoft.Numerics.Statistics TCDistArrayHandle
2. Add the Numerics.Runtime.Intialize() routine to your program to initialize the session so that it can utilize distributed data or computation.
- Initialize the runtime session where you want to perform distributed data processing.
- Create distributed arrays using a method or constructor in the Microsoft.Numerics.Distributed namespace.
- Perform single program multiple data (SPMD) style data parallelism by passing in your method and a distributed data object to the "Cloud Numerics" Apply Framework or use a "Cloud Numerics" library method with a distributed overload for single instruction multiple data (SIMD) style data parallelism.
- Perform subsequent processing on the results data or save the results to a local array, with the NumericDenseArrayFactory.CreateFromSystemArray.method.
- Call Shutdown() on the Numerics.Runtime to end your distributed session.
- Output your results data to a file.
The following serial and distributed examples can be used, along with any of those provided in the library function reference help, in place of the sample application provided in your Microsoft codename “Cloud Numerics” Visual Studio C# project. The library function reference help is available by way of the Microsoft Connect portal (http://connect.microsoft.com/).
The following example operates on local (non-distributed) arrays created using the Numerics.Local.NumericDenseArrayFactory method.
using System;using Microsoft.Numerics;using Microsoft.Numerics.Local;using Microsoft.Numerics.Mathematics;namespace BasicMathModExample{ class BasicMathModExample { public static void Main() { // Construct input arrays var values = NumericDenseArrayFactory.CreateFromSystemArray<double>( new double [] {15.0, 17.0, 24.0, 30.0}); var divisors = NumericDenseArrayFactory.CreateFromSystemArray<double>(new double [] {3.0, 5.0, 7.0, 9.0}); // Compute Mod function value and write result var modulus = BasicMath.Mod(values, divisors); Console.WriteLine(modulus); } }}
The following is a serial signal processing example. The "Cloud Numerics" signal processing library methods can be used with local arrays.
using System;using Microsoft.Numerics;using Microsoft.Numerics.Local;using Microsoft.Numerics.Signal;namespace IIRExample{ class IIRExample { public static void Main() { // Counting of signal int N = 100; // Generation of input singal var x = Microsoft.Numerics.Local.NumericDenseArrayFactory.UniformGrid<Double> (N,-2 * Microsoft.Numerics.Mathematics.BasicMath.PI,2 * Microsoft.Numerics.Mathematics.BasicMath.PI); var inputSignal = Microsoft.Numerics.Mathematics.BasicMath.Sin(x); // Frequencies double Freq = 0.25; double NoiseFreq = 0.1; // Generation of noise var t = Microsoft.Numerics.Local.NumericDenseArrayFactory.UniformGrid<Double>(N, 0, N-1); var Noise = Microsoft.Numerics.Mathematics.BasicMath.Sin(2 * Microsoft.Numerics.Mathematics.BasicMath.PI * NoiseFreq * t / Freq) / 2; //Input signal with noise inputSignal += Noise; // Creating of low-pass IIR Chebyshev-I filter int filterOrder = 8; double ripple = 0.001; double cutOffFreq = 0.5; var IIRFilter = IIR.ChebyshevI(filterOrder,FilterKind.LowPass,cutOffFreq,ripple); //Applying IIR filter to the input noised signal var outputSignal = Filtering.Filter(IIRFilter, inputSignal); Console.WriteLine("The filtered signal (IIR): {0}", outputSignal); } }}
The following example creates local arrays with Numerics.Local.NumericDenseArrayFactory, operates on them with the Kronecker product method, casts the result array to be distributed, and then operates on this distributed array. You can run this example either by using the local distributed runtime or on Windows Azure
using System;using Microsoft.Numerics;using msnl = Microsoft.Numerics.Local;using msnd = Microsoft.Numerics.Distributed;using Microsoft.Numerics.Mathematics;namespace BasicMathExample{ class BasicMathExample { public static void Main() { // Demonstrate identity sin(x)*sin(x) + cos(x)*cos(x) = 1, for local real, local complex, and distributed arrays // Initialize distributed runtime NumericsRuntime.Initialize(); long n = 10; double minValue = 0; double maxValue = 5; var values = msnl.NumericDenseArrayFactory.UniformGrid<double>(n, minValue, maxValue); var result = BasicMath.Pow(BasicMath.Sin(values), 2) + BasicMath.Pow(BasicMath.Cos(values), 2); Console.WriteLine("Identity check result: {0}", result); // Show that the identity holds for complex values too // Construct vector of complex numbers with specified phase and magnitude var phase = BasicMath.PI * msnl.NumericDenseArrayFactory.CreateFromSystemArray<double>(new double[] { -0.5, 0.0, 0.5, 1.0 }); var magnitude = msnl.NumericDenseArrayFactory.CreateFromSystemArray<double>(new double[] { 0.25, 0.5, 0.75, 1.0 }); var complexValues = magnitude.ConvertTo<Complex128>() * BasicMath.Cis(phase); // Apply formula var complexResult = BasicMath.Pow(BasicMath.Sin(complexValues), 2) + BasicMath.Pow(BasicMath.Cos(complexValues), 2); Console.WriteLine("Identity check for complex numbers"); Console.WriteLine("Magnitude: {0}", BasicMath.Abs(complexResult)); Console.WriteLine("Real Part: {0}", BasicMath.RealPart(complexResult)); Console.WriteLine("Complex Part: {0}", BasicMath.ImaginaryPart(complexResult)); // Show that the identity holds for large distributed array, // by using distributed function overloads // Use Kronecker product to expand vector into distributed matrix n = 2000; msnd.NumericDenseArray<double> row = msnl.NumericDenseArrayFactory.UniformGrid<double>(n, minValue, maxValue).Reshape(new long[] { 1, n }); msnd.NumericDenseArray<double> column = msnl.NumericDenseArrayFactory.UniformGrid<double>(n, minValue, maxValue).Reshape(new long[] { n, 1 }); var distributedValues = Microsoft.Numerics.LinearAlgebra.Operations.KroneckerProduct(column, row); // Compute distributed sin function and compare to exact result of 1 var distributedResult = BasicMath.Pow(BasicMath.Sin(values), 2) + BasicMath.Pow(BasicMath.Cos(values), 2); var maxError = ArrayMath.Max(BasicMath.Abs(distributedResult - 1)); Console.WriteLine("Maximum error in distributed result: {0}", maxError); // Shut down distributed runtime NumericsRuntime.Shutdown(); } }}