Selaa lähdekoodia

Avoid using the deprecated MSG_environment_as_get_hosts

Samuel Thibault 7 vuotta sitten
vanhempi
commit
a4abc81e39
2 muutettua tiedostoa jossa 7 lisäystä ja 2 poistoa
  1. 2 2
      configure.ac
  2. 5 0
      src/core/simgrid.c

+ 2 - 2
configure.ac

@@ -165,7 +165,7 @@ if test x$enable_simgrid = xyes ; then
 	AC_CHECK_HEADERS([simgrid/host.h], [AC_DEFINE([STARPU_HAVE_SIMGRID_HOST_H], [1], [Define to 1 if you have host.h in simgrid/.])])
 	AC_CHECK_HEADERS([xbt/synchro.h], [AC_DEFINE([STARPU_HAVE_XBT_SYNCHRO_H], [1], [Define to 1 if you have synchro.h in xbt/.])])
 	AC_CHECK_TYPES([smx_actor_t], [AC_DEFINE([STARPU_HAVE_SMX_ACTOR_T], [1], [Define to 1 if you have the smx_actor_t type.])], [], [[#include <simgrid/simix.h>]])
-   	AC_CHECK_FUNCS([MSG_process_join MSG_process_attach MSG_get_as_by_name MSG_zone_get_by_name MSG_environment_get_routing_root MSG_host_get_speed MSG_process_self_name])
+   	AC_CHECK_FUNCS([MSG_process_join MSG_process_attach MSG_get_as_by_name MSG_zone_get_by_name MSG_environment_get_routing_root MSG_zone_get_hosts MSG_host_get_speed MSG_process_self_name])
 	AC_CHECK_FUNCS([xbt_mutex_try_acquire smpi_process_set_user_data sg_link_name sg_host_route sg_host_self simcall_process_create])
 	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>]])
@@ -194,7 +194,7 @@ if test x$enable_simgrid = xyes ; then
 
 	# Simgrid 3.12 & 3.13 need -std=c++11 to be able to build anything in C++...
 	AC_LANG_PUSH([C++])
-	if x$enable_shared = xno ; then
+	if test x$enable_shared = xno ; then
 		# When linking statically, libtool does not realize we need libstdc++ for simgrid_cpp.cpp
 		SIMGRID_LIBS="$SIMGRID_LIBS -lstdc++"
 		LDFLAGS="$LDFLAGS -lstdc++"

+ 5 - 0
src/core/simgrid.c

@@ -120,7 +120,12 @@ int _starpu_simgrid_get_nbhosts(const char *prefix)
 		char name[32];
 		STARPU_ASSERT(starpu_mpi_world_rank);
 		snprintf(name, sizeof(name), STARPU_MPI_AS_PREFIX"%d", starpu_mpi_world_rank());
+#ifdef HAVE_MSG_ZONE_GET_HOSTS
+		hosts = xbt_dynar_new(sizeof(sg_host_t), NULL);
+		MSG_zone_get_hosts(_starpu_simgrid_get_as_by_name(name), hosts);
+#else
 		hosts = MSG_environment_as_get_hosts(_starpu_simgrid_get_as_by_name(name));
+#endif
 		snprintf(new_prefix, sizeof(new_prefix), "%s-%s", name, prefix);
 		prefix = new_prefix;
 		len = strlen(prefix);