Am a newbie to PARALLEL VERSION USING MPI , I need to convert the code below to parallel version using mpi.
-
/* TEST WITH THE FOLLOWING PROBLEM 1 inputs: infinity:999 no. of cities: 4 no. of paths:6 PROBLEM 2 inputs: infinity:999 no. of cities: 5 no. of paths:10 */ #include #define ALL -1 #define MAXCITIES 10 enum BOOL{FALSE,TRUE}; long*visited;//visited nodes set here long*min_circuit;//min inner circuit for given node as start node at position indexed 0 long*ham_circuit;//optimal circuit with length stored at position indexed 0 long min_circuit_length;//min circuit lenth for given start node int n;//city count long matrix[MAXCITIES][MAXCITIES];//nondirectional nXn symmetric matrix //to store path distances as sourceXdestination long INFI;// INFINITY value to be defined by user // function resets minimum circuit for a given start node //with setting its id at index 0 and setting furthr node ids to -1 void reset_min_circuit(int s_v_id) { min_circuit[0]=s_v_id; for(int i=1;i
-
/* TEST WITH THE FOLLOWING PROBLEM 1 inputs: infinity:999 no. of cities: 4 no. of paths:6 PROBLEM 2 inputs: infinity:999 no. of cities: 5 no. of paths:10 */ #include #define ALL -1 #define MAXCITIES 10 enum BOOL{FALSE,TRUE}; long*visited;//visited nodes set here long*min_circuit;//min inner circuit for given node as start node at position indexed 0 long*ham_circuit;//optimal circuit with length stored at position indexed 0 long min_circuit_length;//min circuit lenth for given start node int n;//city count long matrix[MAXCITIES][MAXCITIES];//nondirectional nXn symmetric matrix //to store path distances as sourceXdestination long INFI;// INFINITY value to be defined by user // function resets minimum circuit for a given start node //with setting its id at index 0 and setting furthr node ids to -1 void reset_min_circuit(int s_v_id) { min_circuit[0]=s_v_id; for(int i=1;i