Skip to content
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

[Dynamic Selection] Parallel tests for Dynamic Selection #1623

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

AnuyaWelling2801
Copy link
Contributor

@AnuyaWelling2801 AnuyaWelling2801 commented Jun 12, 2024

Added Parallel tests for

  1. Round Robin policy - sycl backend
  2. Round Robin policy - inline backend
  3. Fixed resource policy - sycl backend
  4. Fixed resource policy - inline backend
  5. Dynamic Load policy - sycl backend
  6. Dynamic Load policy - inline backend
  7. Auto tune policy - sycl backend
  8. Auto tune policy - inline backend

More to be added either in this PR or a separate PR

@AnuyaWelling2801 AnuyaWelling2801 added this to the 2022.7.0 milestone Jul 1, 2024
AnuyaWelling2801 and others added 7 commits July 1, 2024 15:01
* Replace threads.push_back(std::thread(thread_func)); to threads.emplace_back(thread_func);

Signed-off-by: Sergey Kopienko <[email protected]>

* Fix includes order

Signed-off-by: Sergey Kopienko <[email protected]>

---------

Signed-off-by: Sergey Kopienko <[email protected]>
@SergeyKopienko
Copy link
Contributor

@AnuyaWelling2801 Could you please extract this two typical peace of code in your test into some functions?

        for(int i=0;i<n_threads;i++){
            threads.emplace_back(thread_func);
        }
        for(auto& thread : threads){
            thread.join();
        }

There are a lot of this code...

@SergeyKopienko
Copy link
Contributor

@AnuyaWelling2801 another question:
For example, we have some code like this:

    if (!pass)
    {
        std::cout << "ERROR: did not select expected resources\n";
        return 1;
    }

in the function test_submit_and_wait_on_group and in some other functions.

The question: should we continue test is it's happen (!pass) ?
And if so, should this affect the outcome of the entire test?

@SergeyKopienko
Copy link
Contributor

CI is red...


class Barrier {
public:
explicit Barrier(std::size_t count) : threshold(count), count(count), generation(0) {}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we will have incorrect work here if count == 0 or threshold == 0.
I believe assert may help to check this.

std::condition_variable condition;
std::size_t threshold;
std::size_t count;
std::size_t generation;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
std::size_t generation;
std::size_t generation = 0;


class Barrier {
public:
explicit Barrier(std::size_t count) : threshold(count), count(count), generation(0) {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
explicit Barrier(std::size_t count) : threshold(count), count(count), generation(0) {}
explicit Barrier(std::size_t count) : threshold(count), count(count) {}

void arrive_and_wait() {
std::unique_lock<std::mutex> lock(mutex);
auto gen = generation;
if (--count == 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

What if count == 0 ?

@AnuyaWelling2801 AnuyaWelling2801 removed this from the 2022.7.0 milestone Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants