#!/usr/bin/perl -w my ($nodes, $num_procs_per_node, $node, $proc); my ($target, $linkname, $filesystem); if (@ARGV != 2) { printf "Usage: $0 \n\n"; exit (0); } $num_nodes = $ARGV[0]; $num_procs_per_node = $ARGV[1]; for ($node = $proc = 0; $node < $num_nodes; $node++, $proc++) { $filesystem = 2*($node % 4) + 1; $target = "$ENV{HOME}/storage$filesystem"; $linkname = "proc$proc"; lstat ($linkname); unlink ($linkname) if (-l _); symlink ($target, $linkname) || print ("Failed to create symlink \'$linkname\': $!\n"); if ($num_procs_per_node != 1) { $proc++; $linkname = "proc$proc"; unlink ($linkname) if (-l _); symlink ($target, $linkname) || print ("Failed to create symlink \'$linkname\': $!\n"); } }