#include "gb_common.h" #include "gb_spi.h" #include #include #include #include #include #include "mpi.h" /* PROVIDES THE BASIC MPI DEFINITION AND TYPES */ #define STORED 2 void setup_gpio() { INP_GPIO(8); SET_GPIO_ALT(8,0); INP_GPIO(9); SET_GPIO_ALT(9,0); INP_GPIO(10); SET_GPIO_ALT(10,0); INP_GPIO(11); SET_GPIO_ALT(11,0); } // setup_gpio int main(int argc, char **argv) { int my_rank; int partner; int namelen; int size, i,t; int j=0; char greeting[100]; char processor_name[MPI_MAX_PROCESSOR_NAME]; MPI_Status stat; printf("I can normally get here!\n"); // /dev/mem error happens after this point setup_io(); // /dev/mem seems to be called inside here! printf("Could you get past setup_io()? I couldn't.\n"); setup_gpio(); setup_spi(); printf("Setup of normal things done\n"); MPI_Init(&argc, &argv); /*START MPI */ MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); /*DETERMINE RANK OF THIS PROCESSOR*/ MPI_Comm_size(MPI_COMM_WORLD, &size); /*DETERMINE TOTAL NUMBER OF PROCESSORS*/ MPI_Get_processor_name(processor_name,&namelen); printf("Ready to begin.\n"); getchar(); for(i=0;i