From 5eb926c43df5a01d3efdfb12d1036ab1862e8943 Mon Sep 17 00:00:00 2001 From: Ulrich Noebauer Date: Fri, 11 Dec 2015 14:35:11 +0100 Subject: [PATCH 1/2] added Christian's fix for build behaviour in case of changes in C File --- setup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index d68bca6c7df..773ef44343f 100755 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ import __builtin__ as builtins builtins._ASTROPY_SETUP_ = True -from astropy_helpers.setup_helpers import (register_commands, adjust_compiler, +from astropy_helpers.setup_helpers import (register_commands, adjust_compiler, get_debug_option, get_package_info, add_command_option) from astropy_helpers.git_helpers import get_git_devstr @@ -101,6 +101,8 @@ hook_func = 'astropy.utils.release:' + '_'.join(hook) entry_points[hook_ep] = ['%s = %s' % (hook_name, hook_func)] +from Cython.Build import cythonize +package_info['ext_modules'] = cythonize(package_info['ext_modules']) # Include all .c files, recursively, including those generated by # Cython, since we can not do this in MANIFEST.in with a "dynamic" # directory name. From dd513d9e3b7cfaa4de612dbd95b2a1ee5dab53c0 Mon Sep 17 00:00:00 2001 From: Ulrich Noebauer Date: Fri, 11 Dec 2015 14:36:11 +0100 Subject: [PATCH 2/2] -replaced nthreads with omp_get_num_threads --- tardis/montecarlo/src/cmontecarlo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tardis/montecarlo/src/cmontecarlo.c b/tardis/montecarlo/src/cmontecarlo.c index 1ff5a670ee9..a7cd66ac3b5 100644 --- a/tardis/montecarlo/src/cmontecarlo.c +++ b/tardis/montecarlo/src/cmontecarlo.c @@ -826,9 +826,9 @@ montecarlo_main_loop(storage_model_t * storage, int64_t virtual_packet_flag, int storage->virt_array_size = storage->no_of_packets; #endif // WITH_VPACKET_LOGGING #ifdef WITHOPENMP - fprintf(stderr, "Running with OpenMP - %d threads\n", nthreads); omp_set_dynamic(0); omp_set_num_threads(nthreads); + fprintf(stderr, "Running with OpenMP - %d threads\n", omp_get_num_threads()); #pragma omp parallel { rk_state mt_state;