Explorar el Código

fix compatibility with older simgrid versions

Samuel Thibault hace 8 años
padre
commit
0d900cb464
Se han modificado 2 ficheros con 11 adiciones y 1 borrados
  1. 1 1
      configure.ac
  2. 10 0
      src/core/simgrid.c

+ 1 - 1
configure.ac

@@ -1105,7 +1105,7 @@ if test x$enable_simgrid = xyes ; then
 		]
 	)
 	AC_CHECK_HEADERS([simgrid/msg.h], [AC_DEFINE([STARPU_HAVE_SIMGRID_MSG_H], [1], [Define to 1 if you have msg.h in simgrid/.])])
-   	AC_CHECK_FUNCS([MSG_process_join MSG_process_attach MSG_get_as_by_name MSG_environment_get_routing_root MSG_host_get_speed xbt_mutex_try_acquire smpi_process_set_user_data])
+   	AC_CHECK_FUNCS([MSG_process_join MSG_process_attach MSG_get_as_by_name MSG_environment_get_routing_root MSG_host_get_speed xbt_mutex_try_acquire smpi_process_set_user_data SD_link_get_name surf_network_link_get_name sg_link_name])
 	AC_CHECK_FUNCS([xbt_barrier_init], [AC_DEFINE([STARPU_SIMGRID_HAVE_XBT_BARRIER_INIT], [1], [Define to 1 if you have the `xbt_barrier_init' function.])])
 	AC_CHECK_DECLS([smpi_process_set_user_data], [], [], [[#include <smpi/smpi.h>]])
 	AC_CHECK_FUNCS([SIMIX_process_get_code], [AC_DEFINE([STARPU_SIMGRID_HAVE_SIMIX_PROCESS_GET_CODE], [1], [Define to 1 if you have the `SIMIX_process_get_code' function.])])

+ 10 - 0
src/core/simgrid.c

@@ -733,6 +733,16 @@ void _starpu_simgrid_count_ngpus(void)
 			routesize = SD_route_get_size(srchost, dsthost);
 			route = SD_route_get_list(srchost, dsthost);
 
+#ifndef HAVE_SG_LINK_NAME
+#ifdef HAVE_SD_LINK_GET_NAME
+/* Simgrid 3.11 name */
+#define sg_link_name(link) SD_link_get_name(link)
+#endif
+#ifdef HAVE_SURF_NETWORK_LINK_GET_NAME
+/* Simgrid 3.11+something name */
+#define sg_link_name(link) surf_network_link_get_name(link)
+#endif
+#endif
 			/* If it goes through "Host", do not care, there is no
 			 * direct transfer support */
 			for (i = 0; i < routesize; i++)