changeset 9:4fa0a48323fe

Modified get_node_name.rb
author Nobuyasu
date Sat, 11 Jan 2014 04:41:24 +0900
parents 9ed378589601
children f94fc7812cd8
files distributed/get_node_name.rb distributed/loop_qsub.sh distributed/nodes.txt distributed/nodes_stress_write_jungle.rb
diffstat 4 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/distributed/get_node_name.rb	Sat Jan 11 03:44:39 2014 +0900
+++ b/distributed/get_node_name.rb	Sat Jan 11 04:41:24 2014 +0900
@@ -2,11 +2,15 @@
   def get_node_name(filename)
     f = open(filename,"r")
     nodes = []
-    f.each { |line| nodes.push(line) }
+    f.each { |line| 
+      if /.+jp/ =~ line then
+        nodes.push(line) 
+      end
+    }
     hostname = `hostname`
     mynum = 0
     if /[0-9]+/ =~ hostname then
-      num = $&.to_i
+      mynum = $&.to_i
     end
   nodenum = mynum % nodes.size 
   return nodes[nodenum]
--- a/distributed/loop_qsub.sh	Sat Jan 11 03:44:39 2014 +0900
+++ b/distributed/loop_qsub.sh	Sat Jan 11 04:41:24 2014 +0900
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 start=1
-finish=2
+finish=10
 #finish=45
 
 for i in `seq $start $finish`
--- a/distributed/nodes.txt	Sat Jan 11 03:44:39 2014 +0900
+++ b/distributed/nodes.txt	Sat Jan 11 04:41:24 2014 +0900
@@ -1,2 +1,2 @@
 bldsv12.cr.ie.u-ryukyu.ac.jp
-bldsv10.cr.ie.u-ryukyu.ac.jp
+bldsv10.cr.ie.u-ryukyu.ac.jp
\ No newline at end of file
--- a/distributed/nodes_stress_write_jungle.rb	Sat Jan 11 03:44:39 2014 +0900
+++ b/distributed/nodes_stress_write_jungle.rb	Sat Jan 11 04:41:24 2014 +0900
@@ -14,6 +14,7 @@
 nodename = get_node_name("/home/mass/share/student/k128576/jungle_benchmark/distributed/nodes.txt")
 r = Benchmark.measure {
   count = ARGV[1].to_i
+  puts nodename.chomp
   uri = URI.parse('http://' << nodename.chomp << ':8080/editMessage?bname=hello%20world&uuid=0')
   count.times {|i|
     res = Net::HTTP.post_form(uri, {:author =>'oshiro', :bname =>'hello world', :uuid =>'0', :key =>'0', :msg =>"hogehoge #{i}"})