diff options
author | nilabjar <nilabjar@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2006-12-05 06:37:33 +0000 |
---|---|---|
committer | nilabjar <nilabjar@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2006-12-05 06:37:33 +0000 |
commit | 014804b7f40ed9b56e02b51e18f4d9d80059aeca (patch) | |
tree | e0009a8ecc87266dc11ad67a0630ef5157c115b3 | |
parent | d16849664a31d34bcd45274fddd6ef714c26c54c (diff) | |
download | ATCD-014804b7f40ed9b56e02b51e18f4d9d80059aeca.tar.gz |
ChangeLogTag:Tue Dec 5 06:29:22 UTC 2006 Nilabja R <nilabjar@dre.vanderbilt.edu>
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | DAnCE/TargetManager/CmpClient.cpp | 236 | ||||
-rw-r--r-- | ciao/CCM_Core.mpc | 1 | ||||
-rw-r--r-- | ciao/Deployment_ResourceCommitmentManager.idl | 34 | ||||
-rw-r--r-- | ciao/Deployment_TargetManager.idl | 10 |
5 files changed, 166 insertions, 126 deletions
diff --git a/ChangeLog b/ChangeLog index 8afd03641f9..d8b9847861e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +Tue Dec 5 06:29:22 UTC 2006 Nilabja R <nilabjar@dre.vanderbilt.edu> + + * DAnCE/TargetManager/CmpClient.cpp: + + * ciao/CCM_Core.mpc: + * ciao/Deployment_ResourceCommitmentManager.idl: + * ciao/Deployment_TargetManager.idl: + Added in order to introduce ResourceCommitmenManager + to TargetManager + Mon Dec 4 12:14:57 UTC 2006 Johnny Willemsen <jwillemsen@remedy.nl> * MPC/config/*: @@ -680,4 +690,3 @@ mode: change-log add-log-time-format: (lambda () (progn (setq tz (getenv "TZ")) (set-time-zone-rule "UTC") (setq time (format-time-string "%a %b %e %H:%M:%S %Z %Y" (current-time))) (set-time-zone-rule tz) time)) indent-tabs-mode: nil End: - diff --git a/DAnCE/TargetManager/CmpClient.cpp b/DAnCE/TargetManager/CmpClient.cpp index 12deaa5ac80..7e3480418a8 100644 --- a/DAnCE/TargetManager/CmpClient.cpp +++ b/DAnCE/TargetManager/CmpClient.cpp @@ -22,14 +22,14 @@ int main (int argc, char* argv[]) // First initialize the ORB, that will remove some arguments... CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, - "" /* the ORB name, it can be anything! */); + "" /* the ORB name, it can be anything! */); // There must be at least two arguments, the first is the factory // name, the rest are the names of the stock symbols we want to // get quotes for. if (argc < 2) { cerr << "Usage: " << argv[0] - << " Factory_IOR ..." << endl; + << " Factory_IOR ..." << endl; return 1; } @@ -50,20 +50,20 @@ int main (int argc, char* argv[]) // Now make calls on the Target Manager facet try - { - Deployment::Domain_var domainV = targetI->getAllResources (); - ACE_DEBUG ((LM_DEBUG , "\n\nGetAllResources Returned \n")); - ::Deployment::DnC_Dump::dump (domainV); - } + { + Deployment::Domain_var domainV = targetI->getAllResources (); + ACE_DEBUG ((LM_DEBUG , "\n\nGetAllResources Returned \n")); + ::Deployment::DnC_Dump::dump (domainV); + } catch(CORBA::NO_IMPLEMENT &) - { - ACE_DEBUG((LM_DEBUG ,"Error:TargetManager:CORBA::NO_IMPLEMENT thrown\n")); - } + { + ACE_DEBUG((LM_DEBUG ,"Error:TargetManager:CORBA::NO_IMPLEMENT thrown\n")); + } catch(CORBA::Exception &) - { - ACE_DEBUG((LM_DEBUG ,"Error:TargetManager:CORBA Generic Exception \n")); - ACE_DEBUG((LM_DEBUG ,"Error:TargetManager:Exception in TargetManager call\n")); - } + { + ACE_DEBUG((LM_DEBUG ,"Error:TargetManager:CORBA Generic Exception \n")); + ACE_DEBUG((LM_DEBUG ,"Error:TargetManager:Exception in TargetManager call\n")); + } // make a call to the commit resources ..... @@ -108,59 +108,59 @@ int main (int argc, char* argv[]) bool resource_available = true; try - { - targetI->commitResources(plan); - ACE_DEBUG ((LM_DEBUG , "\n\ncommitResources Returned \n")); - } + { + // targetI->commitResources(plan); + ACE_DEBUG ((LM_DEBUG , "\n\ncommitResources Returned \n")); + } catch(CORBA::NO_IMPLEMENT &) - { - cerr << "Error:TargetManager:CORBA::NO_IMPLEMENT thrown" << endl; - } + { + cerr << "Error:TargetManager:CORBA::NO_IMPLEMENT thrown" << endl; + } catch (Deployment::ResourceNotAvailable & e) - { - resource_available = 0; - cout << "TargetManager commitResources ResourceNotAvailable Exception" <<endl; + { + resource_available = 0; + cout << "TargetManager commitResources ResourceNotAvailable Exception" <<endl; - ACE_DEBUG ((LM_DEBUG , - "ResourceNotAvailable\n name=[%s]\n elementName=[%s]\n resourceName=[%s]\n \ + ACE_DEBUG ((LM_DEBUG , + "ResourceNotAvailable\n name=[%s]\n elementName=[%s]\n resourceName=[%s]\n \ resourceType= [%s]\n propertyName=[%s]\n", - e.name.in (), - e.elementName.in (), - e.resourceName.in (), - e.resourceType.in (), - e.propertyName.in ())); - } + e.name.in (), + e.elementName.in (), + e.resourceName.in (), + e.resourceType.in (), + e.propertyName.in ())); + } catch(CORBA::Exception & ex) - { - cout << "Error:TargetManager:commitResources Exception" <<endl; - cout << "Error:TargetManager:CORBA Generic Exception " << endl; - cerr << "Error:TargetManager:Exception in TargetManager call" << ex << endl; - } + { + cout << "Error:TargetManager:commitResources Exception" <<endl; + cout << "Error:TargetManager:CORBA Generic Exception " << endl; + cerr << "Error:TargetManager:Exception in TargetManager call" << ex << endl; + } // Make a call to release resources , if resource < 0 try - { - if (!resource_available) - { - targetI->releaseResources(plan); - ACE_DEBUG ((LM_DEBUG , "\n\nreleaseResources Returned \n")); - } - } + { + if (!resource_available) + { + // targetI->releaseResources(plan); + ACE_DEBUG ((LM_DEBUG , "\n\nreleaseResources Returned \n")); + } + } catch(CORBA::NO_IMPLEMENT &) - { - cerr << "Error:TargetManager:CORBA::NO_IMPLEMENT thrown" << endl; - } + { + cerr << "Error:TargetManager:CORBA::NO_IMPLEMENT thrown" << endl; + } catch (Deployment::ResourceNotAvailable &) - { - cout << "Error:TargetManager releaseResources ResourceNotAvailable Exception" <<endl; - } + { + cout << "Error:TargetManager releaseResources ResourceNotAvailable Exception" <<endl; + } catch(CORBA::Exception & ex) - { - cout << "Error:TargetManager:releaseResources Exception" <<endl; - cout << "Error:TargetManager:CORBA Generic Exception " << endl; - cerr << "Error:TargetManager:Exception in TargetManager call" << ex << endl; - } + { + cout << "Error:TargetManager:releaseResources Exception" <<endl; + cout << "Error:TargetManager:CORBA Generic Exception " << endl; + cerr << "Error:TargetManager:Exception in TargetManager call" << ex << endl; + } // Here make a call on the TM with update domain and node deletion @@ -175,57 +175,57 @@ int main (int argc, char* argv[]) Add = ACE_OS::atoi (argv[3]); if (Add) - { - try { - targetI->updateDomain (elements , updated, ::Deployment::Add); + try + { + targetI->updateDomain (elements , updated, ::Deployment::Add); + } + catch(CORBA::NO_IMPLEMENT &) + { + cerr << "Error:TargetManager:CORBA::NO_IMPLEMENT thrown" << endl; + } + catch(CORBA::Exception & ex) + { + cout << "Error:TargetManager:CORBA Generic Exception " << endl; + cerr << "Error:TargetManager:Exception in UpdateDomain call" << ex << endl; + } } - catch(CORBA::NO_IMPLEMENT &) - { - cerr << "Error:TargetManager:CORBA::NO_IMPLEMENT thrown" << endl; - } - catch(CORBA::Exception & ex) + else { - cout << "Error:TargetManager:CORBA Generic Exception " << endl; - cerr << "Error:TargetManager:Exception in UpdateDomain call" << ex << endl; + try + { + targetI->updateDomain (elements , updated, ::Deployment::Delete); + } + catch(CORBA::NO_IMPLEMENT &) + { + cerr << "Error:TargetManager:CORBA::NO_IMPLEMENT thrown" << endl; + } + catch(CORBA::Exception & ex) + { + cout << "Error:TargetManager:CORBA Generic Exception " << endl; + cerr << "Error:TargetManager:Exception in UpdateDomain call" << ex << endl; + } } - } - else - { - try + // Now make a call of getAvailableResources on the TargetManager ... + try { - targetI->updateDomain (elements , updated, ::Deployment::Delete); + Deployment::Domain_var domainV = targetI->getAvailableResources(); + + // here write things to file ... + write_to_file (domainV.in()); + + ACE_DEBUG ((LM_DEBUG , "\n\nGetAvailableResources Returned \n")); + ::Deployment::DnC_Dump::dump (domainV); } - catch(CORBA::NO_IMPLEMENT &) + catch(CORBA::NO_IMPLEMENT &) { cerr << "Error:TargetManager:CORBA::NO_IMPLEMENT thrown" << endl; } - catch(CORBA::Exception & ex) + catch(CORBA::Exception & ex) { cout << "Error:TargetManager:CORBA Generic Exception " << endl; - cerr << "Error:TargetManager:Exception in UpdateDomain call" << ex << endl; + cerr << "Error:TargetManager:Exception in TargetManager call" << ex << endl; } - } - // Now make a call of getAvailableResources on the TargetManager ... - try - { - Deployment::Domain_var domainV = targetI->getAvailableResources(); - - // here write things to file ... - write_to_file (domainV.in()); - - ACE_DEBUG ((LM_DEBUG , "\n\nGetAvailableResources Returned \n")); - ::Deployment::DnC_Dump::dump (domainV); - } - catch(CORBA::NO_IMPLEMENT &) - { - cerr << "Error:TargetManager:CORBA::NO_IMPLEMENT thrown" << endl; - } - catch(CORBA::Exception & ex) - { - cout << "Error:TargetManager:CORBA Generic Exception " << endl; - cerr << "Error:TargetManager:Exception in TargetManager call" << ex << endl; - } // Finally destroy the ORB orb->destroy (); @@ -239,33 +239,33 @@ int main (int argc, char* argv[]) void write_to_file (::Deployment::Domain domain) { for (size_t i = 0;i < domain.node.length ();i++) - { - std::ofstream out (domain.node[i].name.in ()); + { + std::ofstream out (domain.node[i].name.in ()); - // write in the node usage ... - for (size_t j = 0;j < domain.node[i].resource.length ();j++) - { + // write in the node usage ... + for (size_t j = 0;j < domain.node[i].resource.length ();j++) + { - if (!strcmp (domain.node[i].resource[j].name.in (), "Processor")) - { - CORBA::Double node_cpu; - domain.node[i].resource[j].property[0].value >>= node_cpu; - out << node_cpu << std::endl; - } - if (!strcmp (domain.node[i].resource[j].name.in (), "NA_Monitor")) - { - std::string file_name = "NA_"; - file_name += domain.node[i].name.in (); - std::ofstream na_out (file_name.c_str ()); - CORBA::Double na_node_cpu; - domain.node[i].resource[j].property[0].value >>= na_node_cpu; - na_out << na_node_cpu << std::endl; - na_out.close (); - } - } + if (!strcmp (domain.node[i].resource[j].name.in (), "Processor")) + { + CORBA::Double node_cpu; + domain.node[i].resource[j].property[0].value >>= node_cpu; + out << node_cpu << std::endl; + } + if (!strcmp (domain.node[i].resource[j].name.in (), "NA_Monitor")) + { + std::string file_name = "NA_"; + file_name += domain.node[i].name.in (); + std::ofstream na_out (file_name.c_str ()); + CORBA::Double na_node_cpu; + domain.node[i].resource[j].property[0].value >>= na_node_cpu; + na_out << na_node_cpu << std::endl; + na_out.close (); + } + } - out.close (); - } + out.close (); + } } diff --git a/ciao/CCM_Core.mpc b/ciao/CCM_Core.mpc index 222a0eaa9aa..1ae06805bf0 100644 --- a/ciao/CCM_Core.mpc +++ b/ciao/CCM_Core.mpc @@ -196,6 +196,7 @@ project(Deployment_stub) : taolib_with_idl, valuetype, ifr_client, ciao_events_b Deployment_DomainApplicationManager.idl Deployment_ExecutionManager.idl Deployment_RepositoryManager.idl + Deployment_ResourceCommitmentManager.idl } Source_Files { diff --git a/ciao/Deployment_ResourceCommitmentManager.idl b/ciao/Deployment_ResourceCommitmentManager.idl new file mode 100644 index 00000000000..fd13b7ae46b --- /dev/null +++ b/ciao/Deployment_ResourceCommitmentManager.idl @@ -0,0 +1,34 @@ + +#ifndef RESOURCE_COMMITMENT_MANAGER_IDL +#define RESOURCE_COMMITMENT_MANAGER_IDL + +module Deployment { + + exception ResourceCommitmentFailure { + string reason; + short index; + string propertyName; + any propertyValue; + }; + /** + * @interface ResourceAllocation + * @brief Identifies a resource within a domain that is + * allocated from and the amount it is allocated + */ + interface ResourceAllocation + { + attribute string elementName; + attribute string resourceName; + }; + + /// The Resource Allocation Sequence + typedef sequence <ResourceAllocation> ResourceAllocationSeq; + + interface ResourceCommitmentManager { + void commitResources (in ResourceAllocationSeq resources); + void releaseResources (in ResourceAllocationSeq resources); + }; +}; + + +#endif diff --git a/ciao/Deployment_TargetManager.idl b/ciao/Deployment_TargetManager.idl index ff47c8af43e..65848bff3df 100644 --- a/ciao/Deployment_TargetManager.idl +++ b/ciao/Deployment_TargetManager.idl @@ -6,8 +6,7 @@ #include "ciao/Deployment_Target_Data.idl" #include "ciao/Deployment_TargetData.idl" #include "ciao/Deployment_DeploymentPlan.idl" -// Only needed for ResourceNotAvailable but that should go, so this include also -#include "ciao/Deployment_ApplicationManager.idl" +#include "ciao/Deployment_ResourceCommitmentManager.idl" module Deployment { @@ -25,11 +24,8 @@ module Deployment { interface TargetManager { Domain getAllResources (); Domain getAvailableResources (); - /// @todo 06-04-01 specifies this differently - void commitResources (in DeploymentPlan plan) - raises (ResourceNotAvailable, PlanError); - /// @todo This is not part of 06-04-01 - void releaseResources (in DeploymentPlan argname); + ResourceCommitmentManager createResourceCommitment (in ResourceAllocationSeq manager); + void destroyResourceCommitment (in ResourceCommitmentManager resources); void updateDomain (in ::CORBA::StringSeq elements, in Domain domainSubset, in DomainUpdateKind updateKind); |