MCPcopy Create free account
hub / github.com/dmlc/xgboost / MakeCachePrefix

Function MakeCachePrefix

src/data/sparse_page_source.cc:34–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34std::string MakeCachePrefix(std::string cache_prefix) {
35 std::string_view constexpr kDftname{"DMatrix"};
36 cache_prefix = cache_prefix.empty() ? kDftname : cache_prefix;
37 // Use the directory if one exists
38 if (std::filesystem::is_directory(cache_prefix)) {
39 cache_prefix = (std::filesystem::path{cache_prefix} / kDftname).string(); // NOLINT
40 }
41 // Avoid conflicts in distributed environments.
42 if (collective::IsDistributed()) {
43 cache_prefix += ("-r" + std::to_string(collective::GetRank()));
44 }
45 return cache_prefix;
46}
47} // namespace xgboost::data

Callers 3

SparsePageDMatrixMethod · 0.85
ExtMemQuantileDMatrixMethod · 0.85

Calls 3

IsDistributedFunction · 0.85
GetRankFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected