Skip to content

Commit

Permalink
Merge pull request #311 from joakim-hove/move-thread-pool
Browse files Browse the repository at this point in the history
Removed thread_pool implementation from libecl
  • Loading branch information
joakim-hove authored Feb 21, 2018
2 parents 6bc0660 + 76958bd commit a98730e
Show file tree
Hide file tree
Showing 12 changed files with 5 additions and 726 deletions.
14 changes: 0 additions & 14 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
project(libecl-ecl C CXX)

if (HAVE_PTHREAD)
# The block_fs filesystem is so heavily dependant on pthreads that it is
# not built if de not have pthreads.
list(APPEND opt_srcs util/thread_pool.c)
endif ()


if (HAVE_BACKTRACE)
Expand Down Expand Up @@ -275,15 +270,6 @@ add_test(NAME ert_util_work_area
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/util/tests
)

find_library( VALGRIND NAMES valgr )
if (VALGRIND)
set(valgrind_cmd valgrind --error-exitcode=1 --tool=memcheck)
endif ()

add_executable(test_thread_pool util/tests/test_thread_pool.c)
target_link_libraries(test_thread_pool ecl)
add_test(NAME test_thread_pool COMMAND ${valgrind_cmd} test_thread_pool)

add_executable(ert_util_cwd_test util/tests/ert_util_cwd_test.c)
target_link_libraries(ert_util_cwd_test ecl)
add_test(NAME ert_util_cwd_test COMMAND ert_util_cwd_test ${CMAKE_CURRENT_BINARY_DIR})
Expand Down
43 changes: 0 additions & 43 deletions lib/include/ert/util/thread_pool.h

This file was deleted.

13 changes: 0 additions & 13 deletions lib/util/tests/ert_util_spawn.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include <ert/util/test_util.h>
#include <ert/util/util.h>
#include <ert/util/test_work_area.h>
#include <ert/util/thread_pool.h>


static const char * stdout_msg = "stdout_xxx";
Expand Down Expand Up @@ -178,18 +177,6 @@ void test_spawn_redirect_threaded() {
test_assert_true(check_script(script));
}

// Run the scripts in parallel
stringlist_type * script_paths = stringlist_alloc_new(); // free the paths after threads have completed
thread_pool_type * tp = thread_pool_alloc( 8 , true );
for(int i = 0; i < num; i++) {
char * path = util_alloc_sprintf("%06d" , path_codes[i]);
stringlist_append_owned_ref(script_paths, path);
thread_pool_add_job( tp , test_spawn_redirect__ , path );
}
thread_pool_join( tp );
thread_pool_free( tp );
stringlist_free(script_paths);

stringlist_free(script_fullpaths);
util_free(path_codes);
test_work_area_free( test_area );
Expand Down
27 changes: 0 additions & 27 deletions lib/util/thread_pool.c

This file was deleted.

90 changes: 0 additions & 90 deletions lib/util/thread_pool1.c

This file was deleted.

Loading

0 comments on commit a98730e

Please sign in to comment.