Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
start to design a test for storage management in SimDag (very very
authorsuter <frederic.suter@cc.in2p3.fr>
Fri, 9 Aug 2013 15:02:23 +0000 (17:02 +0200)
committersuter <frederic.suter@cc.in2p3.fr>
Fri, 9 Aug 2013 15:02:23 +0000 (17:02 +0200)
preliminary for now)

buildtools/Cmake/AddTests.cmake
buildtools/Cmake/DefinePackages.cmake
buildtools/Cmake/MakeExe.cmake
examples/simdag/io/CMakeLists.txt [new file with mode: 0644]
examples/simdag/io/io.tesh [new file with mode: 0644]
examples/simdag/io/sd_io.c [new file with mode: 0644]

index d565c9c..b276f09 100644 (file)
@@ -271,6 +271,7 @@ if(NOT enable_memcheck)
   ADD_TEST(simdag-test-dax-cycle                ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag/dax --cd ${CMAKE_BINARY_DIR}/examples/simdag/dax ${CMAKE_HOME_DIRECTORY}/examples/simdag/dax/simple_dax_with_cycle.tesh)
   ADD_TEST(simdag-test-prop                     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/properties/test_prop.tesh)
   ADD_TEST(simdag-test-minmin-scheduling        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/simdag/scheduling --cd ${CMAKE_HOME_DIRECTORY}/examples/simdag/scheduling test_minmin.tesh)
+  ADD_TEST(simdag-test-io                      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/simdag/ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/ --cd ${CMAKE_HOME_DIRECTORY}/examples/ ${CMAKE_HOME_DIRECTORY}/examples/simdag/io/io.tesh)
 
   ADD_TEST(msg-gtnets-crosstraffic-thread       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-crosstraffic.tesh)
   if(CONTEXT_UCONTEXT)
index ad79642..dab01cd 100644 (file)
@@ -895,6 +895,7 @@ set(EXAMPLES_CMAKEFILES_TXT
   examples/simdag/dax/CMakeLists.txt
   examples/simdag/dot/CMakeLists.txt
   examples/simdag/goal/CMakeLists.txt
+  examples/simdag/io/CMakeLists.txt
   examples/simdag/metaxml/CMakeLists.txt
   examples/simdag/properties/CMakeLists.txt
   examples/simdag/scheduling/CMakeLists.txt
index 9fa4edb..2ae21da 100644 (file)
@@ -68,6 +68,7 @@ add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/simdag)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/simdag/dax)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/simdag/dot)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/simdag/goal)
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/simdag/io)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/simdag/metaxml)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/simdag/properties)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/simdag/scheduling)
diff --git a/examples/simdag/io/CMakeLists.txt b/examples/simdag/io/CMakeLists.txt
new file mode 100644 (file)
index 0000000..6288f7f
--- /dev/null
@@ -0,0 +1,31 @@
+cmake_minimum_required(VERSION 2.6)
+
+set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
+
+add_executable(sd_io sd_io.c)
+
+### Add definitions for compile
+if(NOT WIN32)
+  target_link_libraries(sd_io simgrid pthread m)
+else()
+  target_link_libraries(sd_io simgrid)
+endif()
+
+set(tesh_files
+  ${tesh_files}
+  ${CMAKE_CURRENT_SOURCE_DIR}/io.tesh
+  PARENT_SCOPE
+  )
+set(examples_src
+  ${examples_src}
+  ${CMAKE_CURRENT_SOURCE_DIR}/sd_io.c
+  PARENT_SCOPE
+  )
+set(bin_files
+  ${bin_files}
+  PARENT_SCOPE
+  )
+set(txt_files
+  ${txt_files}
+  PARENT_SCOPE
+  )
diff --git a/examples/simdag/io/io.tesh b/examples/simdag/io/io.tesh
new file mode 100644 (file)
index 0000000..201b147
--- /dev/null
@@ -0,0 +1,7 @@
+#! ./tesh
+
+$ ${bindir:=.}/io/sd_io ${srcdir:=.}/examples/platforms/storage.xml 
+> [0.000000] [sd_io/INFO] Workstation 'denise' mounts '/home'
+> [0.000000] [sd_io/INFO] Workstation 'alice' mounts '/home'
+> [0.000000] [sd_io/INFO] Workstation 'carl' mounts '/home'
+> [0.000000] [sd_io/INFO] Workstation 'bob' mounts '/home'
diff --git a/examples/simdag/io/sd_io.c b/examples/simdag/io/sd_io.c
new file mode 100644 (file)
index 0000000..76a192b
--- /dev/null
@@ -0,0 +1,40 @@
+/* Copyright (c) 2013. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "simdag/simdag.h"
+#include "xbt/ex.h"
+#include "xbt/log.h"
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(sd_io,
+                             "Logging specific to this SimDag example");
+int main(int argc, char **argv)
+{
+  unsigned int ctr, ctr2;
+  const SD_workstation_t *workstations;
+  int total_nworkstations;
+  xbt_dynar_t current_storage_list;
+  char *mount_name;
+
+  SD_init(&argc, argv);
+  /* Set the workstation model to default, as storage is not supported by the
+   * ptask_L07 model yet.
+   */
+  SD_config("workstation/model", "default");
+  SD_create_environment(argv[1]);
+  workstations = SD_workstation_get_list();
+  total_nworkstations = SD_workstation_get_number();
+
+  for (ctr=0; ctr<total_nworkstations;ctr++){
+    current_storage_list = SD_workstation_get_storage_list(workstations[ctr]);
+    xbt_dynar_foreach(current_storage_list, ctr2, mount_name)
+      XBT_INFO("Workstation '%s' mounts '%s'",
+         SD_workstation_get_name(workstations[ctr]), mount_name);
+    xbt_dynar_free_container(&current_storage_list);
+  }
+  return 0;
+}