enable_smpi_MPICH3_testsuite flag in cmake. Run with ctest.
* Add all missing Fortran bindings, SMPI should work with Fortran 90
(no privatization of global variables yet)
+ * Preliminary DVFS support (see examples/smpi/energy/ for details)
Model-Checking;
* Verification of liveness properties is now available for SMPI applications
ADD_TEST(smpi-shared-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/shared.tesh)
endif()
endif()
+
+ ADD_TEST(smpi-energy ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/energy --cd ${CMAKE_BINARY_DIR}/examples/smpi/energy ${CMAKE_HOME_DIRECTORY}/examples/smpi/energy/energy.tesh)
+
if(HAVE_TRACING)
ADD_TEST(smpi-tracing-ptp ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/tracing/smpi_traced.tesh)
ADD_TEST(smpi-replay ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/smpi_replay.tesh)
examples/simdag/scheduling/CMakeLists.txt
examples/smpi/CMakeLists.txt
examples/smpi/MM/CMakeLists.txt
+ examples/smpi/energy/CMakeLists.txt
examples/xbt/CMakeLists.txt
)
add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/smpi)
add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/smpi/MM)
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/smpi/energy)
add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/xbt)
--- /dev/null
+cmake_minimum_required(VERSION 2.6)
+
+if(enable_smpi)
+ if(WIN32)
+ set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
+ else()
+ set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+ endif()
+
+ set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
+ include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi")
+
+ add_executable(se se.c)
+ target_link_libraries(se simgrid)
+endif()
+
+set(tesh_files
+ ${tesh_files}
+ ${CMAKE_CURRENT_SOURCE_DIR}/energy.tesh
+ PARENT_SCOPE
+ )
+set(xml_files
+ ${xml_files}
+ ${CMAKE_CURRENT_SOURCE_DIR}/platform.xml
+ PARENT_SCOPE
+ )
+set(examples_src
+ ${examples_src}
+ ${CMAKE_CURRENT_SOURCE_DIR}/se.c
+ PARENT_SCOPE
+ )
+set(bin_files
+ ${bin_files}
+ PARENT_SCOPE
+ )
+set(txt_files
+ ${txt_files}
+ ${CMAKE_CURRENT_SOURCE_DIR}/hostfile
+ PARENT_SCOPE
+ )
--- /dev/null
+p Test smpi bindings for dvfs functions (C example)
+$ ../../../smpi_script/bin/smpirun -np 2 -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/platform.xml --cfg=smpi/cpu_threshold:-1 ${bindir:=.}/se
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu_threshold' to '-1'
+> [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
+> [0.000000] [rank 1] Pstates: 1; Powers: 100000000
+> [0.000000] [rank 0] Pstates: 3; Powers: 100000000, 50000000, 20000000
+> [0.000000] [rank 1] Current pstate: 0; Current power: 100000000
+> [0.000000] [rank 0] Current pstate: 0; Current power: 100000000
+> [10.000000] [rank 1] Energy consumed: 2000 Joules.
+> [10.000000] [rank 0] Energy consumed: 2000 Joules.
+> [10.000000] [rank 0] Current pstate: 1; Current power: 50000000
+> [30.000000] [rank 0] Energy consumed: 5400 Joules.
+> [30.000000] [rank 0] Current pstate: 2; Current power: 20000000
+> [80.000000] [rank 0] Energy consumed: 12900 Joules.
--- /dev/null
+MyHost1
+MyHost2
--- /dev/null
+<?xml version='1.0'?>
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
+<platform version="3">
+<AS id="AS0" routing="Full">
+ <!-- Multiple pstate processor capacities can be defined as a list of powers specified for a given host -->
+ <!-- The enabled pstate can be set through the "pstate" attribute (lowest pstate corresponds to the highest processor power) -->
+ <host id="MyHost1" power="100.0Mf,50.0Mf,20.0Mf" pstate="0" >
+ <!-- List of min_power:max_power pairs (in Watts) corresponding to the power consumed when the processor is idle and when it is fully loaded -->
+ <!-- The list must contain one power pair for each previously defined pstate-->
+ <prop id="power_per_state" value="95.0:200.0, 93.0:170.0, 90.0:150.0" />
+ </host>
+ <host id="MyHost2" power="100.0Mf" >
+ <prop id="power_per_state" value="95.0:200.0" />
+ </host>
+</AS>
+</platform>
--- /dev/null
+#include <stdio.h>
+#include <stdlib.h>
+#include <mpi.h>
+#include <smpi/smpi.h>
+
+int main(int argc, char *argv[])
+{
+ int rank, pstates;
+ int i;
+ char buf[1024];
+ char *s;
+ size_t sz, x;
+
+ if (MPI_Init(&argc, &argv) != MPI_SUCCESS) {
+ printf("MPI initialization failed!\n");
+ exit(EXIT_FAILURE);
+ }
+
+ MPI_Comm_rank(MPI_COMM_WORLD, &rank); /* Get id of this process */
+
+ pstates = smpi_get_host_nb_pstates();
+
+ s = buf;
+ sz = sizeof buf;
+ x = snprintf(s, sz,
+ "[%.6f] [rank %d] Pstates: %d; Powers: %.0f",
+ MPI_Wtime(), rank, pstates, smpi_get_host_power_peak_at(0));
+ if (x < sz) {
+ s += x;
+ sz -= x;
+ } else
+ sz = 0;
+ for (i = 1; i < pstates; i++) {
+ x = snprintf(s, sz, ", %.0f", smpi_get_host_power_peak_at(i));
+ if (x < sz) {
+ s += x;
+ sz -= x;
+ } else
+ sz = 0;
+ }
+ printf("%s%s\n", buf, (sz ? "" : " [...]"));
+
+ for (i = 0; i < pstates; i++) {
+ smpi_set_host_power_peak_at(i);
+ printf("[%.6f] [rank %d] Current pstate: %d; Current power: %.0f\n",
+ MPI_Wtime(), rank, i, smpi_get_host_current_power_peak());
+
+ SMPI_SAMPLE_FLOPS(1e9) {
+ /* imagine here some code running for 1e9 flops... */
+ }
+
+ printf("[%.6f] [rank %d] Energy consumed: %g Joules.\n",
+ MPI_Wtime(), rank, smpi_get_host_consumed_energy());
+ }
+
+ return MPI_Finalize();
+}