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

Merged
merged 2 commits into from Jan 27, 2017

Conversation

Projects
None yet
3 participants
@sdiazpier
Contributor

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.

@heplesser

@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.

@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')
@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

@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.

@heplesser

heplesser Jan 26, 2017

Contributor

See above.

@sdiazpier

This comment has been minimized.

Show comment
Hide comment
@sdiazpier

sdiazpier Jan 27, 2017

Contributor

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

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@heplesser

heplesser Jan 27, 2017

Contributor

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

Contributor

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

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