Skip to content

Commit 6fd44c5

Browse files
committed
feat: add runtime error if partition file is empty
1 parent f8cc65a commit 6fd44c5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

core/src/include/ModelMetadata.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ class ModelMetadata {
4141
#ifdef USE_MPI
4242
inline static ModelMetadata& getInstance(std::string partitionFile = "")
4343
{
44+
if (partitionFile.empty()) {
45+
throw std::runtime_error(
46+
"ModelMetadata :: getInstance() called without partition file in MPI build.");
47+
}
4448
static ModelMetadata instance = ModelMetadata(partitionFile);
4549
if (instance.isInitialized) {
4650
return instance;

0 commit comments

Comments
 (0)