Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ test/request_tracking/fenix_request_tracking_test
test/request_tracking/fenix_request_tracking_test_nofenix
build/
install/
spack-*

# Other
*~
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion include/fenix.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
11 changes: 7 additions & 4 deletions include/fenix_data_group.h → include/fenix_data_group.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,21 @@
#ifndef __FENIX_DATA_GROUP_H__
#define __FENIX_DATA_GROUP_H__

#include <vector>

#include <mpi.h>
#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

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);
Expand Down Expand Up @@ -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 );

Expand Down
4 changes: 2 additions & 2 deletions include/fenix_data_member.h → include/fenix_data_member.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
#define __FENIX_DATA_MEMBER_H__

#include <mpi.h>
#include "fenix_data_packet.h"
#include "fenix_util.h"
#include "fenix_data_packet.hpp"
#include "fenix_util.hpp"


#define __FENIX_DEFAULT_MEMBER_SIZE 512
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

#include <mpi.h>
#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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
#define __FENIX_DATA_POLICY_IN_MEMORY_RAID_H__

#include <mpi.h>
#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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <mpi.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down
7 changes: 3 additions & 4 deletions include/fenix_ext.h → include/fenix_ext.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@

#include <mpi.h>
#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
Expand All @@ -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
Expand Down
82 changes: 0 additions & 82 deletions include/fenix_f.h

This file was deleted.

29 changes: 15 additions & 14 deletions include/fenix_process_recovery_global.h → include/fenix_init.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 ([email protected]) and
Expand All @@ -53,23 +53,24 @@
// ************************************************************************
//@HEADER
*/
#ifndef __FENIX_PROCES_RECOVERY_GLOBAL_H__
#define __FENIX_PROCES_RECOVERY_GLOBAL_H__

#ifndef __FENIX_INIT__
#define __FENIX_INIT__

#include <mpi.h>
#include <setjmp.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdint.h>
#include <signal.h>

#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
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
#include <stdint.h>
#include <signal.h>

#include "fenix_init.h"

#define __FENIX_RESUME_AT_INIT 0
#define __FENIX_RESUME_NO_JUMP 200

Expand All @@ -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();
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion include/fenix_util.h → include/fenix_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
#ifndef __FENIX_UTIL__
#define __FENIX_UTIL__

#include "fenix_process_recovery.h"
#include "fenix_process_recovery.hpp"
#include <mpi.h>
#include <syslog.h>
#include <sys/types.h>
Expand Down
30 changes: 14 additions & 16 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/fenix.c → src/fenix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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) {
Expand Down
17 changes: 8 additions & 9 deletions src/fenix_callbacks.c → src/fenix_callbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,20 @@

#include <assert.h>

#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 <mpi.h>


int __fenix_callback_register(void (*recover)(MPI_Comm, int, void *), void *callback_data)
{
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);
Expand Down Expand Up @@ -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;
Expand Down
Loading