diff options
author | nilabjar <nilabjar@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-01-12 22:07:03 +0000 |
---|---|---|
committer | nilabjar <nilabjar@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-01-12 22:07:03 +0000 |
commit | 45d4e5c7573cd6ea08c394aca6e12cf813faf252 (patch) | |
tree | 0985344604ffd1e468f57eb71c9b10c4f1dc333d | |
parent | 1bea9a8596a25e08fd8eccf27f1c43775e27b070 (diff) | |
download | ATCD-45d4e5c7573cd6ea08c394aca6e12cf813faf252.tar.gz |
ChangeLogTag: Fri Jan 12 22:04:14 UTC 2007 Nilabja R <nilabjar@dre.vanderbilt.edu
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | DAnCE/TargetManager/CmpClient.cpp | 328 | ||||
-rw-r--r-- | DAnCE/TargetManager/DomainDataManager.cpp | 50 | ||||
-rw-r--r-- | DAnCE/TargetManager/DomainDataManager.h | 20 | ||||
-rw-r--r-- | DAnCE/TargetManager/TargetManager_exec.cpp | 8 | ||||
-rw-r--r-- | DAnCE/TargetManager/descriptors/run_test_TargetManager.pl | 2 | ||||
-rw-r--r-- | ciao/Deployment_TargetManager.idl | 2 |
7 files changed, 241 insertions, 181 deletions
diff --git a/ChangeLog b/ChangeLog index 240b9d43dfe..bc31d341d01 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +Fri Jan 12 22:04:14 UTC 2007 Nilabja R <nilabjar@dre.vanderbilt.edu> + + * DAnCE/TargetManager/CmpClient.cpp: + * DAnCE/TargetManager/DomainDataManager.h: + * DAnCE/TargetManager/DomainDataManager.cpp: + * DAnCE/TargetManager/TargetManager_exec.cpp: + + * DAnCE/TargetManager/descriptors/run_test_TargetManager.pl: + + * ciao/Deployment_TargetManager.idl: + Changed to address Johnny's comments + Thu Dec 28 22:59:45 UTC 2006 Nilabja R <nilabjar@dre.vanderbilt.edu> * DAnCE/TargetManager/CmpClient.cpp: diff --git a/DAnCE/TargetManager/CmpClient.cpp b/DAnCE/TargetManager/CmpClient.cpp index aa0506df858..e788bca57ce 100644 --- a/DAnCE/TargetManager/CmpClient.cpp +++ b/DAnCE/TargetManager/CmpClient.cpp @@ -12,245 +12,297 @@ #include "ciao/Deployment_DataC.h" #include "DAnCE/TargetManager/TargetManagerImplC.h" #include "ace/streams.h" +#include "ace/FILE_IO.h" +#include "ace/FILE_Connector.h" +#include "ace/FILE_Addr.h" +#include "ace/Get_Opt.h" #include "Config_Handlers/DnC_Dump.h" -void write_to_file (::Deployment::Domain domain); - -int main (int argc, char* argv[]) +namespace TM_Tester { - try { - // 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! */); - - // 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; - return 1; - } - - // Use the first argument to create the factory object reference, - // in real applications we use the naming service, but let's do - // the easy part first! - CORBA::Object_var factory_object = - orb->string_to_object (argv[1]); - - // Now downcast the object reference to the appropriate type - CIAO::TargetManagerImpl_var targetCmp = - CIAO::TargetManagerImpl::_narrow (factory_object.in ()); - - // Now get the facet reference from the target Manager Component - ACE_DEBUG((LM_DEBUG, "Making a Call to provide_targetMgr ()\n")); - Deployment::TargetManager_ptr targetI = targetCmp->provide_targetMgr (); + void write_to_file (::Deployment::Domain domain); + + const char * stringified_TM_IOR; + bool add_to_domain = true; + bool call_update = false; + const char * host_name; + + + bool parse_args (int argc, char *argv[]) + { + ACE_DEBUG ((LM_DEBUG, "The Parse Agr is called\n")); + ACE_Get_Opt get_opts (argc, argv, "t:u:d"); + int c; + while ((c = get_opts ()) != -1) + switch (c) + { + case 't': + stringified_TM_IOR = get_opts.opt_arg (); + ACE_DEBUG ((LM_DEBUG, "The stringified IOR is [%s]\n",stringified_TM_IOR)); + break; + case 'u': + host_name = get_opts.opt_arg (); + call_update = true; + break; + case 'd': + add_to_domain = false; + break; + case '?': // display help for use of the server. + default: + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s\n" + "-t <TM_IOR>\n" + "-u <host_name in update>\n" + "-n <delete , default add>\n" + "\n", + argv [0]), + false); + } - // Now make calls on the Target Manager facet + return true; + } +} - try + int main (int argc, char* argv[]) + { + try { + // 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! */); + + if (!TM_Tester::parse_args (argc, argv)) + return -1; + + // Use the first argument to create the factory object reference, + // in real applications we use the naming service, but let's do + // the easy part first! + CORBA::Object_var factory_object = + orb->string_to_object (TM_Tester::stringified_TM_IOR); + + // Now downcast the object reference to the appropriate type + CIAO::TargetManagerImpl_var targetCmp = + CIAO::TargetManagerImpl::_narrow (factory_object.in ()); + + // Now get the facet reference from the target Manager Component + ACE_DEBUG((LM_DEBUG, "Making a Call to provide_targetMgr ()\n")); + Deployment::TargetManager_ptr targetI = targetCmp->provide_targetMgr (); + + // 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); } - catch(CORBA::NO_IMPLEMENT &) + catch(CORBA::NO_IMPLEMENT &) { ACE_DEBUG((LM_DEBUG ,"Error:TargetManager:CORBA::NO_IMPLEMENT thrown\n")); } - catch(CORBA::Exception &) + catch(CORBA::Exception &) { 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 ..... + // make a call to the commit resources ..... - bool resource_available = true; + bool resource_available = true; - ::Deployment::ResourceAllocations resource_seq; + ::Deployment::ResourceAllocations resource_seq; - resource_seq.length (1); + resource_seq.length (1); - resource_seq[0].elementName = CORBA::string_dup ("TargetManagerNode_1"); + resource_seq[0].elementName = CORBA::string_dup ("TargetManagerNode_1"); - resource_seq[0].resourceName = CORBA::string_dup ("Processor"); + resource_seq[0].resourceName = CORBA::string_dup ("Processor"); - resource_seq[0].property.length (1); - resource_seq[0].property[0].name = - CORBA::string_dup ("LoadAverage"); + resource_seq[0].property.length (1); + resource_seq[0].property[0].name = + CORBA::string_dup ("LoadAverage"); - CORBA::Long d = 20; - resource_seq[0].property[0].value <<= d; + CORBA::Long d = 20; + resource_seq[0].property[0].value <<= d; - ::Deployment::ResourceCommitmentManager_ptr manager; + ::Deployment::ResourceCommitmentManager_ptr manager; - try + try { - // targetI->commitResources(plan); manager = targetI->createResourceCommitment (resource_seq); manager->commitResources (resource_seq); ACE_DEBUG ((LM_DEBUG , "\n\ncommitResources Returned \n")); } - catch(CORBA::NO_IMPLEMENT &) + catch(CORBA::NO_IMPLEMENT &) { - cerr << "Error:TargetManager:CORBA::NO_IMPLEMENT thrown" << endl; + ACE_DEBUG ((LM_DEBUG, "Error:TargetManager:CORBA::NO_IMPLEMENT thrown\n")); } - catch (::Deployment::ResourceCommitmentFailure& e) + catch (::Deployment::ResourceCommitmentFailure& e) { resource_available = 0; - cout << "TargetManager commitResources ResourceCommitmentFailure Exception" <<endl; + ACE_DEBUG ((LM_DEBUG, "TargetManager commitResources ResourceCommitmentFailure Exception\n")); ACE_DEBUG ((LM_DEBUG , - "ResourceCommitmentFailure\n reason=[%s]\n elementName=[%s]\n resourceName=[%s]\n propertyName=[%s]\n", - e.reason.in (), - resource_seq[e.index].elementName.in (), - resource_seq[e.index].resourceName.in (), - e.propertyName.in ())); + "ResourceCommitmentFailure\n reason=[%s]\n elementName=[%s]\n resourceName=[%s]\n propertyName=[%s]\n", + e.reason.in (), + resource_seq[e.index].elementName.in (), + resource_seq[e.index].resourceName.in (), + e.propertyName.in ())); } - catch(CORBA::Exception & ex) + 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; + ACE_DEBUG ((LM_DEBUG, "Error:TargetManager:commitResources Exception\n")); + ACE_DEBUG ((LM_DEBUG, "Error:TargetManager:CORBA Generic Exception\n")); + ACE_DEBUG ((LM_DEBUG, "Error:TargetManager:Exception in TargetManager call")); } - // Make a call to release resources , if resource < 0 - try + + // Make a call to release resources , if resource < 0 + try { -// if (!resource_available) - { - d = 10; - resource_seq[0].property[0].value <<= d; - manager->releaseResources (resource_seq); -// targetI->destroyResourceCommitment (manager); - ACE_DEBUG ((LM_DEBUG , "\n\nreleaseResources Returned \n")); - } + { + d = 10; + resource_seq[0].property[0].value <<= d; + manager->releaseResources (resource_seq); + // targetI->destroyResourceCommitment (manager); + ACE_DEBUG ((LM_DEBUG , "\n\nreleaseResources Returned \n")); + } } - catch(CORBA::NO_IMPLEMENT &) + catch(CORBA::NO_IMPLEMENT &) { - cerr << "Error:TargetManager:CORBA::NO_IMPLEMENT thrown" << endl; + ACE_DEBUG ((LM_DEBUG, "Error:TargetManager:CORBA::NO_IMPLEMENT thrown\n")); } - catch (Deployment::ResourceNotAvailable &) + catch (Deployment::ResourceNotAvailable &) { - cout << "Error:TargetManager releaseResources ResourceNotAvailable Exception" <<endl; + ACE_DEBUG ((LM_DEBUG, "Error:TargetManager releaseResources ResourceNotAvailable Exception\n")); } - catch(CORBA::Exception & ex) + 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; + ACE_DEBUG ((LM_DEBUG, "Error:TargetManager:releaseResources Exception\n")); + ACE_DEBUG ((LM_DEBUG, "Error:TargetManager:CORBA Generic Exception\n")); + ACE_DEBUG ((LM_DEBUG, "Error:TargetManager:Exception in TargetManager call")); } - // Here make a call on the TM with update domain and node deletion + // Here make a call on the TM with update domain and node deletion - ::Deployment::Domain updated; - updated.node.length (1); - updated.node[0].name = CORBA::string_dup (argv[2]); + ::Deployment::Domain updated; + updated.node.length (1); + updated.node[0].name = CORBA::string_dup (TM_Tester::host_name); - ::CORBA::StringSeq elements; - elements.length (0); + ::CORBA::StringSeq elements; + elements.length (0); - bool Add = true; - Add = ACE_OS::atoi (argv[3]); - if (Add) + if (TM_Tester::call_update) { - try + if (TM_Tester::add_to_domain) + { + try { targetI->updateDomain (elements , updated, ::Deployment::Add); } - catch(CORBA::NO_IMPLEMENT &) + catch(CORBA::NO_IMPLEMENT &) { - cerr << "Error:TargetManager:CORBA::NO_IMPLEMENT thrown" << endl; + ACE_DEBUG ((LM_DEBUG, "Error:TargetManager:CORBA::NO_IMPLEMENT thrown\n")); } - catch(CORBA::Exception & ex) + catch(CORBA::Exception & ex) { - cout << "Error:TargetManager:CORBA Generic Exception " << endl; - cerr << "Error:TargetManager:Exception in UpdateDomain call" << ex << endl; + ACE_DEBUG ((LM_DEBUG, "Error:TargetManager:CORBA Generic Exception\n")); + ACE_DEBUG ((LM_DEBUG, "Error:TargetManager:Exception in UpdateDomain call")); } - } - else - { - try + } + else + { + try { targetI->updateDomain (elements , updated, ::Deployment::Delete); } - catch(CORBA::NO_IMPLEMENT &) + catch(CORBA::NO_IMPLEMENT &) { - cerr << "Error:TargetManager:CORBA::NO_IMPLEMENT thrown" << endl; + ACE_DEBUG ((LM_DEBUG, "Error:TargetManager:CORBA::NO_IMPLEMENT thrown\n")); } - catch(CORBA::Exception & ex) + catch(CORBA::Exception & ex) { - cout << "Error:TargetManager:CORBA Generic Exception " << endl; - cerr << "Error:TargetManager:Exception in UpdateDomain call" << ex << endl; + ACE_DEBUG ((LM_DEBUG, "Error:TargetManager:CORBA Generic Exception\n")); + ACE_DEBUG ((LM_DEBUG, "Error:TargetManager:Exception in UpdateDomain call")); } + } } - // Now make a call of getAvailableResources on the TargetManager ... - try + + // 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()); + TM_Tester::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; + ACE_DEBUG ((LM_DEBUG, "Error:TargetManager:CORBA::NO_IMPLEMENT thrown\n")); } - catch(CORBA::Exception & ex) + catch(CORBA::Exception & ex) { - cout << "Error:TargetManager:CORBA Generic Exception " << endl; - cerr << "Error:TargetManager:Exception in TargetManager call" << ex << endl; + ACE_DEBUG ((LM_DEBUG ,"Error:TargetManager:CORBA Generic Exception\n")); + ACE_DEBUG ((LM_DEBUG, "Error:TargetManager:Exception in TargetManager call\n")); } - // Finally destroy the ORB - orb->destroy (); - } - catch (CORBA::Exception & ex) { - cerr << "Error:TargetManager:CORBA exception raised!" << ex << endl; + // Finally destroy the ORB + orb->destroy (); + } + catch (CORBA::Exception & ex) + { + ACE_DEBUG ((LM_DEBUG, "Error:TargetManager:CORBA exception raised!\n")); + } + return 0; } - return 0; -} -void write_to_file (::Deployment::Domain domain) +namespace TM_Tester { - for (size_t i = 0;i < domain.node.length ();i++) + 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 ()); // 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 (); + ACE_FILE_IO file_io; + ACE_FILE_Connector (file_io, ACE_FILE_Addr (file_name.c_str ())); + // std::ofstream na_out (file_name.c_str ()); + CORBA::Double na_node_cpu; + domain.node[i].resource[j].property[0].value >>= na_node_cpu; + char buf[BUFSIZ]; + memset (buf , 0 , BUFSIZ); + ACE_OS::sprintf (buf , "%f", na_node_cpu); + file_io.send (buf, ACE_OS::strlen (buf)); +// na_out << na_node_cpu << std::endl; +// na_out.close (); + } + } out.close (); } + } } diff --git a/DAnCE/TargetManager/DomainDataManager.cpp b/DAnCE/TargetManager/DomainDataManager.cpp index 841a5f1f420..233b50e1dff 100644 --- a/DAnCE/TargetManager/DomainDataManager.cpp +++ b/DAnCE/TargetManager/DomainDataManager.cpp @@ -47,8 +47,6 @@ CIAO::DomainDataManager::delete_data_manger () delete global_data_manager_; } - - int CIAO::DomainDataManager::update_domain ( const ::CORBA::StringSeq &, const ::Deployment::Domain & domainSubset, @@ -63,7 +61,7 @@ int CIAO::DomainDataManager::update_domain ( switch (update_kind) { case ::Deployment::UpdateAll: - case ::Deployment::UpdateAvailable: + case ::Deployment::UpdateDynamic: break; case ::Deployment::Add: add_to_domain (domainSubset); @@ -75,12 +73,12 @@ int CIAO::DomainDataManager::update_domain ( break; } - int size = current_domain_.node.length (); + CORBA::ULong size = current_domain_.node.length (); - int i; + CORBA::ULong i; for (i=0;i < size;i++) { - if (!strcmp (domainSubset.node[0].name , + if (!ACE_OS::strcmp (domainSubset.node[0].name , current_domain_.node[i].name)) { // found a match @@ -257,16 +255,16 @@ CIAO::Host_Infos* CIAO::DomainDataManager::get_cpu_info () ACE_DEBUG ((LM_DEBUG , "TM:: The node length is [%d]", current_domain_.node.length ())); - for (unsigned int i=0;i < current_domain_.node.length ();i++) + for (CORBA::ULong i=0;i < current_domain_.node.length ();i++) { (*host_info_seq)[i].hostname = CORBA::string_dup (current_domain_.node[i].name); // ACE_DEBUG ((LM_DEBUG , "The resource length is [%d]", // current_domain_.node[i].resource.length ())); - for (unsigned int j = 0;j < current_domain_.node[i].resource.length ();j++) + for (CORBA::ULong j = 0;j < current_domain_.node[i].resource.length ();j++) { - if (!strcmp( + if (!ACE_OS::strcmp( current_domain_.node[i].resource[j].name, "Processor")) { @@ -286,7 +284,7 @@ CIAO::Host_Infos* CIAO::DomainDataManager::get_cpu_info () return host_info_seq; } -CORBA::Long CIAO::DomainDataManager::get_pid (ACE_CString cmp) +CORBA::Long CIAO::DomainDataManager::get_pid (const ACE_CString& cmp) { CORBA::Long pid; @@ -294,13 +292,13 @@ CORBA::Long CIAO::DomainDataManager::get_pid (ACE_CString cmp) // all the resources for a particular component. // It needs to be stored in some other data structure - for (unsigned int i=0;i < current_domain_.node.length ();i++) + for (CORBA::ULong i=0;i < current_domain_.node.length ();i++) { if (CIAO::debug_level () > 9) ACE_DEBUG ((LM_DEBUG , "TM::The resource length is [%d]", current_domain_.node[i].resource.length ())); - for (unsigned int j = 0;j < current_domain_.node[i].resource.length ();j++) + for (CORBA::ULong j = 0;j < current_domain_.node[i].resource.length ();j++) { // The resource if (!ACE_OS::strcmp( @@ -336,11 +334,11 @@ void CIAO::DomainDataManager ::Deployment::Domain temp_provisioned_data = provisioned_data_; - for (unsigned int i = 0;i < plan.instance.length ();i++) + for (CORBA::ULong i = 0;i < plan.instance.length ();i++) { - for (unsigned int j = 0;j < temp_provisioned_data.node.length ();j++) + for (CORBA::ULong j = 0;j < temp_provisioned_data.node.length ();j++) { - if (!strcmp (plan.instance[i].node.in () , + if (!ACE_OS::strcmp (plan.instance[i].node.in () , temp_provisioned_data.node[j].name.in ())) { if (CIAO::debug_level () > 9) @@ -378,9 +376,9 @@ releaseResources ( // set the action value current_action_ = release; - for (unsigned int i = 0;i < plan.instance.length ();i++) + for (CORBA::ULong i = 0;i < plan.instance.length ();i++) { - for (unsigned int j = 0;j < provisioned_data_.node.length ();j++) + for (CORBA::ULong j = 0;j < provisioned_data_.node.length ();j++) { if (!ACE_OS::strcmp (plan.instance[i].node.in () , provisioned_data_.node[j].name.in ())) @@ -416,7 +414,7 @@ match_requirement_resource ( // available resource for (CORBA::ULong j = 0;j < available.length ();j++) { - if (!strcmp (deployed[i].requirementName, available[j].name)) + if (!ACE_OS::strcmp (deployed[i].requirementName, available[j].name)) { if (CIAO::debug_level () > 9) ACE_DEBUG ((LM_DEBUG , @@ -424,7 +422,7 @@ match_requirement_resource ( // search for the resourcename in the resourceType for (CORBA::ULong k = 0;k < available[j].resourceType.length ();k++) { - if (!strcmp (deployed[i].resourceName, + if (!ACE_OS::strcmp (deployed[i].resourceName, available[j].resourceType[k])) { if (CIAO::debug_level () > 9) @@ -714,7 +712,7 @@ int CIAO::DomainDataManager::delete_from_domain ( for (CORBA::ULong i = 0;i < domain.node.length ();i++) { - if (strcmp (domain.node[i].name.in (), + if (ACE_OS::strcmp (domain.node[i].name.in (), this->provisioned_data_.node[j].name.in ()) == 0) { found = true; @@ -757,7 +755,7 @@ bool CIAO::DomainDataManager::update_node_status () return 0; } -int CIAO::DomainDataManager::commitResourceAllocation ( +void CIAO::DomainDataManager::commitResourceAllocation ( const ::Deployment::ResourceAllocations & resources) { // commit the resources @@ -766,16 +764,16 @@ int CIAO::DomainDataManager::commitResourceAllocation ( // set the action value current_action_ = commit; - return this->commit_release_RA (resources); + this->commit_release_RA (resources); } -int CIAO::DomainDataManager::releaseResourceAllocation ( +void CIAO::DomainDataManager::releaseResourceAllocation ( const ::Deployment::ResourceAllocations & resources) { // set the action value current_action_ = release; - return this->commit_release_RA (resources); + this->commit_release_RA (resources); } @@ -818,7 +816,7 @@ CIAO::DomainDataManager::find_resource ( // spec for (CORBA::ULong j = 0;j < this->temp_provisioned_data_.node.length ();j++) { - if (!strcmp (resource.elementName.in () , + if (!ACE_OS::strcmp (resource.elementName.in () , this->temp_provisioned_data_.node[j].name.in ())) { if (CIAO::debug_level () > 9) @@ -828,7 +826,7 @@ CIAO::DomainDataManager::find_resource ( k < this->temp_provisioned_data_.node[j].resource.length (); k++) { - if (!strcmp (this->temp_provisioned_data_.node[j].resource[k].name.in (), + if (!ACE_OS::strcmp (this->temp_provisioned_data_.node[j].resource[k].name.in (), resource.resourceName.in ())) return this->temp_provisioned_data_.node[j].resource[k];//resource found here, return } diff --git a/DAnCE/TargetManager/DomainDataManager.h b/DAnCE/TargetManager/DomainDataManager.h index 898855663e9..d1234a0beb3 100644 --- a/DAnCE/TargetManager/DomainDataManager.h +++ b/DAnCE/TargetManager/DomainDataManager.h @@ -65,7 +65,6 @@ namespace CIAO */ ::Deployment::Domain* get_current_domain (); - /** * @brief This function is called to create the Datamanager * @param orb The orb pointer @@ -91,7 +90,6 @@ namespace CIAO * @brief deletes the data manager */ static void delete_data_manger (); - /** * @brief returns the sequence of node managers * object reference @@ -113,7 +111,7 @@ namespace CIAO * * @return process id */ - CORBA::Long get_pid (ACE_CString cmp); + CORBA::Long get_pid (const ACE_CString& cmp); /** * @brief commits the resources that are specified @@ -155,7 +153,7 @@ namespace CIAO * @description This function is for the ResourceCommitmentManager * */ - int commitResourceAllocation ( + void commitResourceAllocation ( const ::Deployment::ResourceAllocations & resources); /** @@ -167,10 +165,10 @@ namespace CIAO * @description This function is for the ResourceCommitmentManager * */ - int releaseResourceAllocation ( + void releaseResourceAllocation ( const ::Deployment::ResourceAllocations & resources); - protected: + private: /** @@ -301,7 +299,8 @@ namespace CIAO /// at total capacity ::Deployment::Domain initial_domain_; - + /// The staic data member , replacing a global variable + static DomainDataManager* global_data_manager_; /// The Current Domain - contains resources /// at current capacity ::Deployment::Domain current_domain_; @@ -310,12 +309,6 @@ namespace CIAO ::Deployment::TargetManager_var target_mgr_; /** - * The staic data manager pointer implementing - * singleton pattern - */ - static DomainDataManager* global_data_manager_; - - /** * The static provisioned Domain data */ ::Deployment::Domain provisioned_data_; @@ -330,4 +323,5 @@ namespace CIAO } // CIAO + #endif /* DOMAIN_DATA_MGRH */ diff --git a/DAnCE/TargetManager/TargetManager_exec.cpp b/DAnCE/TargetManager/TargetManager_exec.cpp index dfeec640cf1..c3378aae403 100644 --- a/DAnCE/TargetManager/TargetManager_exec.cpp +++ b/DAnCE/TargetManager/TargetManager_exec.cpp @@ -47,7 +47,11 @@ namespace CIDL_TargetManager_i target_impl->provide_targetMgr (); // dataManager_.reset (new CIAO::DomainDataManager (orb, target.in ())); ACE_DEBUG ((LM_DEBUG, "TM_Exec: creating domain data manager\n")); - CIAO::DomainDataManager::create (orb, target.in()); + + // Create Domain Data here + + CIAO::DomainDataManager::create (orb_, target.in ()); +// CIAO::Domain_Singleton::instance (); ACE_DEBUG ((LM_DEBUG, "TM_Exec: DDD created!\n")); } @@ -287,7 +291,7 @@ namespace CIDL_TargetManager_i ACE_DEBUG ((LM_DEBUG , "Calling TM constructor")); } - if (CORBA::is_nil (this->exec_ext_object_.in ())) + if (CORBA::is_nil (this->exec_object_.in ())) { this->exec_object_ = new TargetManager_exec_i(this, context_->_ciao_the_Container()->the_ORB(), diff --git a/DAnCE/TargetManager/descriptors/run_test_TargetManager.pl b/DAnCE/TargetManager/descriptors/run_test_TargetManager.pl index a98401ef296..3206732edb9 100644 --- a/DAnCE/TargetManager/descriptors/run_test_TargetManager.pl +++ b/DAnCE/TargetManager/descriptors/run_test_TargetManager.pl @@ -134,7 +134,7 @@ $call_num = 5; for ($i = 0; $i < $call_num; ++$i) { print "Invoking the client\n"; - $tmclient = new PerlACE::Process ("../CmpClient", "file://TargetManager.ior"); + $tmclient = new PerlACE::Process ("../CmpClient", "-t file://TargetManager.ior"); $result = $tmclient->SpawnWaitKill (3000); if ($result != 0) { diff --git a/ciao/Deployment_TargetManager.idl b/ciao/Deployment_TargetManager.idl index 171ce0c685f..54ae166e431 100644 --- a/ciao/Deployment_TargetManager.idl +++ b/ciao/Deployment_TargetManager.idl @@ -14,7 +14,7 @@ module Deployment { Add, Delete, UpdateAll, - UpdateAvailable + UpdateDynamic }; interface TargetManager { |