how to parallel programming in device driver module
/home/wonder/layer/hello.c:608:5: error: implicit declaration of function ‘MPI_Init’ [-Werror=implicit-function-declaration]
/home/wonder/layer/hello.c:609:5: error: implicit declaration of function ‘MPI_Comm_rank’ [-Werror=implicit-function-declaration]
/home/wonder/layer/hello.c:609:26: error: ‘MPI_COMM_WORLD’ undeclared (first use in this function)
/home/wonder/layer/hello.c:609:26: note: each undeclared identifier is reported only once for each function it appears in
/home/wonder/layer/hello.c:610:5: error: implicit declaration of function ‘MPI_Comm_size’ [-Werror=implicit-function-declaration]
/home/wonder/layer/hello.c:615:5: error: implicit declaration of function ‘MPI_Finalize’ [-Werror=implicit-function-declaration]
can not use normal functions after include <linux/mpi.h>
Code:
int my_id = 0;
int num_procs = 0;
int ierr = MPI_Init(2, 0);
ierr = MPI_Comm_rank(MPI_COMM_WORLD, &my_id);
ierr = MPI_Comm_size(MPI_COMM_WORLD, &num_procs);
if(my_id == 0){
}
else if(my_id == 1){
}
ierr = MPI_Finalize();
Bookmarks