summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CIAO/ChangeLog22
-rw-r--r--CIAO/DAnCE/NodeManager/CIAO_Monitor.cpp34
-rw-r--r--CIAO/DAnCE/NodeManager/MonitorController.cpp17
-rw-r--r--CIAO/DAnCE/NodeManager/NM_Monitor_Impl.cpp39
-rw-r--r--CIAO/DAnCE/TM_Daemon/DomainDataManager.cpp4
-rw-r--r--CIAO/DAnCE/TM_Daemon/Handler_i.cpp2
-rw-r--r--CIAO/DAnCE/TM_Daemon/TM_Daemon.cpp2
-rw-r--r--CIAO/DAnCE/TM_Daemon/driver.cpp5
-rw-r--r--CIAO/examples/space/descriptors/Domain_1.cdd73
-rwxr-xr-xCIAO/examples/space/descriptors/run_TM.sh2
10 files changed, 85 insertions, 115 deletions
diff --git a/CIAO/ChangeLog b/CIAO/ChangeLog
index 442ff608074..498b5c1102f 100644
--- a/CIAO/ChangeLog
+++ b/CIAO/ChangeLog
@@ -1,8 +1,28 @@
+Mon Jan 7 18:30:09 UTC 2008 Nishanth Shankaran <nshankar@nospam.com>
+
+ * DAnCE/NodeManager/CIAO_Monitor.cpp:
+ * DAnCE/NodeManager/MonitorController.cpp:
+ * DAnCE/NodeManager/NM_Monitor_Impl.cpp:
+
+ Fixed the monitor to obtain the correct CPU load.
+
+ * DAnCE/TM_Daemon/DomainDataManager.cpp:
+ * DAnCE/TM_Daemon/Handler_i.cpp:
+ * DAnCE/TM_Daemon/TM_Daemon.cpp:
+ * DAnCE/TM_Daemon/driver.cpp:
+
+ Made some minor updates and cosmetic changes.
+
+ * examples/space/descriptors/Domain_1.cdd:
+ * examples/space/descriptors/run_TM.sh:
+
+ Update these as well.
+
Thu Dec 20 23:50:52 UTC 2007 Nilabja R <nilabjar@dre.vanderbilt.edu>
* examples/space/descriptors/Domain_1.cdd:
* examples/space/descriptors/NodeManagerMap_1.dat:
- The above files will configure and run a single NodeManager
+ The above files will configure and run a single NodeManager
Thu Dec 20 23:49:06 UTC 2007 Nilabja R <nilabjar@dre.vanderbilt.edu>
diff --git a/CIAO/DAnCE/NodeManager/CIAO_Monitor.cpp b/CIAO/DAnCE/NodeManager/CIAO_Monitor.cpp
index 79a24c0ff9e..6ab8f628f9e 100644
--- a/CIAO/DAnCE/NodeManager/CIAO_Monitor.cpp
+++ b/CIAO/DAnCE/NodeManager/CIAO_Monitor.cpp
@@ -70,18 +70,16 @@ 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 ();
+ CORBA::Double current_load = calculate_load ();
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
@@ -98,7 +96,7 @@ int CIAO::CIAO_Monitor::stop ()
if (!ACE_OS::strcmp (
current_domain_
->node[0].resource[i].property[j].name.in (),
- "LoadAverage"))
+ "Current"))
{
current_domain_->node[0].resource[i].property[j].kind =
::Deployment::Quantity;
@@ -132,18 +130,16 @@ double CIAO::CIAO_Monitor::calculate_load ()
res_file >> current_.system_cpu;
res_file >> current_.idle_time;
- current_.total_load = current_.user_cpu + current_.user_cpu_low + current_.system_cpu + current_.idle_time;
-
- double load = current_.total_load - previous_.total_load;
-
- double user_current_load = (current_.user_cpu - previous_.user_cpu)/load;
- double system_current_load = (current_.system_cpu - previous_.system_cpu)/load;
- double idle_load = (current_.idle_time - previous_.idle_time)/load;
-
-
res_file.close ();
- previous_ = current_;
+ current_.total_load = current_.user_cpu + current_.user_cpu_low +
+ current_.system_cpu + current_.idle_time;
- return user_current_load*100;
+ double load = current_.total_load - previous_.total_load;
+ // double user_current_load = (current_.user_cpu - previous_.user_cpu)/load;
+ // double system_current_load = (current_.system_cpu - previous_.system_cpu)/load;
+ double delta_idle = current_.idle_time - previous_.idle_time;
+ double percent_cpu_load = 100.0 - (delta_idle / load * 100.0);
+ previous_ = current_;
+ return percent_cpu_load;
}
diff --git a/CIAO/DAnCE/NodeManager/MonitorController.cpp b/CIAO/DAnCE/NodeManager/MonitorController.cpp
index dd9e5c0ed5c..dea59b14609 100644
--- a/CIAO/DAnCE/NodeManager/MonitorController.cpp
+++ b/CIAO/DAnCE/NodeManager/MonitorController.cpp
@@ -88,8 +88,8 @@ 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 =
new ::Deployment::Domain (this->initial_domain_);
@@ -97,24 +97,11 @@ int CIAO::MonitorController::init ()
// Set the new domain resource to zero
domain->node[0].resource.length (0);
-// 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++)
{
-
- // prf_mon.start ();
::Deployment::Domain *new_domain =
monitor_list_[i]->monitor_->get_current_data ();
-
add_resource_to_domain (*domain , *new_domain);
-
- // prf_mon.stop ();
}
return domain;
diff --git a/CIAO/DAnCE/NodeManager/NM_Monitor_Impl.cpp b/CIAO/DAnCE/NodeManager/NM_Monitor_Impl.cpp
index 5279508d584..e49f1e5535d 100644
--- a/CIAO/DAnCE/NodeManager/NM_Monitor_Impl.cpp
+++ b/CIAO/DAnCE/NodeManager/NM_Monitor_Impl.cpp
@@ -53,7 +53,7 @@ void Onl_Monitor_NM_Monitor_i::monitor_app_QoS (
{
// ACE_DEBUG ((LM_DEBUG, "\t\nInside the monitor_app_QoS\n"));
- for (CORBA::ULong i;i < plans.length ();i++)
+ for (CORBA::ULong i = 0;i < plans.length ();i++)
{
::Deployment::DeploymentPlan plan = plans[i];
auto_ptr<Deployment::Domain> domain =
@@ -65,9 +65,9 @@ void Onl_Monitor_NM_Monitor_i::monitor_app_QoS (
key += domain->node[0].name.in ();
ACE_DEBUG ((LM_DEBUG, "The key is %s\n", key.c_str ()));
-
+
CORBA::Object_var obj;
-
+
try {
obj = node_manager_->get_NAM (key);
}
@@ -76,7 +76,7 @@ void Onl_Monitor_NM_Monitor_i::monitor_app_QoS (
ex._tao_print_exception ("(%P|%t) NM_Monitor_i::monitor_app_QoS ()\t\n");
ACE_DEBUG ((LM_DEBUG, "TM_DAEMON::Does not have a Component in this Node"));
continue;
- }
+ }
try {
Deployment::NodeApplicationManager_var nam =
@@ -107,45 +107,18 @@ void Onl_Monitor_NM_Monitor_i::monitor_app_QoS (
::Deployment::Domain * Onl_Monitor_NM_Monitor_i::get_resource_data (
void)
{
- // Add your implementation here
-
// ACE_DEBUG ((LM_DEBUG, "Inside the get_resource_data\n"));
- Deployment::Domain_var domainv;
-
- // time stamp the call to measure overhead of monitoring ...
-
- // ACE_High_Res_Timer time;
- //time.start ();
-
- domainv = this->controller_->update_data_for_TM ();
+ Deployment::Domain_var domainv = this->controller_->update_data_for_TM ();
// now get the qos data from each NAM
domainv->node[0].qos_seq.length (this->qos_monitor_seq_.size ());
for (unsigned int i = 0;i < qos_monitor_seq_.size ();i++)
{
- ::Deployment::QoSSpecifications_var qos_seq =
+ ::Deployment::QoSSpecifications_var qos_seq =
this->qos_monitor_seq_[i]->get_app_QoS ();
-
-
domainv->node[0].qos_seq[i] = (*qos_seq)[0];
}
-
- // ACE_Time_Value tv;
- //time.elapsed_time (tv);
-
- //ACE_hrtime_t tm;
- //time.elapsed_microseconds (tm);
-
- //std::string file_prox = domainv->node[0].name.in ();
-
- //file_prox += "_Tprox";
-
- //std::ofstream out (file_prox.c_str (), ios::app);
- //out << tv.msec () << std::endl;
- //out << tm << std::endl;
- //out.close ();
-
return domainv._retn ();
}
diff --git a/CIAO/DAnCE/TM_Daemon/DomainDataManager.cpp b/CIAO/DAnCE/TM_Daemon/DomainDataManager.cpp
index a662253b792..2626be03d98 100644
--- a/CIAO/DAnCE/TM_Daemon/DomainDataManager.cpp
+++ b/CIAO/DAnCE/TM_Daemon/DomainDataManager.cpp
@@ -91,7 +91,7 @@ namespace CIAO
ACE_DEBUG ((LM_DEBUG, "Calling join doamin on %s... ",
sub_domain.node[0].name.in ()));
node_manager->joinDomain (sub_domain, NULL, log);
- ACE_DEBUG ((LM_DEBUG, "done!"));
+ ACE_DEBUG ((LM_DEBUG, "done!\n"));
}
catch (CORBA::Exception& ex)
{
@@ -269,6 +269,8 @@ namespace CIAO
this->condition_.wait ();
// Now update the current domain.
+// ACE_DEBUG ((LM_DEBUG, "Obtained resource data from node monitors."
+// "\nNow updating the current domain!\n"));
this->current_domain_.node.length (this->node_info_map_.size ());
std::map<std::string, ::Deployment::Node>::iterator itr = this->node_info_map_.begin ();
CORBA::ULong i = 0;
diff --git a/CIAO/DAnCE/TM_Daemon/Handler_i.cpp b/CIAO/DAnCE/TM_Daemon/Handler_i.cpp
index 70d239f81d1..1755b86fd07 100644
--- a/CIAO/DAnCE/TM_Daemon/Handler_i.cpp
+++ b/CIAO/DAnCE/TM_Daemon/Handler_i.cpp
@@ -33,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/TM_Daemon.cpp b/CIAO/DAnCE/TM_Daemon/TM_Daemon.cpp
index bbb25b2afe8..eb1922fe784 100644
--- a/CIAO/DAnCE/TM_Daemon/TM_Daemon.cpp
+++ b/CIAO/DAnCE/TM_Daemon/TM_Daemon.cpp
@@ -33,7 +33,7 @@ namespace CIAO
this->handler_ = Onl_Monitor::AMI_NM_MonitorHandler::_narrow (object.in ());
this->manager_->start_monitor_qos (this->handler_);
- ACE_DEBUG ((LM_DEBUG, "Created the Daemon!\n"));
+ // ACE_DEBUG ((LM_DEBUG, "Created the Daemon!\n"));
}
diff --git a/CIAO/DAnCE/TM_Daemon/driver.cpp b/CIAO/DAnCE/TM_Daemon/driver.cpp
index e6e3fd3f8d0..986729ed424 100644
--- a/CIAO/DAnCE/TM_Daemon/driver.cpp
+++ b/CIAO/DAnCE/TM_Daemon/driver.cpp
@@ -124,8 +124,6 @@ namespace CIAO
domain_file,
root_poa,
threads), 1);
- ACE_DEBUG ((LM_DEBUG, "done!\n"));
-
PortableServer::ServantBase_var owner_transfer(daemon_impl);
PortableServer::ObjectId_var id =
@@ -157,7 +155,8 @@ namespace CIAO
cos_name.length (1);
cos_name[0].id = ::CORBA::string_dup (name);
naming_context->rebind (cos_name, daemon.in ());
- ACE_DEBUG ((LM_DEBUG, "done! Bound witht the naming service under %s.\n", name));
+ ACE_DEBUG ((LM_DEBUG, "done! Bound with the naming "
+ "service under %s.\n", name));
}
daemon_impl->run ();
diff --git a/CIAO/examples/space/descriptors/Domain_1.cdd b/CIAO/examples/space/descriptors/Domain_1.cdd
index 527c3e5fded..117daff473e 100644
--- a/CIAO/examples/space/descriptors/Domain_1.cdd
+++ b/CIAO/examples/space/descriptors/Domain_1.cdd
@@ -5,47 +5,38 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
-<UUID>effd4bd0-6db0-4c50-9bb7-db9decebae1c</UUID>
-<label>Hello Domain</label>
-
-
-<node>
- <name>blade39</name>
- <label>Linux Node</label>
- <resource>
- <name>Processor</name>
- <resourceType>CPULoad</resourceType>
- <property>
- <name>LoadAverage</name>
- <kind>Quantity</kind>
- <dynamic>true</dynamic>
- <value>
- <type>
- <kind>tk_long</kind>
- </type>
- <value><long>99</long></value>
- </value>
- </property>
- </resource>
- <resource>
- <name>NA_Monitor</name>
- <resourceType>CPULoad</resourceType>
- <property>
- <name>LoadAverage</name>
- <kind>Quantity</kind>
- <dynamic>false</dynamic>
- <value>
- <type>
- <kind>tk_double</kind>
- </type>
+ <UUID>effd4bd0-6db0-4c50-9bb7-db9decebae1c</UUID>
+ <label>Hello Domain</label>
+ <node>
+ <name>blade39</name>
+ <label>Linux Node</label>
+ <resource>
+ <name>Processor</name>
+ <resourceType>CPULoad</resourceType>
+ <property>
+ <name>Setpoint</name>
+ <kind>Quantity</kind>
+ <dynamic>true</dynamic>
<value>
- <double>100</double>
+ <type>
+ <kind>tk_double</kind>
+ </type>
+ <value><double>99</double></value>
</value>
- </value>
- </property>
- </resource>
-
-</node>
-
-
+ </property>
+ <property>
+ <name>Current</name>
+ <kind>Quantity</kind>
+ <dynamic>false</dynamic>
+ <value>
+ <type>
+ <kind>tk_double</kind>
+ </type>
+ <value>
+ <double>10</double>
+ </value>
+ </value>
+ </property>
+ </resource>
+ </node>
</Deployment:domain>
diff --git a/CIAO/examples/space/descriptors/run_TM.sh b/CIAO/examples/space/descriptors/run_TM.sh
new file mode 100755
index 00000000000..d5d1ffeeee3
--- /dev/null
+++ b/CIAO/examples/space/descriptors/run_TM.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+$CIAO_ROOT/DAnCE/TM_Daemon/TM_Daemon -ORBInitRef NameService=corbaloc:iiop:roon.dre.vanderbilt.edu:40000/NameService -k SPACE.cdp -m NodeManagerMap_1.dat -N CIAO_TM_Daemon -d Domain_1.cdd