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

Added check on threading in two python tests which require it. #642

Merged
merged 2 commits into from Jan 27, 2017

Conversation

@sdiazpier
Copy link
Contributor

@sdiazpier sdiazpier commented Jan 26, 2017

This PR solves a problem with two python tests which require threading but were not being skipped if threading was not enabled.

Copy link
Contributor

@lekshmideepu lekshmideepu left a comment

Looks good to me

Copy link
Contributor

@heplesser heplesser left a comment

@sdiazpier Fine in principle, but one can do the SLI-interface more elegantly.

@@ -29,7 +29,10 @@
# and multiple threads are set, or if multiple threads are set and
# the enable_structural_plasticity function is called.

HAVE_OPENMP = nest.sli_func("statusdict/threading ::")

This comment has been minimized.

@heplesser

heplesser Jan 26, 2017
Contributor

It would be even better to do as follows:

HAVE_OPENMP = nest.sli_func("is_threaded")

This insulates the details of how threading is marked at the sli level. The result is a bool.



@unittest.skipIf(HAVE_OPENMP == 'no', 'OpenMP is not available')

This comment has been minimized.

@heplesser

heplesser Jan 26, 2017
Contributor

With the change above, this would simplify to

@unittest.skipIf(HAVE_OPENMP, 'OpenMP is not available')
@@ -28,6 +28,7 @@
import nest
from nest import raster_plot
import time
HAVE_OPENMP = nest.sli_func("statusdict/threading ::")

This comment has been minimized.

@heplesser

heplesser Jan 26, 2017
Contributor

See above

@@ -216,6 +217,7 @@ def growth_curve(self, t):
)


@unittest.skipIf(HAVE_OPENMP == 'no', 'OpenMP is not available')

This comment has been minimized.

@heplesser

heplesser Jan 26, 2017
Contributor

See above.

@sdiazpier
Copy link
Contributor Author

@sdiazpier sdiazpier commented Jan 27, 2017

Dear @heplesser thanks for the suggestion. I have made the changes. Please let me know if anything else is missing.

@heplesser
Copy link
Contributor

@heplesser heplesser commented Jan 27, 2017

Summary: Suppresses thread-dependent threads if NEST was build without threads.

@heplesser heplesser merged commit d1b7da9 into nest:master Jan 27, 2017
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.