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

check for pending operations #172

Open
wants to merge 1 commit into
base: stable
Choose a base branch
from

Conversation

swilly22
Copy link
Contributor

This pull-request adds the GxB_Matrix_pending function which checks if a matrix A has any pending work:

  1. pending tuples
  2. zombies
  3. jumbled
  4. hyper-hash

In which case the functions sets its input/output argument to true otherwise the argument is set to false.
Please let me know if I should add a test.

@DrTimothyAldenDavis
Copy link
Owner

I'm still undecided if this should be GxB_Matrix_pending, or if I should use something like:

GxB_get (A, GxB_(something new here), &has_pending_operations) ;

@swilly22
Copy link
Contributor Author

I don't have a preference in this case.

If there are any guarantees, possible side-effects e.g. GxB_get will never flush the queries object in either one of the different conventions pick the one which suites us best.

@rayegun
Copy link
Contributor

rayegun commented Mar 29, 2023

@swilly22 what was the background for this PR? What is your use case? The C committee is discussing it.

@swilly22
Copy link
Contributor Author

RedisGraph may use a matrix A via multiple threads concurrently.
In case A has pending changes (requires wait) we must avoid concurrent matrix synchronization. Before a thread gains "access" to a matrix it checks for any pending work via GxB_Matrix_pending and if needed synchronize the matrix is a thread safe manner.

@DrTimothyAldenDavis
Copy link
Owner

I'm getting ready to release GraphBLAS 8.2.2 with some minor updates (in SuiteSparse 7.4), and I'm waiting on the 2.1 C API to be released so that I can release GraphBLAS 9.0.0 with the latest GrB get/set methods.

Kernel fusion might render this method a challenge. I haven't started kernel fusion yet but it would be a problem if I added this method to GraphBLAS now, only to have to take it out when I get to that project.

So for now, let's hold of. It works for now inside FalkorDB and RedisGraph, for GraphBLAS 8.x and 9.x. I hope to keep it in place for GraphBLAS when I add kernel fusion but time will tell.

@swilly22
Copy link
Contributor Author

Can you please explain how GxB_Matrix_pending is effected by kernel fusion?

@DrTimothyAldenDavis
Copy link
Owner

Unsure, but I need to somehow flag a matrix as taking part in one or more pending GraphBLAS operations. There's a possibility that keeping GxB_Matrix_pending functional when kernel fusion is added would be complicated, and might need an API change.

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.

3 participants