@machines = ('icsib78', 'samosa', 'icsib18');
@num_threads = (1..10);
@to_nodes = (0..2);
@iterations =  (10, 100, 500, 1000, 2000);
$program = "/u/borisv/Sather/Sather/System/Common/Brahma/myrinet_solaris/tests/test_threads";


foreach $num_thread (@num_threads) {
    foreach $to (@to_nodes) {
		  foreach $num_iter (@iterations) {
				foreach $machine ('icsib78', 'samosa') {
					 system("rsh $machine $program $to $num_iter $num_thread &");
					 print "rsh $machine $program $to $num_iter $num_thread \n";
					 sleep 3;
				};
				
				system("rsh icsib18 $program $to $num_iter $num_thread");
				print "rsh icsib18 $program $to $num_iter $num_thread\n";
				sleep 3;
		  }
	 }
}

