From b18f993395a4857eb64d80ea73fbae89d45a5441 Mon Sep 17 00:00:00 2001 From: nilabjar Date: Mon, 17 Sep 2007 21:00:22 +0000 Subject: Mon Sep 17 20:53:15 UTC 2007 Nishanth Shankaran --- CIAO/ChangeLog | 322 +------------- CIAO/DAnCE/NodeManager/CIAO_Monitor.cpp | 10 +- CIAO/DAnCE/NodeManager/MonitorController.cpp | 60 +-- CIAO/DAnCE/NodeManager/NA_Monitor.cpp | 30 +- CIAO/DAnCE/TM_Daemon/Client_Task.cpp | 26 ++ CIAO/DAnCE/TM_Daemon/Client_Task.h | 27 ++ CIAO/DAnCE/TM_Daemon/DomainDataManager.cpp | 614 +++------------------------ CIAO/DAnCE/TM_Daemon/DomainDataManager.h | 201 ++------- CIAO/DAnCE/TM_Daemon/Handler_i.cpp | 14 +- CIAO/DAnCE/TM_Daemon/Handler_i.h | 29 +- CIAO/DAnCE/TM_Daemon/Profile_Code.cpp | 34 +- CIAO/DAnCE/TM_Daemon/Profile_Code.h | 10 +- CIAO/DAnCE/TM_Daemon/TM_Daemon.cpp | 64 ++- CIAO/DAnCE/TM_Daemon/TM_Daemon.mpc | 1 + 14 files changed, 308 insertions(+), 1134 deletions(-) create mode 100644 CIAO/DAnCE/TM_Daemon/Client_Task.cpp create mode 100644 CIAO/DAnCE/TM_Daemon/Client_Task.h diff --git a/CIAO/ChangeLog b/CIAO/ChangeLog index b5587bd10c6..0c846c0d78b 100644 --- a/CIAO/ChangeLog +++ b/CIAO/ChangeLog @@ -1,3 +1,22 @@ +Mon Sep 17 20:53:15 UTC 2007 Nishanth Shankaran + + * DAnCE/NodeManager/CIAO_Monitor.cpp: + * DAnCE/NodeManager/MonitorController.cpp: + * DAnCE/NodeManager/NA_Monitor.cpp: + + * DAnCE/TM_Daemon/Client_Task.h: + * DAnCE/TM_Daemon/Client_Task.cpp: + * DAnCE/TM_Daemon/DomainDataManager.h: + * DAnCE/TM_Daemon/DomainDataManager.cpp: + * DAnCE/TM_Daemon/Handler_i.h: + * DAnCE/TM_Daemon/Handler_i.cpp: + * DAnCE/TM_Daemon/Profile_Code.h: + * DAnCE/TM_Daemon/Profile_Code.cpp: + * DAnCE/TM_Daemon/TM_Daemon.cpp: + * DAnCE/TM_Daemon/TM_Daemon.mpc: + + Checking a new version of the TM monitor. + Fri Sep 7 21:25:06 UTC 2007 Nilabja R * DAnCE/TM_Daemon/README: @@ -29,306 +48,5 @@ Thu Sep 6 23:14:59 UTC 2007 Nilabja R * DAnCE/TM_Daemon/Profile_Code.cpp: * DAnCE/TM_Daemon/TM_Daemon.cpp: * DAnCE/TM_Daemon/TM_Daemon.mpc: - Files needed for Onlinie Monitoring - -Tue Sep 4 14:25:24 UTC 2007 Abdullah Sowayan - - * performance-tests/Benchmark/RoundTripClient/RoundTripClient_exec.cpp: - * performance-tests/Benchmark/RoundTripClient/client.cpp: - Untabify. - -Mon Sep 03 02:50:30 CDT 2007 Johnny Willemsen - - * CIAO version 0.6 released. - -Mon Aug 27 23:04:36 UTC 2007 Nilabja R - - * ciao/Servant_Impl_Base.h: - Deleted the Private Constructor in the class Servant_Impl_Base. - This strangely solves the problem on Bug 3060. - -Mon Aug 27 13:21:14 UTC 2007 Abdullah Sowayan - - * tools/Config_Handlers/ADD_Handler.cpp: - * tools/Config_Handlers/Any_Handler.h: - * tools/Config_Handlers/CCD_Handler.cpp: - * tools/Config_Handlers/CEPE_Handler.h: - * tools/Config_Handlers/CPD_Handler.h: - * tools/Config_Handlers/DP_PCD_Handler.h: - * tools/Config_Handlers/DP_PCD_Handler.cpp: - * tools/Config_Handlers/ERE_Handler.h: - * tools/Config_Handlers/IDD_Handler.cpp: - * tools/Config_Handlers/Package_Handlers/CAD_Handler.cpp: - * tools/Config_Handlers/Package_Handlers/CID_Handler.cpp: - * tools/Config_Handlers/Package_Handlers/CPD_Handler.h: - * tools/Config_Handlers/Package_Handlers/CPD_Handler.cpp: - * tools/Config_Handlers/Package_Handlers/Comp_Intf_Descr_Handler.cpp: - * tools/Config_Handlers/Package_Handlers/IAD_Handler.cpp: - * tools/Config_Handlers/Package_Handlers/PCD_Handler.cpp: - * tools/Config_Handlers/Package_Handlers/SID_Handler.h: - * tools/Config_Handlers/Property_Handler.h: - * tools/Config_Handlers/RT-CCM/TPL_Handler.h: - * tools/Config_Handlers/Req_Handler.h: - * tools/Config_Handlers/Req_Handler.cpp: - * tools/Config_Handlers/STD_CID_Handler.cpp: - * tools/Config_Handlers/SatisfierProperty_Handler.h: - * tools/Config_Handlers/Utils/XML_Helper.h: - * tools/Config_Handlers/XSCRT/Traversal.hpp: - Untabify. - -Fri Aug 24 14:23:06 UTC 2007 Abdullah Sowayan - - * examples/BasicSP/EC/controller.cpp: - * examples/Display/NavDisplayGUI_exec/DetailView.cpp: - * examples/Display/NavDisplayGUI_exec/MapView.cpp: - * examples/Hello/Receiver/Receiver_exec.h: - * examples/Hello/Sender/starter.cpp: - * examples/Null_Component/plan.h: - * examples/Swapping/Receiver/Receiver_exec.h: - * examples/Swapping/Sender/starter.cpp: - Untabify. - -Thu Aug 23 22:21:16 UTC 2007 Abdullah Sowayan - - * DAnCE/Deployment/CIAO_NodeApplication_CallBack.idl: - * DAnCE/NodeApplication/NodeApplication_Impl.cpp: - * DAnCE/RepositoryManager/ZIP_Wrapper.cpp: - Untabify. - -Tue Aug 21 14:43:24 UTC 2007 Abdullah Sowayan - - * DAnCE/Interfaces/ExecutionManager_stub_export.h: - * DAnCE/Interfaces/NodeManager_stub_export.h: - * DAnCE/Interfaces/NodeManager_svnt_export.h: - * DAnCE/NodeApplication/CIAO_NodeApplication_export.h: - * DAnCE/NodeApplication/NA_Configurator_Export.h: - * DAnCE/NodeApplication/NoOp_Configurator_export.h: - * DAnCE/NodeApplication/NodeApp_Configurator_Export.h: - * DAnCE/NodeApplication/RTNA_Configurator_Export.h: - * DAnCE/NodeApplicationManager/CIAO_NAM_Export.h: - * DAnCE/TargetManager/TargetManager_exec_export.h: - * DAnCE/TargetManager/TargetManager_stub_export.h: - * DAnCE/TargetManager/TargetManager_svnt_export.h: - * DAnCE/tests/NodeApplicationTest/RoundTrip_exec_export.h: - * DAnCE/tests/NodeApplicationTest/RoundTrip_stub_export.h: - * DAnCE/tests/NodeApplicationTest/RoundTrip_svnt_export.h: - * ciao/CIAO_Client_Export.h: - * ciao/CIAO_Container_Export.h: - * ciao/CIAO_Server_Export.h: - * ciaosvcs/Events/CIAO_Events_Base/CIAO_Events_Export.h: - * ciaosvcs/Events/CIAO_Events_Export.h: - * docs/tutorials/Quoter/Simple/Broker/Broker_exec_export.h: - * docs/tutorials/Quoter/Simple/Broker/Broker_stub_export.h: - * docs/tutorials/Quoter/Simple/Broker/Broker_svnt_export.h: - * docs/tutorials/Quoter/Simple/Distributor/Distributor_exec_export.h: - * docs/tutorials/Quoter/Simple/Distributor/Distributor_stub_export.h: - * docs/tutorials/Quoter/Simple/Distributor/Distributor_svnt_export.h: - * docs/tutorials/Quoter/Simple/Stock_Base/Stock_Base_skel_export.h: - * docs/tutorials/Quoter/Simple/Stock_Base/Stock_Base_stub_export.h: - * examples/Display/NavDisplayGUI_exec/NavDisplayGUI_exec_exec_export.h: - * examples/Display/NavDisplayGUI_exec/NavDisplayGUI_exec_export.h: - * examples/Display/NavDisplayGUI_exec/NavDisplayGUI_exec_stub_export.h: - * examples/Display/NavDisplayGUI_exec/NavDisplayGUI_exec_svnt_export.h: - * examples/Display/NavDisplayGUI_exec/NavDisplayGUI_stub_export.h: - * examples/Display/NavDisplayGUI_exec/NavDisplayGUI_svnt_export.h: - * examples/Display/RateGen/RateGen_exec_export.h: - * examples/Hello/Hello_Base/Hello_Base_stub_export.h: - * examples/Hello/Hello_Base/Hello_Base_svnt_export.h: - * examples/Hello/Receiver/Receiver_exec_export.h: - * examples/Hello/Receiver/Receiver_stub_export.h: - * examples/Hello/Receiver/Receiver_svnt_export.h: - * examples/Hello/Sender/Sender_exec_export.h: - * examples/Hello/Sender/Sender_stub_export.h: - * examples/Hello/Sender/Sender_svnt_export.h: - * examples/Swapping/Hello_Base/Hello_Base_stub_export.h: - * examples/Swapping/Hello_Base/Hello_Base_svnt_export.h: - * examples/Swapping/Receiver/Receiver_exec_export.h: - * examples/Swapping/Receiver/Receiver_stub_export.h: - * examples/Swapping/Receiver/Receiver_svnt_export.h: - * examples/Swapping/Sender/Sender_exec_1_export.h: - * examples/Swapping/Sender/Sender_exec_2_export.h: - * examples/Swapping/Sender/Sender_exec_export.h: - * examples/Swapping/Sender/Sender_stub_export.h: - * examples/Swapping/Sender/Sender_svnt_export.h: - * performance-tests/Benchmark/Benchmark_stub_export.h: - * performance-tests/Benchmark/Benchmark_svnt_export.h: - * performance-tests/Benchmark/RoundTrip/RoundTrip_exec_export.h: - * performance-tests/Benchmark/RoundTrip/RoundTrip_stub_export.h: - * performance-tests/Benchmark/RoundTrip/RoundTrip_svnt_export.h: - * performance-tests/Benchmark/RoundTripClient/RoundTripClient_exec_export.h: - * performance-tests/Benchmark/RoundTripClient/RoundTripClient_stub_export.h: - * performance-tests/Benchmark/RoundTripClient/RoundTripClient_svnt_export.h: - * performance-tests/Protocols/Receiver/Receiver_exec_export.h: - * performance-tests/Protocols/Receiver/Receiver_stub_export.h: - * performance-tests/Protocols/Receiver/Receiver_svnt_export.h: - * performance-tests/Protocols/Sender/Sender_exec_export.h: - * performance-tests/Protocols/Sender/Sender_stub_export.h: - * performance-tests/Protocols/Sender/Sender_svnt_export.h: - * performance-tests/Protocols/common/Protocols_skel_export.h: - * performance-tests/Protocols/common/Protocols_stub_export.h: - * tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint_exec_export.h: - * tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint_stub_export.h: - * tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint_svnt_export.h: - * tests/Bug_2130_Regression/interfaces/ENW_skel_export.h: - * tests/Bug_2130_Regression/interfaces/ENW_stub_export.h: - * tests/IDL3/Components/ComplexComponent/Attributes/Attributes_stub_export.h: - * tests/IDL3/Components/ComplexComponent/Attributes/Attributes_svnt_export.h: - * tests/IDL3/Components/ComplexComponent/EventSink/EventSink_stub_export.h: - * tests/IDL3/Components/ComplexComponent/EventSink/EventSink_svnt_export.h: - * tests/IDL3/Components/ComplexComponent/EventSource/EventSource_stub_export.h: - * tests/IDL3/Components/ComplexComponent/EventSource/EventSource_svnt_export.h: - * tests/IDL3/Components/ComplexComponent/Facets/Facets_stub_export.h: - * tests/IDL3/Components/ComplexComponent/Facets/Facets_svnt_export.h: - * tests/IDL3/Components/ComplexComponent/Receptacles/Receptacles_stub_export.h: - * tests/IDL3/Components/ComplexComponent/Receptacles/Receptacles_svnt_export.h: - * tests/IDL3/Components/SimpleComponent/SimpleComponent_exec_export.h: - * tests/IDL3/Components/SimpleComponent/SimpleComponent_stub_export.h: - * tests/IDL3/Components/SimpleComponent/SimpleComponent_svnt_export.h: - * tests/IDL3/Events/Abstract/Abstract_stub_export.h: - * tests/IDL3/Events/Abstract/Abstract_svnt_export.h: - * tests/IDL3/Events/Regular/Regular_stub_export.h: - * tests/IDL3/Events/Regular/Regular_svnt_export.h: - * tests/IDL3/Homes/Attributes/HomeAttributes_stub_export.h: - * tests/IDL3/Homes/Attributes/HomeAttributes_svnt_export.h: - * tests/IDL3/Homes/Basic/Basic_stub_export.h: - * tests/IDL3/Homes/Basic/Basic_svnt_export.h: - * tests/IDL3/Homes/Factory/Factory_stub_export.h: - * tests/IDL3/Homes/Factory/Factory_svnt_export.h: - * tests/IDL3/Homes/Finder/Finder_stub_export.h: - * tests/IDL3/Homes/Finder/Finder_svnt_export.h: - * tests/IDL3/Homes/Inheritance/Inheritance_stub_export.h: - * tests/IDL3/Homes/Inheritance/Inheritance_svnt_export.h: - * tests/IDL3/ImpliedIDL/Components/Basic/ICBasic_stub_export.h: - * tests/IDL3/ImpliedIDL/Components/Basic/ICBasic_svnt_export.h: - * tests/IDL3/ImpliedIDL/Components/EventSink/ICEventSink_stub_export.h: - * tests/IDL3/ImpliedIDL/Components/EventSink/ICEventSink_svnt_export.h: - * tests/IDL3/ImpliedIDL/Components/EventSource/ICEventSource_stub_export.h: - * tests/IDL3/ImpliedIDL/Components/EventSource/ICEventSource_svnt_export.h: - * tests/IDL3/ImpliedIDL/Components/Receptacles/ICReceptacles_stub_export.h: - * tests/IDL3/ImpliedIDL/Components/Receptacles/ICReceptacles_svnt_export.h: - * tests/IDL3/ImpliedIDL/Events/Events_stub_export.h: - * tests/IDL3/ImpliedIDL/Events/Events_svnt_export.h: - * tests/IDL3/ImpliedIDL/Homes/Homes_stub_export.h: - * tests/IDL3/ImpliedIDL/Homes/Homes_svnt_export.h: - * tests/Minimum/Minimum_Base/Minimum_Base_stub_export.h: - * tests/Minimum/Minimum_Base/Minimum_Base_svnt_export.h: - * tests/Minimum/Receiver/Receiver_exec_export.h: - * tests/Minimum/Receiver/Receiver_stub_export.h: - * tests/Minimum/Receiver/Receiver_svnt_export.h: - * tests/Minimum/Sender/Sender_exec_export.h: - * tests/Minimum/Sender/Sender_stub_export.h: - * tests/Minimum/Sender/Sender_svnt_export.h: - * tools/Config_Handlers/CIAO_Events/CIAO_Events_Handlers_Export.h: - * tools/Config_Handlers/DynAny_Handler/DynAny_Handler_Export.h: - * tools/Config_Handlers/RT-CCM/RT_CCM_Handlers_Export.h: - * tools/Config_Handlers/Utils/CIAO_XML_Utils_Export.h: - * tools/Config_Handlers/XSC_XML_Handlers_Export.h: - * tools/IDL3_to_IDL2/TAO_IDL3_TO_IDL2_BE_Export.h: - - Regenerated export files to address compile-time problems - for static MSVC71 builds. - -Mon Aug 20 12:38:12 UTC 2007 Johnny Willemsen - - * docs/tutorials/Quoter/Simple/03.html: - Corrected invalid hyperlink - -Wed Aug 8 13:41:12 UTC 2007 Johnny Willemsen - - * performance-tests/Protocols/Sender/Sender_exec.cpp: - Added needed include due to refactoring - -Wed Aug 8 07:03:33 UTC 2007 Jeff Parsons - - * tools/IDL3_to_IDL2/identifier_helper.cpp (original_local_name): - - To the code that removes a prepended '_cxx_' from an indentifier, - added a check to make sure it was added automatically to avoid - a C++ keyword clash, and not by the user. - -Tue Aug 7 08:57:46 UTC 2007 Jeff Parsons - - * tests/IDL3/ImpliedIDL/All/include.idl: - * tests/IDL3/ImpliedIDL/All/raw_include.idl: - * tests/IDL3/ImpliedIDL/All/pass_through.idl: - - Added #ifndef guards. - -Mon Aug 6 13:00:10 UTC 2007 Jeff Parsons - - * tools/IDL3_to_IDL2/identifier_helper.cpp (orig_sn): - - Fixed a problem with Borland BCB6 Pro not finding an implicit - conversion from ACE_CString to char*. - -Fri Aug 3 07:40:11 UTC 2007 Jeff Parsons - - * tools/IDL3_to_IDL2/README: - * tests/IDL3/ImpliedIDL/All/README: - - Updated documentation in these directories. - -Fri Aug 3 07:01:35 UTC 2007 Jeff Parsons - - * tools/IDL3_to_IDL2/basic_visitor.cpp: - * tools/IDL3_to_IDL2/basic_visitor.h: - * tools/IDL3_to_IDL2/be_sunsoft.cpp: - * tools/IDL3_to_IDL2/be_sunsoft.h: - * tools/IDL3_to_IDL2/identifier_helper.cpp: - * tools/IDL3_to_IDL2/be_helper.cpp: - * tools/IDL3_to_IDL2/idl3_to_idl2_visitor.cpp: - * tools/IDL3_to_IDL2/identifier_helper.h: - * tools/IDL3_to_IDL2/be_helper.h: - - - Changes incorporating enhancements by folks at Thales ATM to - better handle the mapping of escaped identifiers (masking - IDL keywords) and identifiers that are C++ keywords from - IDL3 to IDL2. Thanks to Hakim Souami - for leading this - effort. - - - Further changes to build on those above by adding keyword - handling support for scoped names and component port names. - - - Addition of the capability, also from Thales ATM, to - optionally generate #includes of IDL files without the - addition of the default '_IDL2' suffix. This feature is - necessary when included IDL files aren't available for - conversion or when 'system' IDL files are included and - contain only IDL declarations with no 'implied IDL' - mapping. It is also handy for users who may have similar - IDL files included and don't wish to run the conversion - on them needlessly. While Thales ATM's version of this - feature uses a list of 'excluded' filenames in a text - file, the feature in this version uses a command line - option '-x ' for each file to be excluded. - - * tests/IDL3/ImpliedIDL/All/raw_include.idl: - * tests/IDL3/ImpliedIDL/All/keyword_clash.idl: - - New files that expand the test coverage to include the new - festures described above. - - * tests/IDL3/ImpliedIDL/All/all.mpc: - * tests/IDL3/ImpliedIDL/All/pass_through.idl: - - Changes to existing test files to make use of the new files - listed above. - -Thu Aug 2 03:37:40 UTC 2007 Krishnakumar B - - * examples/BasicSP/BMDisplay/BMDisplay.mpc: - - Added a dependency from BMDisplay_exec to BasicSP_exec. Fixes - problems due to build order. Thanks to Johnny and Gan for - reporting the problem. - -Fri Jul 27 06:50:14 CDT 2007 Johnny Willemsen - - * CIAO version 0.5.10 released. -Local Variables: -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: + Files needed for Onlinie Monitoring diff --git a/CIAO/DAnCE/NodeManager/CIAO_Monitor.cpp b/CIAO/DAnCE/NodeManager/CIAO_Monitor.cpp index c86b3eed3b8..607faa13269 100644 --- a/CIAO/DAnCE/NodeManager/CIAO_Monitor.cpp +++ b/CIAO/DAnCE/NodeManager/CIAO_Monitor.cpp @@ -70,10 +70,10 @@ int CIAO::CIAO_Monitor::stop () // current_domain_->node[0].name.in ())); } - ACE_DEBUG ((LM_DEBUG , - "CIAO_Monitor::Inside the get_current_data of[%s]\n", - current_domain_->node[0].name.in ())); - +// ACE_DEBUG ((LM_DEBUG , +// "CIAO_Monitor::Inside the get_current_data of[%s]\n", +// current_domain_->node[0].name.in ())); + CORBA::Double current_load = 0; current_load = calculate_load (); @@ -81,7 +81,7 @@ int CIAO::CIAO_Monitor::stop () CORBA::Any any; any <<= current_load; - ACE_DEBUG ((LM_DEBUG, "The current load is %f\n", current_load)); + // ACE_DEBUG ((LM_DEBUG, "The current load is %f\n", current_load)); // here insert the util value, in the right position diff --git a/CIAO/DAnCE/NodeManager/MonitorController.cpp b/CIAO/DAnCE/NodeManager/MonitorController.cpp index 51c4588e4e5..54983d6346a 100644 --- a/CIAO/DAnCE/NodeManager/MonitorController.cpp +++ b/CIAO/DAnCE/NodeManager/MonitorController.cpp @@ -61,26 +61,26 @@ CIAO::MonitorController::MonitorController (CORBA::ORB_ptr orb, int CIAO::MonitorController::init () { - ACE_DEBUG ((LM_DEBUG , "Inside the init function [%s]\n", + ACE_DEBUG ((LM_DEBUG , "Inside the init function [%s]\n", initial_domain_.node[0].name.in ())); create_the_servant (); - ACE_DEBUG ((LM_DEBUG , "After the create servant function [%s]\n", + ACE_DEBUG ((LM_DEBUG , "After the create servant function [%s]\n", initial_domain_.node[0].name.in ())); upload_obj_ref (); - ACE_DEBUG ((LM_DEBUG , "After the upload obj ref function [%s]\n", + ACE_DEBUG ((LM_DEBUG , "After the upload obj ref function [%s]\n", initial_domain_.node[0].name.in ())); // Parse the intial domain and setup the options parse_initial_domain (); - ACE_DEBUG ((LM_DEBUG , "After the parse_initial_domain function [%s]\n", + ACE_DEBUG ((LM_DEBUG , "After the parse_initial_domain function [%s]\n", initial_domain_.node[0].name.in ())); - + // Populat and startup the monitor list populate_monitor_list (); - ACE_DEBUG ((LM_DEBUG , "After the populate monitor list function [%s]\n", + ACE_DEBUG ((LM_DEBUG , "After the populate monitor list function [%s]\n", initial_domain_.node[0].name.in ())); return 1; @@ -88,31 +88,33 @@ int CIAO::MonitorController::init () ::Deployment::Domain* CIAO::MonitorController::update_data_for_TM () { - ACE_DEBUG ((LM_DEBUG , "The list size is %d\n", - monitor_list_.size ())); +// ACE_DEBUG ((LM_DEBUG , "The list size is %d\n", +// monitor_list_.size ())); - ::Deployment::Domain* domain = + ::Deployment::Domain* domain = new ::Deployment::Domain (this->initial_domain_); // Set the new domain resource to zero domain->node[0].resource.length (0); -// form the monitor time file name +// form the monitor time file name + +/* std::string mon_file = domain->node[0].name.in (); mon_file += "_Tmon"; Profile_Code prf_mon (mon_file); +*/ - for (size_t i =0;i < monitor_list_.size ();i++) + for (size_t i = 0;i < monitor_list_.size ();i++) { - - prf_mon.start (); + // prf_mon.start (); ::Deployment::Domain *new_domain = monitor_list_[i]->monitor_->get_current_data (); add_resource_to_domain (*domain , *new_domain); - prf_mon.stop (); + // prf_mon.stop (); } return domain; @@ -120,13 +122,13 @@ int CIAO::MonitorController::init () int CIAO::MonitorController::svc (void) { - ACE_DEBUG ((LM_DEBUG , "Inside the Node for [%s]\n", - initial_domain_.node[0].name.in ())); - +// ACE_DEBUG ((LM_DEBUG , "Inside the Node for [%s]\n", +// initial_domain_.node[0].name.in ())); + // Parse the intial domain and setup the options parse_initial_domain (); - + // Populat and startup the monitor list populate_monitor_list (); @@ -330,7 +332,7 @@ void CIAO::MonitorController::populate_monitor_list () } // if monitor_cpu_usage if (monitor_NA_usage_) { - + // create a MonitorElement monitor_elem = new MonitorElement; @@ -340,7 +342,7 @@ void CIAO::MonitorController::populate_monitor_list () monitor_elem->lib_name_ += na_monitor_lib_name; ACE_DEBUG ((LM_DEBUG, "Inside the NA_Usage\n")); - + ACE_DEBUG ((LM_DEBUG, "NA Monitor Lib name %s\n", monitor_elem->lib_name_.c_str () )); int retval @@ -446,7 +448,7 @@ void CIAO::MonitorController::upload_obj_ref () orb_->resolve_initial_references ("NameService"); CosNaming::NamingContext_var naming_context = CosNaming::NamingContext::_narrow (naming_context_object.in ()); - + // check for context first CosNaming::Name name (1); name.length (1); @@ -458,7 +460,7 @@ void CIAO::MonitorController::upload_obj_ref () } catch (CosNaming::NamingContext::NotFound& ex) { - ex._tao_print_exception ("MonitorController::upload_obj_ref\t\n"); + ex._tao_print_exception ("MonitorController::upload_obj_ref\t\n"); try { @@ -466,7 +468,7 @@ void CIAO::MonitorController::upload_obj_ref () } catch (CORBA::Exception & e) { - ex._tao_print_exception ("MonitorController::upload_obj_ref:bind_new_context\t\n"); + ex._tao_print_exception ("MonitorController::upload_obj_ref:bind_new_context\t\n"); return; } @@ -483,7 +485,7 @@ void CIAO::MonitorController::upload_obj_ref () } catch (CORBA::Exception& ex) { - ex._tao_print_exception ("MonitorController::upload_obj_ref\t\n"); + ex._tao_print_exception ("MonitorController::upload_obj_ref\t\n"); return; } } @@ -494,15 +496,15 @@ void CIAO::MonitorController::create_the_servant () orb_->resolve_initial_references ("RootPOA"); poa_ = PortableServer::POA::_narrow (poa_object.in ()); - - monitor_i_ = new Onl_Monitor_NM_Monitor_i (this, this->node_mgr_); - + + monitor_i_ = new Onl_Monitor_NM_Monitor_i (this, this->node_mgr_); + monitorv_ = monitor_i_->_this (); } -auto_ptr +auto_ptr CIAO::MonitorController::get_initial_domain () { auto_ptr domain (new ::Deployment::Domain (this->initial_domain_)); - return domain; + return domain; } diff --git a/CIAO/DAnCE/NodeManager/NA_Monitor.cpp b/CIAO/DAnCE/NodeManager/NA_Monitor.cpp index 6367e3f0eb8..ade554b50d2 100644 --- a/CIAO/DAnCE/NodeManager/NA_Monitor.cpp +++ b/CIAO/DAnCE/NodeManager/NA_Monitor.cpp @@ -193,12 +193,12 @@ int CIAO::NA_Monitor::stop () ::Deployment::Domain* CIAO::NA_Monitor::get_current_data () { - // if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG , - "NA_Monitor::Inside the get_current_data of[%s]\n", - current_domain_->node[0].name.in ())); - } +// if (CIAO::debug_level () > 9) +// { +// ACE_DEBUG ((LM_DEBUG , +// "NA_Monitor::Inside the get_current_data of[%s]\n", +// current_domain_->node[0].name.in ())); +// } // first get the process id for the NA from the controller @@ -207,8 +207,8 @@ int CIAO::NA_Monitor::stop () ACE_Unbounded_Set_Iterator iter (cids.process_ids_); - ACE_DEBUG ((LM_DEBUG , "The size of the Process Set is %d \n", - cids.process_ids_.size ())); +// ACE_DEBUG ((LM_DEBUG , "The size of the Process Set is %d \n", +// cids.process_ids_.size ())); size_t counter = 0; // get process data for each NA process @@ -241,7 +241,7 @@ int CIAO::NA_Monitor::stop () // ACE_DEBUG ((LM_INFO, "\n%3.2f\n", current_load)); - std::cout << "\n The NA load is " << current_load << std::endl; + // std::cout << "\n The NA load is " << current_load << std::endl; if (current_load > 100 || current_load < 0) current_load = 100; @@ -289,10 +289,10 @@ int CIAO::NA_Monitor::stop () - if (CIAO::debug_level () > 9) - { - //ACE_DEBUG ((LM_DEBUG , "CIAO::Monitor::Exiting from the get_current_data function\n")); - } +// if (CIAO::debug_level () > 9) +// { +// //ACE_DEBUG ((LM_DEBUG , "CIAO::Monitor::Exiting from the get_current_data function\n")); +// } return current_domain_.get (); } @@ -321,8 +321,8 @@ CIAO::NA_Monitor::read_data (pid_t pid) std::ifstream ifstream_; - ACE_DEBUG ((LM_DEBUG, "The file name is %s\n", - str.str ().c_str ())); +// ACE_DEBUG ((LM_DEBUG, "The file name is %s\n", +// str.str ().c_str ())); ifstream_.open (str.str ().c_str (), std::ios_base::in); diff --git a/CIAO/DAnCE/TM_Daemon/Client_Task.cpp b/CIAO/DAnCE/TM_Daemon/Client_Task.cpp new file mode 100644 index 00000000000..cba31c52026 --- /dev/null +++ b/CIAO/DAnCE/TM_Daemon/Client_Task.cpp @@ -0,0 +1,26 @@ +#include "Client_Task.h" + +Client_Task::Client_Task (CORBA::ORB_ptr orb) + : orb_ (CORBA::ORB::_duplicate (orb)) + +{ +} + +int +Client_Task::svc (void) +{ + try + { +// while (!manager->got_all_response ()) +// { +// if (orb->work_pending ()) +// { +// orb->perform_work (); +// } +// } + + this->orb_->run (); + } + catch (const CORBA::Exception&){} + return 0; +} diff --git a/CIAO/DAnCE/TM_Daemon/Client_Task.h b/CIAO/DAnCE/TM_Daemon/Client_Task.h new file mode 100644 index 00000000000..75d2bbf86a0 --- /dev/null +++ b/CIAO/DAnCE/TM_Daemon/Client_Task.h @@ -0,0 +1,27 @@ +#ifndef CLIENT_TASK_H +#define CLIENT_TASK_H +#include /**/ "ace/pre.h" + +#include "tao/ORB.h" +#include "ace/Task.h" + +/// Implement a simple ACE_Task to run the ORB event loop +/** + * This class is used to implement a simple thread pool. + */ +class Client_Task : public ACE_Task_Base +{ +public: + /// Constructor + Client_Task (CORBA::ORB_ptr orb); + + /// The thread entry point + virtual int svc (void); + +private: + /// Keep a reference to the ORB + CORBA::ORB_var orb_; +}; + +#include /**/ "ace/post.h" +#endif /* CLIENT_TASK_H */ diff --git a/CIAO/DAnCE/TM_Daemon/DomainDataManager.cpp b/CIAO/DAnCE/TM_Daemon/DomainDataManager.cpp index 45f1de77f7a..a3b24bd1c99 100644 --- a/CIAO/DAnCE/TM_Daemon/DomainDataManager.cpp +++ b/CIAO/DAnCE/TM_Daemon/DomainDataManager.cpp @@ -9,16 +9,14 @@ #include -#include - const char * domain_file_name = "Domain.cdd"; CIAO::DomainDataManager* CIAO::DomainDataManager::global_data_manager_ = 0; -CIAO::DomainDataManager * CIAO::DomainDataManager::create (CORBA::ORB_ptr orb, - ::Deployment::TargetManager_ptr target, - const char* dat_file - ) +CIAO::DomainDataManager * +CIAO::DomainDataManager::create (CORBA::ORB_ptr orb, + ::Deployment::TargetManager_ptr target, + const char* dat_file) { if (global_data_manager_ == 0) { @@ -50,116 +48,72 @@ int CIAO::DomainDataManager::update_domain ( // Update the subset of the domain which the above // parameter corresponds to - ACE_DEBUG ((LM_DEBUG, "THe update domain called\n")); + // ACE_DEBUG ((LM_DEBUG, "[TM] Update domain called\n")); //check the type of update .. - ex_occur = false; + this->update_dynamic (domainSubset); + +// switch (update_kind) +// { +// case ::Deployment::UpdateAll: +// case ::Deployment::UpdateDynamic: +// this->update_dynamic (domainSubset); +// break; + +// case ::Deployment::Add: +// ex_occur = true; +// break; +// default: +// return 1; +// } + return 0; - switch (update_kind) - { - case ::Deployment::UpdateAll: - case ::Deployment::UpdateDynamic: - break; - case ::Deployment::Add: - ex_occur = true; - //add_to_domain (domainSubset); - break; - case ::Deployment::Delete: - delete_from_domain (domainSubset); - break; - default: - break; - } +} +int +CIAO::DomainDataManager::update_dynamic (const ::Deployment::Domain + &domainSubset) +{ CORBA::ULong const size = current_domain_.node.length (); + this->node_info_map_ [domainSubset.node[0].name.in ()] = domainSubset.node[0]; - if (ex_occur == false) - { - ACE_GUARD_RETURN (ACE_Thread_Mutex, guard, lock, 0); - - Profile_Code prfTagg ("Tagg"); - - prfTagg.start (); - - CORBA::ULong i; - for (i=0;i < size;i++) - { - if (!ACE_OS::strcmp (domainSubset.node[0].name , - current_domain_.node[i].name)) - { - // found a match - // for now overwrite the entire Node info ... - // but later , this has to be changed to overwrite - // only the specific part ... - current_domain_.node[i] = domainSubset.node[0]; - - CORBA::Double load; - current_domain_.node[i].resource[0].property[0].value >>= load; - ACE_DEBUG ((LM_DEBUG, "The current load is %f\n", load)); - break; // finished job ...break - } - } - if (i == size) - { - // thus the node is new .. add it to current_domain_ - // later change it ... - current_domain_.node.length (size+1); - current_domain_.node[size]=domainSubset.node[0]; - } - prfTagg.stop (); - - } - - - profile_nodes_[domainSubset.node[0].name.in ()]->stop (); + int temp_count; + this->mutex_.acquire (); this->response_count_++; + temp_count = this->response_count_; + this->mutex_.release (); - if (this->response_count_ == current_domain_.node.length ()) + if (temp_count == current_domain_.node.length ()) { - this->got_all_response_ = true; - // all responses have come in .... now time stamp the event this->profile_->stop (); + this->profile_->dump (); + for (std::map::iterator itr = this->profile_nodes_.begin (); + itr != this->profile_nodes_.end (); + itr++) + { + (*itr).second->dump (); - // now delete the object then file will be closed .. - delete this->profile_; - } + } + this->got_all_response_ = true; - if (ex_occur = true) - return 0; + } - CORBA::ULong response_time; + // CORBA::Double load; + // domainSubset.node[0].resource[0].property[0].value >>= load; + // ACE_DEBUG ((LM_DEBUG, "The current load is %f\n", load)); - domainSubset.node[0].qos_seq[0].value >>= response_time; - ACE_DEBUG ((LM_DEBUG, "The response time is %u\n", response_time)); + profile_nodes_[domainSubset.node[0].name.in ()]->stop (); -/* - CORBA::Double cpu_load; - CORBA::Double na_load; - for (CORBA::ULong i =0; - i < domainSubset.node[0].resource.length (); - i++) - { - if (!strcmp (domainSubset.node[0].resource[i].name.in (), "NA_Monitor")) - domainSubset.node[0].resource[i].property[0].value >>= na_load; + // CORBA::ULong response_time; - if (!strcmp (domainSubset.node[0].resource[i].name.in (), "Processor")) - domainSubset.node[0].resource[i].property[0].value >>= cpu_load; - } -*/ -// std::ofstream out (domainSubset.node[0].name.in (), std::ios::app); -// out << cpu_load -// << "\t" -// << na_load -// << "\t" -// << response_time -// << std::endl; + // domainSubset.node[0].qos_seq[0].value >>= response_time; -// out.close (); + // ACE_DEBUG ((LM_DEBUG, "The response time is %u\n", response_time)); return 0; } @@ -170,8 +124,8 @@ DomainDataManager (CORBA::ORB_ptr orb, const char* dat_file) : orb_ (CORBA::ORB::_duplicate (orb)), deployment_config_ (orb_.in()), - target_mgr_ (::Deployment::TargetManager::_duplicate(target)), - dat_file_ (dat_file) + dat_file_ (dat_file), + profile_ (new Profile_Code ("Tst")) { CIAO::Config_Handlers::DD_Handler dd (domain_file_name); ::Deployment::Domain* dmn = dd.domain_idl (); @@ -182,34 +136,19 @@ DomainDataManager (CORBA::ORB_ptr orb, current_domain_ = *dmn; initial_domain_ = current_domain_; - // initialize the provisioning domain - provisioned_data_ = initial_domain_; - - update_node_status (); + // update_node_status (); - // set up the profile timers for each node + // set up the profile timers for each node for (int i = 0;i < current_domain_.node.length ();i++) { profile_nodes_[current_domain_.node[i].name.in ()] = - new Profile_Code (current_domain_.node[i].name.in ()); + new Profile_Code (current_domain_.node[i].name.in ()); } - - call_all_node_managers (); } -::Deployment::Domain* CIAO::DomainDataManager::get_current_domain () -{ - return new ::Deployment::Domain (provisioned_data_); -} - -::Deployment::Domain* CIAO::DomainDataManager::get_initial_domain () -{ - return new ::Deployment::Domain (initial_domain_); -} - int CIAO::DomainDataManager::readin_domain_data () { // here read in Domain data ... @@ -268,7 +207,7 @@ int CIAO::DomainDataManager::call_all_node_managers () { ACE_DEBUG ((LM_DEBUG, "CAlling Join DOmain\n")); node_manager->joinDomain (sub_domain, - target_mgr_.in (), + NULL, log); } catch (CORBA::Exception& ex) @@ -284,207 +223,6 @@ int CIAO::DomainDataManager::call_all_node_managers () } -void CIAO::DomainDataManager -::commitResources ( - const ::Deployment::DeploymentPlan & plan) -{ - // commit the resources - // parse into the plan and commit resources ... - - // set the action value - current_action_ = commit; - - // temporary created to guard against exceptions - ::Deployment::Domain temp_provisioned_data = - provisioned_data_; - - for (CORBA::ULong i = 0;i < plan.instance.length ();i++) - { - for (CORBA::ULong j = 0;j < temp_provisioned_data.node.length ();j++) - { - if (!ACE_OS::strcmp (plan.instance[i].node.in () , - temp_provisioned_data.node[j].name.in ())) - { - try { - match_requirement_resource ( - plan.instance[i].deployedResource, - temp_provisioned_data.node[j].resource); - } - catch (::Deployment::ResourceCommitmentFailure& ex) - { - // catch the exception and add parameters - throw ex; - } - } - } - } - - // here commit the commitresources - provisioned_data_ = temp_provisioned_data; -} - - -void CIAO::DomainDataManager:: -releaseResources ( - const ::Deployment::DeploymentPlan& plan) -{ - // release the resources - - - // set the action value - current_action_ = release; - - for (CORBA::ULong i = 0;i < plan.instance.length ();i++) - { - 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 ())) - { - match_requirement_resource ( - plan.instance[i].deployedResource, - provisioned_data_.node[j].resource); - - } - } - } - -} - - -void CIAO::DomainDataManager:: -match_requirement_resource ( - ::Deployment::InstanceResourceDeploymentDescriptions deployed, - ::Deployment::Resources & available - ) -{ - // here match the deployed to the available - - for (CORBA::ULong i = 0;i < deployed.length ();i++) - { - // for each deployed resource ....search the corresponding - // available resource - for (CORBA::ULong j = 0;j < available.length ();j++) - { - if (!ACE_OS::strcmp (deployed[i].requirementName, available[j].name)) - { - if (CIAO::debug_level () > 9) - // search for the resourcename in the resourceType - for (CORBA::ULong k = 0;k < available[j].resourceType.length ();k++) - { - if (!ACE_OS::strcmp (deployed[i].resourceName, - available[j].resourceType[k])) - { - try { - match_properties (deployed[i].property, - available[j].property); - } - catch (::Deployment::ResourceCommitmentFailure& ex) - { - // catch the exception and add parameters - throw ex; - } - } - } - } - } - } - -} - -void CIAO::DomainDataManager:: -match_properties ( - ::Deployment::Properties deployed, - ::Deployment::SatisfierProperties & available) -{ - bool property_found; - - for (CORBA::ULong i = 0;i < deployed.length ();i++) - { - property_found = false; - - for (CORBA::ULong j = 0;j < available.length ();j++) - { - if (!ACE_OS::strcmp (deployed[i].name , available[j].name)) - { - // check kind here ....and then subtract .... - // accordingly , ..this is complex ... better to write - // some specialised algo - // for now assuming Capacity .... - // and tk_double .... - - commit_release_resource (deployed[i] , available[j]); - property_found = true; - } - } // internal for .... - - // check if property was found or not - if (property_found == false) - { - // throw an error since property was not found in the Resource - ::Deployment::ResourceCommitmentFailure failure; - - failure.reason = CORBA::string_dup ("Property Not Found\n"); - failure.propertyName = CORBA::string_dup (deployed[i].name); - failure.propertyValue.length (0); - - throw failure; - } - } // outside for ... -} - -void CIAO::DomainDataManager::commit_release_resource ( - ::Deployment::Property & deployed, - ::Deployment::SatisfierProperty & available) -{ - if (current_action_ == commit) - { - - CORBA::Long required_d; - - if ((deployed.value >>= required_d) == false) - ACE_ERROR ((LM_ERROR, "Failed to extract required amount\n")); - - CORBA::Long available_d; - - if ((available.value >>= available_d) == false) - ACE_ERROR ((LM_ERROR, "failed to extract available amount\n")); - - if (available_d >= required_d) - { - available_d = available_d - required_d; - - available.value <<= available_d; - } - else - { - ::Deployment::ResourceCommitmentFailure failure; - - failure.reason = CORBA::string_dup ("Insufficient resources!"); - failure.propertyName = CORBA::string_dup (available.name); - failure.propertyValue.length (1); - failure.propertyValue[0] = available.value; - - throw failure; - } - } - else - { - //must be release - // @todo check return value of >>= - CORBA::Long required_d; - deployed.value >>= required_d; - CORBA::Long available_d; - available.value >>= available_d; - - available_d = available_d + required_d; - - // Should we check for bin > 100 ?????? - - available.value <<= available_d; - } -} - void CIAO::DomainDataManager::stop_monitors () { @@ -527,230 +265,6 @@ void CIAO::DomainDataManager::stop_monitors () } -int CIAO::DomainDataManager::add_to_domain ( - const ::Deployment::Domain& domain) -{ - // here add the domain to the Domain - // right now use only a node - - // got to take care of the fact , that a node can be added , - // while it is still in the domain - - //iterate through the supplied domain - //for each node - // find it in the pristine domain - // and copy it back to the provisioned_domain - - for (CORBA::ULong i = 0;i < domain.node.length ();i++) - { - //find in the pristine domain - ::Deployment::Node a_node; - - if (!this->find_in_initial_domain (domain.node[i].name.in (), - a_node)) - continue; // dont know this node - - //check if already present - if (!this->find_in_provisioned_domain (domain.node[i].name.in (), - a_node)) - { - // add the node to the domain ... - provisioned_data_.node.length (provisioned_data_.node.length () + 1); - provisioned_data_.node[provisioned_data_.node.length () - 1] = - a_node; - } - } - - return 0; -} - -bool CIAO::DomainDataManager:: -find_in_initial_domain (const char* node_name, - ::Deployment::Node& node) -{ - for (CORBA::ULong i =0; - i < this->initial_domain_.node.length (); - i++) - { - if (ACE_OS::strcmp (node_name, this->initial_domain_.node[i].name.in ()) == 0) - { - node = this->initial_domain_.node[i]; - return true; - } - } - - // not found the node , return a node with an empty name - return false; -} - - -bool CIAO::DomainDataManager:: -find_in_provisioned_domain (const char* node_name, - ::Deployment::Node& node) -{ - for (CORBA::ULong i =0; - i < this->provisioned_data_.node.length (); - i++) - { - if (ACE_OS::strcmp (node_name, this->provisioned_data_.node[i].name.in ()) == 0) - { - node = this->provisioned_data_.node[i]; - return true; - } - } - - // not found the node , return a node with an empty name - return false; -} - -int CIAO::DomainDataManager::delete_from_domain ( - const ::Deployment::Domain& domain) -{ - // validate input - if (domain.node.length () == 0) - return 1; - - if (domain.node.length () > - this->provisioned_data_.node.length ()) - return 0; - - //algo : parse through the provisioned_data - // for each node , find in the deleted domain list - // if not found add it to the updated nodes list - - ::Deployment::Nodes updated_nodes; - bool found = false; - - for (CORBA::ULong j = 0; - j < this->provisioned_data_.node.length (); - j++) - { - found = false; - - for (CORBA::ULong i = 0;i < domain.node.length ();i++) - { - if (ACE_OS::strcmp (domain.node[i].name.in (), - this->provisioned_data_.node[j].name.in ()) == 0) - { - found = true; - break; // found the node - } - } - if (found) - continue; - - // not found in the deleted list - - // update the length of the list - updated_nodes.length (updated_nodes.length () + 1); - - // copy the node info - updated_nodes[updated_nodes.length () - 1] = - this->provisioned_data_.node[j]; - - } // for provisioned_data - - // here update the provisioned data - this->provisioned_data_.node = updated_nodes; - - return 1; -} - -int CIAO::DomainDataManager::intimate_planner ( - const ::Deployment::Domain& domain) -{ - // use the connection with the planner and get a reference to the planner - // make a call top the planner - Deployment::Domain d = domain; - return 0; - -} - -bool CIAO::DomainDataManager::update_node_status () -{ - // update the node status here ... - return 0; -} - -void CIAO::DomainDataManager::commitResourceAllocation ( - const ::Deployment::ResourceAllocations & resources) -{ - // commit the resources - // parse into the plan and commit resources ... - - // set the action value - current_action_ = commit; - - this->commit_release_RA (resources); -} - -void CIAO::DomainDataManager::releaseResourceAllocation ( - const ::Deployment::ResourceAllocations & resources) -{ - // set the action value - current_action_ = release; - - this->commit_release_RA (resources); -} - - -int CIAO::DomainDataManager:: -commit_release_RA (const ::Deployment::ResourceAllocations& resources) -{ - // temporary used to guard against exceptions - temp_provisioned_data_ = provisioned_data_; - - - for (CORBA::ULong i = 0;i < resources.length ();i++) - { - try - { - ::Deployment::Resource& res = find_resource (resources[i]); - - match_properties (resources[i].property , res.property); - } - catch (::Deployment::ResourceCommitmentFailure& ex) - { - // catch the exception and add parameters - ACE_ERROR ((LM_ERROR, "Caught the Exception in releaseResourceAllocation\n")); - ex.index = i; - throw ex; - } - } - - // here commit the commitresources - provisioned_data_ = temp_provisioned_data_; - - return 0; -} - -::Deployment::Resource& -CIAO::DomainDataManager::find_resource ( - const ::Deployment::ResourceAllocation& resource) -{ - // for now search the resource in the Node sequence; Later need - // to add it to the Bridges and Interconnects too according to the - // spec - for (CORBA::ULong j = 0;j < this->temp_provisioned_data_.node.length ();j++) - { - if (!ACE_OS::strcmp (resource.elementName.in () , - this->temp_provisioned_data_.node[j].name.in ())) - { - for (CORBA::ULong k =0; - k < this->temp_provisioned_data_.node[j].resource.length (); - k++) - { - 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 - } - - // resource not found - throw ::Deployment::ResourceCommitmentFailure ().reason = CORBA::string_dup ("Resource Not Found\n"); - } - } - throw ::Deployment::ResourceCommitmentFailure ().reason = CORBA::string_dup ("Resource Not Found\n"); -} int CIAO::DomainDataManager::get_monitor_obj_ref () { @@ -772,29 +286,27 @@ int CIAO::DomainDataManager::get_monitor_obj_ref () naming_context->resolve (name); node_monitors_.push_back (Onl_Monitor::NM_Monitor::_narrow (object.in ())); } + return 0; + } -void CIAO::DomainDataManager::get_all_data (Onl_Monitor::AMI_NM_MonitorHandler_ptr handler) +void +CIAO::DomainDataManager::get_all_data (Onl_Monitor::AMI_NM_MonitorHandler_ptr + handler) { this->got_all_response_ = false; + this->mutex_.acquire (); this->response_count_ = 0; + this->mutex_.release (); - Profile_Code profiler ("Tout"); - - this->profile_ = new Profile_Code ("Tst"); this->profile_->start (); - - for (int i = 0;i < node_monitors_.size ();i++) { - profiler.start (); - + profile_nodes_[current_domain_.node[i].name.in ()]->start (); node_monitors_[i]->sendc_get_resource_data (handler); - - profiler.stop (); } } @@ -812,6 +324,8 @@ start_monitor_qos (Onl_Monitor::AMI_NM_MonitorHandler_ptr handler, { node_monitors_[i]->sendc_monitor_app_QoS (handler, plan); } + return 0; + } void diff --git a/CIAO/DAnCE/TM_Daemon/DomainDataManager.h b/CIAO/DAnCE/TM_Daemon/DomainDataManager.h index 122a556391f..48ed329e928 100644 --- a/CIAO/DAnCE/TM_Daemon/DomainDataManager.h +++ b/CIAO/DAnCE/TM_Daemon/DomainDataManager.h @@ -14,9 +14,8 @@ #ifndef DOMAIN_DATA_MGRH #define DOMAIN_DATA_MGRH -//#include "TargetManagerImplC.h" #include "DAnCE/DomainApplicationManager/Deployment_Configuration.h" -#include "DAnCE/Deployment/Deployment_ResourceCommitmentManagerC.h" +//#include "DAnCE/Deployment/Deployment_ResourceCommitmentManagerC.h" #include "NM_MonitorC.h" @@ -24,7 +23,7 @@ #include #include #include "Profile_Code.h" - +#include "ace/Mutex.h" /** * @namespace CIAO @@ -51,29 +50,15 @@ namespace CIAO * current domain data. * @param elements The string sequence of elements * being updated - * @param domainSubset The subset of the actual Domain to be updated - * @param updateKind Specifies the update type eg. add, delete, update + * @param domainSubset The subset of the actual Domain to + * be updated + * @param updateKind Specifies the update type eg. add, + * delete, update * */ int update_domain (const ::CORBA::StringSeq & elements, const ::Deployment::Domain & domainSubset, - ::Deployment::DomainUpdateKind updateKind - ); - /** - * @brief This function is called from the Executor code - * to get the Original Domain data. - * @return Domain* The Initial Domain - * - */ - ::Deployment::Domain* get_initial_domain (); - - /** - * @brief This function is called from the Executor code - * to get the Current Domain data. - * @return Domain* The Current Domain - */ - ::Deployment::Domain* get_current_domain (); - + ::Deployment::DomainUpdateKind updateKind); /** * This function calls the constructor of the * class Domain Data Manager @@ -84,8 +69,7 @@ namespace CIAO */ static DomainDataManager * create (CORBA::ORB_ptr orb, ::Deployment::TargetManager_ptr target, - const char* dat_file - ); + const char* dat_file); /** * @brief Returns the static pointer to the @@ -101,48 +85,6 @@ namespace CIAO */ static void delete_data_manger (); - /** - * @brief returns the sequence of node managers - * object reference - */ - void commitResources ( - const ::Deployment::DeploymentPlan & plan); - - /** - * @brief The function releases the resources held by a plan - * @param plan ::Deployment::DeploymentPlan the plan whose - * resources are to be released - */ - void releaseResources ( - const ::Deployment::DeploymentPlan& plan); - - /** - * The node manager in turn stops the monitor - * @brief The function makes a call on the leaveDomain on the - * NodeManager - */ - void stop_monitors (); - - /** - * @brief The function allocates resources specified in the - * parameter - * - * This function is for the ResourceCommitmentManager - * - */ - void commitResourceAllocation ( - const ::Deployment::ResourceAllocations & resources); - - /** - * @brief The function releases resources specified in the - * parameter - * - * This function is for the ResourceCommitmentManager - * - */ - void releaseResourceAllocation ( - const ::Deployment::ResourceAllocations & resources); - /** * @brief Extracts the Obj Refs from the NS */ @@ -164,6 +106,9 @@ namespace CIAO int start_monitor_qos (Onl_Monitor::AMI_NM_MonitorHandler_ptr handler, ::Deployment::DeploymentPlan& plan); + void stop_monitors (); + + /** * @brief Writes snapshot of the application */ @@ -188,109 +133,21 @@ namespace CIAO */ int readin_domain_data (); - /** - * @brief Match the deployed resources to the - * available resource - */ - void match_requirement_resource ( - ::Deployment::InstanceResourceDeploymentDescriptions deployed, - ::Deployment::Resources& available - ); - - /** - * @brief Match the properties of a Requirement to the - * properties of available resource - * @param deployed The deployed Properties - * @param available The available Properties - */ - void match_properties ( - ::Deployment::Properties deployed, - ::Deployment::SatisfierProperties& available); - - - /// The different actiona that can take place - enum Action {commit , release}; - - /** - * @brief Either commits or releases the given resource - * based on the current Action set. - * @param deployed ::Deployment::Property is the resource - * to be commited/released - * @param available ::Deployment::SatisfierProperty is the - * available resource from which committed/released. - * @exception ::Deployment::ResourceNotAvailable thrown - * when the deployed resources exceeds - * the available resource. - */ - void commit_release_resource ( ::Deployment::Property & deployed, - ::Deployment::SatisfierProperty & available); - /** * @brief This function calls all NM and gives them * the sub-domain */ int call_all_node_managers (); - - - /** - * @brief This function add new elements to the - * already existing domain - * - * @param domain Deployment::Domain contians the new - * elements - */ - int add_to_domain (const ::Deployment::Domain& domain); - - /** - * @brief This function deletes elements from the domain - * - * @param domain ::Deployment::Domain contains the new elements - * in the domain - */ - int delete_from_domain (const ::Deployment::Domain& domain); - - /** - * @brief This function intimates the planner about a domain - * change - * - * @param domain ::Deployment::Domain contains the new elements - * in the domain - */ - int intimate_planner (const ::Deployment::Domain& domain); - - /** - * @brief This function finds a new node in the initial_domain - * - * @param node The name of the node which is to be searched - */ - - bool find_in_initial_domain (const char* node_name, - ::Deployment::Node& node); - /** - * @brief This function finds a new node in the proviosiond_domain - * - * @param node The name of the node which is to be searched - */ - bool find_in_provisioned_domain (const char* node_name, - ::Deployment::Node& node); - /** * @brief updates the node status by reading it from a file */ bool update_node_status (); /** - * @function find_resource - * @brief It finds the Resource structure which is respresents the - * ResourceAllocation + * @brief updates the snapshot of the system. */ - ::Deployment::Resource& find_resource ( - const ::Deployment::ResourceAllocation& resource); - - int commit_release_RA ( - const ::Deployment::ResourceAllocations& resources); - + int update_dynamic (const ::Deployment::Domain &domainSubset); /// The ORB pointer CORBA::ORB_var orb_; @@ -309,21 +166,6 @@ namespace CIAO /// at current capacity ::Deployment::Domain current_domain_; - /// The Target Manager Context - ::Deployment::TargetManager_var target_mgr_; - - /** - * The static provisioned Domain data - */ - ::Deployment::Domain provisioned_data_; - - /// temporary domain used in commit/release to - /// guard against exceptions - ::Deployment::Domain temp_provisioned_data_; - - /// The current action - Action current_action_; - /// The monitor obj references std::vector node_monitors_; @@ -336,17 +178,24 @@ namespace CIAO /// The profiler class to time code Profile_Code * profile_; - /// Exception occured - bool ex_occur; + /// Exception occured + bool ex_occur; - /// guard + /// guard ACE_Thread_Mutex lock; - /// profiles for each node to measure end-to-end for each node + /// profiles for each node to measure end-to-end for each node std::map profile_nodes_; - /// the Data file which contains the Node Manager references + /// Map used to store "dynamic information" of each node. + std::map node_info_map_; + + /// the Data file which contains the Node Manager references std::string dat_file_; + + /// Thread mutex. + ACE_Mutex mutex_; + }; } // CIAO diff --git a/CIAO/DAnCE/TM_Daemon/Handler_i.cpp b/CIAO/DAnCE/TM_Daemon/Handler_i.cpp index fd845a38e5e..f4e68bedbdc 100644 --- a/CIAO/DAnCE/TM_Daemon/Handler_i.cpp +++ b/CIAO/DAnCE/TM_Daemon/Handler_i.cpp @@ -1,4 +1,3 @@ - #include "Handler_i.h" #include "DomainDataManager.h" @@ -7,16 +6,19 @@ Monitor_Handler_I::Monitor_Handler_I (CIAO::DomainDataManager* manager) { } -void Monitor_Handler_I::get_resource_data (const ::Deployment::Domain & ami_return_val) +void Monitor_Handler_I::get_resource_data (const ::Deployment::Domain + &ami_return_val) { - ACE_DEBUG ((LM_DEBUG, "getresource data returns \n")); - + // ACE_DEBUG ((LM_DEBUG, "getresource data returns \n")); + ::CORBA::StringSeq elements; ::Deployment::DomainUpdateKind kind = ::Deployment::UpdateDynamic; manager_->update_domain (elements, ami_return_val, kind); } -void Monitor_Handler_I::get_resource_data_excep (::Messaging::ExceptionHolder * excep_holder) + +void Monitor_Handler_I::get_resource_data_excep (::Messaging::ExceptionHolder + * excep_holder) { // handle the exception here .... ACE_DEBUG ((LM_DEBUG, "getresource exception occured \n")); @@ -31,7 +33,7 @@ void Monitor_Handler_I::get_resource_data_excep (::Messaging::ExceptionHolder * void Monitor_Handler_I::monitor_app_QoS (void) { - ACE_DEBUG ((LM_DEBUG, "Monitor app QoS returned\n")); + // ACE_DEBUG ((LM_DEBUG, "Monitor app QoS returned\n")); } void Monitor_Handler_I::monitor_app_QoS_excep (::Messaging::ExceptionHolder * excep_holder) diff --git a/CIAO/DAnCE/TM_Daemon/Handler_i.h b/CIAO/DAnCE/TM_Daemon/Handler_i.h index 09134cbd797..325ef87742f 100644 --- a/CIAO/DAnCE/TM_Daemon/Handler_i.h +++ b/CIAO/DAnCE/TM_Daemon/Handler_i.h @@ -10,21 +10,24 @@ namespace CIAO class Monitor_Handler_I : public POA_Onl_Monitor::AMI_NM_MonitorHandler { - public: - - Monitor_Handler_I (CIAO::DomainDataManager* manager); - void get_resource_data (const ::Deployment::Domain & ami_return_val); - - void get_resource_data_excep ( - ::Messaging::ExceptionHolder * excep_holder); - - void monitor_app_QoS (void); - - void monitor_app_QoS_excep ( - ::Messaging::ExceptionHolder * excep_holder); + public: + + // Constructor. + Monitor_Handler_I (CIAO::DomainDataManager* manager); + + // Handle reply from corresponding method invocation. + void get_resource_data (const ::Deployment::Domain & ami_return_val); + + void get_resource_data_excep (::Messaging::ExceptionHolder * excep_holder); + + void monitor_app_QoS (void); + + void monitor_app_QoS_excep (::Messaging::ExceptionHolder * excep_holder); protected: - CIAO::DomainDataManager* manager_; + + // Reference to the DomainDataManager object. + CIAO::DomainDataManager* manager_; }; #endif diff --git a/CIAO/DAnCE/TM_Daemon/Profile_Code.cpp b/CIAO/DAnCE/TM_Daemon/Profile_Code.cpp index f846c148bd1..05707c37399 100644 --- a/CIAO/DAnCE/TM_Daemon/Profile_Code.cpp +++ b/CIAO/DAnCE/TM_Daemon/Profile_Code.cpp @@ -18,32 +18,32 @@ Profile_Code::~Profile_Code () void Profile_Code::start () { -// if still running ... stop it and then run again ... - if (running_) - time.stop (); + // if still running ... stop it and then run again ... + if (this->running_) + { + this->timer_.stop (); + } + // start the timer .... - time.start (); + this->timer_.start (); - running_ = true; + this->running_ = true; } void Profile_Code::stop () { - time.stop (); - - ACE_Time_Value tv; - - // time.elapsed_time (tv); + this->timer_.stop (); + this->timer_.elapsed_microseconds (this->elapsed_time_); + // reset the state + this->running_ = false; - ACE_hrtime_t tm; - - time.elapsed_microseconds (tm); +} - // file_ << tv.msec () << std::endl; - file_ << tm << std::endl; +void +Profile_Code::dump () +{ + this->file_ << this->elapsed_time_ << std::endl; - // reset the state - running_ = false; } diff --git a/CIAO/DAnCE/TM_Daemon/Profile_Code.h b/CIAO/DAnCE/TM_Daemon/Profile_Code.h index e469e5500b6..8c80a7ce49c 100644 --- a/CIAO/DAnCE/TM_Daemon/Profile_Code.h +++ b/CIAO/DAnCE/TM_Daemon/Profile_Code.h @@ -9,7 +9,7 @@ class ACE_High_Res_Timer; class Profile_Code { public: - Profile_Code (const std::string& file); + Profile_Code (const std::string &file); Profile_Code (){}; @@ -19,10 +19,16 @@ public: void stop (); + void dump (); + + private: /// The high resolution Timer ... - ACE_High_Res_Timer time; + ACE_High_Res_Timer timer_; + + /// Elapsed time. + ACE_hrtime_t elapsed_time_; std::ofstream file_; diff --git a/CIAO/DAnCE/TM_Daemon/TM_Daemon.cpp b/CIAO/DAnCE/TM_Daemon/TM_Daemon.cpp index 4c6e4b33014..7ca1423ecd9 100644 --- a/CIAO/DAnCE/TM_Daemon/TM_Daemon.cpp +++ b/CIAO/DAnCE/TM_Daemon/TM_Daemon.cpp @@ -2,6 +2,10 @@ #include "Handler_i.h" #include "Config_Handlers/XML_File_Intf.h" #include "Config_Handlers/DnC_Dump.h" +#include "Client_Task.h" +// To set RT Sched params. +#include "ace/Sched_Params.h" +#include "ace/OS_NS_errno.h" namespace CIAO { @@ -12,6 +16,29 @@ namespace CIAO run_main (int argc, char *argv[]) { + int priority = + (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO) + + ACE_Sched_Params::priority_max (ACE_SCHED_FIFO)) / 2; + priority = ACE_Sched_Params::next_priority (ACE_SCHED_FIFO, + priority); + // Enable FIFO scheduling, e.g., RT scheduling class on Solaris. + + if (ACE_OS::sched_params (ACE_Sched_Params (ACE_SCHED_FIFO, + priority, + ACE_SCOPE_PROCESS)) != 0) + { + if (ACE_OS::last_error () == EPERM) + { + ACE_DEBUG ((LM_DEBUG, + "server (%P|%t): user is not superuser, " + "test runs in time-shared class\n")); + } + else + ACE_ERROR ((LM_ERROR, + "server (%P|%t): sched_params failed\n")); + } + + try { CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); @@ -28,20 +55,17 @@ namespace CIAO poa_manager->activate (); // create the Domain data Manager - DomainDataManager* manager = - DomainDataManager::create (orb, NULL, argv[2]); + DomainDataManager* manager = + DomainDataManager::create (orb, NULL, argv[2]); - sleep (10); // wait for all the monitors to upload their obj. refs + // Wait for all the monitors to upload their obj. refs + sleep (10); manager->get_monitor_obj_ref (); ACE_DEBUG ((LM_DEBUG, "After get_monitor_obj_ref\n")); Monitor_Handler_I handler_i (manager); - -// PortableServer::ServantBase_var servant = -// handler_i; - Onl_Monitor::AMI_NM_MonitorHandler_var handlerV = handler_i._this (); @@ -54,26 +78,28 @@ namespace CIAO ACE_DEBUG ((LM_DEBUG, "After call to get plan \n")); manager->start_monitor_qos (handlerV, plan); - - //sleep (100); + // Now active the threads that run the orb. + Client_Task client_task (orb.in ()); + // Spawn multiple threads to run the orb event loop. + // @@ TODO: Need to make this configurable via command line param. + if (client_task.activate (THR_NEW_LWP | THR_JOINABLE, + 4) != 0) + { + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot activate client threads\n"), 1); + } while (true) { + // Sampling period. + // @@ TODO: Need to make this configurable. sleep (5); ACE_DEBUG ((LM_DEBUG, "Calling get_all_data\n")); manager->get_all_data (handlerV); - - while (!manager->got_all_response ()) - { - if (orb->work_pending ()) - orb->perform_work (); - } - - // write the system snapshot - manager->write_snapshot (); } + // Wait for all the threads to complete execution. + client_task.thr_mgr ()->wait (); // Finally destroy the ORB - orb->run (); orb->destroy (); } catch (const CORBA::Exception& ex) diff --git a/CIAO/DAnCE/TM_Daemon/TM_Daemon.mpc b/CIAO/DAnCE/TM_Daemon/TM_Daemon.mpc index 0ab8fa4f2f7..d407cd1c8c0 100644 --- a/CIAO/DAnCE/TM_Daemon/TM_Daemon.mpc +++ b/CIAO/DAnCE/TM_Daemon/TM_Daemon.mpc @@ -8,6 +8,7 @@ project(TM_Daemon): ciao_server_dnc, dance_extension_stub, ciaoexe , ciao_domain Source_Files { TM_Daemon.cpp + Client_Task.cpp DomainDataManager.cpp ../NodeManager/NM_MonitorS.cpp ../NodeManager/NM_MonitorC.cpp -- cgit v1.2.1