Updated IPC detection logic (#51)

* Added environment variable to enable/disable IPC at runtime

* Fixed IPC detection logic allow for difference process mappings

* Updated README.md
Bu işleme şunda yer alıyor:
Yiltan
2025-03-17 11:36:11 -04:00
işlemeyi yapan: GitHub
ebeveyn df4ad2c04d
işleme b7f3839f27
7 değiştirilmiş dosya ile 47 ekleme ve 1 silme
+10 -1
Dosyayı Görüntüle
@@ -48,14 +48,23 @@ class IpcOnImpl {
char **ipc_bases{nullptr};
int *pes_with_ipc_avail{nullptr};
__host__ void ipcHostInit(int my_pe, const HEAP_BASES_T &heap_bases,
MPI_Comm thread_comm);
__host__ void ipcHostStop();
__device__ bool isIpcAvailable(int my_pe, int target_pe) {
return my_pe / shm_size == target_pe / shm_size;
if (nullptr == pes_with_ipc_avail) { return false; }
for (int i=0; i<shm_size; i++) {
if (pes_with_ipc_avail[i] == target_pe) { return true; }
}
return false;
}
__device__ void ipcGpuInit(Backend *gpu_backend, Context *ctx, int thread_id);
__device__ void ipcCopy(void *dst, void *src, size_t size);