We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a78db2c commit 9fd116dCopy full SHA for 9fd116d
src/data/sparse_page_source.cc
@@ -31,7 +31,13 @@ void TryDeleteCacheFile(const std::string& file) {
31
}
32
33
std::string MakeCachePrefix(std::string cache_prefix) {
34
- cache_prefix = cache_prefix.empty() ? "DMatrix" : cache_prefix;
+ std::string_view constexpr kDftname{"DMatrix"};
35
+ cache_prefix = cache_prefix.empty() ? kDftname : cache_prefix;
36
+ // Use the directory if one exists
37
+ if (std::filesystem::is_directory(cache_prefix)) {
38
+ cache_prefix = std::filesystem::path{cache_prefix} / kDftname;
39
+ }
40
+ // Avoid conflicts in distributed environments.
41
if (collective::IsDistributed()) {
42
cache_prefix += ("-r" + std::to_string(collective::GetRank()));
43
0 commit comments