Skip to content

BUDA: support multithread apps #6414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jul 7, 2025
Merged

BUDA: support multithread apps #6414

merged 10 commits into from
Jul 7, 2025

Conversation

davidpanderson
Copy link
Contributor

@davidpanderson davidpanderson commented Jul 4, 2025

docker wrapper

  • pass --cpus arg to Docker/Podman if app uses >1 CPU
  • Win: output of stats command can start with warning line;
    skip it to parse CPU time correctly
  • change version to 7
  • Win: add \n to command output strings so they display correctly

multi_thread (test app)

  • add --standalone option so you can run it as Docker app

web (job submission)

  • allow apps with no input or output files

plan class XML spec:

  • add <nthreads_cmdline> to mt class

@Copilot Copilot AI review requested due to automatic review settings July 4, 2025 20:47
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR bumps the Docker wrapper version to 7 across build/config files, adds a new nthreads_cmdline XML setting, and refactors several sample applications and utilities to use new constants and improve robustness.

  • Bump Docker wrapper release to 7 in project files and scripts
  • Add <nthreads_cmdline> setting to plan_class XML
  • Refactor multi-thread and Docker wrapper samples for clearer constants, improved parsing, and STANDALONE support

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
win_build/docker_wrapper.vcxproj Updated <TargetVersion> from 6 to 7
version.h Bumped DOCKERWRAPPER_RELEASE to 7, removed WSL_WRAPPER_RELEASE
sched/plan_class_spec.xml.sample Added <nthreads_cmdline> element
samples/multi_thread/multi_thread.cpp Replaced TOTAL_UNITS with UNITS_PER_THREAD, added STANDALONE guard
samples/multi_thread/Makefile Renamed PROGS to PROG, updated build target
samples/docker_wrapper/docker_wrapper.cpp Added --cpus flag, robust stats parsing, fixed fprintf call
lib/str_util.cpp Modified split to append delimiter
html/user/buda.php Reordered handling of output_file_names
configure.ac Bumped DOCKERWRAPPER_RELEASE to 7
Comments suppressed due to low confidence (3)

sched/plan_class_spec.xml.sample:7

  • A new <nthreads_cmdline> element was added—please update the plan_class_spec documentation to describe its purpose and valid values.
        <nthreads_cmdline>      1           </nthreads_cmdline>

version.h:32

  • The WSL_WRAPPER_RELEASE macro was removed but may still be used elsewhere; please reintroduce #define WSL_WRAPPER_RELEASE 4 (or appropriate version) before bumping DOCKERWRAPPER_RELEASE.
// dockerwrapper version number

lib/str_util.cpp:842

  • Appending the delimiter to each split item changes the expected behavior of split; most consumers expect the delimiter to be removed. Consider pushing item alone.
        result.push_back(item+delim);

@@ -41,7 +41,7 @@ clean: distclean
distclean:
/bin/rm -f $(PROGS) $(addsuffix .exe, $(PROGS)) *.o libstdc++.a
Copy link
Preview

Copilot AI Jul 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The distclean rule still references $(PROGS) which is no longer defined; update it to use $(PROG) so the generated binary is cleaned up correctly.

Suggested change
/bin/rm -f $(PROGS) $(addsuffix .exe, $(PROGS)) *.o libstdc++.a
/bin/rm -f $(PROG) $(addsuffix .exe, $(PROG)) *.o libstdc++.a

Copilot uses AI. Check for mistakes.

Comment on lines 51 to 52
int units_per_thread;

Copy link
Preview

Copilot AI Jul 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The units_per_thread variable is no longer used after switching to the UNITS_PER_THREAD constant; consider removing this declaration to avoid confusion.

Suggested change
int units_per_thread;

Copilot uses AI. Check for mistakes.

bool found = false;
double cpu_pct=0, mem=0;
char mem_unit=0;
for (string line: out) {
Copy link
Preview

Copilot AI Jul 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Iterating by value causes unnecessary string copies; prefer for (const string& line : out) to avoid allocations.

Suggested change
for (string line: out) {
for (const string& line : out) {

Copilot uses AI. Check for mistakes.

@davidpanderson davidpanderson changed the title Dpa docker wrapper12 BUDA: support multithread apps Jul 4, 2025
AenBleidd added 2 commits July 5, 2025 03:53
…ipt.

Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
…ersion.h file with the script

Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
@github-project-automation github-project-automation bot moved this to Backlog in Server Jul 6, 2025
@github-project-automation github-project-automation bot moved this to In progress in Client/Manager Jul 6, 2025
@AenBleidd AenBleidd added this to Server Jul 6, 2025
@AenBleidd AenBleidd added this to the Client/Manager 8.4.0 milestone Jul 6, 2025
@AenBleidd AenBleidd merged commit c0ae9db into master Jul 7, 2025
175 checks passed
@AenBleidd AenBleidd deleted the dpa_docker_wrapper12 branch July 7, 2025 06:57
@github-project-automation github-project-automation bot moved this from Backlog to Done in Server Jul 7, 2025
@github-project-automation github-project-automation bot moved this from In progress to Merged in Client/Manager Jul 7, 2025
@AenBleidd AenBleidd removed this from the Client/Manager 8.4.0 milestone Jul 11, 2025
@AenBleidd AenBleidd added this to the Client/Manager 8.2.5 milestone Jul 11, 2025
AenBleidd added a commit that referenced this pull request Jul 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants