Skip to content
This repository was archived by the owner on Aug 31, 2025. It is now read-only.
This repository was archived by the owner on Aug 31, 2025. It is now read-only.

Create DotMP-Builder #36

Closed
Closed

Description

@computablee

I am interested on working on a DotMP-Builder program that is capable of turning pragma-based C# programs parallelized with DotMP into programs that can actually be compiled by the .NET C# compiler.

It would be intended to resemble the pragma-based approach of C and C++ OpenMP as close as possible. For instance:

#pragma dmp parallel for num_threads(8) schedule(static) chunk_size(128)
for (int i = 0; i < 1_000_000; i++)
{
    y[i] += a * x[i];
}

would be transformed into:

DotMP.Parallel.ParallelFor(
    0, 1_000_000,
    num_threads: 8,
    schedule: DotMP.Schedule.Static,
    chunk_size: 128,
    action: i =>
{
    y[i] += a * x[i];
});

Furthermore, it would work as a command line application that would fully replace the dotnet CLI package. In essence, if you had a .NET Core solution with C# code resembling this pragma-based paradigm, you could call:

mpbuild run -c Release arg1 arg2 arg3

and mpbuild would take the following steps:

  1. Read the contents of the current directory
  2. Copy the contents into a .mptemp subdirectory
  3. Parse all of the *.cs files, replacing pragmas with DotMP function calls
  4. Run dotnet run -c Release arg1 arg2 arg3

This would allow the user to replace their workflow with mpbuild instead of dotnet to seamlessly implement pragma-based parallel programming in C#.

This issue serves for now as a way for me to gather interest and potential collaborators. Since this would involve a fair bit of parsing C# source code, and since I am not a compilers expert, I would love to see if anyone actually cares about this or would want to help before pouring tons of effort into this.

Activity

  1. added
    enhancement
    help wanted
    question
    on Sep 11, 2023
  2. pinned this issue on Sep 11, 2023
  3. Repository owner locked and limited conversation to collaborators on Sep 11, 2023
  4. converted this issue into a discussion #37 on Sep 11, 2023
  5. unpinned this issue on Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementhelp wantedquestion

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions