Skip to content

Commit

Permalink
load spakc environnement with kokkos
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-saigre committed Jan 23, 2025
1 parent 64d5929 commit bf22fa9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
-
name: Build
run: |
spack load kokkos

This comment has been minimized.

Copy link
@thomas-saigre

thomas-saigre Jan 23, 2025

Author Collaborator

fix #14

spacktivate feelpp-openmpi4-kokkos
cmake --preset default
cmake --build --preset default
-
Expand Down
1 change: 0 additions & 1 deletion docs/modules/kokkos/examples/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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 )
Expand Down
4 changes: 2 additions & 2 deletions src/MPI/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -60,4 +60,4 @@ foreach (myfile ${WFOPenMP_SRC})
#endif()
endforeach (file ${WFOPenMP_SRC})

########### end ####################################
########### end ####################################
10 changes: 5 additions & 5 deletions src/MPI/MPI_Philosophers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -16,7 +16,7 @@ void philosopher(int rank)
int leftChopstick;
int rightChopstick;
int dummy;

if(rank == NUM_PHILOSOPHERS)
{

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

0 comments on commit bf22fa9

Please sign in to comment.