Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill that ruby script that nobody will ever use
authorMartin Quinson <martin.quinson@loria.fr>
Sat, 6 Feb 2016 01:02:19 +0000 (02:02 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sat, 6 Feb 2016 01:02:19 +0000 (02:02 +0100)
examples/msg/chainsend/generate_deployment_file.rb [deleted file]
tools/internal/check_dist_archive.exclude

diff --git a/examples/msg/chainsend/generate_deployment_file.rb b/examples/msg/chainsend/generate_deployment_file.rb
deleted file mode 100755 (executable)
index e290ae1..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-#!/usr/bin/env ruby
-
-# Copyright (c) 2012-2014. The SimGrid Team.
-# All rights reserved.
-
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the license (GNU LGPL) which comes with this package.
-
-require 'rexml/document'
-
-class HostsExtractor
-  @@doc = nil
-  @@hosts = []
-
-  def initialize(xml)
-    @@doc = REXML::Document.new(xml)
-    @@doc.elements.each('platform') do |platform|
-      extract_hosts(platform)
-    end
-  end
-
-  def extract_hosts(doc)
-    doc.elements.each('AS') do |as|
-      extract_hosts_from_AS(as)
-      extract_hosts(as)
-    end
-  end
-
-  def extract_hosts_from_AS(doc)
-    doc.elements.each('host') do |h|
-      @@hosts << h.attributes['id']
-      puts "hosts %s" % h.attributes['id']
-    end
-
-    doc.elements.each('cluster') do |c|
-      prefix = c.attributes['prefix']
-      suffix = c.attributes['suffix']
-      puts "%s %s %s" % [prefix, c.attributes['radical'], suffix]
-      expand_radical(c.attributes['radical']).each do |num|
-        @@hosts << "%s%s%s" % [prefix, num, suffix]
-      end
-    end
-  end
-
-  def hosts
-    return @@hosts
-  end
-
-  def expand_radical(radical)
-   l = []
-   puts radical
-   radical.split(',').each do |range|
-     range.scan(/^\d+$/) { |x| l << x }
-     range.scan(/^(\d+)-(\d+)$/) { |x, y| (x..y).each do |i| l << i end }
-   end
-   return l
-  end
-end
-
-class DeploymentGenerator
-  @@outfile = nil
-
-  def initialize(fname)
-    @@outfile = File.new(fname, "w")
-  end
-
-  def write_header
-    @@outfile.puts "<?xml version='1.0'?>"
-    @@outfile.puts "<!DOCTYPE platform SYSTEM \"http://simgrid.gforge.inria.fr/simgrid.dtd\">"
-    @@outfile.puts "<platform version=\"3\">"
-  end
-
-  def write_process(name, function, hosts, args)
-    @@outfile.puts "  <!-- %s -->" % name
-    hosts.zip(args).each do |h, a|
-      @@outfile.puts "  <process host=\"%s\" function=\"%s\">" % [h, function]
-      @@outfile.puts "    <argument value=\"%s\"/>" % [a]
-      @@outfile.puts "  </process>"
-    end
-  end
-
-  def write_footer
-    @@outfile.puts "</platform>"
-  end
-end
-
-xml = File.read(ARGV.shift)
-he = HostsExtractor.new(xml)
-
-raise "Cannot run with less than 2 hosts" unless he.hosts.size > 1
-
-output = ARGV.shift
-n = ARGV.shift
-if n == nil or n.to_i < 2
-  n = he.hosts.size - 1
-else
-  n = n.to_i - 1
-end
-puts n
-
-dg = DeploymentGenerator.new(output)
-dg.write_header
-
-puts he.hosts
-broadcaster = he.hosts.shift
-peers = he.hosts
-
-dg.write_process("Broadcaster", "broadcaster", [broadcaster], [n])
-dg.write_process("Peers", "peer", peers[0..n-1], (1..n))
-
-dg.write_footer
index 8ea4497..7f4d474 100644 (file)
@@ -23,7 +23,6 @@
 + contrib/.*
 
 + examples/msg/actions/NAS_LU_S_4/.*
 + contrib/.*
 
 + examples/msg/actions/NAS_LU_S_4/.*
-+ examples/msg/chainsend/generate_deployment_file\.rb
 + examples/msg/chord/chord3\.xml
 
 + examples/smpi/MM/command_exemple
 + examples/msg/chord/chord3\.xml
 
 + examples/smpi/MM/command_exemple