Traveling Salesman
From Bootable Cluster CD
- Creating a machine file for your group
- Run the
bccd-joingroup groupnamecommand with a unique group name on each node in a group. Be sure to run the command on only one machine at a time. This will create a machinefile calledgroupnameon each machine in the lab.
- Run the
- Running the traveling salesman program
- cd into the
traveling_salesdirectory, and execute amakecommand. - Push the code to each machine in the group using
bccd-syncdir ~/traveling_sales ~/groupname. Note the directory which the code is sync'd into. -
cdto the /tmp/ directory in which the code has been sync'd. - Run the code using the
mpiruncommand, which has the syntax:
- cd into the
mpirun -np <numprocesses> -machinefile <groupfile> ./travel <num_cities> \ <num_neighborhoods> <num_outer_trials> <num_inner_trials> <temperature> \ <cooling_factor> <do_display> <do_print_output>
num_neighborhoods is either -1 for a regular polygon, 1, 2, or 4; do_display and do_print are either 1 or 0. Defaults are 500, 1, 1000000, 10, 1.0, 0.999, 1, and 0

