# HG changeset patch # User suruga # Date 1518677473 -32400 # Node ID 6a99af8772957c462b8858fd5b909ff695ba88ab # Parent afbd290bb017786e4aa49bbe9f9a904c32d51319 torque worked diff -r afbd290bb017 -r 6a99af877295 scripts/LogupdateTest-qsub.sh --- a/scripts/LogupdateTest-qsub.sh Thu Feb 15 15:06:48 2018 +0900 +++ b/scripts/LogupdateTest-qsub.sh Thu Feb 15 15:51:13 2018 +0900 @@ -1,7 +1,7 @@ #!/bin/sh #PBS -q jungle #PBS -N LogUpdateTest -#PBS -l nodes=4,walltime=00:04:00 +#PBS -l nodes=10,walltime=00:04:00 cd /mnt/data/jungle_workspace/Log /usr/bin/perl /mnt/data/jungle_workspace/scripts/LogupdateTest.pl diff -r afbd290bb017 -r 6a99af877295 scripts/LogupdateTest.pl --- a/scripts/LogupdateTest.pl Thu Feb 15 15:06:48 2018 +0900 +++ b/scripts/LogupdateTest.pl Thu Feb 15 15:51:13 2018 +0900 @@ -1,20 +1,28 @@ #!usr/bin/perl -my $debug = 1; +my $debug = 0; + +my @wait ; sub mysystem { - my ($cmd) = @_; + my ($cmd,$wait) = @_; if ($debug) { print $cmd ,"\n"; - } else { + } elsif ($wait) { + if (my $pid = fork) { + system $cmd; + exit 0; + } + push @wait,1; + } else { system $cmd; - } + } } system("hostname") if ($debug); my $nodes = $ENV{'PBS_NODEFILE'}; my $jungleDir = "/mnt/data/jungle_workspace"; -my $logFile = "$jungleDir/Log/Log"; +my $logFile = "$jungleDir/Log"; my $logNum = "0000"; open my $fd,"<",$nodes or die("can't read file $nodes $!"); @@ -28,15 +36,19 @@ my $nodeNum = $#nodes; mysystem("cd $jungleDir; ruby scripts/tree.rb $nodeNum > scripts/tree.dot"); -mkdir "$logfile/$logNum"; -mysystem("ssh $nodes[0] \"cd $jungleDir/$logNum;java -cp ../../build/libs/Alice.jar alice.topology.manager.TopologyManager -conf ../../scripts/tree.dot -p 10000 --noKeepAlive > $logFile$logNum\" &"); +mkdir "$logFile/$logNum"; +mysystem("ssh $nodes[0] \"cd $logFile/$logNum;java -cp ../../build/libs/logupdateTest-1.1.jar alice.topology.manager.TopologyManager -conf ../../scripts/tree.dot -p 10000 --noKeepAlive > $logNum\" ",1); $logNum++; sleep 10; for my $i (1..($#nodes-1)) { - mysystem("ssh $nodes[$i] \"cd $jungleDir/$logNum;java -Dlogfile.name=${Logfile}java$lognum -jar ../../build/libs/logupdateTest-1.1.jar -host $nodes[0] -p 10003 -port 10000 --noKeepAlive > $logFile$logNum\" & "); + mkdir "$logFile/$logNum"; + mysystem("ssh $nodes[$i] \"cd $logFile/$logNum;java -jar ../../build/libs/logupdateTest-1.1.jar -host $nodes[0] -p 10003 -port 10000 --noKeepAlive > $logNum\" & "); $logNum++; } +mkdir "$logFile/$logNum"; +mysystem("ssh $nodes[$#nodes] \"cd $logFile/$logNum;java -jar ../../build/libs/logupdateTest-1.1.jar -host $nodes[0] -p 10003 -port 10000 -write --noKeepAlive > $logNum\" &" ); + +for (@wait) { + wait; +} -sleep 10; -mysystem("ssh $nodes[$#nodes] \"cd $jungleDir/$logNum;java -Dlogfile.name=${Logfile}java$lognum -jar build/libs/logupdateTest-1.1.jar -host $nodes[0] -p 10003 -port 10000 -write --noKeepAlive > $logFile$logNum\" &" ); -sleep 30;