diff --git a/CMakeLists.txt b/CMakeLists.txt index 44a613da35..19052a6f47 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,6 +47,23 @@ if (DEFINED SimGrid_PATH) endif() endif() find_package(SimGrid REQUIRED) + +# Find SimGrid's FS module +if (DEFINED FSMOD_PATH) + if (NOT EXISTS "${FSMOD_PATH}") + message(FATAL_ERROR "The specified FSMOD_PATH doesn't exit") + else() + file(GLOB LIBFSMOD_FILES + "${FSMOD_PATH}/liblibfsmod.so" + "${FSMOD_PATH}/lib/libfsmod.dylib" + ) + if (NOT LIBFSMOD_FILES) + message(FATAL_ERROR "The specified FSMOD_PATH doesn't seem to contain a valid FSMod installation") + else() + set(CMAKE_PREFIX_PATH ${FSMOD_PATH} ${CMAKE_PREFIX_PATH}) + endif() + endif() +endif() find_package(FSMod REQUIRED) # Find nlohmann_json diff --git a/examples/workflow_api/basic-examples/bare-metal-bag-of-tasks-programmatic-platform/BareMetalBagOfTasksProgrammaticPlatform.cpp b/examples/workflow_api/basic-examples/bare-metal-bag-of-tasks-programmatic-platform/BareMetalBagOfTasksProgrammaticPlatform.cpp index 22014e84a7..e069d16fb2 100755 --- a/examples/workflow_api/basic-examples/bare-metal-bag-of-tasks-programmatic-platform/BareMetalBagOfTasksProgrammaticPlatform.cpp +++ b/examples/workflow_api/basic-examples/bare-metal-bag-of-tasks-programmatic-platform/BareMetalBagOfTasksProgrammaticPlatform.cpp @@ -210,7 +210,7 @@ int main(int argc, char **argv) { * by workflow tasks, and thus are only input files. These files are then staged on the storage service. */ std::cerr << "Staging task input files..." << std::endl; for (auto const &f: workflow->getInputFiles()) { - simulation->stageFile(f, storage_service); + storage_service->createFile(f); } /* Launch the simulation. This call only returns when the simulation is complete. */ diff --git a/examples/workflow_api/basic-examples/bare-metal-chain-scratch/BareMetalChainScratch.cpp b/examples/workflow_api/basic-examples/bare-metal-chain-scratch/BareMetalChainScratch.cpp index 6de7bcce51..6941561930 100755 --- a/examples/workflow_api/basic-examples/bare-metal-chain-scratch/BareMetalChainScratch.cpp +++ b/examples/workflow_api/basic-examples/bare-metal-chain-scratch/BareMetalChainScratch.cpp @@ -139,7 +139,7 @@ int main(int argc, char **argv) { * by workflow tasks, and thus are only input files. These files are then staged on the storage service. */ std::cerr << "Staging task input files..." << std::endl; for (auto const &f: workflow->getInputFiles()) { - simulation->stageFile(f, storage_service); + storage_service->createFile(f); } /* Launch the simulation. This call only returns when the simulation is complete. */ diff --git a/examples/workflow_api/basic-examples/bare-metal-chain/BareMetalChain.cpp b/examples/workflow_api/basic-examples/bare-metal-chain/BareMetalChain.cpp index 73bf95f833..65e1d05cf1 100755 --- a/examples/workflow_api/basic-examples/bare-metal-chain/BareMetalChain.cpp +++ b/examples/workflow_api/basic-examples/bare-metal-chain/BareMetalChain.cpp @@ -148,7 +148,7 @@ int main(int argc, char **argv) { * by workflow tasks, and thus are only input files. These files are then staged on the storage service. */ std::cerr << "Staging task input files..." << std::endl; for (auto const &f: workflow->getInputFiles()) { - simulation->stageFile(f, storage_service); + storage_service->createFile(f); } /* Launch the simulation. This call only returns when the simulation is complete. */ diff --git a/examples/workflow_api/basic-examples/bare-metal-complex-job/ComplexJob.cpp b/examples/workflow_api/basic-examples/bare-metal-complex-job/ComplexJob.cpp index a1588396c0..46fa4590ab 100755 --- a/examples/workflow_api/basic-examples/bare-metal-complex-job/ComplexJob.cpp +++ b/examples/workflow_api/basic-examples/bare-metal-complex-job/ComplexJob.cpp @@ -120,7 +120,7 @@ int main(int argc, char **argv) { * by workflow tasks, and thus are only input files. These files are then staged on the storage service. */ std::cerr << "Staging task input files..." << std::endl; for (auto const &f: workflow->getInputFiles()) { - simulation->stageFile(f, storage_service1); + storage_service1->createFile(f); } /* Launch the simulation. This call only returns when the simulation is complete. */ diff --git a/examples/workflow_api/basic-examples/bare-metal-data-movement/DataMovement.cpp b/examples/workflow_api/basic-examples/bare-metal-data-movement/DataMovement.cpp index 69cbbaa1ca..fd0c188b01 100755 --- a/examples/workflow_api/basic-examples/bare-metal-data-movement/DataMovement.cpp +++ b/examples/workflow_api/basic-examples/bare-metal-data-movement/DataMovement.cpp @@ -121,7 +121,7 @@ int main(int argc, char **argv) { * by workflow tasks, and thus are only input files. These files are then staged on the storage service. */ std::cerr << "Staging task input files..." << std::endl; for (auto const &f: workflow->getInputFiles()) { - simulation->stageFile(f, storage_service1); + storage_service1->createFile(f); } /* Launch the simulation. This call only returns when the simulation is complete. */ diff --git a/examples/workflow_api/basic-examples/batch-bag-of-tasks/BatchBagOfTasks.cpp b/examples/workflow_api/basic-examples/batch-bag-of-tasks/BatchBagOfTasks.cpp index e5b0be5498..63a21a5816 100755 --- a/examples/workflow_api/basic-examples/batch-bag-of-tasks/BatchBagOfTasks.cpp +++ b/examples/workflow_api/basic-examples/batch-bag-of-tasks/BatchBagOfTasks.cpp @@ -134,7 +134,7 @@ int main(int argc, char **argv) { * by workflow tasks, and thus are only input files. These files are then staged on the storage service. */ std::cerr << "Staging task input files..." << std::endl; for (auto const &f: workflow->getInputFiles()) { - simulation->stageFile(f, storage_service); + storage_service->createFile(f); } /* Launch the simulation. This call only returns when the simulation is complete. */ diff --git a/examples/workflow_api/basic-examples/batch-pilot-job/BatchPilotJob.cpp b/examples/workflow_api/basic-examples/batch-pilot-job/BatchPilotJob.cpp index 205815030f..eb2be560ad 100755 --- a/examples/workflow_api/basic-examples/batch-pilot-job/BatchPilotJob.cpp +++ b/examples/workflow_api/basic-examples/batch-pilot-job/BatchPilotJob.cpp @@ -124,7 +124,7 @@ int main(int argc, char **argv) { * by workflow tasks, and thus are only input files. These files are then staged on the storage service. */ std::cerr << "Staging task input files..." << std::endl; for (auto const &f: workflow->getInputFiles()) { - simulation->stageFile(f, storage_service); + storage_service->createFile(f); } /* Launch the simulation. This call only returns when the simulation is complete. */ diff --git a/examples/workflow_api/basic-examples/cloud-bag-of-tasks-energy/CloudBagOfTasksEnergy.cpp b/examples/workflow_api/basic-examples/cloud-bag-of-tasks-energy/CloudBagOfTasksEnergy.cpp index a35cfc885b..47d35542e9 100755 --- a/examples/workflow_api/basic-examples/cloud-bag-of-tasks-energy/CloudBagOfTasksEnergy.cpp +++ b/examples/workflow_api/basic-examples/cloud-bag-of-tasks-energy/CloudBagOfTasksEnergy.cpp @@ -149,7 +149,7 @@ int main(int argc, char **argv) { * by workflow tasks, and thus are only input files. These files are then staged on the storage service. */ std::cerr << "Staging task input files..." << std::endl; for (auto const &f: workflow->getInputFiles()) { - simulation->stageFile(f, storage_service); + storage_service->createFile(f); } /* Launch the simulation. This call only returns when the simulation is complete. */ diff --git a/examples/workflow_api/basic-examples/cloud-bag-of-tasks/CloudBagOfTasks.cpp b/examples/workflow_api/basic-examples/cloud-bag-of-tasks/CloudBagOfTasks.cpp index 52d71a2b75..61286d2a4c 100755 --- a/examples/workflow_api/basic-examples/cloud-bag-of-tasks/CloudBagOfTasks.cpp +++ b/examples/workflow_api/basic-examples/cloud-bag-of-tasks/CloudBagOfTasks.cpp @@ -137,7 +137,7 @@ int main(int argc, char **argv) { * by workflow tasks, and thus are only input files. These files are then staged on the storage service. */ std::cerr << "Staging task input files..." << std::endl; for (auto const &f: workflow->getInputFiles()) { - simulation->stageFile(f, storage_service); + storage_service->createFile(f); } /* Launch the simulation. This call only returns when the simulation is complete. */ diff --git a/examples/workflow_api/basic-examples/io-pagecache/IOPageCacheMulti.cpp b/examples/workflow_api/basic-examples/io-pagecache/IOPageCacheMulti.cpp index c45fa77d90..e7297d1250 100755 --- a/examples/workflow_api/basic-examples/io-pagecache/IOPageCacheMulti.cpp +++ b/examples/workflow_api/basic-examples/io-pagecache/IOPageCacheMulti.cpp @@ -188,7 +188,7 @@ int main(int argc, char **argv) { std::cerr << "Staging task input files..." << std::endl; for (auto const &f: workflow->getInputFiles()) { - simulation->stageFile(f, storage_service); + storage_service->createFile(f); } double start = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); diff --git a/examples/workflow_api/basic-examples/io-pagecache/IOPageCacheNFS.cpp b/examples/workflow_api/basic-examples/io-pagecache/IOPageCacheNFS.cpp index 4b88ca3c51..17fb97077d 100755 --- a/examples/workflow_api/basic-examples/io-pagecache/IOPageCacheNFS.cpp +++ b/examples/workflow_api/basic-examples/io-pagecache/IOPageCacheNFS.cpp @@ -165,7 +165,7 @@ int main(int argc, char **argv) { std::cerr << "Staging task input files..." << std::endl; for (auto const &f: workflow->getInputFiles()) { - simulation->stageFile(f, server_storage_service); + server_storage_service->createFile(f); } simulation->getOutput().enableWorkflowTaskTimestamps(true); diff --git a/examples/workflow_api/basic-examples/io-pagecache/IOPageCacheNighres.cpp b/examples/workflow_api/basic-examples/io-pagecache/IOPageCacheNighres.cpp index 0f2efb3567..a60fce5976 100755 --- a/examples/workflow_api/basic-examples/io-pagecache/IOPageCacheNighres.cpp +++ b/examples/workflow_api/basic-examples/io-pagecache/IOPageCacheNighres.cpp @@ -87,7 +87,7 @@ int main(int argc, char **argv) { std::cerr << "Staging task input files..." << std::endl; for (auto const &f: workflow->getInputFiles()) { - simulation->stageFile(f, storage_service); + storage_service->createFile(f); } simulation->getOutput().enableWorkflowTaskTimestamps(true); diff --git a/examples/workflow_api/basic-examples/io-pagecache/IOPageCacheSingle.cpp b/examples/workflow_api/basic-examples/io-pagecache/IOPageCacheSingle.cpp index 1d8e289c14..10f501c86b 100755 --- a/examples/workflow_api/basic-examples/io-pagecache/IOPageCacheSingle.cpp +++ b/examples/workflow_api/basic-examples/io-pagecache/IOPageCacheSingle.cpp @@ -153,7 +153,7 @@ int main(int argc, char **argv) { std::cerr << "Staging task input files..." << std::endl; for (auto const &f: workflow->getInputFiles()) { - simulation->stageFile(f, storage_service); + storage_service->createFile(f); } simulation->getOutput().enableWorkflowTaskTimestamps(true); diff --git a/examples/workflow_api/basic-examples/virtualized-cluster-bag-of-tasks/VirtualizedClusterBagOfTasks.cpp b/examples/workflow_api/basic-examples/virtualized-cluster-bag-of-tasks/VirtualizedClusterBagOfTasks.cpp index f0ce8fe826..d1306765b7 100755 --- a/examples/workflow_api/basic-examples/virtualized-cluster-bag-of-tasks/VirtualizedClusterBagOfTasks.cpp +++ b/examples/workflow_api/basic-examples/virtualized-cluster-bag-of-tasks/VirtualizedClusterBagOfTasks.cpp @@ -137,7 +137,7 @@ int main(int argc, char **argv) { * by workflow tasks, and thus are only input files. These files are then staged on the storage service. */ std::cerr << "Staging task input files..." << std::endl; for (auto const &f: workflow->getInputFiles()) { - simulation->stageFile(f, storage_service); + storage_service->createFile(f); } /* Launch the simulation. This call only returns when the simulation is complete. */ diff --git a/examples/workflow_api/condor-grid-example/CondorGridSimulator.cpp b/examples/workflow_api/condor-grid-example/CondorGridSimulator.cpp index e6d07cb013..5ad4263c7c 100755 --- a/examples/workflow_api/condor-grid-example/CondorGridSimulator.cpp +++ b/examples/workflow_api/condor-grid-example/CondorGridSimulator.cpp @@ -94,7 +94,7 @@ int main(int argc, char **argv) { // Stage the input_file on the storage service for (auto const &f: workflow->getInputFiles()) { - simulation->stageFile(f, local_ss); + local_ss->createFile(f); } // Run the simulation diff --git a/examples/workflow_api/real-workflow-example/SimpleWorkflowSimulator.cpp b/examples/workflow_api/real-workflow-example/SimpleWorkflowSimulator.cpp index 4f0bd7eea8..59133ed6bb 100755 --- a/examples/workflow_api/real-workflow-example/SimpleWorkflowSimulator.cpp +++ b/examples/workflow_api/real-workflow-example/SimpleWorkflowSimulator.cpp @@ -163,7 +163,7 @@ int main(int argc, char **argv) { std::cerr << "Staging input files..." << std::endl; for (auto const &f: workflow->getInputFiles()) { try { - simulation->stageFile(f, storage_service); + storage_service->createFile(f); } catch (std::runtime_error &e) { std::cerr << "Exception: " << e.what() << std::endl; return 0; diff --git a/test/services/compute_services/bare_metal_compound_jobs/BareMetalComputeServiceOneActionTests.cpp b/test/services/compute_services/bare_metal_compound_jobs/BareMetalComputeServiceOneActionTests.cpp index 890d1a5976..af6cbfa6b0 100644 --- a/test/services/compute_services/bare_metal_compound_jobs/BareMetalComputeServiceOneActionTests.cpp +++ b/test/services/compute_services/bare_metal_compound_jobs/BareMetalComputeServiceOneActionTests.cpp @@ -1519,7 +1519,7 @@ TEST_F(BareMetalComputeServiceOneActionTest, ServiceSuspended) { void BareMetalComputeServiceOneActionTest::do_OneSleepActionServiceSuspended_test() { // Create and initialize a simulation auto simulation = wrench::Simulation::createSimulation(); - +x2 int argc = 1; auto argv = (char **) calloc(argc, sizeof(char *)); argv[0] = strdup("one_action_test"); diff --git a/tools/wrench/wrench-init/base_code/CMakeLists.txt b/tools/wrench/wrench-init/base_code/CMakeLists.txt index 441a656592..7d7d05ed0d 100755 --- a/tools/wrench/wrench-init/base_code/CMakeLists.txt +++ b/tools/wrench/wrench-init/base_code/CMakeLists.txt @@ -34,6 +34,24 @@ if (DEFINED SimGrid_PATH) endif() find_package(SimGrid REQUIRED) +# Find SimGrid's FS module +if (DEFINED FSMOD_PATH) + if (NOT EXISTS "${FSMOD_PATH}") + message(FATAL_ERROR "The specified FSMOD_PATH doesn't exit") + else() + file(GLOB LIBFSMOD_FILES + "${FSMOD_PATH}/liblibfsmod.so" + "${FSMOD_PATH}/lib/libfsmod.dylib" + ) + if (NOT LIBFSMOD_FILES) + message(FATAL_ERROR "The specified FSMOD_PATH doesn't seem to contain a valid FSMod installation") + else() + set(CMAKE_PREFIX_PATH ${FSMOD_PATH} ${CMAKE_PREFIX_PATH}) + endif() + endif() +endif() +find_package(FSMod REQUIRED) + # Find WRENCH if (DEFINED WRENCH_PATH) if (NOT EXISTS "${WRENCH_PATH}") @@ -53,7 +71,7 @@ find_package(WRENCH REQUIRED) # include directories -include_directories(include/ /usr/local/include/ /opt/local/include/ ${WRENCH_INCLUDE_DIR} ${SimGrid_INCLUDE_DIR} ${Boost_INCLUDE_DIR}) +include_directories(include/ /usr/local/include/ /opt/local/include/ ${WRENCH_INCLUDE_DIR} ${SimGrid_INCLUDE_DIR} ${FSMOD_INCLUDE_DIR} ${Boost_INCLUDE_DIR}) # source files set(SOURCE_FILES @@ -70,6 +88,7 @@ if (ENABLE_BATSCHED) target_link_libraries(my-wrench-simulator ${WRENCH_LIBRARY} ${SimGrid_LIBRARY} + ${FSMOD_LIBRARY} ${Boost_LIBRARIES} ${WRENCH_WFCOMMONS_WORKFLOW_PARSER_LIBRARY} -lzmq) @@ -77,6 +96,7 @@ else() target_link_libraries(my-wrench-simulator ${WRENCH_LIBRARY} ${SimGrid_LIBRARY} + ${FSMOD_LIBRARY} ${Boost_LIBRARIES} ${WRENCH_WFCOMMONS_WORKFLOW_PARSER_LIBRARY} ) diff --git a/tools/wrench/wrench-init/base_code/Simulator_WORKFLOW.cpp b/tools/wrench/wrench-init/base_code/Simulator_WORKFLOW.cpp index 26a051a50a..7c1fefed73 100755 --- a/tools/wrench/wrench-init/base_code/Simulator_WORKFLOW.cpp +++ b/tools/wrench/wrench-init/base_code/Simulator_WORKFLOW.cpp @@ -100,7 +100,7 @@ int main(int argc, char **argv) { /* Stage input files on the storage service */ for (auto const &f: workflow->getInputFiles()) { - simulation->stageFile(f, storage_service); + storage_service->createFile(f); } /* Launch the simulation */ diff --git a/tools/wrench/wrench-init/generate.sh b/tools/wrench/wrench-init/generate.sh index d8d09f8aa7..6475b1872a 100755 --- a/tools/wrench/wrench-init/generate.sh +++ b/tools/wrench/wrench-init/generate.sh @@ -23,6 +23,11 @@ cat $1"/conf/cmake/FindSimGrid.cmake" echo "\"\"\"" echo "" +echo "FILE_CONTENT_FINDFSMOD_CMAKE = r\"\"\"" +cat $1"/conf/cmake/FindFSMod.cmake" +echo "\"\"\"" +echo "" + echo "FILE_CONTENT_FINDWRENCH_CMAKE = r\"\"\"" cat $1"/FindWRENCH.cmake" echo "\"\"\"" diff --git a/tools/wrench/wrench-init/wrench-init.in b/tools/wrench/wrench-init/wrench-init.in index d008912374..9d354d772b 100755 --- a/tools/wrench/wrench-init/wrench-init.in +++ b/tools/wrench/wrench-init/wrench-init.in @@ -77,6 +77,7 @@ def main(): _create_file(FILE_CONTENT_README_MD, args.project_dir + "/README.md") _create_file(FILE_CONTENT_CMAKELISTS_TXT, args.project_dir + "/CMakeLists.txt") _create_file(FILE_CONTENT_FINDSIMGRID_CMAKE, args.project_dir + "/CMakeModules/FindSimGrid.cmake") + _create_file(FILE_CONTENT_FINDFSMOD_CMAKE, args.project_dir + "/CMakeModules/FindFSMod.cmake") _create_file(FILE_CONTENT_FINDWRENCH_CMAKE, args.project_dir + "/CMakeModules/FindWRENCH.cmake") _create_file(FILE_CONTENT_PLATFORM_XML, args.project_dir + "/data/platform.xml")