diff --git a/.gitignore b/.gitignore index 3e3dd51..04d97a9 100644 --- a/.gitignore +++ b/.gitignore @@ -41,6 +41,7 @@ test/request_tracking/fenix_request_tracking_test test/request_tracking/fenix_request_tracking_test_nofenix build/ install/ +spack-* # Other *~ diff --git a/CMakeLists.txt b/CMakeLists.txt index 170b576..3813059 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ cmake_minimum_required(VERSION 3.10.2) -project(Fenix C) +project(Fenix C CXX) # The version number. set(FENIX_VERSION_MAJOR 1) set(FENIX_VERSION_MINOR 0) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7c823fd..a33ea2c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -15,25 +15,25 @@ configure_file (${CMAKE_SOURCE_DIR}/include/fenix-config.h.in FILE(GLOB Fenix_HEADERS ${CMAKE_SOURCE_DIR}/include/*.h) set (Fenix_SOURCES -fenix.c -fenix_mpi_override.c -fenix_opt.c -fenix_process_recovery.c -fenix_util.c -fenix_data_recovery.c -fenix_data_group.c -fenix_data_policy.c -fenix_data_policy_in_memory_raid.c -fenix_data_member.c -fenix_data_subset.c -fenix_comm_list.c -fenix_callbacks.c -globals.c +fenix.cpp +fenix_mpi_override.cpp +fenix_opt.cpp +fenix_process_recovery.cpp +fenix_util.cpp +fenix_data_recovery.cpp +fenix_data_group.cpp +fenix_data_policy.cpp +fenix_data_policy_in_memory_raid.cpp +fenix_data_member.cpp +fenix_data_subset.cpp +fenix_comm_list.cpp +fenix_callbacks.cpp +globals.cpp ) add_library( fenix STATIC ${Fenix_SOURCES}) -target_link_libraries(fenix PUBLIC MPI::MPI_C) +target_link_libraries(fenix PUBLIC MPI::MPI_CXX) target_include_directories(fenix PUBLIC diff --git a/src/fenix.c b/src/fenix.cpp similarity index 99% rename from src/fenix.c rename to src/fenix.cpp index 70c55d5..69858bf 100644 --- a/src/fenix.c +++ b/src/fenix.cpp @@ -91,7 +91,7 @@ int Fenix_Data_member_create( int group_id, int member_id, void *buffer, int cou } int Fenix_Data_group_get_redundancy_policy( int group_id, int* policy_name, void *policy_value, int *flag ) { - return __fenix_group_get_redundancy_policy( group_id, policy_name, policy_value, flag ); + return __fenix_group_get_redundancy_policy( group_id, policy_name, (int*)policy_value, flag ); } int Fenix_Data_wait(Fenix_Request request) { diff --git a/src/fenix_callbacks.c b/src/fenix_callbacks.cpp similarity index 95% rename from src/fenix_callbacks.c rename to src/fenix_callbacks.cpp index 8779402..1e0c913 100644 --- a/src/fenix_callbacks.c +++ b/src/fenix_callbacks.cpp @@ -70,7 +70,7 @@ int __fenix_callback_register(void (*recover)(MPI_Comm, int, void *), void *call { int error_code = FENIX_SUCCESS; if (fenix.fenix_init_flag) { - fenix_callback_func *fp = s_malloc(sizeof(fenix_callback_func)); + fenix_callback_func *fp = (fenix_callback_func *) s_malloc(sizeof(fenix_callback_func)); fp->x = recover; fp->y = callback_data; __fenix_callback_push( &fenix.callback_list, fp); @@ -105,7 +105,7 @@ void __fenix_callback_invoke_all(int error) void __fenix_callback_push(fenix_callback_list_t **head, fenix_callback_func *fp) { - fenix_callback_list_t *callback = malloc(sizeof(fenix_callback_list_t)); + fenix_callback_list_t *callback = (fenix_callback_list_t *) malloc(sizeof(fenix_callback_list_t)); callback->callback = fp; callback->next = *head; *head = callback; diff --git a/src/fenix_comm_list.c b/src/fenix_comm_list.cpp similarity index 98% rename from src/fenix_comm_list.c rename to src/fenix_comm_list.cpp index d1b56d2..1a805fe 100644 --- a/src/fenix_comm_list.c +++ b/src/fenix_comm_list.cpp @@ -123,11 +123,11 @@ void __fenix_comm_list_destroy(void) { else { fenix_comm_list_elm_t *current = my_list.tail; while (current->next) { - fenix_comm_list_elm_t *new = current->next; + fenix_comm_list_elm_t *next = current->next; MPIX_Comm_revoke(*current->comm); PMPI_Comm_free(current->comm); free(current); - current = new; + current = next; } MPIX_Comm_revoke(*current->comm); PMPI_Comm_free(current->comm); diff --git a/src/fenix_data_group.c b/src/fenix_data_group.cpp similarity index 100% rename from src/fenix_data_group.c rename to src/fenix_data_group.cpp diff --git a/src/fenix_data_member.c b/src/fenix_data_member.cpp similarity index 100% rename from src/fenix_data_member.c rename to src/fenix_data_member.cpp diff --git a/src/fenix_data_policy.c b/src/fenix_data_policy.cpp similarity index 100% rename from src/fenix_data_policy.c rename to src/fenix_data_policy.cpp diff --git a/src/fenix_data_policy_in_memory_raid.c b/src/fenix_data_policy_in_memory_raid.cpp similarity index 99% rename from src/fenix_data_policy_in_memory_raid.c rename to src/fenix_data_policy_in_memory_raid.cpp index 8eaa362..4d106ff 100644 --- a/src/fenix_data_policy_in_memory_raid.c +++ b/src/fenix_data_policy_in_memory_raid.cpp @@ -844,7 +844,7 @@ int __imr_member_restore(fenix_group_t* g, int member_id, if(recovery_locally_possible) retval = FENIX_SUCCESS; } else if (group->raid_mode == 5){ - int* set_results = malloc(sizeof(int) * group->set_size); + int* set_results = (int *) malloc(sizeof(int) * group->set_size); MPI_Allgather((void*)&found_member, 1, MPI_INT, (void*)set_results, 1, MPI_INT, group->set_comm); diff --git a/src/fenix_data_recovery.c b/src/fenix_data_recovery.cpp similarity index 100% rename from src/fenix_data_recovery.c rename to src/fenix_data_recovery.cpp diff --git a/src/fenix_data_subset.c b/src/fenix_data_subset.cpp similarity index 100% rename from src/fenix_data_subset.c rename to src/fenix_data_subset.cpp diff --git a/src/fenix_mpi_override.c b/src/fenix_mpi_override.cpp similarity index 100% rename from src/fenix_mpi_override.c rename to src/fenix_mpi_override.cpp diff --git a/src/fenix_opt.c b/src/fenix_opt.cpp similarity index 100% rename from src/fenix_opt.c rename to src/fenix_opt.cpp diff --git a/src/fenix_process_recovery.c b/src/fenix_process_recovery.cpp similarity index 99% rename from src/fenix_process_recovery.c rename to src/fenix_process_recovery.cpp index 02f7801..4e1d557 100644 --- a/src/fenix_process_recovery.c +++ b/src/fenix_process_recovery.cpp @@ -83,7 +83,7 @@ int __fenix_preinit(int *role, MPI_Comm comm, MPI_Comm *new_comm, int *argc, cha MPI_Comm_create_errhandler(__fenix_test_MPI, &fenix.mpi_errhandler); - fenix.world = malloc(sizeof(MPI_Comm)); + fenix.world = (MPI_Comm *)malloc(sizeof(MPI_Comm)); MPI_Comm_dup(comm, fenix.world); PMPI_Comm_set_errhandler(*fenix.world, fenix.mpi_errhandler); @@ -659,7 +659,7 @@ int* __fenix_get_fail_ranks(int *survivor_world, int survivor_world_size, int fa qsort(survivor_world, survivor_world_size, sizeof(int), __fenix_comparator); int failed_pos = 0; - int *fail_ranks = calloc(fail_world_size, sizeof(int)); + int *fail_ranks = (int *)calloc(fail_world_size, sizeof(int)); int i; for (i = 0; i < survivor_world_size + fail_world_size; i++) { diff --git a/src/fenix_util.c b/src/fenix_util.cpp similarity index 100% rename from src/fenix_util.c rename to src/fenix_util.cpp diff --git a/src/globals.c b/src/globals.cpp similarity index 100% rename from src/globals.c rename to src/globals.cpp diff --git a/test/failed_spares/CMakeLists.txt b/test/failed_spares/CMakeLists.txt index 8fd95b3..46e4f4c 100644 --- a/test/failed_spares/CMakeLists.txt +++ b/test/failed_spares/CMakeLists.txt @@ -9,7 +9,7 @@ # add_executable(fenix_failed_spares fenix_failed_spares.c) -target_link_libraries(fenix_failed_spares fenix MPI::MPI_C) +target_link_libraries(fenix_failed_spares fenix MPI::MPI_CXX) add_test(NAME failed_spares COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} 6 ${MPIEXEC_PREFLAGS} fenix_failed_spares ${MPIEXEC_POSTFLAGS} 3 1 3 4 ) diff --git a/test/issend/CMakeLists.txt b/test/issend/CMakeLists.txt index f141d40..2b44c38 100644 --- a/test/issend/CMakeLists.txt +++ b/test/issend/CMakeLists.txt @@ -9,6 +9,6 @@ # add_executable(fenix_issend_test fenix_issend_test.c) -target_link_libraries(fenix_issend_test fenix MPI::MPI_C) +target_link_libraries(fenix_issend_test fenix MPI::MPI_CXX) add_test(NAME issend COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} 5 ${MPIEXEC_PREFLAGS} fenix_issend_test ${MPIEXEC_POSTFLAGS} "1") diff --git a/test/message_replay/CMakeLists.txt b/test/message_replay/CMakeLists.txt new file mode 100644 index 0000000..f9f2c11 --- /dev/null +++ b/test/message_replay/CMakeLists.txt @@ -0,0 +1,14 @@ +# +# This file is part of Fenix +# Copyright (c) 2016 Rutgers University and Sandia Corporation. +# This software is distributed under the BSD License. +# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +# the U.S. Government retains certain rights in this software. +# For more information, see the LICENSE file in the top Fenix +# directory. +# + +add_executable(fenix_message_logging_test fenix_message_logging_test.cxx) +target_link_libraries(fenix_message_logging_test fenix MPI::MPI_CXX) + +add_test(NAME request_cancelled COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} 5 ${MPIEXEC_PREFLAGS} fenix_message_logging_test ${MPIEXEC_POSTFLAGS} "1") diff --git a/test/no_jump/CMakeLists.txt b/test/no_jump/CMakeLists.txt index dfc9311..250059f 100644 --- a/test/no_jump/CMakeLists.txt +++ b/test/no_jump/CMakeLists.txt @@ -9,6 +9,6 @@ # add_executable(fenix_no_jump_test fenix_no_jump_test.c) -target_link_libraries(fenix_no_jump_test fenix MPI::MPI_C) +target_link_libraries(fenix_no_jump_test fenix MPI::MPI_CXX) add_test(NAME no_jump COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} 5 ${MPIEXEC_PREFLAGS} fenix_no_jump_test ${MPIEXEC_POSTFLAGS} "1") diff --git a/test/request_cancelled/CMakeLists.txt b/test/request_cancelled/CMakeLists.txt index 97dd331..f20dee8 100644 --- a/test/request_cancelled/CMakeLists.txt +++ b/test/request_cancelled/CMakeLists.txt @@ -9,6 +9,6 @@ # add_executable(fenix_request_cancelled_test fenix_req_cancelled_test.c) -target_link_libraries(fenix_request_cancelled_test fenix MPI::MPI_C) +target_link_libraries(fenix_request_cancelled_test fenix MPI::MPI_CXX) add_test(NAME request_cancelled COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} 5 ${MPIEXEC_PREFLAGS} fenix_request_cancelled_test ${MPIEXEC_POSTFLAGS} "1") diff --git a/test/request_tracking/CMakeLists.txt b/test/request_tracking/CMakeLists.txt index 8d008ed..694bc99 100644 --- a/test/request_tracking/CMakeLists.txt +++ b/test/request_tracking/CMakeLists.txt @@ -9,7 +9,7 @@ # add_executable(fenix_request_tracking_test fenix_request_tracking_test.c) -target_link_libraries(fenix_request_tracking_test fenix MPI::MPI_C) +target_link_libraries(fenix_request_tracking_test fenix MPI::MPI_CXX) add_test(NAME request_tracking COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} 3 ${MPIEXEC_PREFLAGS} fenix_request_tracking_test ${MPIEXEC_POSTFLAGS})