Skip to content

Commit

Permalink
Merge branch 'master' of github.com:wrench-project/wrench
Browse files Browse the repository at this point in the history
  • Loading branch information
henricasanova committed Nov 25, 2017
2 parents 4d6d4e8 + 58c89c8 commit 8d79c4c
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 47 deletions.
6 changes: 3 additions & 3 deletions doc/getting_started.md
Expand Up @@ -26,7 +26,7 @@ one of the following commands:

~~~~~~~~~~~~~{.sh}
# running the cloud-based implementation
wrench-simple-wms-cloud <PATH-TO-WRENCH-SRC-FOLDER>/examples/two_hosts.xml <PATH-TO-WRENCH-SRC-FOLDER>/examples/genome.dax
wrench-simple-wms-cloud <PATH-TO-WRENCH-SRC-FOLDER>/examples/cloud_hosts.xml <PATH-TO-WRENCH-SRC-FOLDER>/examples/genome.dax
# running the batch-based implementation
wrench-simple-wms-batch <PATH-TO-WRENCH-SRC-FOLDER>/examples/two_hosts.xml <PATH-TO-WRENCH-SRC-FOLDER>/examples/genome.dax
Expand All @@ -38,14 +38,14 @@ The `simple-wms` example requires two arguments: (1) a [SimGrid virtual platform
description file](http://simgrid.gforge.inria.fr/simgrid/3.17/doc/platform.html); and
(2) a WRENCH workflow file.

_**SimGrid virtual platform description file:**_
**SimGrid virtual platform description file:**
In [SimGrid](http://simgrid.gforge.inria.fr), any study must entail the description
of the platform on which you want to simulate your application. This file includes
definitions of computing hosts, clusters, storage, network links and routes, etc.
A detailed description on how to build your platform description file can be found
[here](http://simgrid.gforge.inria.fr/simgrid/3.17/doc/platform.html).

_**WRENCH workflow file:**_
**WRENCH workflow file:**
WRENCH provides native parsers for [DAX](http://workflowarchive.org) (DAG in XML)
and [JSON](http://workflowhub.org/traces/) formats. Please, refer to the hyperlinked
texts for their respective documentations.
Expand Down
21 changes: 21 additions & 0 deletions examples/cloud_hosts.xml
@@ -0,0 +1,21 @@
<?xml version='1.0'?>
<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
<platform version="4.1">
<zone id="AS0" routing="Full">
<host id="Tremblay" speed="1f" core="1"/>
<host id="Jupiter" speed="1f" core="4"/>
<host id="Fafard" speed="1f" core="1"/>

<link id="1" bandwidth="125MBps" latency="100us"/>

<route src="Tremblay" dst="Jupiter">
<link_ctn id="1"/>
</route>
<route src="Fafard" dst="Tremblay">
<link_ctn id="1"/>
</route>
<route src="Fafard" dst="Jupiter">
<link_ctn id="1"/>
</route>
</zone>
</platform>
64 changes: 20 additions & 44 deletions examples/simple-wms/SimpleWMSCloud.cpp
Expand Up @@ -11,9 +11,15 @@
#include <wrench.h>

#include "SimpleWMS.h"
#include "scheduler/RandomScheduler.h"
#include "scheduler/CloudScheduler.h"

/**
* @brief An example of a simple WMS within a cloud service.
*
* @param argc: argument count
* @param argv: argument vector
* @return whether the simulation has successfully completed
*/
int main(int argc, char **argv) {

wrench::Simulation simulation;
Expand Down Expand Up @@ -43,82 +49,50 @@ int main(int argc, char **argv) {
// obtaining the list of hosts
std::vector<std::string> hostname_list = simulation.getHostnameList();

std::string storage_host = hostname_list[(hostname_list.size() > 3) ? 2 : 1];

// storage service
std::string storage_host = hostname_list[(hostname_list.size() > 2) ? 2 : 1];
std::cerr << "Instantiating a SimpleStorageService on " << storage_host << "..." << std::endl;

wrench::StorageService *storage_service = simulation.add(std::unique_ptr<wrench::SimpleStorageService>(
new wrench::SimpleStorageService(storage_host, 10000000000000.0)));
// wrench::StorageService *simulation = simulation.add(
// std::unique_ptr<wrench::SimpleStorageService>(new wrench::SimpleStorageService(storage_host, 10.0)));

// WMS and Cloud services in the same host
std::string wms_host = hostname_list[0];


std::string executor_host = hostname_list[(hostname_list.size() > 1) ? 1 : 0];

wrench::ComputeService *cloud_service = new wrench::CloudService(
wms_host, true, true, storage_service,
{{wrench::CloudServiceProperty::STOP_DAEMON_MESSAGE_PAYLOAD, "666"}});
std::vector<std::string> execution_hosts = {executor_host};

try {

std::cerr << "Instantiating a MultiCore Job executor on " << executor_host << "..." << std::endl;
// simulation.add(
// std::unique_ptr<wrench::MultihostMulticoreComputeService>(
// new wrench::MultihostMulticoreComputeService(executor_host, true, true,
// storage_service,
// {{wrench::MultihostMulticoreComputeServiceProperty::STOP_DAEMON_MESSAGE_PAYLOAD, "666"}})));

simulation.add(std::unique_ptr<wrench::ComputeService>(cloud_service));

// std::cerr << "Instantiating a MultiCore Job executor on " << executor_host << "..." << std::endl;
// simulation.add(std::unique_ptr<wrench::MultihostMulticoreComputeService>(
// new wrench::MultihostMulticoreComputeService(executor_host, true, false,
// {{wrench::MultihostMulticoreComputeService::Property::STOP_DAEMON_MESSAGE_PAYLOAD, "666"}})));

// std::cerr << "Instantiating a MultiCore Job executor on " << exexutor_host << "..." << std::endl;
// simulation.add(std::unique_ptr<wrench::MultihostMulticoreComputeService>(
// new wrench::MultihostMulticoreComputeService(executor_host, false, true,
// {{wrench::MultihostMulticoreComputeService::Property::STOP_DAEMON_MESSAGE_PAYLOAD, "666"}})));

// std::cerr << "Instantiating a MultiCore Job executor on " << exexutor_host << "..." << std::endl;
// simulation.add(std::unique_ptr<wrench::MultihostMulticoreComputeService>(
// new wrench::MultihostMulticoreComputeService(executor_host, true, true,
// {{wrench::MultihostMulticoreComputeService::Property::STOP_DAEMON_MESSAGE_PAYLOAD, "666"}})));

} catch (std::invalid_argument &e) {

std::cerr << "Error: " << e.what() << std::endl;
std::exit(1);

}

// execution hosts
std::string executor_host = hostname_list[(hostname_list.size() > 1) ? 1 : 0];
std::vector<std::string> execution_hosts = {executor_host};

std::cerr << "Instantiating a WMS on " << wms_host << "..." << std::endl;

// WMS Configuration
wrench::WMS *wms = simulation.setWMS(
std::unique_ptr<wrench::WMS>(
new wrench::SimpleWMS(&workflow,
std::unique_ptr<wrench::Scheduler>(
// new wrench::RandomScheduler()),
new wrench::CloudScheduler(cloud_service, execution_hosts,
new wrench::CloudScheduler(cloud_service,
execution_hosts,
&simulation)),
wms_host)));

// wms->setPilotJobScheduler(std::unique_ptr<wrench::PilotJobScheduler>(new wrench::CriticalPathScheduler()));

// wms->addStaticOptimization(std::unique_ptr<wrench::StaticOptimization>(new wrench::SimplePipelineClustering()));
// wms->addDynamicOptimization(std::unique_ptr<wrench::DynamicOptimization>(new wrench::FailureDynamicClustering()));

// file registry
std::string file_registry_service_host = hostname_list[(hostname_list.size() > 2) ? 1 : 0];

std::cerr << "Instantiating a FileRegistryService on " << file_registry_service_host << "..." << std::endl;
std::unique_ptr<wrench::FileRegistryService> file_registry_service(
new wrench::FileRegistryService(file_registry_service_host));
simulation.setFileRegistryService(std::move(file_registry_service));

// staging input files
std::cerr << "Staging input files..." << std::endl;
std::set<wrench::WorkflowFile *> input_files = workflow.getInputFiles();
try {
Expand All @@ -128,6 +102,7 @@ int main(int argc, char **argv) {
return 0;
}

// launching the simulation
std::cerr << "Launching the Simulation..." << std::endl;
try {
simulation.launch();
Expand All @@ -137,6 +112,7 @@ int main(int argc, char **argv) {
}
std::cerr << "Simulation done!" << std::endl;

// metrics
std::vector<wrench::SimulationTimestamp<wrench::SimulationTimestampTaskCompletion> *> trace;
trace = simulation.output.getTrace<wrench::SimulationTimestampTaskCompletion>();
std::cerr << "Number of entries in TaskCompletion trace: " << trace.size() << std::endl;
Expand Down

0 comments on commit 8d79c4c

Please sign in to comment.