Skip to content

Commit

Permalink
moving numa to include
Browse files Browse the repository at this point in the history
  • Loading branch information
Saeed Maleki committed Aug 4, 2023
1 parent e87752a commit 9e417e8
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
File renamed without changes.
6 changes: 4 additions & 2 deletions src/numa.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include <fstream>
#include <mscclpp/cuda_utils.hpp>

#include "api.h"

// Convert a logical cudaDev index to the NVML device minor number
static const std::string getBusId(int cudaDev) {
// On most systems, the PCI bus ID comes back as in the 0000:00:00.0
Expand All @@ -22,7 +24,7 @@ static const std::string getBusId(int cudaDev) {

namespace mscclpp {

int getDeviceNumaNode(int cudaDev) {
MSCCLPP_API_CPP int getDeviceNumaNode(int cudaDev) {
std::string busId = getBusId(cudaDev);
std::string file_str = "/sys/bus/pci/devices/" + busId + "/numa_node";
std::ifstream file(file_str);
Expand All @@ -37,7 +39,7 @@ int getDeviceNumaNode(int cudaDev) {
return numaNode;
}

void numaBind(int node) {
MSCCLPP_API_CPP void numaBind(int node) {
int totalNumNumaNodes = numa_num_configured_nodes();
if (node < 0 || node >= totalNumNumaNodes) {
throw Error(
Expand Down
2 changes: 1 addition & 1 deletion src/proxy_channel.cc
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

#include <mscclpp/numa.hpp>
#include <mscclpp/proxy_channel.hpp>

#include "api.h"
#include "debug.h"
#include "numa.hpp"

namespace mscclpp {

Expand Down
2 changes: 1 addition & 1 deletion test/allgather_test_host_offloading.cu
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
#include <mscclpp/core.hpp>
#include <mscclpp/cuda_utils.hpp>
#include <mscclpp/fifo.hpp>
#include <mscclpp/numa.hpp>
#include <mscclpp/proxy.hpp>
#include <mscclpp/semaphore.hpp>
#include <numa.hpp>

#ifdef MSCCLPP_USE_MPI_FOR_TESTS
#include "mpi.h"
Expand Down
3 changes: 1 addition & 2 deletions test/unit/fifo_tests.cu
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@

#include <mscclpp/cuda_utils.hpp>
#include <mscclpp/fifo.hpp>
#include <mscclpp/numa.hpp>
#include <mscclpp/utils.hpp>

#include "numa.hpp"

#define FLUSH_PERIOD (MSCCLPP_PROXY_FIFO_SIZE) // should not exceed MSCCLPP_PROXY_FIFO_SIZE
#define ITER 10000 // should be larger than MSCCLPP_PROXY_FIFO_SIZE for proper testing

Expand Down
3 changes: 1 addition & 2 deletions test/unit/numa_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
#include <gtest/gtest.h>

#include <mscclpp/cuda_utils.hpp>

#include "numa.hpp"
#include <mscclpp/numa.hpp>

TEST(NumaTest, Basic) {
int num;
Expand Down

0 comments on commit 9e417e8

Please sign in to comment.