mirror of
https://github.com/microsoft/mscclpp.git
synced 2026-05-12 01:10:22 +00:00
Manage runtime environments (#452)
* Add `Env` class that manages all runtime environments. * Changed `NPKIT_DUMP_DIR` to `MSCCLPP_NPKIT_DUMP_DIR`.
This commit is contained in:
42
include/mscclpp/env.hpp
Normal file
42
include/mscclpp/env.hpp
Normal file
@@ -0,0 +1,42 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#ifndef MSCCLPP_ENV_HPP_
|
||||
#define MSCCLPP_ENV_HPP_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
namespace mscclpp {
|
||||
|
||||
class Env;
|
||||
|
||||
/// Get the MSCCL++ environment.
|
||||
/// @return A reference to the global environment object.
|
||||
std::shared_ptr<Env> env();
|
||||
|
||||
/// The MSCCL++ environment. The constructor reads environment variables and sets the corresponding fields.
|
||||
/// Use the @ref env() function to get the environment object.
|
||||
class Env {
|
||||
public:
|
||||
const std::string debug;
|
||||
const std::string debugSubsys;
|
||||
const std::string debugFile;
|
||||
const std::string hcaDevices;
|
||||
const std::string hostid;
|
||||
const std::string socketFamily;
|
||||
const std::string socketIfname;
|
||||
const std::string commId;
|
||||
const std::string executionPlanDir;
|
||||
const std::string npkitDumpDir;
|
||||
const bool cudaIpcUseDefaultStream;
|
||||
|
||||
private:
|
||||
Env();
|
||||
|
||||
friend std::shared_ptr<Env> env();
|
||||
};
|
||||
|
||||
} // namespace mscclpp
|
||||
|
||||
#endif // MSCCLPP_ENV_HPP_
|
||||
Reference in New Issue
Block a user