Skip to content

Commit 96fdd6d

Browse files
Initial conversion to C++
1 parent 6e7b2d9 commit 96fdd6d

23 files changed

+44
-29
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ test/request_tracking/fenix_request_tracking_test
4141
test/request_tracking/fenix_request_tracking_test_nofenix
4242
build/
4343
install/
44+
spack-*
4445

4546
# Other
4647
*~

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
cmake_minimum_required(VERSION 3.10.2)
1212

13-
project(Fenix C)
13+
project(Fenix C CXX)
1414
# The version number.
1515
set(FENIX_VERSION_MAJOR 1)
1616
set(FENIX_VERSION_MINOR 0)

src/CMakeLists.txt

+15-15
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,25 @@ configure_file (${CMAKE_SOURCE_DIR}/include/fenix-config.h.in
1515
FILE(GLOB Fenix_HEADERS ${CMAKE_SOURCE_DIR}/include/*.h)
1616

1717
set (Fenix_SOURCES
18-
fenix.c
19-
fenix_mpi_override.c
20-
fenix_opt.c
21-
fenix_process_recovery.c
22-
fenix_util.c
23-
fenix_data_recovery.c
24-
fenix_data_group.c
25-
fenix_data_policy.c
26-
fenix_data_policy_in_memory_raid.c
27-
fenix_data_member.c
28-
fenix_data_subset.c
29-
fenix_comm_list.c
30-
fenix_callbacks.c
31-
globals.c
18+
fenix.cpp
19+
fenix_mpi_override.cpp
20+
fenix_opt.cpp
21+
fenix_process_recovery.cpp
22+
fenix_util.cpp
23+
fenix_data_recovery.cpp
24+
fenix_data_group.cpp
25+
fenix_data_policy.cpp
26+
fenix_data_policy_in_memory_raid.cpp
27+
fenix_data_member.cpp
28+
fenix_data_subset.cpp
29+
fenix_comm_list.cpp
30+
fenix_callbacks.cpp
31+
globals.cpp
3232
)
3333

3434
add_library( fenix STATIC ${Fenix_SOURCES})
3535

36-
target_link_libraries(fenix PUBLIC MPI::MPI_C)
36+
target_link_libraries(fenix PUBLIC MPI::MPI_CXX)
3737

3838
target_include_directories(fenix
3939
PUBLIC

src/fenix.c renamed to src/fenix.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ int Fenix_Data_member_create( int group_id, int member_id, void *buffer, int cou
9191
}
9292

9393
int Fenix_Data_group_get_redundancy_policy( int group_id, int* policy_name, void *policy_value, int *flag ) {
94-
return __fenix_group_get_redundancy_policy( group_id, policy_name, policy_value, flag );
94+
return __fenix_group_get_redundancy_policy( group_id, policy_name, (int*)policy_value, flag );
9595
}
9696

9797
int Fenix_Data_wait(Fenix_Request request) {

src/fenix_callbacks.c renamed to src/fenix_callbacks.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ int __fenix_callback_register(void (*recover)(MPI_Comm, int, void *), void *call
7070
{
7171
int error_code = FENIX_SUCCESS;
7272
if (fenix.fenix_init_flag) {
73-
fenix_callback_func *fp = s_malloc(sizeof(fenix_callback_func));
73+
fenix_callback_func *fp = (fenix_callback_func *) s_malloc(sizeof(fenix_callback_func));
7474
fp->x = recover;
7575
fp->y = callback_data;
7676
__fenix_callback_push( &fenix.callback_list, fp);
@@ -105,7 +105,7 @@ void __fenix_callback_invoke_all(int error)
105105

106106
void __fenix_callback_push(fenix_callback_list_t **head, fenix_callback_func *fp)
107107
{
108-
fenix_callback_list_t *callback = malloc(sizeof(fenix_callback_list_t));
108+
fenix_callback_list_t *callback = (fenix_callback_list_t *) malloc(sizeof(fenix_callback_list_t));
109109
callback->callback = fp;
110110
callback->next = *head;
111111
*head = callback;

src/fenix_comm_list.c renamed to src/fenix_comm_list.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,11 @@ void __fenix_comm_list_destroy(void) {
123123
else {
124124
fenix_comm_list_elm_t *current = my_list.tail;
125125
while (current->next) {
126-
fenix_comm_list_elm_t *new = current->next;
126+
fenix_comm_list_elm_t *next = current->next;
127127
MPIX_Comm_revoke(*current->comm);
128128
PMPI_Comm_free(current->comm);
129129
free(current);
130-
current = new;
130+
current = next;
131131
}
132132
MPIX_Comm_revoke(*current->comm);
133133
PMPI_Comm_free(current->comm);
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/fenix_data_policy_in_memory_raid.c renamed to src/fenix_data_policy_in_memory_raid.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ int __imr_member_restore(fenix_group_t* g, int member_id,
844844
if(recovery_locally_possible) retval = FENIX_SUCCESS;
845845

846846
} else if (group->raid_mode == 5){
847-
int* set_results = malloc(sizeof(int) * group->set_size);
847+
int* set_results = (int *) malloc(sizeof(int) * group->set_size);
848848
MPI_Allgather((void*)&found_member, 1, MPI_INT, (void*)set_results, 1, MPI_INT,
849849
group->set_comm);
850850

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/fenix_process_recovery.c renamed to src/fenix_process_recovery.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ int __fenix_preinit(int *role, MPI_Comm comm, MPI_Comm *new_comm, int *argc, cha
8383

8484
MPI_Comm_create_errhandler(__fenix_test_MPI, &fenix.mpi_errhandler);
8585

86-
fenix.world = malloc(sizeof(MPI_Comm));
86+
fenix.world = (MPI_Comm *)malloc(sizeof(MPI_Comm));
8787
MPI_Comm_dup(comm, fenix.world);
8888
PMPI_Comm_set_errhandler(*fenix.world, fenix.mpi_errhandler);
8989

@@ -659,7 +659,7 @@ int* __fenix_get_fail_ranks(int *survivor_world, int survivor_world_size, int fa
659659
qsort(survivor_world, survivor_world_size, sizeof(int), __fenix_comparator);
660660
int failed_pos = 0;
661661

662-
int *fail_ranks = calloc(fail_world_size, sizeof(int));
662+
int *fail_ranks = (int *)calloc(fail_world_size, sizeof(int));
663663

664664
int i;
665665
for (i = 0; i < survivor_world_size + fail_world_size; i++) {
File renamed without changes.
File renamed without changes.

test/failed_spares/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#
1010

1111
add_executable(fenix_failed_spares fenix_failed_spares.c)
12-
target_link_libraries(fenix_failed_spares fenix MPI::MPI_C)
12+
target_link_libraries(fenix_failed_spares fenix MPI::MPI_CXX)
1313

1414
add_test(NAME failed_spares
1515
COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} 6 ${MPIEXEC_PREFLAGS} fenix_failed_spares ${MPIEXEC_POSTFLAGS} 3 1 3 4 )

test/issend/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
#
1010

1111
add_executable(fenix_issend_test fenix_issend_test.c)
12-
target_link_libraries(fenix_issend_test fenix MPI::MPI_C)
12+
target_link_libraries(fenix_issend_test fenix MPI::MPI_CXX)
1313

1414
add_test(NAME issend COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} 5 ${MPIEXEC_PREFLAGS} fenix_issend_test ${MPIEXEC_POSTFLAGS} "1")

test/message_replay/CMakeLists.txt

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#
2+
# This file is part of Fenix
3+
# Copyright (c) 2016 Rutgers University and Sandia Corporation.
4+
# This software is distributed under the BSD License.
5+
# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
6+
# the U.S. Government retains certain rights in this software.
7+
# For more information, see the LICENSE file in the top Fenix
8+
# directory.
9+
#
10+
11+
add_executable(fenix_message_logging_test fenix_message_logging_test.cxx)
12+
target_link_libraries(fenix_message_logging_test fenix MPI::MPI_CXX)
13+
14+
add_test(NAME request_cancelled COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} 5 ${MPIEXEC_PREFLAGS} fenix_message_logging_test ${MPIEXEC_POSTFLAGS} "1")

test/no_jump/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
#
1010

1111
add_executable(fenix_no_jump_test fenix_no_jump_test.c)
12-
target_link_libraries(fenix_no_jump_test fenix MPI::MPI_C)
12+
target_link_libraries(fenix_no_jump_test fenix MPI::MPI_CXX)
1313

1414
add_test(NAME no_jump COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} 5 ${MPIEXEC_PREFLAGS} fenix_no_jump_test ${MPIEXEC_POSTFLAGS} "1")

test/request_cancelled/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
#
1010

1111
add_executable(fenix_request_cancelled_test fenix_req_cancelled_test.c)
12-
target_link_libraries(fenix_request_cancelled_test fenix MPI::MPI_C)
12+
target_link_libraries(fenix_request_cancelled_test fenix MPI::MPI_CXX)
1313

1414
add_test(NAME request_cancelled COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} 5 ${MPIEXEC_PREFLAGS} fenix_request_cancelled_test ${MPIEXEC_POSTFLAGS} "1")

test/request_tracking/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#
1010

1111
add_executable(fenix_request_tracking_test fenix_request_tracking_test.c)
12-
target_link_libraries(fenix_request_tracking_test fenix MPI::MPI_C)
12+
target_link_libraries(fenix_request_tracking_test fenix MPI::MPI_CXX)
1313

1414
add_test(NAME request_tracking
1515
COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} 3 ${MPIEXEC_PREFLAGS} fenix_request_tracking_test ${MPIEXEC_POSTFLAGS})

0 commit comments

Comments
 (0)