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

Make CurrentAssertionLevel thread local #3821

Closed
fingolfin opened this issue Jan 1, 2020 · 1 comment · Fixed by #3822
Closed

Make CurrentAssertionLevel thread local #3821

fingolfin opened this issue Jan 1, 2020 · 1 comment · Fixed by #3822
Labels
topic: HPC-GAP Issues and PRs related to HPC-GAP

Comments

@fingolfin
Copy link
Member

Right now, CurrentAssertionLevel is global. I think this is problematic in HPC-GAP (ping @rbehrends @stevelinton). So I suggest we make it thread local instead.

The easiest way to do that would be to remove it as a GAP variable, and instead put it into the kernel, as a member of the thread local GAPState. That would also require moving SetAssertionLevel and AssertionLevel from the library to the kernel, but that's easy. I can't think of any downsides?

@rbehrends
Copy link
Contributor

The only potential problem I can see is that code that depends on the current gvar (and bypasses AssertionLevel() and SetAssertionLevel() would break. But I don't know any code that would do that? (The documentation describes CurrentAssertionLevel as unpublished, but one cannot always rely on user code adhering to that.)

Other than that, that looks like a sensible change. It would probably also make checking the assertion level in GAP code slightly faster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: HPC-GAP Issues and PRs related to HPC-GAP
Projects
None yet
2 participants