diff options
author | dengg <dengg@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-08-03 22:15:06 +0000 |
---|---|---|
committer | dengg <dengg@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-08-03 22:15:06 +0000 |
commit | 847ea7d8b627c758f2cdec3038a34792a68e4ebc (patch) | |
tree | dda6d4c458599cca4bf85fa792cfeb082cba92ce | |
parent | 0028937f5a35f4f1ec02c55659987d4f839d5a4a (diff) | |
download | ATCD-847ea7d8b627c758f2cdec3038a34792a68e4ebc.tar.gz |
-rw-r--r-- | DAnCE/ExecutionManager/Execution_Manager.cpp | 19 | ||||
-rw-r--r-- | DAnCE/Plan_Launcher/Plan_Launcher_Benchmark_Impl.cpp | 136 | ||||
-rw-r--r-- | DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp | 58 | ||||
-rw-r--r-- | DAnCE/Utils/Plan_Handler.cpp | 135 |
4 files changed, 178 insertions, 170 deletions
diff --git a/DAnCE/ExecutionManager/Execution_Manager.cpp b/DAnCE/ExecutionManager/Execution_Manager.cpp index c58688fa9f7..1d147d7e9cd 100644 --- a/DAnCE/ExecutionManager/Execution_Manager.cpp +++ b/DAnCE/ExecutionManager/Execution_Manager.cpp @@ -25,6 +25,7 @@ namespace CIAO const char *ior_file_name_ = "executionManager.ior"; const char *init_file_name = "deployment.dat"; const char *pid_file_name_ = 0; + size_t total_lanes = 1; static bool register_with_ns_ = false; static bool write_to_ior_ = false; static bool rt_corba_enabled = false; @@ -34,7 +35,7 @@ namespace CIAO bool parse_args (int argc, char *argv[]) { - ACE_Get_Opt get_opts (argc, argv, "o:i:abnrp:"); + ACE_Get_Opt get_opts (argc, argv, "o:i:abnr:p:"); int c; while ((c = get_opts ()) != -1) switch (c) @@ -51,6 +52,7 @@ namespace CIAO break; case 'r': rt_corba_enabled = true; + total_lanes = ACE_OS::atoi (get_opts.opt_arg ()); break; case 'p': pid_file_name_ = get_opts.opt_arg (); @@ -204,12 +206,12 @@ namespace CIAO /// Create thread pool with lanes ///// /// - CORBA::ULong TOTAL_LANES = 2; // avoid magic number - RTCORBA::ThreadpoolLanes lanes (TOTAL_LANES); - lanes.length (TOTAL_LANES); + CORBA::ULong TOTAL_LANES = 3; // avoid magic number + RTCORBA::ThreadpoolLanes lanes (total_lanes); + lanes.length (total_lanes); // Initialize the lane information - for (CORBA::ULong i = 0; i < TOTAL_LANES; ++i) + for (CORBA::ULong i = 0; i < total_lanes; ++i) { lanes[i].static_threads = 1; lanes[i].dynamic_threads = 0; @@ -224,9 +226,10 @@ namespace CIAO RTCORBA::Priority default_thread_priority = current->the_priority (); - lanes[0].lane_priority = default_thread_priority; - lanes[1].lane_priority = default_thread_priority + 1; - + for (CORBA::ULong i = 0; i < total_lanes; ++i) + { + lanes[i].lane_priority = default_thread_priority + i; + } RTCORBA::ThreadpoolId threadpool_id = rt_orb->create_threadpool_with_lanes (0, //static size diff --git a/DAnCE/Plan_Launcher/Plan_Launcher_Benchmark_Impl.cpp b/DAnCE/Plan_Launcher/Plan_Launcher_Benchmark_Impl.cpp index dc3d8c38286..f35cee8adbd 100644 --- a/DAnCE/Plan_Launcher/Plan_Launcher_Benchmark_Impl.cpp +++ b/DAnCE/Plan_Launcher/Plan_Launcher_Benchmark_Impl.cpp @@ -12,6 +12,7 @@ #include <iostream> #include <sstream> #include <string> +#include <vector> namespace CIAO { @@ -20,7 +21,7 @@ namespace CIAO class Task : public ACE_Task_Base { public: - Task (Plan_Launcher_Benchmark_i launcher, + Task (Plan_Launcher_Benchmark_i &launcher, const ::Deployment::DeploymentPlan &plan); int svc (void); @@ -34,7 +35,7 @@ namespace CIAO int Task::plan_id_count_ = 0; - Task::Task (Plan_Launcher_Benchmark_i launcher, + Task::Task (Plan_Launcher_Benchmark_i &launcher, const ::Deployment::DeploymentPlan &plan) : launcher_ (launcher), plan_ (plan) @@ -72,33 +73,63 @@ namespace CIAO return this->launch_plan_i (plan); // Create task. - - Task task (*this, plan); + std::vector<Task*> task_vector; // Task activation flags. long flags = THR_NEW_LWP | THR_JOINABLE; - // Activate task with a number of threads - int result = task.activate (flags, nthreads_); - if (result == -1) + for (size_t i = 0; i < nthreads_; ++i) { - /* - if (errno == EPERM) + Deployment::DeploymentPlan tmp_plan (plan); + + DAnCE_Utils::remove_instance (tmp_plan, + "Hello-Sender-idd"); + + char trailing[256]; + ACE_OS::itoa (i, trailing, 10); + ACE_CString inst_name ("Sender"); + inst_name += trailing; + DAnCE_Utils::add_instances (100, + tmp_plan, + inst_name.c_str (), + "SenderNode", + "Hello-Sender-mdd", + 0); + + + + Task * task; + + ACE_NEW_RETURN (task, + Task (*this, tmp_plan), + 0); + + task_vector.push_back (task); + + int result = task->activate (flags); + + if (result == -1) { - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot create thread with scheduling policy %s\n" - "because the user does not have the appropriate privileges, terminating program....\n" - "Check svc.conf options and/or run as root\n", - sched_policy_name (orb_->orb_core ()->orb_params ()->ace_sched_policy ())), - 2); + /* + if (errno == EPERM) + { + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot create thread with scheduling policy %s\n" + "because the user does not have the appropriate privileges, terminating program....\n" + "Check svc.conf options and/or run as root\n", + sched_policy_name (orb_->orb_core ()->orb_params ()->ace_sched_policy ())), + 2); + } + else + // Unexpected error. */ + ACE_ASSERT (0); } - else - // Unexpected error. */ - ACE_ASSERT (0); } - // Wait for task to exit. - task.wait (); + for (size_t i = 0; i < nthreads_; ++i) + { + task_vector[i]->wait (); + } return plan.UUID.in (); } @@ -117,7 +148,8 @@ namespace CIAO "SenderNode", "Hello-Sender-mdd", 0); - + + DAnCE_Utils::add_instances (100, tmp_plan, "Receiver", @@ -125,7 +157,7 @@ namespace CIAO "Hello-Receiver-mdd", 0); */ - DAnCE_Utils::print_instances (tmp_plan); + // DAnCE_Utils::print_instances (tmp_plan); ///// Start Test //////////////////////////////////////////// ACE_Sample_History history_prepare_plan (this->niterations_); @@ -145,7 +177,7 @@ ACE_DEBUG ((LM_DEBUG, if (CORBA::is_nil (this->em_.in ())) { ACE_ERROR ((LM_ERROR, - ACE_TEXT ("CIAO::Plan_Launcher_Benchmark_i: ") + ACE_TEXT ("(%P|%t) CIAO::Plan_Launcher_Benchmark_i: ") ACE_TEXT ("launch_plan called witn an uninitialized EM.\n"))); return 0; } @@ -153,7 +185,7 @@ ACE_DEBUG ((LM_DEBUG, if (CIAO::debug_level () > 9) { ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("CIAO::Plan_Launcher_Benchmark_i: " ) + ACE_TEXT ("(%P|%t) CIAO::Plan_Launcher_Benchmark_i: " ) ACE_TEXT ("about to call this->em_->preparePlan\n"))); } @@ -163,13 +195,10 @@ ACE_DEBUG ((LM_DEBUG, call_end = ACE_OS::gethrtime (); history_prepare_plan.sample (call_end - call_start); -ACE_DEBUG ((LM_DEBUG, - "(%P|%t) **** step 20\n")); - if (CIAO::debug_level () > 9) { ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("CIAO::Plan_Launcher_Benchmark_i: " ) + ACE_TEXT ("(%P|%t) CIAO::Plan_Launcher_Benchmark_i: " ) ACE_TEXT ("after to call this->em_->preparePlan\n"))); } @@ -184,7 +213,7 @@ ACE_DEBUG ((LM_DEBUG, if (CIAO::debug_level () > 9) { ACE_DEBUG ((LM_DEBUG, - "CIAO_PlanLauncher: Obtained DAM ref \n")); + "(%P|%t) CIAO_PlanLauncher: Obtained DAM ref \n")); } ::Deployment::Properties_var properties; @@ -195,13 +224,9 @@ ACE_DEBUG ((LM_DEBUG, if (CIAO::debug_level ()) { ACE_DEBUG ((LM_DEBUG, - "CIAO_PlanLauncher: start Launch application...\n")); + "(%P|%t) CIAO_PlanLauncher: start Launch application...\n")); } - -ACE_DEBUG ((LM_DEBUG, - "(%P|%t) **** step 30\n")); - // Do not start the Application immediately since it violates // the semantics of component activation sequence int start = 0; @@ -219,11 +244,7 @@ ACE_DEBUG ((LM_DEBUG, // Call finish Launch to complete the connections if (CIAO::debug_level ()) ACE_DEBUG ((LM_DEBUG, - "CIAO_PlanLauncher: finish Launch application...\n")); - - -ACE_DEBUG ((LM_DEBUG, - "(%P|%t) **** step 40\n")); + "(%P|%t) CIAO_PlanLauncher: finish Launch application...\n")); //////// Measure the latency for finishLaunch() //////////////// call_start = ACE_OS::gethrtime (); @@ -234,13 +255,10 @@ ACE_DEBUG ((LM_DEBUG, if (CIAO::debug_level ()) ACE_DEBUG ((LM_DEBUG, "[success]\n")); -ACE_DEBUG ((LM_DEBUG, - "(%P|%t) **** step 50\n")); - // Call start to activate components if (CIAO::debug_level ()) ACE_DEBUG ((LM_DEBUG, - "CIAO_PlanLauncher: start activating components...\n")); + "(%P|%t) CIAO_PlanLauncher: start activating components...\n")); //////// Measure the latency for start() //////////////// call_start = ACE_OS::gethrtime (); @@ -248,23 +266,16 @@ ACE_DEBUG ((LM_DEBUG, call_end = ACE_OS::gethrtime (); history_start_system.sample (call_end - call_start); -ACE_DEBUG ((LM_DEBUG, - "(%P|%t) **** step 60\n")); - - if (CIAO::debug_level ()) ACE_DEBUG ((LM_DEBUG, "[success]\n")); if (CIAO::debug_level ()) ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("CIAO_PlanLauncher: ") + ACE_TEXT ("(%P|%t) CIAO_PlanLauncher: ") ACE_TEXT ("Application Deployed successfully\n"))); - // map_.bind_dam_reference (tmp_plan.UUID.in (), - // Deployment::DomainApplicationManager::_duplicate (dam.in ())); - -ACE_DEBUG ((LM_DEBUG, - "(%P|%t) **** step 65\n")); + map_.bind_dam_reference (tmp_plan.UUID.in (), + Deployment::DomainApplicationManager::_duplicate (dam.in ())); // In order to run the launch_plan() multiple times to collect benchmarking // results, we have to tear down the plan and then redeploy. @@ -275,15 +286,12 @@ ACE_DEBUG ((LM_DEBUG, } } -ACE_DEBUG ((LM_DEBUG, - "(%P|%t) **** step 70\n")); - ///// End Test //////////////////////////////////////////// ACE_hrtime_t test_end = ACE_OS::gethrtime (); - ACE_DEBUG ((LM_DEBUG, "test finished\n")); + ACE_DEBUG ((LM_DEBUG, "(%P|%t) Test finished\n")); - ACE_DEBUG ((LM_DEBUG, "High resolution timer calibration....")); + 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")); @@ -319,7 +327,7 @@ ACE_DEBUG ((LM_DEBUG, catch (Deployment::ResourceNotAvailable& ex) { ACE_ERROR ((LM_ERROR, - "EXCEPTION: ResourceNotAvaiable exception caught: %s,\n" + "(%P|%t) EXCEPTION: ResourceNotAvaiable exception caught: %s,\n" "Type: %s\n" "Property: %s\n" "Element: %s\n" @@ -334,7 +342,7 @@ ACE_DEBUG ((LM_DEBUG, catch (Deployment::StartError& ex) { ACE_ERROR ((LM_ERROR, - "EXCEPTION: StartError exception caught: %s, %s\n", + "(%P|%t) EXCEPTION: StartError exception caught: %s, %s\n", ex.name.in (), ex.reason.in ())); throw Deployment_Failure (""); @@ -342,7 +350,7 @@ ACE_DEBUG ((LM_DEBUG, catch (Deployment::InvalidProperty& ex) { ACE_ERROR ((LM_ERROR, - "EXCEPTION: InvalidProperty exception caught: %s, %s\n", + "(%P|%t) EXCEPTION: InvalidProperty exception caught: %s, %s\n", ex.name.in (), ex.reason.in ())); throw Deployment_Failure (""); @@ -350,7 +358,7 @@ ACE_DEBUG ((LM_DEBUG, catch (Deployment::InvalidConnection& ex) { ACE_ERROR ((LM_ERROR, - "EXCEPTION: InvalidConnection exception caught: %s, %s\n", + "(%P|%t) EXCEPTION: InvalidConnection exception caught: %s, %s\n", ex.name.in (), ex.reason.in ())); throw Deployment_Failure (""); @@ -358,14 +366,14 @@ ACE_DEBUG ((LM_DEBUG, catch (const CORBA::Exception& ex) { ACE_ERROR ((LM_ERROR, - "CORBA EXCEPTION: %s\n", + "(%P|%t) CORBA EXCEPTION: %s\n", ex._info().fast_rep())); throw Deployment_Failure (""); } catch (...) { ACE_ERROR ((LM_ERROR, - "EXCEPTION: non-CORBA exception\n")); + "(%P|%t) EXCEPTION: non-CORBA exception\n")); throw Deployment_Failure (""); } diff --git a/DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp b/DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp index 6dab3199716..c16731db560 100644 --- a/DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp +++ b/DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp @@ -132,7 +132,7 @@ namespace CIAO if (CIAO::debug_level () > 9) { - ACE_DEBUG ((LM_DEBUG, "Parsing complete....\n")); + ACE_DEBUG ((LM_DEBUG, "(%P|%t) Parsing complete....\n")); } return this->launch_plan (plan.in ()); @@ -146,7 +146,7 @@ namespace CIAO if (CORBA::is_nil (this->em_.in ())) { ACE_ERROR ((LM_ERROR, - ACE_TEXT ("CIAO::Plan_Launcher_i: ") + ACE_TEXT ("(%P|%t) CIAO::Plan_Launcher_i: ") ACE_TEXT ("launch_plan called witn an uninitialized EM.\n"))); return 0; } @@ -154,7 +154,7 @@ namespace CIAO if (CIAO::debug_level () > 9) { ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("CIAO::Plan_Launcher_i: " ) + ACE_TEXT ("(%P|%t) CIAO::Plan_Launcher_i: " ) ACE_TEXT ("about to call this->em_->preparePlan\n"))); } @@ -163,7 +163,7 @@ namespace CIAO if (CIAO::debug_level () > 9) { ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("CIAO::Plan_Launcher_i: " ) + ACE_TEXT ("(%P|%t) CIAO::Plan_Launcher_i: " ) ACE_TEXT ("after to call this->em_->preparePlan\n"))); } @@ -178,7 +178,7 @@ namespace CIAO if (CIAO::debug_level () > 9) { ACE_DEBUG ((LM_DEBUG, - "CIAO_PlanLauncher: Obtained DAM ref \n")); + "(%P|%t) CIAO_PlanLauncher: Obtained DAM ref \n")); } ::Deployment::Properties_var properties; @@ -189,7 +189,7 @@ namespace CIAO if (CIAO::debug_level ()) { ACE_DEBUG ((LM_DEBUG, - "CIAO_PlanLauncher: start Launch application...\n")); + "(%P|%t) CIAO_PlanLauncher: start Launch application...\n")); } // Dont not start the Application immediately since it violates @@ -204,7 +204,7 @@ namespace CIAO // Call finish Launch to complete the connections if (CIAO::debug_level ()) ACE_DEBUG ((LM_DEBUG, - "CIAO_PlanLauncher: finish Launch application...\n")); + "(%P|%t) CIAO_PlanLauncher: finish Launch application...\n")); dam->finishLaunch (start, false); // is_ReDAC by default is <false> if (CIAO::debug_level ()) @@ -213,7 +213,7 @@ namespace CIAO // Call start to activate components if (CIAO::debug_level ()) ACE_DEBUG ((LM_DEBUG, - "CIAO_PlanLauncher: start activating components...\n")); + "(%P|%t) CIAO_PlanLauncher: start activating components...\n")); dam->start (); if (CIAO::debug_level ()) @@ -221,7 +221,7 @@ namespace CIAO if (CIAO::debug_level ()) ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("CIAO_PlanLauncher: ") + ACE_TEXT ("(%P|%t) CIAO_PlanLauncher: ") ACE_TEXT ("Application Deployed successfully\n"))); map_.bind_dam_reference (plan.UUID.in (), @@ -245,7 +245,7 @@ namespace CIAO catch (const Deployment::StartError& ex) { ACE_ERROR ((LM_ERROR, - "EXCEPTION: StartError exception caught: %s, %s\n", + "(%P|%t) EXCEPTION: StartError exception caught: %s, %s\n", ex.name.in (), ex.reason.in ())); throw Deployment_Failure (""); @@ -253,7 +253,7 @@ namespace CIAO catch (const Deployment::InvalidProperty& ex) { ACE_ERROR ((LM_ERROR, - "EXCEPTION: InvalidProperty exception caught: %s, %s\n", + "(%P|%t) EXCEPTION: InvalidProperty exception caught: %s, %s\n", ex.name.in (), ex.reason.in ())); throw Deployment_Failure (""); @@ -261,7 +261,7 @@ namespace CIAO catch (const Deployment::InvalidConnection& ex) { ACE_ERROR ((LM_ERROR, - "EXCEPTION: InvalidConnection exception caught: %s, %s\n", + "(%P|%t) EXCEPTION: InvalidConnection exception caught: %s, %s\n", ex.name.in (), ex.reason.in ())); throw Deployment_Failure (""); @@ -269,14 +269,14 @@ namespace CIAO catch (const CORBA::Exception& ex) { ACE_ERROR ((LM_ERROR, - "CORBA EXCEPTION: %s\n", + "(%P|%t) CORBA EXCEPTION: %s\n", ex._info().fast_rep())); throw Deployment_Failure (""); } catch (...) { ACE_ERROR ((LM_ERROR, - "EXCEPTION: non-CORBA exception\n")); + "(%P|%t) EXCEPTION: non-CORBA exception\n")); throw Deployment_Failure (""); } @@ -326,7 +326,7 @@ namespace CIAO { // @todo the destroy_dam_by_plan could give a stoperror exception // we should handle - ACE_ERROR ((LM_ERROR, "Unable to find DomainApplicationManager " + ACE_ERROR ((LM_ERROR, "(%P|%t) Unable to find DomainApplicationManager " "for plan with uuid: %s\n", uuid)); return false; } @@ -340,7 +340,7 @@ namespace CIAO if (CIAO::debug_level ()) { ACE_DEBUG ((LM_DEBUG, - "CIAO_PlanLauncher: destroy the application.....\n")); + "(%P|%t) CIAO_PlanLauncher: destroy the application.....\n")); } dam->destroyApplication (); @@ -361,7 +361,7 @@ namespace CIAO if (CIAO::debug_level ()) { ACE_DEBUG ((LM_DEBUG, - "CIAO_PlanLauncher: destroy the manager.....\n")); + "(%P|%t) CIAO_PlanLauncher: destroy the manager.....\n")); } this->em_->destroyManager (dam); @@ -378,7 +378,7 @@ namespace CIAO if (CIAO::debug_level ()) { ACE_DEBUG ((LM_DEBUG, - "CIAO_PlanLauncher: destroy the manager.....\n")); + "(%P|%t) CIAO_PlanLauncher: destroy the manager.....\n")); } this->em_->destroyManagerByPlan (plan_uuid); @@ -418,7 +418,7 @@ namespace CIAO if (CORBA::is_nil (this->em_.in ())) { ACE_ERROR ((LM_ERROR, - ACE_TEXT ("CIAO::Plan_Launcher_i: ") + ACE_TEXT ("(%P|%t) CIAO::Plan_Launcher_i: ") ACE_TEXT ("re_launch_plan called witn an uninitialized EM.\n"))); return 0; } @@ -428,7 +428,7 @@ namespace CIAO if (CIAO::debug_level ()) { ACE_DEBUG ((LM_DEBUG, - "CIAO_PlanLauncher: new plan redeployed ...\n")); + "(%P|%t) CIAO_PlanLauncher: new plan redeployed ...\n")); } return CORBA::string_dup (plan.UUID.in ()); @@ -436,7 +436,7 @@ namespace CIAO catch (const Deployment::ResourceNotAvailable& ex) { ACE_ERROR ((LM_ERROR, - "EXCEPTION: ResourceNotAvaiable exception caught: %s,\n" + "(%P|%t) EXCEPTION: ResourceNotAvaiable exception caught: %s,\n" "Type: %s\n" "Property: %s\n" "Element: %s\n" @@ -451,7 +451,7 @@ namespace CIAO catch (const Deployment::StartError& ex) { ACE_ERROR ((LM_ERROR, - "EXCEPTION: StartError exception caught: %s, %s\n", + "(%P|%t) EXCEPTION: StartError exception caught: %s, %s\n", ex.name.in (), ex.reason.in ())); throw Deployment_Failure (""); @@ -459,7 +459,7 @@ namespace CIAO catch (const Deployment::InvalidProperty& ex) { ACE_ERROR ((LM_ERROR, - "EXCEPTION: InvalidProperty exception caught: %s, %s\n", + "(%P|%t) EXCEPTION: InvalidProperty exception caught: %s, %s\n", ex.name.in (), ex.reason.in ())); throw Deployment_Failure (""); @@ -467,7 +467,7 @@ namespace CIAO catch (const Deployment::InvalidConnection& ex) { ACE_ERROR ((LM_ERROR, - "EXCEPTION: InvalidConnection exception caught: %s, %s\n", + "(%P|%t) EXCEPTION: InvalidConnection exception caught: %s, %s\n", ex.name.in (), ex.reason.in ())); throw Deployment_Failure (""); @@ -475,14 +475,14 @@ namespace CIAO catch (const CORBA::Exception& ex) { ACE_ERROR ((LM_ERROR, - "CORBA EXCEPTION: %s\n", + "(%P|%t) CORBA EXCEPTION: %s\n", ex._info().fast_rep())); throw Deployment_Failure (""); } catch (...) { ACE_ERROR ((LM_ERROR, - "EXCEPTION: non-CORBA exception\n")); + "(%P|%t) EXCEPTION: non-CORBA exception\n")); throw Deployment_Failure (""); } @@ -530,7 +530,7 @@ namespace CIAO if (desired_priority != priority) ACE_ERROR_RETURN ((LM_ERROR, - "ERROR: Unable to set thread " + "(%P|%t) ERROR: Unable to set thread " "priority to %d\n", desired_priority), false); @@ -549,7 +549,7 @@ namespace CIAO if (CORBA::is_nil (priority_policy.in ())) { ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("CIAO::Plan_Launcher_i: " ) + ACE_TEXT ("(%P|%t) CIAO::Plan_Launcher_i: " ) ACE_TEXT ("In ExecutionManager, the Priority Model Policy is not exposed. ") ACE_TEXT ("Use non-RT mode.\n"))); return false; @@ -561,7 +561,7 @@ namespace CIAO if (priority_model != RTCORBA::CLIENT_PROPAGATED) { ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("CIAO::Plan_Launcher_i: " ) + ACE_TEXT ("(%P|%t) CIAO::Plan_Launcher_i: " ) ACE_TEXT ("The Priority Model of ExecutionManager is not CLIENT_PROPAGATED! ") ACE_TEXT ("Use non-RT mode instead.\n"))); return false; diff --git a/DAnCE/Utils/Plan_Handler.cpp b/DAnCE/Utils/Plan_Handler.cpp index 3dd0eab8845..e191be8b53d 100644 --- a/DAnCE/Utils/Plan_Handler.cpp +++ b/DAnCE/Utils/Plan_Handler.cpp @@ -77,68 +77,13 @@ namespace CIAO } } - - - /* void - DAnCE_Utils::add_connection (::Deployment::DeploymentPlan_var &deployment_plan, const char *connection_name, const char *port_name, const char *facet_instance, const char *receptacle_instance) - { - // Modifying the deployment plan in order to include the new connection ... - - ::Deployment::PlanConnectionDescriptions connection = deployment_plan->connection; - connection.length(connection.length()+1); - - connection[connection.length()-1].name = CORBA::string_dup(connection_name); - connection[connection.length()-1].source.length(0); - connection[connection.length()-1].deployRequirement.length(0); - connection[connection.length()-1].externalEndpoint.length(0); - connection[connection.length()-1].internalEndpoint.length(2); - connection[connection.length()-1].internalEndpoint[0].portName = CORBA::string_dup(port_name); - connection[connection.length()-1].internalEndpoint[0].provider = 0L; - connection[connection.length()-1].internalEndpoint[0].kind = ::Deployment::Facet; - - unsigned int i; - - // Looking for instance block with name equals to facet_instance ... - - ::Deployment::InstanceDeploymentDescriptions instance = deployment_plan->instance; - - for (i = 0; i < instance.length(); i++) - if (!ACE_OS::strcmp(instance[i].name.in(), facet_instance)) - break; - - if (i < instance.length()) - connection[connection.length()-1].internalEndpoint[0].instanceRef = i; - else - throw InstanceNotFound(); - - connection[connection.length()-1].internalEndpoint[1].portName = CORBA::string_dup(port_name); - connection[connection.length()-1].internalEndpoint[1].provider = 0L; - connection[connection.length()-1].internalEndpoint[1].kind = ::Deployment::SimplexReceptacle; - - // Looking for instance block with name equals to receptacle_instance ... - - for (i = 0; i < instance.length(); i++) - if (!ACE_OS::strcmp(instance[i].name.in(), receptacle_instance)) - break; - - if (i < instance.length()) - connection[connection.length()-1].internalEndpoint[1].instanceRef = i; - else - throw InstanceNotFound(); - - // Re-assigning connection to deployment plan - - deployment_plan->connection = connection; - } - - void - DAnCE_Utils::remove_instance (::Deployment::DeploymentPlan_var &deployment_plan, const char *instance_name) + DAnCE_Utils::remove_instance (::Deployment::DeploymentPlan &deployment_plan, const char *instance_name) { // Modifying the deployment plan in order to remove the instance ... - ::Deployment::InstanceDeploymentDescriptions instance = deployment_plan->instance; - ::Deployment::PlanConnectionDescriptions connection = deployment_plan->connection; + ::Deployment::InstanceDeploymentDescriptions instance = deployment_plan.instance; + ::Deployment::PlanConnectionDescriptions connection = deployment_plan.connection; // Looking for the instance position in sequence of instances ... @@ -164,7 +109,7 @@ namespace CIAO // Updating i in order to verify the shifted connection ... i--; // Re-acquiring instances from the deployment plan ... - connection = deployment_plan->connection; + connection = deployment_plan.connection; break; } @@ -188,26 +133,23 @@ namespace CIAO instance.length(instance.length()-1); // Re-assigning instances to the deployment plan ... - deployment_plan->instance = instance; + deployment_plan.instance = instance; // Updating connections for the shifted instances ... - connection = deployment_plan->connection; + connection = deployment_plan.connection; for (i = 0; i < connection.length(); i++) for (unsigned int j = 0; j < connection[i].internalEndpoint.length(); j++) if (connection[i].internalEndpoint[j].instanceRef > instance_ref) connection[i].internalEndpoint[j].instanceRef--; - deployment_plan->connection = connection; - - return; - + deployment_plan.connection = connection; } void DAnCE_Utils::remove_connection ( - ::Deployment::DeploymentPlan_var &deployment_plan, + ::Deployment::DeploymentPlan &deployment_plan, const char *connection_name) { - ::Deployment::PlanConnectionDescriptions connection = deployment_plan->connection; + ::Deployment::PlanConnectionDescriptions connection = deployment_plan.connection; for (unsigned int i = 0; i < connection.length(); i++) if (!ACE_OS::strcmp(connection[i].name.in(), connection_name)) @@ -248,17 +190,72 @@ namespace CIAO connection[k].deployedResource[l].targetName = connection[k+1].deployedResource[l].targetName; connection[k].deployedResource[l].requirementName = connection[k+1].deployedResource[l].requirementName; connection[k].deployedResource[l].resourceName = connection[k+1].deployedResource[l].resourceName; - connection[k].deployedResource[l].resourceValue = connection[k+1].deployedResource[l].resourceValue; +// connection[k].deployedResource[l].resourceValue = connection[k+1].deployedResource[l].resourceValue; } } connection.length(connection.length()-1); // Re-assigning connection to the deployment plan ... - deployment_plan->connection = connection; + deployment_plan.connection = connection; return; } // Throw exception if connection name not found ... throw ConnectionNotFound(); } + + /* + void + DAnCE_Utils::add_connection (::Deployment::DeploymentPlan_var &deployment_plan, const char *connection_name, const char *port_name, const char *facet_instance, const char *receptacle_instance) + { + // Modifying the deployment plan in order to include the new connection ... + + ::Deployment::PlanConnectionDescriptions connection = deployment_plan->connection; + connection.length(connection.length()+1); + + connection[connection.length()-1].name = CORBA::string_dup(connection_name); + connection[connection.length()-1].source.length(0); + connection[connection.length()-1].deployRequirement.length(0); + connection[connection.length()-1].externalEndpoint.length(0); + connection[connection.length()-1].internalEndpoint.length(2); + connection[connection.length()-1].internalEndpoint[0].portName = CORBA::string_dup(port_name); + connection[connection.length()-1].internalEndpoint[0].provider = 0L; + connection[connection.length()-1].internalEndpoint[0].kind = ::Deployment::Facet; + + unsigned int i; + + // Looking for instance block with name equals to facet_instance ... + + ::Deployment::InstanceDeploymentDescriptions instance = deployment_plan->instance; + + for (i = 0; i < instance.length(); i++) + if (!ACE_OS::strcmp(instance[i].name.in(), facet_instance)) + break; + + if (i < instance.length()) + connection[connection.length()-1].internalEndpoint[0].instanceRef = i; + else + throw InstanceNotFound(); + + connection[connection.length()-1].internalEndpoint[1].portName = CORBA::string_dup(port_name); + connection[connection.length()-1].internalEndpoint[1].provider = 0L; + connection[connection.length()-1].internalEndpoint[1].kind = ::Deployment::SimplexReceptacle; + + // Looking for instance block with name equals to receptacle_instance ... + + for (i = 0; i < instance.length(); i++) + if (!ACE_OS::strcmp(instance[i].name.in(), receptacle_instance)) + break; + + if (i < instance.length()) + connection[connection.length()-1].internalEndpoint[1].instanceRef = i; + else + throw InstanceNotFound(); + + // Re-assigning connection to deployment plan + + deployment_plan->connection = connection; + } + + */ void DAnCE_Utils::print_instances (const ::Deployment::DeploymentPlan &deployment_plan) |