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

Remove tc thread private array #435

Merged
merged 9 commits into from
Oct 30, 2023
Merged

Remove tc thread private array #435

merged 9 commits into from
Oct 30, 2023

Conversation

marchdf
Copy link
Contributor

@marchdf marchdf commented Oct 26, 2023

No description provided.

@marchdf
Copy link
Contributor Author

marchdf commented Oct 26, 2023

@malihass can you check to see if this gives correct results? I think it does but your tests are better ;)

@marchdf marchdf force-pushed the remove-tc branch 2 times, most recently from 35b50c7 to 41b01ba Compare October 27, 2023 14:59
@jrood-nrel
Copy link
Contributor

This appears to have no performance implications.

@marchdf marchdf marked this pull request as ready for review October 27, 2023 15:39
@marchdf marchdf changed the title Remove tc Remove tc thread private array Oct 27, 2023
@malihass
Copy link
Collaborator

I see a very small diff of temperature specifically when running the 0D ignition with the analytical Jacobian and the dodecane_lu_qss. I don't see any diff for dodecane_lu and ch4-2-steps. I also don't see diff for the qss mech with numerical Jacobian. Maybe something is off with the symbolic Jacobian?

Otherwise for performance, I suspect it will shine most on GPU. Did you see no diff when running on GPU @jrood-nrel ?

@marchdf
Copy link
Contributor Author

marchdf commented Oct 27, 2023

I don't expect a performance change (it's basically what I want). I am not really doing this for performance... but i am hoping this gets me to the nasa9 polynomials easier

@marchdf
Copy link
Contributor Author

marchdf commented Oct 30, 2023

I think there are a couple of things causing this minor diff in the analytical jacobian:

  • pow(x, 0.5) became sqrt(x)
  • logT, T2, etc are expressions instead of using tc[i].
    All this might lead to a slightly different expression optimization path.

Thoughts?

Copy link
Collaborator

@malihass malihass left a comment

Choose a reason for hiding this comment

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

I don't see an error in the ceptr code. The changes also do modify a bit the common sub expressions being identified (increases by 0.1% in the case of dodecane) which could explain the very small diff.
I went ahead and compared the actual Jacobians on 100 random samples of composition space and they are the same up to machine precision (I did this for CH4_lean_qss, dodecane_lu_qss and heptane_lu_qss). So I am convinced! Thanks for bearing with me!

@marchdf marchdf merged commit df7f299 into development Oct 30, 2023
@marchdf marchdf deleted the remove-tc branch October 30, 2023 20:05
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