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 ecaac8b..b8d6c7d 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/include/fenix.h b/include/fenix.h index 7a68f82..28af25b 100644 --- a/include/fenix.h +++ b/include/fenix.h @@ -63,8 +63,10 @@ #if defined(c_plusplus) || defined(__cplusplus) extern "C" { #endif + + #include "fenix_data_subset.h" -#include "fenix_process_recovery.h" +#include "fenix_init.h" /** * @file diff --git a/include/fenix_comm_list.h b/include/fenix_comm_list.hpp similarity index 100% rename from include/fenix_comm_list.h rename to include/fenix_comm_list.hpp diff --git a/include/fenix_data_group.h b/include/fenix_data_group.hpp similarity index 97% rename from include/fenix_data_group.h rename to include/fenix_data_group.hpp index 67cb079..35c76da 100644 --- a/include/fenix_data_group.h +++ b/include/fenix_data_group.hpp @@ -56,11 +56,13 @@ #ifndef __FENIX_DATA_GROUP_H__ #define __FENIX_DATA_GROUP_H__ +#include + #include #include "fenix.h" -#include "fenix_data_member.h" -#include "fenix_data_packet.h" -#include "fenix_util.h" +#include "fenix_data_member.hpp" +#include "fenix_data_packet.hpp" +#include "fenix_util.hpp" #include "fenix_data_subset.h" #define __FENIX_DEFAULT_GROUP_SIZE 32 @@ -68,6 +70,7 @@ typedef struct __fenix_group_vtbl fenix_group_vtbl_t; typedef struct __fenix_group fenix_group_t; + //This defines the functions which must be implemented by the group typedef struct __fenix_group_vtbl { int (*group_delete)(fenix_group_t* group); @@ -165,7 +168,7 @@ void __fenix_data_recovery_reinit( fenix_data_recovery_t *dr, fenix_two_containe void __fenix_ensure_data_recovery_capacity( fenix_data_recovery_t *dr); -int __fenix_search_groupid( int key, fenix_data_recovery_t *dr ); +int __fenix_search_groupid( int key, fenix_data_recovery_t *dr); int __fenix_find_next_group_position( fenix_data_recovery_t *dr ); diff --git a/include/fenix_data_member.h b/include/fenix_data_member.hpp similarity index 98% rename from include/fenix_data_member.h rename to include/fenix_data_member.hpp index 391142b..e41b3bd 100644 --- a/include/fenix_data_member.h +++ b/include/fenix_data_member.hpp @@ -57,8 +57,8 @@ #define __FENIX_DATA_MEMBER_H__ #include -#include "fenix_data_packet.h" -#include "fenix_util.h" +#include "fenix_data_packet.hpp" +#include "fenix_util.hpp" #define __FENIX_DEFAULT_MEMBER_SIZE 512 diff --git a/include/fenix_data_packet.h b/include/fenix_data_packet.hpp similarity index 100% rename from include/fenix_data_packet.h rename to include/fenix_data_packet.hpp diff --git a/include/fenix_data_policy.h b/include/fenix_data_policy.hpp similarity index 98% rename from include/fenix_data_policy.h rename to include/fenix_data_policy.hpp index b932985..58bc1a2 100644 --- a/include/fenix_data_policy.h +++ b/include/fenix_data_policy.hpp @@ -59,7 +59,7 @@ #include #include "fenix.h" -#include "fenix_data_group.h" +#include "fenix_data_group.hpp" int __fenix_policy_get_group(fenix_group_t** group, MPI_Comm comm, int timestart, int depth, int policy_name, void* policy_value, int* flag); diff --git a/include/fenix_data_policy_in_memory_raid.h b/include/fenix_data_policy_in_memory_raid.hpp similarity index 98% rename from include/fenix_data_policy_in_memory_raid.h rename to include/fenix_data_policy_in_memory_raid.hpp index 931b0c7..e420c79 100644 --- a/include/fenix_data_policy_in_memory_raid.h +++ b/include/fenix_data_policy_in_memory_raid.hpp @@ -58,7 +58,7 @@ #define __FENIX_DATA_POLICY_IN_MEMORY_RAID_H__ #include -#include "fenix_data_group.h" +#include "fenix_data_group.hpp" void __fenix_policy_in_memory_raid_get_group(fenix_group_t** group, MPI_Comm comm, int timestart, int depth, void* policy_value, int* flag); diff --git a/include/fenix_data_recovery.h b/include/fenix_data_recovery.hpp similarity index 98% rename from include/fenix_data_recovery.h rename to include/fenix_data_recovery.hpp index 4580cb9..717bb13 100644 --- a/include/fenix_data_recovery.h +++ b/include/fenix_data_recovery.hpp @@ -58,10 +58,10 @@ #define __FENIX_DATA_RECOVERY__ -#include "fenix_data_group.h" -#include "fenix_data_member.h" +#include "fenix_data_group.hpp" +#include "fenix_data_member.hpp" #include "fenix_data_subset.h" -#include "fenix_util.h" +#include "fenix_util.hpp" #include #include #include diff --git a/include/fenix_ext.h b/include/fenix_ext.hpp similarity index 96% rename from include/fenix_ext.h rename to include/fenix_ext.hpp index ef4dcc4..9930798 100644 --- a/include/fenix_ext.h +++ b/include/fenix_ext.hpp @@ -59,9 +59,9 @@ #include #include "fenix.h" -#include "fenix_opt.h" -#include "fenix_data_group.h" -#include "fenix_process_recovery.h" +#include "fenix_opt.hpp" +#include "fenix_data_group.hpp" +#include "fenix_process_recovery.hpp" typedef struct { int num_inital_ranks; // Keeps the global MPI rank ID at Fenix_init @@ -87,7 +87,6 @@ typedef struct { int *ret_error; fenix_callback_list_t* callback_list; // singly linked list for user-defined Fenix callback functions - //fenix_communicator_list_t* communicator_list; // singly linked list for Fenix resilient communicators fenix_debug_opt_t options; // This is reserved to store the user options MPI_Comm *world; // Duplicate of the MPI communicator provided by user diff --git a/include/fenix_f.h b/include/fenix_f.h deleted file mode 100644 index a8f06c0..0000000 --- a/include/fenix_f.h +++ /dev/null @@ -1,82 +0,0 @@ -!/* -!//@HEADER -!// ************************************************************************ -!// -!// -!// _|_|_|_| _|_|_|_| _| _| _|_|_| _| _| -!// _| _| _|_| _| _| _| _| -!// _|_|_| _|_|_| _| _| _| _| _| -!// _| _| _| _|_| _| _| _| -!// _| _|_|_|_| _| _| _|_|_| _| _| -!// -!// -!// -!// -!// Copyright (C) 2016 Rutgers University and Sandia Corporation -!// -!// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -!// the U.S. Government retains certain rights in this software. -!// -!// Redistribution and use in source and binary forms, with or without -!// modification, are permitted provided that the following conditions are -!// met: -!// -!// 1. Redistributions of source code must retain the above copyright -!// notice, this list of conditions and the following disclaimer. -!// -!// 2. Redistributions in binary form must reproduce the above copyright -!// notice, this list of conditions and the following disclaimer in the -!// documentation and/or other materials provided with the distribution. -!// -!// 3. Neither the name of the Corporation nor the names of the -!// contributors may be used to endorse or promote products derived from -!// this software without specific prior written permission. -!// -!// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -!// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -!// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -!// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -!// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -!// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -!// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -!// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -!// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -!// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -!// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -!// -!// Author Marc Gamell, Eric Valenzuela, Keita Teranishi, Manish Parashar -!// Michael Heroux, and Matthew Whitlock -!// -!// Questions? Contact Keita Teranishi (knteran@sandia.gov) and -!// Marc Gamell (mgamell@cac.rutgers.edu) -!// -!// ************************************************************************ -!//@HEADER -!*/ - -#ifndef __FENIX_F_H__ -#define __FENIX_F_H__ - - -!/* ------------------------------------------------------------------------- */ -!/* */ -!/* */ -!/* D E F I N E S */ -!/* */ -!/* */ -!/* ------------------------------------------------------------------------- */ - -#if 1 -#define Fenix_Init(_process_role, _comm, _new_comm, _argc, _argv, _num_of_spare_ranks, _spawn, _info, _error) \ - jb \ - call Fenix_Preinit(_process_role, _comm, _new_comm, _argc, _argv, _spare_ranks, _spawn, _info, _error); \ - if(setjmp(jb) .ne. 0) then; \ - _process_status = 2; \ - endif; \ - call Fenix_Postinit( error ); - -#endif - -#endif - - diff --git a/include/fenix_process_recovery_global.h b/include/fenix_init.h similarity index 84% rename from include/fenix_process_recovery_global.h rename to include/fenix_init.h index 4116369..c4ca69b 100644 --- a/include/fenix_process_recovery_global.h +++ b/include/fenix_init.h @@ -44,7 +44,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Author Marc Gamell, Eric Valenzuela, Keita Teranishi, Manish Parashar +// Author Marc Gamell, Eric Valenzuela, Keita Teranishi, Manish Parashar, // Rob Van der Wijngaart, Michael Heroux, and Matthew Whitlock // // Questions? Contact Keita Teranishi (knteran@sandia.gov) and @@ -53,23 +53,24 @@ // ************************************************************************ //@HEADER */ -#ifndef __FENIX_PROCES_RECOVERY_GLOBAL_H__ -#define __FENIX_PROCES_RECOVERY_GLOBAL_H__ + +#ifndef __FENIX_INIT__ +#define __FENIX_INIT__ #include #include -#include -#include -#include -#include -#include -#include -#include "fenix_opt.h" -#include "fenix_util.h" -#include "fenix_data_group.h" +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + +int __fenix_preinit(int *, MPI_Comm, MPI_Comm *, int *, char ***, int, int, MPI_Info, int *, jmp_buf *); + +void __fenix_postinit(int *); -/* This header file is intended to provide global variable definitions for fenix_process_recovery.c only */ +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif -#endif // __FENIX_PROCES_RECOVERY_GLOBAL_H__ +#endif diff --git a/include/fenix_opt.h b/include/fenix_opt.hpp similarity index 100% rename from include/fenix_opt.h rename to include/fenix_opt.hpp diff --git a/include/fenix_process_recovery.h b/include/fenix_process_recovery.hpp similarity index 96% rename from include/fenix_process_recovery.h rename to include/fenix_process_recovery.hpp index 9b85e04..1132992 100644 --- a/include/fenix_process_recovery.h +++ b/include/fenix_process_recovery.hpp @@ -66,6 +66,8 @@ #include #include +#include "fenix_init.h" + #define __FENIX_RESUME_AT_INIT 0 #define __FENIX_RESUME_NO_JUMP 200 @@ -92,8 +94,6 @@ typedef struct { fenix_comm_list_elm_t *tail; } fenix_comm_list_t; -int __fenix_preinit(int *, MPI_Comm, MPI_Comm *, int *, char ***, int, int, MPI_Info, int *, jmp_buf *); - int __fenix_create_new_world(); int __fenix_repair_ranks(); @@ -116,8 +116,6 @@ int __fenix_get_rank_role(); void __fenix_set_rank_role(int FenixRankRole); -void __fenix_postinit(int *); - int __fenix_detect_failures(int do_recovery); void __fenix_finalize(); diff --git a/include/fenix_util.h b/include/fenix_util.hpp similarity index 99% rename from include/fenix_util.h rename to include/fenix_util.hpp index 8f76275..a42d4c3 100644 --- a/include/fenix_util.h +++ b/include/fenix_util.hpp @@ -57,7 +57,7 @@ #ifndef __FENIX_UTIL__ #define __FENIX_UTIL__ -#include "fenix_process_recovery.h" +#include "fenix_process_recovery.hpp" #include #include #include diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7c823fd..4764c7b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -12,28 +12,26 @@ configure_file (${CMAKE_SOURCE_DIR}/include/fenix-config.h.in "${CMAKE_CURRENT_BINARY_DIR}/fenix-config.h" @ONLY) #include_directories(${CMAKE_CURRENT_BINARY_DIR}) -FILE(GLOB Fenix_HEADERS ${CMAKE_SOURCE_DIR}/include/*.h) +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_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_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 98% rename from src/fenix.c rename to src/fenix.cpp index 056814a..525f57d 100644 --- a/src/fenix.c +++ b/src/fenix.cpp @@ -54,10 +54,10 @@ //@HEADER */ -#include "fenix_data_recovery.h" -#include "fenix_process_recovery.h" -#include "fenix_util.h" -#include "fenix_ext.h" +#include "fenix_data_recovery.hpp" +#include "fenix_process_recovery.hpp" +#include "fenix_util.hpp" +#include "fenix_ext.hpp" #include "fenix.h" const Fenix_Data_subset FENIX_DATA_SUBSET_FULL = {0, NULL, NULL, NULL, 0, __FENIX_SUBSET_FULL}; @@ -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 91% rename from src/fenix_callbacks.c rename to src/fenix_callbacks.cpp index 8779402..400535e 100644 --- a/src/fenix_callbacks.c +++ b/src/fenix_callbacks.cpp @@ -56,13 +56,12 @@ #include -#include "fenix_comm_list.h" -#include "fenix_ext.h" -#include "fenix_process_recovery.h" -#include "fenix_data_group.h" -#include "fenix_data_recovery.h" -#include "fenix_opt.h" -#include "fenix_util.h" +#include "fenix_ext.hpp" +#include "fenix_process_recovery.hpp" +#include "fenix_data_group.hpp" +#include "fenix_data_recovery.hpp" +#include "fenix_opt.hpp" +#include "fenix_util.hpp" #include @@ -70,7 +69,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 +104,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.c deleted file mode 100644 index d1b56d2..0000000 --- a/src/fenix_comm_list.c +++ /dev/null @@ -1,138 +0,0 @@ -/* -//@HEADER -// ************************************************************************ -// -// -// _|_|_|_| _|_|_|_| _| _| _|_|_| _| _| -// _| _| _|_| _| _| _| _| -// _|_|_| _|_|_| _| _| _| _| _| -// _| _| _| _|_| _| _| _| -// _| _|_|_|_| _| _| _|_|_| _| _| -// -// -// -// -// Copyright (C) 2016 Rutgers University and Sandia Corporation -// -// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -// the U.S. Government retains certain rights in this software. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author Marc Gamell, Eric Valenzuela, Keita Teranishi, Manish Parashar, -// Rob Van der Wijngaart, Michael Heroux, and Matthew Whitlock -// -// Questions? Contact Keita Teranishi (knteran@sandia.gov) and -// Marc Gamell (mgamell@cac.rutgers.edu) -// -// ************************************************************************ -//@HEADER -*/ - -#include -#include -#include -#include -#include - -fenix_comm_list_t my_list = {NULL, NULL}; - -int __fenix_comm_push(MPI_Comm *comm) { - fenix_comm_list_elm_t *current = (fenix_comm_list_elm_t *) malloc(sizeof(fenix_comm_list_elm_t)); - if (!current) return 0; - current->next = NULL; - current->comm = comm; - if (!my_list.tail) { - /* if list was empty, initialize head and tail */ - current->prev = NULL; - my_list.head = my_list.tail = current; - } - else { - /* if list was not empty, add element to the head of the list */ - current->prev = my_list.head; - my_list.head->next = current; - my_list.head = current; - } - return FENIX_SUCCESS; -} - -int __fenix_comm_delete(MPI_Comm *comm) { - - fenix_comm_list_elm_t *current = my_list.tail; - while (current) { - if (*(current->comm) == *comm) { - if (current != my_list.head && current != my_list.tail) { - current->prev->next = current->next; - current->next->prev = current->prev; - } - else if (current == my_list.tail) { - if (current->next) { - current->next->prev = NULL; - my_list.tail = current->next; - } - else my_list.tail = my_list.head = NULL; - } - else { - if (current->prev) { - current->prev->next = NULL; - my_list.head = current->prev; - } - else my_list.tail = my_list.head = NULL; - } - MPIX_Comm_revoke(*comm); - PMPI_Comm_free(comm); - free(current); - return 1; - } - else current = current->next; - } - /* if we end up here, the requested communicator has not been found */ - return 0; -} - - -void __fenix_comm_list_destroy(void) { - if (my_list.tail == NULL) { - return; - } - else { - fenix_comm_list_elm_t *current = my_list.tail; - while (current->next) { - fenix_comm_list_elm_t *new = current->next; - MPIX_Comm_revoke(*current->comm); - PMPI_Comm_free(current->comm); - free(current); - current = new; - } - MPIX_Comm_revoke(*current->comm); - PMPI_Comm_free(current->comm); - free(current); - } - my_list.tail = my_list.head = NULL; -} - diff --git a/src/fenix_data_group.c b/src/fenix_data_group.cpp similarity index 98% rename from src/fenix_data_group.c rename to src/fenix_data_group.cpp index ad453aa..1d9e5ff 100644 --- a/src/fenix_data_group.c +++ b/src/fenix_data_group.cpp @@ -56,10 +56,10 @@ #include "mpi.h" #include "fenix-config.h" -#include "fenix_ext.h" -#include "fenix_data_group.h" -#include "fenix_data_member.h" -#include "fenix_data_packet.h" +#include "fenix_ext.hpp" +#include "fenix_data_group.hpp" +#include "fenix_data_member.hpp" +#include "fenix_data_packet.hpp" diff --git a/src/fenix_data_member.c b/src/fenix_data_member.cpp similarity index 98% rename from src/fenix_data_member.c rename to src/fenix_data_member.cpp index 3d9d60d..7971d85 100644 --- a/src/fenix_data_member.c +++ b/src/fenix_data_member.cpp @@ -56,10 +56,10 @@ #include "mpi.h" #include "fenix-config.h" -#include "fenix_ext.h" -#include "fenix_data_recovery.h" -#include "fenix_data_member.h" -#include "fenix_data_packet.h" +#include "fenix_ext.hpp" +#include "fenix_data_recovery.hpp" +#include "fenix_data_member.hpp" +#include "fenix_data_packet.hpp" /** diff --git a/src/fenix_data_policy.c b/src/fenix_data_policy.cpp similarity index 95% rename from src/fenix_data_policy.c rename to src/fenix_data_policy.cpp index 603aff1..903bf54 100644 --- a/src/fenix_data_policy.c +++ b/src/fenix_data_policy.cpp @@ -55,11 +55,10 @@ */ #include -#include "fenix_data_policy_in_memory_raid.h" -#include "fenix_data_policy.h" -#include "fenix_data_group.h" -#include "fenix_opt.h" -#include "fenix_ext.h" +#include "fenix_data_policy_in_memory_raid.hpp" +#include "fenix_data_policy.hpp" +#include "fenix_data_group.hpp" +#include "fenix_opt.hpp" #include "fenix.h" /** 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 897f163..70e0d1b 100644 --- a/src/fenix_data_policy_in_memory_raid.c +++ b/src/fenix_data_policy_in_memory_raid.cpp @@ -56,13 +56,13 @@ #include #include "fenix.h" -#include "fenix_ext.h" -#include "fenix_opt.h" +#include "fenix_ext.hpp" +#include "fenix_opt.hpp" #include "fenix_data_subset.h" -#include "fenix_data_recovery.h" -#include "fenix_data_policy.h" -#include "fenix_data_group.h" -#include "fenix_data_member.h" +#include "fenix_data_recovery.hpp" +#include "fenix_data_policy.hpp" +#include "fenix_data_group.hpp" +#include "fenix_data_member.hpp" #define __FENIX_IMR_DEFAULT_MENTRY_NUM 10 #define __FENIX_IMR_NO_MEMBERS 16000 @@ -846,7 +846,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 99% rename from src/fenix_data_recovery.c rename to src/fenix_data_recovery.cpp index 0fba896..914d1b0 100644 --- a/src/fenix_data_recovery.c +++ b/src/fenix_data_recovery.cpp @@ -56,12 +56,11 @@ -#include "fenix_data_recovery.h" -#include "fenix_data_policy.h" -#include "fenix_opt.h" -//#include "fenix_process_recovery.h" -#include "fenix_util.h" -#include "fenix_ext.h" +#include "fenix_data_recovery.hpp" +#include "fenix_data_policy.hpp" +#include "fenix_opt.hpp" +#include "fenix_util.hpp" +#include "fenix_ext.hpp" #include diff --git a/src/fenix_data_subset.c b/src/fenix_data_subset.cpp similarity index 99% rename from src/fenix_data_subset.c rename to src/fenix_data_subset.cpp index ffbb864..430fc1e 100644 --- a/src/fenix_data_subset.c +++ b/src/fenix_data_subset.cpp @@ -55,8 +55,9 @@ */ #include "mpi.h" -#include "fenix-config.h" -#include "fenix_ext.h" +#include "fenix.h" +#include "fenix_opt.hpp" +#include "fenix_util.hpp" #include "fenix_data_subset.h" diff --git a/src/fenix_mpi_override.c b/src/fenix_mpi_override.c deleted file mode 100644 index 3761348..0000000 --- a/src/fenix_mpi_override.c +++ /dev/null @@ -1,76 +0,0 @@ -/* -//@HEADER -// ************************************************************************ -// -// -// _|_|_|_| _|_|_|_| _| _| _|_|_| _| _| -// _| _| _|_| _| _| _| _| -// _|_|_| _|_|_| _| _| _| _| _| -// _| _| _| _|_| _| _| _| -// _| _|_|_|_| _| _| _|_|_| _| _| -// -// -// -// -// Copyright (C) 2016 Rutgers University and Sandia Corporation -// -// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -// the U.S. Government retains certain rights in this software. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author Marc Gamell, Eric Valenzuela, Keita Teranishi, Manish Parashar, -// Rob Van der Wijngaart, Michael Heroux, and Matthew Whitlock -// -// Questions? Contact Keita Teranishi (knteran@sandia.gov) and -// Marc Gamell (mgamell@cac.rutgers.edu) -// -// ************************************************************************ -//@HEADER -*/ -#include "fenix_process_recovery.h" -#include "fenix_comm_list.h" -#include -#include -#include "fenix_ext.h" - -static inline -int __fenix_notify_newcomm(int ret, MPI_Comm *newcomm) -{ - if (ret != MPI_SUCCESS || - !fenix.fenix_init_flag || - *newcomm == MPI_COMM_NULL) return ret; - - if (__fenix_comm_push(newcomm) != FENIX_SUCCESS) { - fprintf(stderr, "[fenix error] Did not manage to push communicator\n"); - PMPI_Comm_free(newcomm); - ret = MPI_ERR_INTERN; - } - - return ret; -} diff --git a/src/fenix_opt.c b/src/fenix_opt.cpp similarity index 97% rename from src/fenix_opt.c rename to src/fenix_opt.cpp index f6f6fac..5a44298 100644 --- a/src/fenix_opt.c +++ b/src/fenix_opt.cpp @@ -56,9 +56,9 @@ #include #include -#include "fenix_opt.h" -#include "fenix_util.h" -#include "fenix_ext.h" +#include "fenix_opt.hpp" +#include "fenix_util.hpp" +#include "fenix_ext.hpp" #define DEBUG 1 diff --git a/src/fenix_process_recovery.c b/src/fenix_process_recovery.cpp similarity index 98% rename from src/fenix_process_recovery.c rename to src/fenix_process_recovery.cpp index 6a65820..18d7fea 100644 --- a/src/fenix_process_recovery.c +++ b/src/fenix_process_recovery.cpp @@ -56,14 +56,12 @@ #include -#include "fenix_ext.h" -#include "fenix_comm_list.h" -#include "fenix_process_recovery_global.h" -#include "fenix_process_recovery.h" -#include "fenix_data_group.h" -#include "fenix_data_recovery.h" -#include "fenix_opt.h" -#include "fenix_util.h" +#include "fenix_ext.hpp" +#include "fenix_process_recovery.hpp" +#include "fenix_data_group.hpp" +#include "fenix_data_recovery.hpp" +#include "fenix_opt.hpp" +#include "fenix_util.hpp" #include #include @@ -83,7 +81,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 +657,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++) { @@ -856,13 +854,9 @@ void __fenix_test_MPI(MPI_Comm *pcomm, int *pret, ...) if(fenix.user_world_exists) MPIX_Comm_revoke(*fenix.user_world); - __fenix_comm_list_destroy(); - fenix.repair_result = __fenix_repair_ranks(); break; case MPI_ERR_REVOKED: - __fenix_comm_list_destroy(); - fenix.repair_result = __fenix_repair_ranks(); break; case MPI_ERR_INTERN: diff --git a/src/fenix_util.c b/src/fenix_util.cpp similarity index 98% rename from src/fenix_util.c rename to src/fenix_util.cpp index b56d237..246ea3f 100644 --- a/src/fenix_util.c +++ b/src/fenix_util.cpp @@ -54,9 +54,9 @@ //@HEADER */ -#include "fenix_opt.h" -#include "fenix_process_recovery.h" -#include "fenix_util.h" +#include "fenix_opt.hpp" +#include "fenix_process_recovery.hpp" +#include "fenix_util.hpp" char* logname; diff --git a/src/globals.c b/src/globals.cpp similarity index 99% rename from src/globals.c rename to src/globals.cpp index e812a08..8285983 100644 --- a/src/globals.c +++ b/src/globals.cpp @@ -54,7 +54,7 @@ //@HEADER */ -#include "fenix_ext.h" +#include "fenix_ext.hpp" fenix_t fenix = { .fenix_init_flag = 0 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/failed_spares/fenix_failed_spares.c b/test/failed_spares/fenix_failed_spares.c index bea1dd7..6b202aa 100644 --- a/test/failed_spares/fenix_failed_spares.c +++ b/test/failed_spares/fenix_failed_spares.c @@ -61,6 +61,7 @@ #include #include #include +#include const int kKillID = 1; 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/issend/fenix_issend_test.c b/test/issend/fenix_issend_test.c index 0159297..212a7ae 100644 --- a/test/issend/fenix_issend_test.c +++ b/test/issend/fenix_issend_test.c @@ -61,6 +61,7 @@ #include #include #include +#include const int kKillID = 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/no_jump/fenix_no_jump_test.c b/test/no_jump/fenix_no_jump_test.c index 82187a3..31eb9f3 100644 --- a/test/no_jump/fenix_no_jump_test.c +++ b/test/no_jump/fenix_no_jump_test.c @@ -61,6 +61,7 @@ #include #include #include +#include const int kKillID = 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_cancelled/fenix_req_cancelled_test.c b/test/request_cancelled/fenix_req_cancelled_test.c index 3d7c89a..554f7f4 100644 --- a/test/request_cancelled/fenix_req_cancelled_test.c +++ b/test/request_cancelled/fenix_req_cancelled_test.c @@ -60,6 +60,7 @@ #include #include #include +#include const int kKillID = 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}) diff --git a/test/request_tracking/fenix_request_tracking_test.c b/test/request_tracking/fenix_request_tracking_test.c index f279e01..ae0dc11 100644 --- a/test/request_tracking/fenix_request_tracking_test.c +++ b/test/request_tracking/fenix_request_tracking_test.c @@ -4,6 +4,7 @@ #include #include #include //for memcpy +#include #ifndef RTT_NO_FENIX #include diff --git a/test/subset_internal/fenix_subset_internal_test.c b/test/subset_internal/fenix_subset_internal_test.c index 5dab905..3e797ed 100644 --- a/test/subset_internal/fenix_subset_internal_test.c +++ b/test/subset_internal/fenix_subset_internal_test.c @@ -56,7 +56,6 @@ */ #include -#include // Never called explicitly by the users #include #include #include