${CMAKE_HOME_DIRECTORY}
${CMAKE_HOME_DIRECTORY}/include
${CMAKE_HOME_DIRECTORY}/src/include
+ ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/include
)
include(FindGraphviz)
include(FindLibSigc++)
-if(enable_java)
- find_package(Java REQUIRED COMPONENTS Runtime Development)
- find_package(JNI REQUIRED)
- message("-- [Java] JNI found: ${JNI_FOUND}")
- message("-- [Java] JNI include dirs: ${JNI_INCLUDE_DIRS}")
- if(enable_maintainer_mode)
- find_package(SWIG REQUIRED)
- include(UseSWIG)
- message("-- [Java] Swig found: ${SWIG_FOUND} (version ${SWIG_VERSION})")
- endif()
- set(HAVE_Java 1)
-endif()
if(enable_scala)
find_package(Scala REQUIRED)
message("-- [Scala] scalac found: ${SCALA_COMPILE}")
#- if [%COMPILER%]==[MSYS2] set PATH=C:\msys64\bin,%PATH%
install:
- if [%COMPILER%]==[MinGW-w64] set PATH=C:\mingw64\bin;%PATH%
-- if [%COMPILER%]==[MinGW-w64] rename "C:\Program Files (x86)\Git\bin\sh.exe" "sh2.exe"
+- if [%COMPILER%]==[MinGW-w64] rename "C:\Program Files (x86)\Git\bin\sh.exe" "sh2.exe" # MinGW cannot stand having a sh.exe in the path
+- if [%COMPILER%]==[MinGW-w64] rename "C:\Program Files\Git\usr\bin\sh.exe" "sh3.exe"
- if [%COMPILER%]==[MinGW-w64] appveyor DownloadFile "https://raw.githubusercontent.com/symengine/dependencies/5cff7d1736877336cf9fb58267111beea4fa152f/x86_64-4.9.1-release-posix-seh-rt_v3-rev1.7z" -FileName mw64.7z || appveyor DownloadFile "https://raw.githubusercontent.com/symengine/dependencies/5cff7d1736877336cf9fb58267111beea4fa152f/x86_64-4.9.1-release-posix-seh-rt_v3-rev1.7z" -FileName mw64.7z
- if [%COMPILER%]==[MinGW-w64] 7z x -oC:\ mw64.7z > NUL
XBT_PUBLIC(int) sg_host_get_core(sg_host_t host);
XBT_PUBLIC(int) sg_host_get_state(sg_host_t host);
+XBT_PUBLIC(int) sg_host_get_nb_pstates(sg_host_t host);
XBT_PUBLIC(int) sg_host_get_pstate(sg_host_t host);
XBT_PUBLIC(double) sg_host_get_consumed_energy(sg_host_t host);
XBT_PUBLIC(double) simcall_host_get_current_power_peak(sg_host_t host);
XBT_PUBLIC(double) simcall_host_get_power_peak_at(sg_host_t host, int pstate_index);
-XBT_PUBLIC(int) simcall_host_get_nb_pstates(sg_host_t host);
XBT_PUBLIC(void) simcall_host_set_pstate(sg_host_t host, int pstate_index);
XBT_PUBLIC(double) simcall_host_get_wattmin_at(sg_host_t host, int pstate);
XBT_PUBLIC(double) simcall_host_get_wattmax_at(sg_host_t host, int pstate);
* \param host host to test
*/
int MSG_host_get_nb_pstates(msg_host_t host) {
-
- xbt_assert((host != NULL), "Invalid parameters (host is NULL)");
- return (simcall_host_get_nb_pstates(host));
+ return sg_host_get_nb_pstates(host);
}
/** \ingroup m_host_management
#ifndef SIMGRID_PORTABLE_H
#define SIMGRID_PORTABLE_H
-#include "internal_config.h"
+#include "src/internal_config.h"
#include "xbt/base.h"
#include "xbt/misc.h"
#ifdef _XBT_WIN32
#include "xbt/dict.h"
#include "simgrid/host.h"
-#include "surf/surf_routing.h" // SIMIX_HOST_LEVEL and friends FIXME: make private here
#include "surf/surf.h" // routing_get_network_element_type FIXME:killme
sg_host_t sg_host_by_name(const char *name){
return surf_host_get_state(surf_host_resource_priv(host));
}
-/** @brief Returns the total energy consumed by the host (in Joules) */
+/** @brief Returns the total energy consumed by the host (in Joules).
+ *
+ * See also @ref SURF_plugin_energy.
+ */
double sg_host_get_consumed_energy(sg_host_t host) {
return surf_host_get_consumed_energy(host);
}
-/** @brief Gets the pstate at which that host currently runs */
+/** @brief Returns the number of power states for a host.
+ *
+ * See also @ref SURF_plugin_energy.
+ */
+int sg_host_get_nb_pstates(sg_host_t host) {
+ return surf_host_get_nb_pstates(host);
+}
+
+/** @brief Gets the pstate at which that host currently runs.
+ *
+ * See also @ref SURF_plugin_energy.
+ */
int sg_host_get_pstate(sg_host_t host) {
return surf_host_get_pstate(host);
}
return simcall_BODY_host_get_power_peak_at(host, pstate_index);
}
-/**
- * \ingroup simix_host_management
- * \brief Returns the number of power states for a host.
- *
- * \param host A SIMIX host
- * \return the number of power states
- */
-int simcall_host_get_nb_pstates(sg_host_t host)
-{
- return simcall_BODY_host_get_nb_pstates(host);
-}
-
/**
* \ingroup simix_host_management
* \brief Sets the pstate at which the host should run
simcall->result.d = result;
}
-static inline sg_host_t simcall_host_get_nb_pstates__get__host(smx_simcall_t simcall) {
- return (sg_host_t) simcall->args[0].dp;
-}
-static inline void simcall_host_get_nb_pstates__set__host(smx_simcall_t simcall, void* arg) {
- simcall->args[0].dp = arg;
-}
-static inline int simcall_host_get_nb_pstates__get__result(smx_simcall_t simcall){
- return simcall->result.i;
-}
-static inline void simcall_host_get_nb_pstates__set__result(smx_simcall_t simcall, int result){
- simcall->result.i = result;
-}
-
static inline sg_host_t simcall_host_get_wattmin_at__get__host(smx_simcall_t simcall) {
return (sg_host_t) simcall->args[0].dp;
}
return self->simcall.result.d;
}
-inline static int simcall_BODY_host_get_nb_pstates(sg_host_t host) {
- smx_process_t self = SIMIX_process_self();
-
- /* Go to that function to follow the code flow through the simcall barrier */
- if (0) SIMIX_host_get_nb_pstates(host);
- /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
-
- self->simcall.call = SIMCALL_HOST_GET_NB_PSTATES;
- memset(&self->simcall.result, 0, sizeof(self->simcall.result));
- memset(self->simcall.args, 0, sizeof(self->simcall.args));
- self->simcall.args[0].dp = (void*) host;
- if (self != simix_global->maestro_process) {
- XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
- SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
- SIMIX_process_yield(self);
- } else {
- SIMIX_simcall_handle(&self->simcall, 0);
- }
- return self->simcall.result.i;
- }
-
inline static double simcall_BODY_host_get_wattmin_at(sg_host_t host, int pstate_index) {
smx_process_t self = SIMIX_process_self();
SIMCALL_HOST_GET_PROCESS_LIST,
SIMCALL_HOST_GET_CURRENT_POWER_PEAK,
SIMCALL_HOST_GET_POWER_PEAK_AT,
- SIMCALL_HOST_GET_NB_PSTATES,
SIMCALL_HOST_GET_WATTMIN_AT,
SIMCALL_HOST_GET_WATTMAX_AT,
SIMCALL_HOST_SET_PSTATE,
[SIMCALL_HOST_GET_PROCESS_LIST] = "SIMCALL_HOST_GET_PROCESS_LIST",
[SIMCALL_HOST_GET_CURRENT_POWER_PEAK] = "SIMCALL_HOST_GET_CURRENT_POWER_PEAK",
[SIMCALL_HOST_GET_POWER_PEAK_AT] = "SIMCALL_HOST_GET_POWER_PEAK_AT",
- [SIMCALL_HOST_GET_NB_PSTATES] = "SIMCALL_HOST_GET_NB_PSTATES",
[SIMCALL_HOST_GET_WATTMIN_AT] = "SIMCALL_HOST_GET_WATTMIN_AT",
[SIMCALL_HOST_GET_WATTMAX_AT] = "SIMCALL_HOST_GET_WATTMAX_AT",
[SIMCALL_HOST_SET_PSTATE] = "SIMCALL_HOST_SET_PSTATE",
SIMIX_simcall_answer(simcall);
break;
-case SIMCALL_HOST_GET_NB_PSTATES:
- simcall->result.i = SIMIX_host_get_nb_pstates((sg_host_t) simcall->args[0].dp);
- SIMIX_simcall_answer(simcall);
- break;
-
case SIMCALL_HOST_GET_WATTMIN_AT:
simcall->result.d = SIMIX_host_get_wattmin_at((sg_host_t) simcall->args[0].dp, simcall->args[1].i);
SIMIX_simcall_answer(simcall);
Func - host_get_process_list (void*, xbt_swag_t) (host, void*, sg_host_t)
Func - host_get_current_power_peak (double) (host, void*, sg_host_t)
Func - host_get_power_peak_at (double) (host, void*, sg_host_t) (pstate_index, int)
-Func - host_get_nb_pstates (int) (host, void*, sg_host_t)
Func - host_get_wattmin_at (double) (host, void*, sg_host_t) (pstate_index, int)
Func - host_get_wattmax_at (double) (host, void*, sg_host_t) (pstate_index, int)
Proc - host_set_pstate (void) (host, void*, sg_host_t) (pstate_index, int)
return surf_host_get_power_peak_at(host, pstate_index);
}
-int SIMIX_host_get_nb_pstates(sg_host_t host) {
- return surf_host_get_nb_pstates(host);
-}
-
-
void SIMIX_host_set_pstate(sg_host_t host, int pstate_index) {
surf_host_set_pstate(host, pstate_index);
}
XBT_PRIVATE xbt_swag_t SIMIX_host_get_process_list(sg_host_t host);
XBT_PRIVATE double SIMIX_host_get_current_power_peak(sg_host_t host);
XBT_PRIVATE double SIMIX_host_get_power_peak_at(sg_host_t host, int pstate_index);
-XBT_PRIVATE int SIMIX_host_get_nb_pstates(sg_host_t host);
XBT_PRIVATE double SIMIX_host_get_wattmin_at(sg_host_t host,int pstate);
XBT_PRIVATE double SIMIX_host_get_wattmax_at(sg_host_t host,int pstate);
XBT_PRIVATE void SIMIX_host_set_pstate(sg_host_t host, int pstate_index);
}
/**
- * \brief Return the number of pstates defined for host
+ * \brief Return the number of pstates defined for the current host
*/
int smpi_get_host_nb_pstates(void)
{
- return simcall_host_get_nb_pstates(SIMIX_host_self());
+ return sg_host_get_nb_pstates(SIMIX_host_self());
}
/**
#ifdef SIMGRID_TEST
#include "xbt.h"
#include "xbt/ex.h"
-#include "portable.h"
+#include "src/portable.h"
#define PRINTF_STR(a) (a)?:"(null)"
/* ************* */
#ifdef SIMGRID_TEST
#include "xbt/hash.h"
-#include "portable.h" /* hexa_str */
+#include "src/portable.h" /* hexa_str */
static char *mycmp(const char *p1, const char *p2, size_t n)
{
endif() # Doxygen found
-if (HAVE_Java)
+if (Java_FOUND)
find_path(JAVADOC_PATH NAMES javadoc PATHS NO_DEFAULT_PATHS)
mark_as_advanced(JAVADOC_PATH)
## This file is loaded only if the Java option is activated
##
-find_package(Java 1.7 REQUIRED)
+find_package(Java 1.7 COMPONENTS Runtime Development)
+if (not ${Java_FOUND})
+ message(FATAL_ERROR "Java not found (need at least Java7). Please install the JDK or disable that option")
+endif()
+set(Java_FOUND 1)
include(UseJava)
+find_package(JNI REQUIRED)
+message("-- [Java] JNI found: ${JNI_FOUND}")
+message("-- [Java] JNI include dirs: ${JNI_INCLUDE_DIRS}")
+
+find_package(SWIG)
+if(${SWIG_FOUND})
+ include(UseSWIG)
+ message("-- [Java] Swig found: version ${SWIG_VERSION}")
+else()
+ message("-- [Java] Swig NOT FOUND. Surf java bindings won't get refreshed. That's fine unless you work on this part yourself.")
+endif()
+mark_as_advanced(SWIG_EXECUTABLE)
+
+
# Rules to build libsimgrid-java
#
add_library(simgrid-java SHARED ${JMSG_C_SRC})
include_directories(${JNI_INCLUDE_DIRS} ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
-if(enable_maintainer_mode)
+if(${SWIG_FOUND})
set(CMAKE_SWIG_FLAGS "-package" "org.simgrid.surf")
set(CMAKE_SWIG_OUTDIR "${CMAKE_HOME_DIRECTORY}/src/bindings/java/org/simgrid/surf")
message(" Compiler: C++ ...............: ${CMAKE_CXX_COMPILER} (${CMAKE_CXX_COMPILER_ID})")
message(" version .............: ${CMAKE_CXX_COMPILER_VERSION}")
endif()
-if(HAVE_Java)
+if(${Java_FOUND})
message(" Compiler: Javac .............: ${Java_JAVAC_EXECUTABLE}")
message(" version .............: ${Java_VERSION_STRING}")
+if(${SWIG_FOUND})
+ message(" SWIG ................: Version ${SWIG_VERSION} found.")
+else()
+ message(" SWIG ................: Missing.")
+endif()
endif()
if(CMAKE_Fortran_COMPILER)
message(" Compiler: Fortran ...........: ${CMAKE_Fortran_COMPILER} (${CMAKE_Fortran_COMPILER_ID})")
message(" Compile NS-3 ................: NO (hint: ${NS3_HINT})")
endif()
-if (HAVE_Java)
+if (${Java_FOUND})
message(" Compile Java ................: yes")
message(" Native lib in jar .........: ${enable_lib_in_jar}")
else()