【问题标题】:Grid Computing API网格计算 API
【发布时间】:2012-10-30 16:41:10
【问题描述】:

我想编写一个分布式软件系统(在这个系统中,您可以比在单个 pc 上更快地执行程序),它可以执行不同类型的程序。(因为这是一个学校项目,我可能会执行像 Prime 这样的程序finder 和 Pi 计算器)

我的偏好是它应该使用 .NET 为 C# 编写,具有良好的文档,编写简单(在使用 .NET 的 C# 中不是新的,但我不专业)并且能够为网格编写任务轻松和/或直接从 .exe 将程序加载到网络。

我看了一点:

  1. MPAPI
  2. Utilify(来自炼金术师)
  3. NGrid(过时了?)

哪一个最适合我的情况?你有他们的经验吗?

ps。我知道这里有很多类似的问题,但它们要么已经过时,没有正确的答案,要么没有回答我的问题,因此我选择再次提问。

【问题讨论】:

  • 看起来都是死项目:(.
  • 如果你想构建自己的,为什么不探索 Quartz.net - 它有“集群”支持,尽管有一些限制(必须是 .NET 并且必须实现 IJob。仅限 JDBC 源)

标签: c# grid-computing


【解决方案1】:

我刚刚联系了 Utilify 的创始人 (Krishna Nadiminti),虽然目前积极的开发已经暂停,但他已经发布了所有源代码 here on Bitbucket

我认为继续这个项目是值得的,因为目前还没有可比的替代方案(甚至是商业的)。我可能会开始研究它,但不要等我:)。

【讨论】:

  • 谢谢,我一定会看看的。将报告:)
  • “没有可比性”你能详细说明吗?
  • 我找不到其他软件,例如 Utilify。
【解决方案2】:

遇到同样的问题。我试过 NGrid、Alchemi 和 MS PI.net。 毕竟我决定开始我自己的开源项目来玩,在这里查看:http://lucygrid.codeplex.com/

更新:

查看 PI 示例: 传递给 AsParallelGrid 的函数将由网格节点执行。 您可以在运行 DEMO 项目时使用它。

/// <summary>
/// Distributes simple const processing
/// </summary>
class PICalculation : AbstractDemo
{

    public int Steps = 100000;
    public int ChunkSize = 50;
    public PICalculation()
    {

    }

    override
    public string Info()
    {
        return "Calculates PI over the grid.";
    }


    override
    public string Run(bool enableLocalProcessing)
    {
        double sum = 0.0;
        double step = 1.0 / (double)Steps;
        /* ORIGINAL VERSION
        object obj = new object();

        Parallel.ForEach(
            Partitioner.Create(0, Steps),
            () => 0.0,
            (range, state, partial) =>
            {
                for (long i = range.Item1; i < range.Item2; i++)
                {
                    double x = (i - 0.5) * step;
                    partial += 4.0 / (1.0 + x * x);
                }
                return partial;
            },
            partial => { lock (obj) sum += partial; });
        */
        sum = Enumerable
            .Range(0, Steps)
            // Create bucket
            .GroupBy(s => s / 50)
            // Local variable initialization is not distributed over the grid
            .Select(i => new 
            {
                Item1 = i.First(),
                Item2 = i.Last() + 1, // Inclusive
                Step = step
            })
            .AsParallelGrid(data =>
            {
                double partial = 0;
                for (var i = data.Item1; i != data.Item2 ; ++i)
                {
                    double x = (i - 0.5) * data.Step;
                    partial += (double)(4.0 / (1.0 + x * x));
                }
                return partial;
            }, new GridSettings()
            {
                EnableLocalProcessing = enableLocalProcessing
            })
            .Sum() * step;
        return sum.ToString();

    }
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多