Skip to content

Commit

Permalink
fix tabulations
Browse files Browse the repository at this point in the history
  • Loading branch information
nfurmento authored and sthibaul committed Jan 23, 2025
1 parent bb44be8 commit 163b9d3
Showing 1 changed file with 43 additions and 43 deletions.
86 changes: 43 additions & 43 deletions mpi/src/starpu_mpi_task_insert.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ int _starpu_mpi_find_executee_node(starpu_data_handle_t data, enum starpu_data_a

int _starpu_mpi_exchange_data_before_execution(starpu_data_handle_t data, enum starpu_data_access_mode mode, int me, int xrank, int do_execute, int prio, MPI_Comm comm)
{
if (data && data->mpi_data)
{
char *redux_map = starpu_mpi_data_get_redux_map(data);
if (redux_map != NULL && mode & STARPU_R && mode & ~ STARPU_REDUX && mode & ~ STARPU_MPI_REDUX)
{
_starpu_mpi_redux_wrapup_data(data);
}
}
if (data && data->mpi_data)
{
char *redux_map = starpu_mpi_data_get_redux_map(data);
if (redux_map != NULL && mode & STARPU_R && mode & ~ STARPU_REDUX && mode & ~ STARPU_MPI_REDUX)
{
_starpu_mpi_redux_wrapup_data(data);
}
}
if (data && xrank == STARPU_MPI_PER_NODE)
{
STARPU_ASSERT_MSG(starpu_mpi_data_get_rank(data) == STARPU_MPI_PER_NODE, "If task is replicated, it has to access only per-node data");
Expand Down Expand Up @@ -187,41 +187,41 @@ int _starpu_mpi_exchange_data_before_execution(starpu_data_handle_t data, enum s
static
int _starpu_mpi_exchange_data_after_execution(starpu_data_handle_t data, enum starpu_data_access_mode mode, int me, int xrank, int do_execute, int prio, MPI_Comm comm)
{
if ((mode & STARPU_REDUX || mode & STARPU_MPI_REDUX) && data)
{
struct _starpu_mpi_data *mpi_data = (struct _starpu_mpi_data *) data->mpi_data;
int rrank = starpu_mpi_data_get_rank(data);
int size;
starpu_mpi_comm_size(comm, &size);
if (mpi_data->redux_map == NULL)
{
_STARPU_CALLOC(mpi_data->redux_map, size, sizeof(mpi_data->redux_map[0]));
}
mpi_data->redux_map [xrank] = 1;
mpi_data->redux_map [rrank] = 1;
int outside_owner = 0;
int j;
for (j = 0; j < size; j++)
{
if (mpi_data->redux_map[j] && j != rrank)
{
outside_owner = 1;
break;
}
}
if (outside_owner)
{
struct _starpu_redux_data_entry *entry;
HASH_FIND_PTR(_redux_data, &data, entry);
if (entry == NULL)
{
_STARPU_MPI_MALLOC(entry, sizeof(*entry));
starpu_data_handle_t data_handle = data;
entry->data_handle = data_handle;
HASH_ADD_PTR(_redux_data, data_handle, entry);
}
}
}
if ((mode & STARPU_REDUX || mode & STARPU_MPI_REDUX) && data)
{
struct _starpu_mpi_data *mpi_data = (struct _starpu_mpi_data *) data->mpi_data;
int rrank = starpu_mpi_data_get_rank(data);
int size;
starpu_mpi_comm_size(comm, &size);
if (mpi_data->redux_map == NULL)
{
_STARPU_CALLOC(mpi_data->redux_map, size, sizeof(mpi_data->redux_map[0]));
}
mpi_data->redux_map[xrank] = 1;
mpi_data->redux_map[rrank] = 1;
int outside_owner = 0;
int j;
for (j = 0; j < size; j++)
{
if (mpi_data->redux_map[j] && j != rrank)
{
outside_owner = 1;
break;
}
}
if (outside_owner)
{
struct _starpu_redux_data_entry *entry;
HASH_FIND_PTR(_redux_data, &data, entry);
if (entry == NULL)
{
_STARPU_MPI_MALLOC(entry, sizeof(*entry));
starpu_data_handle_t data_handle = data;
entry->data_handle = data_handle;
HASH_ADD_PTR(_redux_data, data_handle, entry);
}
}
}
if (mode & STARPU_W && !(mode & STARPU_MPI_REDUX))
{
int mpi_rank = starpu_mpi_data_get_rank(data);
Expand Down

0 comments on commit 163b9d3

Please sign in to comment.