diff --git a/src/binary_c_python_api.c b/src/binary_c_python_api.c index 50b9f2fdeb1f4d0840222761b9966f48fbc92ff3..87b827f19c35c64a760dbff6af35aa588f433be7 100644 --- a/src/binary_c_python_api.c +++ b/src/binary_c_python_api.c @@ -121,6 +121,8 @@ int run_system(char * argstring, stardata->preferences->custom_output_function = (void*)(struct stardata_t *)custom_logging_func_memaddr; } + printf("ensemble_defer: %d\n", stardata->preferences->ensemble_defer); + /* do binary evolution */ binary_c_evolve_for_dt(stardata, stardata->model.max_evolution_time); diff --git a/tests/test_return_persistent_data_memaddr.py b/tests/test_return_persistent_data_memaddr.py index ddd2adfaaf325e84c81305db42740c6effd6fa3b..88124da6f367b63ddaf4e0404e9dd0c76318f4cd 100644 --- a/tests/test_return_persistent_data_memaddr.py +++ b/tests/test_return_persistent_data_memaddr.py @@ -175,7 +175,7 @@ def adding_ensemble_output(): ############################################################################################# # The 2 runs below use the ensemble and both defer the output so that after they are finished - # nothing is printed. After that we explicitly free the memory of the persistent_data and + # nothing is printed. After that we explicitly free the memory of the persistent_data and # have the output returned in that way # Deferred commands @@ -188,8 +188,14 @@ def adding_ensemble_output(): persistent_data_memaddr = binary_c_python_api.return_persistent_data_memaddr() # Run the systems and defer the output each time - output_1_deferred = binary_c_python_api.run_system(argstring=argstring_1_deferred, persistent_data_memaddr=persistent_data_memaddr) - output_2_deferred = binary_c_python_api.run_system(argstring=argstring_2_deferred, persistent_data_memaddr=persistent_data_memaddr) + output_1_deferred = binary_c_python_api.run_system( + argstring=argstring_1_deferred, + persistent_data_memaddr=persistent_data_memaddr + ) + output_2_deferred = binary_c_python_api.run_system( + argstring=argstring_2_deferred, + persistent_data_memaddr=persistent_data_memaddr + ) # Have the persistent_memory adress be released and have the json outputted output_total_deferred = binary_c_python_api.free_persistent_data_memaddr_and_return_json_output(persistent_data_memaddr) @@ -205,14 +211,20 @@ def adding_ensemble_output(): ############################################################################################# # The 2 runs below use the ensemble and the first one defers the output to the memory, - # Then the second one uses that memory to combine its results with, but doesn't defer the + # Then the second one uses that memory to combine its results with, but doesn't defer the # data after that, so it will print it after the second run is done persistent_data_memaddr_2 = binary_c_python_api.return_persistent_data_memaddr() # Run the systems and defer the output once and the second time not, so that the second run automatically prints out the results - output_1_deferred = binary_c_python_api.run_system(argstring=argstring_1_deferred, persistent_data_memaddr=persistent_data_memaddr_2) - output_2_deferred_and_output = binary_c_python_api.run_system(argstring=argstring_2, persistent_data_memaddr=persistent_data_memaddr_2) + output_1_deferred = binary_c_python_api.run_system( + argstring=argstring_1_deferred, + persistent_data_memaddr=persistent_data_memaddr_2 + ) + output_2_deferred_and_output = binary_c_python_api.run_system( + argstring=argstring_2, + persistent_data_memaddr=persistent_data_memaddr_2 + ) ensemble_jsons_deferred_and_output = [line for line in output_2_deferred_and_output.splitlines() if line.startswith("ENSEMBLE_JSON")]