<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>public/images/elasticwulf_logo.png</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -170,6 +170,51 @@ class JobsController &lt; ApplicationController
   end    
       
   
+  # custom actions for MPI cluster config files... 
+  # TODO: move cpu logic out to new model for EC2 instance types. 
+  
+  # GET /jobs/1/hosts
+  def hosts
+    @job = Job.find(params[:id])
+    host_array = []
+    @job.nodes.each do |node|
+      host_array &lt;&lt; &quot;#{node.private_dns_name} #{node.private_dns_name.split('.')[0]}&quot;
+    end
+    send_data host_array.join(&quot;\n&quot;), :type =&gt; 'text/html; charset=utf-8'
+  end  
+      
+      
+  # GET /jobs/1/openmpi_hostfile
+  def openmpi_hostfile
+    # hostfile for OpenMPI clusters
+    # node001 slots=2
+    # node002 slots=2
+    @job = Job.find(params[:id])
+    cpu_count = @job.processors_per_node
+    host_array = []
+    @job.nodes.each do |node|
+      host_array &lt;&lt; &quot;#{node.private_dns_name.split('.')[0]} slots=#{cpu_count}&quot;
+    end
+    send_data host_array.join(&quot;\n&quot;), :type =&gt; 'text/html; charset=utf-8'
+  end
+  
+  # GET /jobs/1/mpich2_machinefile
+  def mpich2_machinefile
+    # machine file for MPICH2 clusters
+    # node001:2
+    # node002:2
+    @job = Job.find(params[:id])
+    cpu_count = @job.processors_per_node    
+    host_array = []
+    @job.nodes.each do |node|
+      host_array &lt;&lt; &quot;#{node.private_dns_name.split('.')[0]}:#{cpu_count}&quot;
+    end
+    send_data host_array.join(&quot;\n&quot;), :type =&gt; 'text/html; charset=utf-8'
+  end        
+      
+      
+  # Custom action for AJAX page refresh    
+  
   # GET /jobs/refresh
   def refresh
     @jobs = Job.paginate :page =&gt; params[:page], :order =&gt; 'created_at DESC', :per_page =&gt;10</diff>
      <filename>app/controllers/jobs_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -168,6 +168,13 @@ class Job &lt; ActiveRecord::Base
     return cancellable_states.include? self.state 
   end
 
+  def processors_per_node
+    # TODO: create a seperate model to hold this info
+    cpus = {&quot;m1.small&quot;=&gt;1, &quot;m1.large&quot;=&gt;2, 
+      &quot;m1.xlarge&quot;=&gt;4, &quot;c1.medium&quot;=&gt;2, &quot;c1.xlarge&quot;=&gt;8}
+    return cpus[self.instance_type]
+  end
+
 
   def launch_cluster
     puts 'background cluster launch initiated...' </diff>
      <filename>app/models/job.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,8 @@
     &lt;%= javascript_include_tag :defaults %&gt;    
     &lt;%= yield(:head) %&gt;
   &lt;/head&gt;
-    &lt;div class=&quot;logo&quot;&gt;&lt;a href=&quot;http://www.datawrangling.com&quot; title=&quot;DataWrangling.com&quot;&gt;&lt;%= image_tag(&quot;datawrangling_logo_white.png&quot;) %&gt;&lt;/a&gt;&lt;/div&gt;
+    &lt;div class=&quot;logo&quot;&gt;&lt;a href=&quot;http://www.datawrangling.com&quot; title=&quot;DataWrangling.com&quot;&gt;&lt;%= image_tag(&quot;datawrangling_logo_white.png&quot;) %&gt;&lt;/a&gt;
+    &lt;/div&gt;
   &lt;body&gt;
     &lt;div id=&quot;container&quot;&gt;
       &lt;%- flash.each do |name, msg| -%&gt;</diff>
      <filename>app/views/layouts/green.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 ActionController::Routing::Routes.draw do |map|
 
   map.root :controller =&gt; &quot;jobs&quot; 
-  map.resources :jobs, :member =&gt; { :cancel =&gt; :put , :nextstep =&gt; :put, :updateprogress =&gt; :put, :error =&gt; :put} , :collection =&gt; { :refresh =&gt; :get }, :has_many =&gt; :nodes
+  map.resources :jobs, :member =&gt; { :cancel =&gt; :put , :nextstep =&gt; :put, :updateprogress =&gt; :put, :error =&gt; :put, :hosts =&gt; :get, :openmpi_hostfile =&gt; :get, :mpich2_machinefile =&gt; :get} , :collection =&gt; { :refresh =&gt; :get }, :has_many =&gt; :nodes
   
 
   # The priority is based upon order of creation: first created -&gt; highest priority.</diff>
      <filename>config/routes.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,7 @@ require 'daemons'
 dir = File.expand_path(File.join(File.dirname(__FILE__), '..'))
 
 daemon_options = {
-  :multiple   =&gt; false,
+  :multiple   =&gt; true,
   :dir_mode   =&gt; :normal,
   :dir        =&gt; File.join(dir, 'tmp', 'pids'),
   :backtrace  =&gt; true</diff>
      <filename>script/delayed_job</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>eb6299b480459cbdf464088ceaa0dae3253a421b</id>
    </parent>
  </parents>
  <author>
    <name>Pete Skomoroch</name>
    <email>pete@datawrangling.com</email>
  </author>
  <url>http://github.com/datawrangling/ec2cluster/commit/7e495fb19c56aa8658b775c2b11b493a64455547</url>
  <id>7e495fb19c56aa8658b775c2b11b493a64455547</id>
  <committed-date>2009-05-26T03:57:09-07:00</committed-date>
  <authored-date>2009-05-26T03:57:09-07:00</authored-date>
  <message>added more custom actions for openmpi and mpich2 cluster config files</message>
  <tree>435fb8250e9167badb984ca7e393e255c7b3ea6b</tree>
  <committer>
    <name>Pete Skomoroch</name>
    <email>pete@datawrangling.com</email>
  </committer>
</commit>
