Traveling Salesman

From Bootable Cluster CD

  • Creating a machine file for your group
    • Run the bccd-joingroup groupname command 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 called groupname on each machine in the lab.
  • Running the traveling salesman program
    • cd into the traveling_sales directory, and execute a make command.
    • 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.
    • cd to the /tmp/ directory in which the code has been sync'd.
    • Run the code using the mpirun command, which has the syntax:
  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

Personal tools