Skip to content

Commit

Permalink
Fix check for peer access.
Browse files Browse the repository at this point in the history
Yes, there was a bug. Yes, PaRSEC says devices cannot access themselves.

Signed-off-by: Joseph Schuchart <[email protected]>
  • Loading branch information
devreal committed Nov 22, 2024
1 parent dc1c090 commit b614df2
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions ttg/ttg/parsec/ttg.h
Original file line number Diff line number Diff line change
Expand Up @@ -1088,12 +1088,15 @@ namespace ttg_parsec {
bool all_peer_access = true;
/* check whether all GPUs can access all peer GPUs */
for (int i = 0; (i < parsec_nb_devices) && all_peer_access; ++i) {
parsec_device_module_t *device = parsec_mca_device_get(i);
if (PARSEC_DEV_IS_GPU(device->type)) {
parsec_device_gpu_module_t *gpu_device = (parsec_device_gpu_module_t*)device;
parsec_device_module_t *idevice = parsec_mca_device_get(i);
if (PARSEC_DEV_IS_GPU(idevice->type)) {
parsec_device_gpu_module_t *gpu_device = (parsec_device_gpu_module_t*)idevice;
for (int j = 0; (j < parsec_nb_devices) && all_peer_access; ++j) {
if (PARSEC_DEV_IS_GPU(device->type)) {
all_peer_access = all_peer_access && (gpu_device->peer_access_mask & (1<<j));
if (i != j) { // because no device can access itself, says PaRSEC
parsec_device_module_t *jdevice = parsec_mca_device_get(j);
if (PARSEC_DEV_IS_GPU(jdevice->type)) {
all_peer_access &= (gpu_device->peer_access_mask & (1<<j)) ? true : false;
}
}
}
}
Expand Down

0 comments on commit b614df2

Please sign in to comment.