Loading src/adp/adp.c +32 −24 Original line number Diff line number Diff line Loading @@ -737,9 +737,12 @@ clusters_t Heuristic1(global_context_t *ctx) MPI_Win_create(to_remove_mask, n * sizeof(heap_node), 1, MPI_INFO_NULL, ctx -> mpi_communicator, &win_to_remove_mask); MPI_Win_fence(0, win_to_remove_mask); MPI_Win win_locks; MPI_Win_create(lock_array, n * sizeof(lock_t), sizeof(lock_t), MPI_INFO_NULL, ctx -> mpi_communicator, &win_locks); MPI_Win_fence(0, win_locks); //MPI_Win win_locks; //MPI_Win_create(lock_array, n * sizeof(lock_t), sizeof(lock_t), MPI_INFO_NULL, ctx -> mpi_communicator, &win_locks); //MPI_Win_fence(0, win_locks); //MPI_Win_lock_all(MPI_LOCK_SHARED, win_to_remove_mask); //MPI_Win_lock_all(MPI_LOCK_SHARED, win_locks); Loading @@ -765,15 +768,20 @@ clusters_t Heuristic1(global_context_t *ctx) * use an array of locks, and compare and swap to actually gain control of the thing * * */ /* #pragma omp critical { int owner = foreign_owner(ctx, jidx); idx_t jpos = jidx - ctx -> rank_idx_start[owner]; lock_t state = LOCK_FREE; state = h1_lock_acquire(ctx, win_locks, owner, jpos, state); //state = h1_lock_acquire(ctx, win_locks, owner, jpos, state); heap_node mask_element; MPI_Request request; MPI_Rget(&mask_element, sizeof(heap_node), MPI_BYTE, owner, jpos * sizeof(heap_node), sizeof(heap_node), MPI_BYTE, win_to_remove_mask, &request); MPI_Wait(&request, MPI_STATUS_IGNORE); Loading @@ -789,9 +797,10 @@ clusters_t Heuristic1(global_context_t *ctx) } state = h1_lock_free(ctx, win_locks, owner, jpos, state); //state = h1_lock_free(ctx, win_locks, owner, jpos, state); } */ /* #pragma omp critical (h1_centers_elimination) { int owner = foreign_owner(ctx, jidx); Loading @@ -817,13 +826,12 @@ clusters_t Heuristic1(global_context_t *ctx) MPI_Win_unlock(owner, win_to_remove_mask); } */ } } } MPI_Win_fence(0, win_to_remove_mask); MPI_Win_fence(0, win_locks); //MPI_Win_fence(0, win_locks); MPI_Barrier(ctx -> mpi_communicator); /* populate the usual arrays */ Loading Loading @@ -873,7 +881,7 @@ clusters_t Heuristic1(global_context_t *ctx) MPI_Win_free(&win_to_remove_mask); free(to_remove_mask); MPI_Win_free(&win_locks); //MPI_Win_free(&win_locks); free(lock_array); int n_centers = (int)actual_centers.count; Loading Loading
src/adp/adp.c +32 −24 Original line number Diff line number Diff line Loading @@ -737,9 +737,12 @@ clusters_t Heuristic1(global_context_t *ctx) MPI_Win_create(to_remove_mask, n * sizeof(heap_node), 1, MPI_INFO_NULL, ctx -> mpi_communicator, &win_to_remove_mask); MPI_Win_fence(0, win_to_remove_mask); MPI_Win win_locks; MPI_Win_create(lock_array, n * sizeof(lock_t), sizeof(lock_t), MPI_INFO_NULL, ctx -> mpi_communicator, &win_locks); MPI_Win_fence(0, win_locks); //MPI_Win win_locks; //MPI_Win_create(lock_array, n * sizeof(lock_t), sizeof(lock_t), MPI_INFO_NULL, ctx -> mpi_communicator, &win_locks); //MPI_Win_fence(0, win_locks); //MPI_Win_lock_all(MPI_LOCK_SHARED, win_to_remove_mask); //MPI_Win_lock_all(MPI_LOCK_SHARED, win_locks); Loading @@ -765,15 +768,20 @@ clusters_t Heuristic1(global_context_t *ctx) * use an array of locks, and compare and swap to actually gain control of the thing * * */ /* #pragma omp critical { int owner = foreign_owner(ctx, jidx); idx_t jpos = jidx - ctx -> rank_idx_start[owner]; lock_t state = LOCK_FREE; state = h1_lock_acquire(ctx, win_locks, owner, jpos, state); //state = h1_lock_acquire(ctx, win_locks, owner, jpos, state); heap_node mask_element; MPI_Request request; MPI_Rget(&mask_element, sizeof(heap_node), MPI_BYTE, owner, jpos * sizeof(heap_node), sizeof(heap_node), MPI_BYTE, win_to_remove_mask, &request); MPI_Wait(&request, MPI_STATUS_IGNORE); Loading @@ -789,9 +797,10 @@ clusters_t Heuristic1(global_context_t *ctx) } state = h1_lock_free(ctx, win_locks, owner, jpos, state); //state = h1_lock_free(ctx, win_locks, owner, jpos, state); } */ /* #pragma omp critical (h1_centers_elimination) { int owner = foreign_owner(ctx, jidx); Loading @@ -817,13 +826,12 @@ clusters_t Heuristic1(global_context_t *ctx) MPI_Win_unlock(owner, win_to_remove_mask); } */ } } } MPI_Win_fence(0, win_to_remove_mask); MPI_Win_fence(0, win_locks); //MPI_Win_fence(0, win_locks); MPI_Barrier(ctx -> mpi_communicator); /* populate the usual arrays */ Loading Loading @@ -873,7 +881,7 @@ clusters_t Heuristic1(global_context_t *ctx) MPI_Win_free(&win_to_remove_mask); free(to_remove_mask); MPI_Win_free(&win_locks); //MPI_Win_free(&win_locks); free(lock_array); int n_centers = (int)actual_centers.count; Loading