Skip to content

Commit

Permalink
Example working-ish (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
henricasanova committed Aug 14, 2021
1 parent b983308 commit a8d2869
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
22 changes: 8 additions & 14 deletions examples/condor-grid-example/CondorGridSimulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,21 +105,15 @@ int main(int argc, char **argv) {
// Running the simulation
simulation->launch();

/* Gathering some statistics */
auto start_timestamps = simulation->getOutput().getTrace<wrench::CondorGridStartTimestamp>();
auto end_timestamp = simulation->getOutput().getTrace<wrench::CondorGridEndTimestamp>().back();
auto task_finish_timestamps = simulation->getOutput().getTrace<wrench::SimulationTimestampTaskCompletion>();

for (const auto &start_timestamp : start_timestamps) {
std::cout << "Started: " << start_timestamp->getContent()->getDate() << std::endl;
}
std::cout << "Tasks: " << flush;
for (const auto &task_finish_timestamp : task_finish_timestamps) {
std::cout << task_finish_timestamp->getContent()->getDate() << ", " << flush;
/* Printing task execution information directly from WorkflowTask objects -- other
* examples showcases how to use simulation->getOutput().getTrace<T>() */

for (const auto &t : workflow->getTasks()) {
std::cout << "Task " + t->getID() << " ";
std::cout << "started at time " << t->getStartDate() << " on ";
std::cout << "host " << t->getPhysicalExecutionHost() << " and finished at time ";
std::cout << t->getEndDate() << "\n";
}
std::cout << std::endl;

std::cout << "Ended: " << end_timestamp->getContent()->getDate() << std::endl;

return 0;
}
2 changes: 0 additions & 2 deletions examples/condor-grid-example/CondorWMS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ namespace wrench {
}
task_count++;
}
std::cerr << "CONDOR ALL SETUP \n";

/* Submit the first 5 tasks as part of a single "grid universe" job to HTCondor */
auto grid_universe_job = job_manager->createStandardJob(first_five_tasks, file_locations);
Expand All @@ -98,7 +97,6 @@ namespace wrench {
htcondor_service_specific_arguments["-service"] = batch_cs->getName();
job_manager->submitJob(grid_universe_job, htcondor_cs, htcondor_service_specific_arguments);

std::cerr << "CONDOR ALL SETUP \n";
/* Submit the next 5 tasks as individual non "grid universe" jobs to HTCondor */
for (auto const &t : last_five_tasks) {
auto job = job_manager->createStandardJob(t, file_locations);
Expand Down
7 changes: 7 additions & 0 deletions examples/condor-grid-example/condor-grid-hosts.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
<route src="HTCondorHost" dst="CloudHeadNode"> <link_ctn id="network_link"/> </route>
<route src="HTCondorHost" dst="BatchHeadNode"> <link_ctn id="network_link"/> </route>
<route src="WMSHost" dst="CloudHeadNode"> <link_ctn id="network_link"/> </route>
<route src="BatchHeadNode" dst="CloudHeadNode"> <link_ctn id="network_link"/> </route>
<route src="CloudHeadNode" dst="CloudNode1"> <link_ctn id="network_link"/> </route>
<route src="CloudHeadNode" dst="CloudNode2"> <link_ctn id="network_link"/> </route>
<route src="WMSHost" dst="CloudNode1"> <link_ctn id="network_link"/> </route>
Expand All @@ -79,6 +80,12 @@
<route src="BatchHeadNode" dst="BatchNode2"> <link_ctn id="network_link"/> </route>
<route src="BatchHeadNode" dst="BatchNode3"> <link_ctn id="network_link"/> </route>
<route src="BatchHeadNode" dst="BatchNode4"> <link_ctn id="network_link"/> </route>
<route src="BatchNode1" dst="BatchNode2"> <link_ctn id="network_link"/> </route>
<route src="BatchNode1" dst="BatchNode3"> <link_ctn id="network_link"/> </route>
<route src="BatchNode1" dst="BatchNode4"> <link_ctn id="network_link"/> </route>
<route src="BatchNode2" dst="BatchNode3"> <link_ctn id="network_link"/> </route>
<route src="BatchNode2" dst="BatchNode4"> <link_ctn id="network_link"/> </route>
<route src="BatchNode3" dst="BatchNode4"> <link_ctn id="network_link"/> </route>

<!-- Each loopback link connects each host to itself -->
<route src="WMSHost" dst="WMSHost"> <link_ctn id="loopback_link"/> </route>
Expand Down

0 comments on commit a8d2869

Please sign in to comment.