Skip to content

Conversation

@muhammadalhroob
Copy link
Contributor

This Pull request:

Cleaning up TMatrixT.cxx; As discussed in PR #20365, I removed OpenMP pragmas.

Changes or fixes:

Checklist:

  • tested changes locally
  • updated the docs (if necessary)

This PR fixes #

@muhammadalhroob muhammadalhroob changed the title Remove openmp MatrixMultiplication Remove openmp from MatrixMultiplication function Dec 4, 2025
@guitargeek
Copy link
Contributor

Hi! @muhammadalhroob, thanks for the PR!

Same request as before: can you make sure there are no merge commits in your development branch?

Only allowing fast-forward merges (i.e. merging only branches that didn't do any merged themselves) in GitHub helps us to maintain a clean and linear project history without unnecessary merge commits. This approach simplifies the commit history, making it easier to understand and manage.

@silverweed
Copy link
Contributor

silverweed commented Dec 4, 2025

Is it really sufficient to remove those lines? Meaning: does the rest of the code make sense at all without openMP to accelerate it? Are the changes still a performance improvement with this removal?

Also, why are we not using nb anymore at all? Are we now assuming that the second matrix has the correct amount of elements without checking?

@guitargeek
Copy link
Contributor

Is it really sufficient to remove those lines? Meaning: does the rest of the code make sense at all without openMP to accelerate it? Are the changes still a performance improvement with this removal?

According to #20365 (comment), the speedup did not rely on OpenMP.

Also, why are we not using nb anymore at all? Are we now assuming that the second matrix has the correct amount of elements without checking?

Yes. The previous implementation also didn't make any checks by the way. It it actually quite common to have nb implicit, also in the BLAS libraries (compare also the CBLAS backend for TMatrix). I guess that's why the new code also doesn't use it, now that we know it's AI generated it explains some things 🙂

@muhammadalhroob
Copy link
Contributor Author

Hi @guitargeek,
I started from the updated master branch, I git cloned root after I synchronised my fork, then I made the remove-openmp-matrixmult branch. I am not sure how to proceed and avoid the 'merge commits in your development branch'

@silverweed
Copy link
Contributor

Yes. The previous implementation also didn't make any checks by the way. It it actually quite common to have nb implicit, also in the BLAS libraries (compare also the CBLAS backend for TMatrix). I guess that's why the new code also doesn't use it, now that we know it's AI generated it explains some things 🙂

Since the caller needs to do the work of passing in the number anyway it would be nice to have an assert on that imho

@muhammadalhroob muhammadalhroob force-pushed the remove-openmp-matrixmult branch from c8df16d to 74b1a12 Compare December 4, 2025 10:09
@guitargeek
Copy link
Contributor

How did you "synchronised my fork"? It looks like you tried to do that by merging the master branch of root into the master branch of your fork:
https://github.com/muhammadalhroob/root/commits/master/

That's not synced at all, because the histories are very different, as the commits are in different order with the merges. When syncing the master branch in your fork, make sure your forks master a clean "copy" of the master in ROOT.

I usually make sure of that by checking out the latest root-project/master branch in my local clone of the repository, and then force-push to the master of my fork.

An alternative is to ignore the master branch in your fork completely. You just check out the root-project/master branch and create your development branch from there.

Also a general advice: nothing good ever comes out of git merge, if you don't have very particular uscases and you know what I'm doing. I personally have not used it in 15 years. The better way to sync branches is git rebase.

There is plenty of discussion on git merge vs git rebase on the internet too, some people are very passionate about it. I think it's an important concept to understand.

@muhammadalhroob muhammadalhroob force-pushed the remove-openmp-matrixmult branch from 74b1a12 to fa76ea4 Compare December 4, 2025 10:25
@silverweed
Copy link
Contributor

Also, whenever you name a commit think of the people who are gonna read it in the context of the repo's history. "Rebase after pulling from root master" gives zero useful information. If you have a single-commit PR it's customary to have your commit short message to be the same as the PR title (ideally with the long message containing the explanation of what's happening and why)

Copy link
Contributor

@guitargeek guitargeek left a comment

Choose a reason for hiding this comment

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

Thanks! I'll reword the commit on merging.

@guitargeek guitargeek merged commit 10b6c35 into root-project:master Dec 4, 2025
29 checks passed
@muhammadalhroob muhammadalhroob deleted the remove-openmp-matrixmult branch December 4, 2025 16:02
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