/******************************************************************** Author: Dana Vrajitoru, IUSB, CS Class: B424 B524 Parallel Programming File name: main.cc Last updated: November 2020 Description: A program that generates an ideal playlist. It starts with a list of songs and uses attributes of these songs to determine how similar the songs are to each other. Then it finds out a permutation of the songs that maximize the closeness of each song in the playlist and the next. Equivalent to the Travelling Salesman problem. *********************************************************************/ #include #include #include using namespace std; #include "process.h" #include int main(int argc, char **argv) { int my_id, nr_proc; int n = 0; const int source_proc = 2; char song[50]; float att1, att2; // Initialize MPI MPI_Init (&argc, &argv); // Get the rank of this process MPI_Comm_rank (MPI_COMM_WORLD, &my_id); // Get number of processes MPI_Comm_size (MPI_COMM_WORLD, &nr_proc); srand(time(NULL)); if (my_id == 0) Master(nr_proc); else Worker(my_id); // Finalize MPI MPI_Finalize (); return 0; }