Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/multiprocess/multiprocess_memory_limit.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ void print_all();
int load_env_from_file(char *filename);
int comparelwr(const char *s1,char *s2);
int put_device_info();
unsigned int nvml_to_cuda_map(unsigned int nvmldev);
unsigned int cuda_to_nvml_map(unsigned int cudadev);
int nvml_to_cuda_map(unsigned int nvmldev);
int cuda_to_nvml_map(unsigned int cudadev);

int clear_proc_slot_nolock(int);
#endif // __MULTIPROCESS_MEMORY_LIMIT_H__
Expand Down
12 changes: 6 additions & 6 deletions src/multiprocess/multiprocess_utilization_watcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,18 @@ long delta(int up_limit, int user_current, long share) {
return share;
}

unsigned int nvml_to_cuda_map(unsigned int nvmldev){
int nvml_to_cuda_map(unsigned int nvmldev){
unsigned int devcount;
CHECK_NVML_API(nvmlDeviceGetCount_v2(&devcount));
int i=0;
for (i=0;i<devcount;i++){
if (cuda_to_nvml_map(i)==nvmldev)
return i;
for (unsigned int i = 0; i < devcount; i++){
int mapped = cuda_to_nvml_map(i);
if ((mapped >= 0) && (mapped == (int)nvmldev))
return (int)i;
}
return -1;
}

unsigned int cuda_to_nvml_map(unsigned int cudadev){
int cuda_to_nvml_map(unsigned int cudadev){
return cuda_to_nvml_map_array[cudadev];
}

Expand Down