summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordengg <dengg@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-09-28 19:36:59 +0000
committerdengg <dengg@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-09-28 19:36:59 +0000
commit0a71ebbde6279b0d4e13cf46281dd679dfff2eb3 (patch)
tree55033bdfb903c3e810fd1e9a1d66a3ed497336ad
parent8c3c2e26af50b209f1c66e5246ffd99c4b0712d2 (diff)
downloadATCD-ciao-dance-optimization.tar.gz
-rw-r--r--DAnCE/Plan_Launcher/Plan_Launcher_Benchmark_Impl.cpp52
-rw-r--r--DAnCE/Plan_Launcher/Plan_Launcher_Benchmark_Impl.h5
-rw-r--r--DAnCE/Plan_Launcher/Plan_Launcher_Impl.h8
3 files changed, 61 insertions, 4 deletions
diff --git a/DAnCE/Plan_Launcher/Plan_Launcher_Benchmark_Impl.cpp b/DAnCE/Plan_Launcher/Plan_Launcher_Benchmark_Impl.cpp
index 58d1dbc2873..949ed525be2 100644
--- a/DAnCE/Plan_Launcher/Plan_Launcher_Benchmark_Impl.cpp
+++ b/DAnCE/Plan_Launcher/Plan_Launcher_Benchmark_Impl.cpp
@@ -7,6 +7,7 @@
#include "ace/Throughput_Stats.h"
#include "ace/Sample_History.h"
#include "ace/Task.h"
+#include "Config_Handlers/XML_File_Intf.h"
#include "DAnCE/Utils/Plan_Handler.h"
#include <iostream>
@@ -65,6 +66,57 @@ namespace CIAO
}
const char *
+ Plan_Launcher_Benchmark_i::launch_plan (const char *deployment_plan_uri,
+ const char *package_uri,
+ bool use_package_name,
+ bool use_repoman)
+ {
+ if (CIAO::debug_level () > 9)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Parsing plan...\n"));
+ }
+
+
+
+ // Benchmarking XML parsing time
+
+ ACE_Sample_History history_parsing_plan (this->niterations_);
+ ACE_hrtime_t call_start, call_end;
+
+ call_start = ACE_OS::gethrtime ();
+ CIAO::Config_Handlers::XML_File_Intf intf (deployment_plan_uri);
+ ::Deployment::DeploymentPlan_var plan = intf.get_plan ();
+ call_end = ACE_OS::gethrtime ();
+ history_parsing_plan.sample (call_end - call_start);
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) High resolution timer calibration...."));
+ ACE_UINT32 gsf = ACE_High_Res_Timer::global_scale_factor ();
+ ACE_DEBUG ((LM_DEBUG, "done\n"));
+
+ ACE_Basic_Stats stats;
+ history_parsing_plan.dump_samples ("HISTORY -- XML Parsing", gsf);
+ history_parsing_plan.collect_basic_stats (stats);
+ stats.dump_results ("TOTAL -- XML Parsing", gsf);
+
+ // End of benchmarking
+
+ // Use the package name(s) or type(s) to modify the location of all the
+ // artifacts in DeploymentPlan.
+ if (use_repoman)
+ {
+ // @todo check return value
+ pg_.generate_plan (plan, package_uri, use_package_name);
+ }
+
+ if (CIAO::debug_level () > 9)
+ {
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) Parsing complete....\n"));
+ }
+
+ return this->launch_plan (plan.in ());
+ }
+
+ const char *
Plan_Launcher_Benchmark_i::launch_plan (
const ::Deployment::DeploymentPlan &plan)
{
diff --git a/DAnCE/Plan_Launcher/Plan_Launcher_Benchmark_Impl.h b/DAnCE/Plan_Launcher/Plan_Launcher_Benchmark_Impl.h
index 133ae6be4d6..fb66761ccbe 100644
--- a/DAnCE/Plan_Launcher/Plan_Launcher_Benchmark_Impl.h
+++ b/DAnCE/Plan_Launcher/Plan_Launcher_Benchmark_Impl.h
@@ -27,6 +27,11 @@ namespace CIAO
virtual ~Plan_Launcher_Benchmark_i ();
+ virtual const char * launch_plan (const char *deployment_plan_uri,
+ const char *package_uri = 0,
+ bool use_package_name = true,
+ bool use_repoman = false);
+
/**
* @brief Launch a plan, given an IDL deployment plan
* @param plan A valid IDL deployment plan
diff --git a/DAnCE/Plan_Launcher/Plan_Launcher_Impl.h b/DAnCE/Plan_Launcher/Plan_Launcher_Impl.h
index 6c1eaaf9ba9..70d78bce566 100644
--- a/DAnCE/Plan_Launcher/Plan_Launcher_Impl.h
+++ b/DAnCE/Plan_Launcher/Plan_Launcher_Impl.h
@@ -56,10 +56,10 @@ namespace CIAO
* @param deployment_plan_uri A uri that points ot a valid deployment plan
* @returns a string containing the UUID of the plan. Null indicates failure.
*/
- const char * launch_plan (const char *deployment_plan_uri,
- const char *package_uri = 0,
- bool use_package_name = true,
- bool use_repoman = false);
+ virtual const char * launch_plan (const char *deployment_plan_uri,
+ const char *package_uri = 0,
+ bool use_package_name = true,
+ bool use_repoman = false);
const char * re_launch_plan (const char *deployment_plan_uri,
const char *package_uri = 0,