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

Missing assertions for threaded execution #278

Open
byjtew opened this issue Jan 10, 2024 · 1 comment · May be fixed by #284
Open

Missing assertions for threaded execution #278

byjtew opened this issue Jan 10, 2024 · 1 comment · May be fixed by #284
Assignees
Labels
bug Something isn't working
Milestone

Comments

@byjtew
Copy link
Collaborator

byjtew commented Jan 10, 2024

As an example, this program compiles, and crashes during its execution for a very misleading reason:

void grb_program( ... ) {
  // Using 1 openMP thread
  omp_set_num_threads( 1 ); 

  // User stuff ...

  grb::Vector<int> x(...);
  grb::Vector<int> y(...);
  grb::Matrix<int> A(...);
  // Build the vectors and the matrix ...

  // NOW using 2 openMP thread
  omp_set_num_threads( 2 ); 

  // Triggers the assertion trigger in include/coordinates.hpp:1343  "assert( _buf % T == 0 );"
  // Reason: The vectors have been allocated for computations with 
  // 1 thread only, but grb::vxm will be executed using 2 threads.
  grb::vxm( y, x, A, ... ); 
}
@byjtew byjtew added the bug Something isn't working label Jan 10, 2024
@byjtew byjtew self-assigned this Jan 10, 2024
@byjtew byjtew linked a pull request Jan 29, 2024 that will close this issue
@anyzelman
Copy link
Member

The suggestion here is to add a mechanism that more clearly reports when the number of threads have been modified. A fix has been suggested.

@anyzelman anyzelman added this to the v0.8 milestone Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants