Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/wrench-project/wrench
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelfsilva committed Aug 22, 2018
2 parents 5009360 + 3ad34ac commit 4562258
Show file tree
Hide file tree
Showing 5 changed files with 540 additions and 12 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Expand Up @@ -248,6 +248,7 @@ set(TEST_FILES
test/simulation/FileRegistryTest.cpp
test/simulation/JobManagerTest.cpp
test/simulation/SimpleSimulationTest.cpp
test/simulation/SimulationCommandLineArgumentsTest.cpp
test/simulation/simulation_output/SimulationOutputTest.cpp
test/simulation/simulation_output/SimulationTimestampTaskTest.cpp
test/simulation/simulation_output/SimulationTimestampFileCopyTest.cpp
Expand Down
2 changes: 1 addition & 1 deletion include/wrench/simgrid_S4U_util/S4U_Daemon.h
Expand Up @@ -73,7 +73,7 @@ namespace wrench {

std::string getName();

/** @brief The daemon's life saved */
/** @brief The daemon's life saver */
LifeSaver *life_saver = nullptr;

/** @brief a pointer to the simulation object */
Expand Down
19 changes: 10 additions & 9 deletions src/wrench/simulation/Simulation.cpp
Expand Up @@ -119,13 +119,14 @@ namespace wrench {
sg_vm_live_migration_plugin_init();

if (wrench_help_requested) {
std::cerr << "General WRENCH command-line arguments:\n";
std::cerr << " --wrench-no-color: disables colored terminal output\n";
std::cerr << " --wrench-no-log: disables logging\n";
std::cerr << " --activate-energy: activates SimGrid's energy plugin\n";
std::cerr << " (requires host pstate definitions in XML platform description file)\n";
std::cerr << " (use --help-logs for detailed help on SimGrid's logging options/syntax)\n";
std::cerr << " --help-simgrid: show full help on general Simgrid command-line arguments\n";
std::cout << "General WRENCH command-line arguments:\n";
std::cout << " --wrench-no-color: disables colored terminal output\n";
std::cout << " --wrench-no-log: disables logging\n";
std::cout << " (use --help-logs for detailed help on SimGrid's logging options/syntax)\n";
std::cout << " --activate-energy: activates SimGrid's energy plugin\n";
std::cout << " (requires host pstate definitions in XML platform description file)\n";
std::cout << " --help-simgrid: show full help on general Simgrid command-line arguments\n";
std::cout << " --help-wrench: displays this help message\n";
std::cerr << "\n";
}

Expand All @@ -137,7 +138,7 @@ namespace wrench {

// If version requested, put back the "--version" argument
if (version_requested) {
std::cerr << "WRENCH version " << getWRENCHVersionString() << "\n";
std::cout << "WRENCH version " << getWRENCHVersionString() << "\n";
argv[*argc] = strdup("--version");
(*argc)++;
}
Expand All @@ -149,7 +150,7 @@ namespace wrench {
if (simgrid_help_requested) {
argv[*argc] = strdup("--help");
(*argc)++;
std::cerr << "\nSimgrid command-line arguments:\n\n";
std::cout << "\nSimgrid command-line arguments:\n\n";
}

// If WRENCH no logging is requested, put back and convert it to a SimGrid argument
Expand Down
22 changes: 20 additions & 2 deletions test/simulation/SimpleSimulationTest.cpp
Expand Up @@ -252,6 +252,20 @@ class SimpleSimulationReadyTasksTestWMS : public wrench::WMS {
}
}

// For converage,
unsigned long num_cores = this->simulation->getNumCores();
if (num_cores != 2) {
throw std::runtime_error("Unexpected number of cores!");
}
double flop_rate = this->simulation->getFlopRate();
if (flop_rate != 1.0) {
throw std::runtime_error("Unexpected flop rate");
}
this->simulation->compute(1 / flop_rate);

std::map<std::string, std::vector<std::string>> clusters =
this->simulation->getHostnameListByCluster();

return 0;
}
};
Expand Down Expand Up @@ -286,7 +300,7 @@ void SimpleSimulationTest::do_getReadyTasksTest_test() {
ASSERT_NO_THROW(simulation->instantiatePlatform(platform_file_path));

// Get a hostname
std::string hostname = simulation->getHostnameList()[0];
std::string hostname = "DualCoreHost";

// Create a Storage Service
ASSERT_THROW(storage_service = simulation->add(
Expand All @@ -311,7 +325,7 @@ void SimpleSimulationTest::do_getReadyTasksTest_test() {
ASSERT_EQ(123, storage_service->getMessagePayloadValueAsDouble(wrench::SimpleStorageServiceMessagePayload::FILE_COPY_ANSWER_MESSAGE_PAYLOAD));

// Create a Cloud Service
std::vector<std::string> execution_hosts = {simulation->getHostnameList()[1]};
std::vector<std::string> execution_hosts = {"QuadCoreHost"};
ASSERT_NO_THROW(compute_service = simulation->add(
new wrench::CloudService(hostname, execution_hosts, 100.0,
{ {wrench::MultihostMulticoreComputeServiceProperty::SUPPORTS_PILOT_JOBS, "false"}})));
Expand All @@ -333,13 +347,17 @@ void SimpleSimulationTest::do_getReadyTasksTest_test() {
ASSERT_THROW(simulation->add((wrench::NetworkProximityService *) nullptr), std::invalid_argument);
ASSERT_THROW(simulation->add((wrench::FileRegistryService *) nullptr), std::invalid_argument);

// Try to stage a file without a file registry
ASSERT_THROW(simulation->stageFile(input_file, storage_service), std::runtime_error);

// Create a file registry
ASSERT_NO_THROW(simulation->add(new wrench::FileRegistryService(hostname)));

// Staging the input_file on the storage service
ASSERT_NO_THROW(simulation->stageFile(input_file, storage_service));

// Staging an invalid file on the storage service
ASSERT_THROW(simulation->stageFile(output_file1, storage_service), std::runtime_error);

// Won't work without a workflow!
ASSERT_THROW(simulation->launch(), std::runtime_error);
Expand Down

0 comments on commit 4562258

Please sign in to comment.