[Saga-devel] saga SVN commit 3261: /trunk/adaptors/ssh/ssh_job/

amerzky at cct.lsu.edu amerzky at cct.lsu.edu
Mon Jan 12 04:17:10 CST 2009


User: amerzky
Date: 2009/01/12 04:17 AM

Modified:
 /trunk/adaptors/ssh/ssh_job/
  ssh_job.cpp, ssh_job.hpp, ssh_job_service.cpp, ssh_job_service.hpp

Log:
 mixed fixes
 A

File Changes:

Directory: /trunk/adaptors/ssh/ssh_job/
=======================================

File [modified]: ssh_job.cpp
Delta lines: +7 -4
===================================================================
--- trunk/adaptors/ssh/ssh_job/ssh_job.cpp	2009-01-11 10:04:16 UTC (rev 3260)
+++ trunk/adaptors/ssh/ssh_job/ssh_job.cpp	2009-01-12 10:16:56 UTC (rev 3261)
@@ -41,8 +41,7 @@
                               saga::ini::ini const            & glob_ini, 
                               saga::ini::ini const            & adap_ini,
                               TR1::shared_ptr <saga::adaptor>   adaptor)
-    : base_cpi  (p, info, adaptor, cpi::Noflags),
-      js_ ("fork://localhost/")
+    : base_cpi  (p, info, adaptor, cpi::Noflags)
   {
     instance_data     idata (this);
     adaptor_data_type adata (this);
@@ -91,6 +90,10 @@
     SAGA_LOG_DEBUG (rm_.get_string ().c_str ());
 
 
+    // create local job service which handles all job submissions
+    js_ = TR1::shared_ptr <saga::job::service> (new saga::job::service ("fork://localhost"));
+
+
     // FIXME: make sure that rm_.get_host () and jd['CandidateHost'] match
 
     if ( idata->init_from_jobid_ )
@@ -101,7 +104,7 @@
       // service, and get job from there, too.  Also get jd, and create old/new
       // jd
 
-      j_ = js_.get_job (new_jobid_);
+      j_ = js_->get_job (new_jobid_);
     }
     else
     {
@@ -150,7 +153,7 @@
       new_jd_.set_vector_attribute (saga::job::attributes::description_candidate_hosts,  new_hosts);
 
       // create the job with the altered jd
-      j_ = js_.create_job (new_jd_);
+      j_ = js_->create_job (new_jd_);
     }
   }
 

File [modified]: ssh_job.hpp
Delta lines: +2 -1
===================================================================
--- trunk/adaptors/ssh/ssh_job/ssh_job.hpp	2009-01-11 10:04:16 UTC (rev 3260)
+++ trunk/adaptors/ssh/ssh_job/ssh_job.hpp	2009-01-12 10:16:56 UTC (rev 3261)
@@ -44,7 +44,8 @@
       // state
       saga::url                            rm_;
       saga::context                        ctx_;
-      saga::job::service                   js_;
+      
+      TR1::shared_ptr <saga::job::service> js_;
 
       std::string                          host_;
       std::string                          user_;

File [modified]: ssh_job_service.cpp
Delta lines: +7 -5
===================================================================
--- trunk/adaptors/ssh/ssh_job/ssh_job_service.cpp	2009-01-11 10:04:16 UTC (rev 3260)
+++ trunk/adaptors/ssh/ssh_job/ssh_job_service.cpp	2009-01-12 10:16:56 UTC (rev 3261)
@@ -36,10 +36,9 @@
                                               saga::ini::ini const & glob_ini, 
                                               saga::ini::ini const & adap_ini,
                                               TR1::shared_ptr <saga::adaptor> adaptor)
-    : base_cpi (p, info, adaptor, cpi::Noflags), 
+    : base_cpi (p, info, adaptor, cpi::Noflags)
       // Create a local job adaptor to spawn off ssh commands at will.  
       // If that throws, we simply pass on the exception.
-      js_ ("fork://localhost/")
   {
     adaptor_data  adata (this);
     instance_data idata (this);
@@ -150,9 +149,12 @@
 
       if ( proc.done () )
       {
-        // remember keyu location, so we can tell the started jobs about it
+        // remember key location, so we can tell the started jobs about it
         env_["SAGA_ADAPTOR_SSH_KEY"] = ".ssh/id_saga";
 
+        // create local job service which handles all job submissions
+        js_ = TR1::shared_ptr <saga::job::service> (new saga::job::service ("fork://localhost"));
+
         // we are done
         return;
       }
@@ -198,7 +200,7 @@
   {
     // FIXME: we should grep for ssh jobs
     // FIXME: translate local jobids into ssh jobids
-    ret = js_.list ();
+    ret = js_->list ();
   }
 
   void job_service_cpi_impl::sync_get_job (saga::job::job & ret, 
@@ -206,7 +208,7 @@
   {
     // FIXME: need to translate the ssh jobid into local jobid
     // FIXME: correctly initialize the ssh::job implmentation, please
-    ret = js_.get_job (jobid);
+    ret = js_->get_job (jobid);
   }
 
   void job_service_cpi_impl::sync_get_self (saga::job::self & ret)

File [modified]: ssh_job_service.hpp
Delta lines: +2 -1
===================================================================
--- trunk/adaptors/ssh/ssh_job/ssh_job_service.hpp	2009-01-11 10:04:16 UTC (rev 3260)
+++ trunk/adaptors/ssh/ssh_job/ssh_job_service.hpp	2009-01-12 10:16:56 UTC (rev 3261)
@@ -48,8 +48,9 @@
       saga::url                            rm_;
       saga::session                        s_;
       saga::context                        ctx_;
-      saga::job::service                   js_;
 
+      TR1::shared_ptr <saga::job::service> js_;
+
       std::string                          host_;
       std::string                          user_;
       std::string                          key_;



More information about the saga-devel mailing list