Skip to content

Commit

Permalink
Fix link on Darwin by disabling force_mpi_hostnames
Browse files Browse the repository at this point in the history
Darwin doesn't seem to be actually supporting weak references, to detect
when libstarpumpi is linked in. Let's just disable force_mpi_hostnames
support there.

Fixes #21

(cherry picked from commit 68ad5cd770bc4e1cc079062630be3617977c57b6)
  • Loading branch information
sthibaul committed May 15, 2023
1 parent cffd489 commit e2b192f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/common/utils.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* StarPU --- Runtime system for heterogeneous multicore architectures.
*
* Copyright (C) 2010-2022 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
* Copyright (C) 2010-2023 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
* Copyright (C) 2020 Federal University of Rio Grande do Sul (UFRGS)
*
* StarPU is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -531,6 +531,11 @@ void _starpu_gethostname(char *hostname, size_t size)
char *host=NULL, *srv_hosts;
srv_hosts = strdup(force_mpi_hostnames);
int rank;

#ifdef STARPU_HAVE_DARWIN
_STARPU_DISP("Detection of MPI rank disabled on darwin, assuming rank is 0");
rank = 0;
#else
if (starpu_mpi_world_rank)
{
rank = starpu_mpi_world_rank();
Expand All @@ -540,6 +545,7 @@ void _starpu_gethostname(char *hostname, size_t size)
_STARPU_DISP("StarPU-MPI unavailable, the rank of this process is 0");
rank = 0;
}
#endif

if (force_mpi_hostnames != NULL)
{
Expand Down

0 comments on commit e2b192f

Please sign in to comment.