diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 13dc0c5..5c19561 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,7 @@ jobs: - name: Build run: | - spack load kokkos + spacktivate feelpp-openmpi4-kokkos cmake --preset default cmake --build --preset default - diff --git a/docs/modules/kokkos/examples/src/CMakeLists.txt b/docs/modules/kokkos/examples/src/CMakeLists.txt index 6405d69..1634830 100644 --- a/docs/modules/kokkos/examples/src/CMakeLists.txt +++ b/docs/modules/kokkos/examples/src/CMakeLists.txt @@ -1,6 +1,5 @@ cmake_minimum_required(VERSION 3.10) -project(KokkosExample) option(FEELPP_ENABLE_KOKKOS "Enable Kokkos support" ON) set(Kokkos_ENABLE_OPENMP ON ) diff --git a/src/MPI/CMakeLists.txt b/src/MPI/CMakeLists.txt index e73a7e7..065843f 100644 --- a/src/MPI/CMakeLists.txt +++ b/src/MPI/CMakeLists.txt @@ -1,7 +1,7 @@ #project(MPI_bcast) -######## A simple cmakelists.txt file for ... ############# +######## A simple cmakelists.txt file for ... ############# cmake_minimum_required(VERSION 3.17) #set(CMAKE_CXX_STANDARD 14) @@ -60,4 +60,4 @@ foreach (myfile ${WFOPenMP_SRC}) #endif() endforeach (file ${WFOPenMP_SRC}) -########### end #################################### +########### end #################################### diff --git a/src/MPI/MPI_Philosophers.c b/src/MPI/MPI_Philosophers.c index 1f8a09f..d6f6531 100755 --- a/src/MPI/MPI_Philosophers.c +++ b/src/MPI/MPI_Philosophers.c @@ -4,8 +4,8 @@ #define NUM_MESSAGES 3*NUM_PHILOSOPHERS*NUM_DINNERS -const int NUM_DINNERS; -const int NUM_PHILOSOPHERS; +int NUM_DINNERS; +int NUM_PHILOSOPHERS; const int NEED_LEFT_CHOPSTICK = 0; const int NEED_RIGHT_CHOPSTICK = 1; const int RELEASE_CHOPSTICKS = 2; @@ -16,7 +16,7 @@ void philosopher(int rank) int leftChopstick; int rightChopstick; int dummy; - + if(rank == NUM_PHILOSOPHERS) { @@ -46,7 +46,7 @@ void philosopher(int rank) printf("Philosopher %d is eating meal %d.\n", rank, i); MPI_Send(&dummy, 1, MPI_INT, 0, RELEASE_CHOPSTICKS, MPI_COMM_WORLD); - } + } } void server() @@ -221,7 +221,7 @@ int main(int argc, char ** argv) if(argc != 3) exit(0); - + sscanf(argv[1], "%d", &NUM_PHILOSOPHERS); printf("The number of philosophers is %d\n", NUM_PHILOSOPHERS); sscanf(argv[2], "%d", &NUM_DINNERS);