Skip to main content

Offloading UDF computations to a Windows HPC cluster from Excel 2010

· 2 min read

Excel 2010 introduced support for offloading UDF computations to a compute cluster. The Excel blog talks about it, and there are some nice pictures on this TechNet article:

Excel-DNA now supports marking functions as cluster-safe, and I have updated the loader to allow add-ins to work under the XllContainer on the HPC nodes. There are some issues to be aware of:

  • The add-in does not create its own AppDomain when running on the compute node. One consequence is that no custom .xll.config file is used; configuration entries need to be set in the XllContainer configuration setup.
  • There are some limitations on the size of array data that can be passed to and from UDF calls - this limit is probably configurable in the WCF service.
  • Only the 32-bit host is currently supported.

To test this you will need an Windows HPC Server 2008 R2 cluster with the HPC Services for Excel installed. On the clients you need Excel 2010 with the HPC cluster connector installed. The latest check-in for Excel-DNA with this support is on GitHub:

In the Microsoft HPC SDK there is a sample called ClusterUDF.xll with a few test functions. I have recreated these in C# in the samples file Distribution\Samples\ClusterSample.dna Basically functions just need to be marked as IsClusterSafe=true to be pushed to the cluster for computation. For example

public static int DnaCountPrimesC(int nFrom, int nTo)
// ...

As usual, any feedback on this feature - questions or reports on whether you use it - will be most appreciated.