Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3202 from STEllAR-GROUP/fixing_config_entry
Making sure resource partitioner is not accessed if its not valid
- Loading branch information
Showing
3 changed files
with
44 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -789,6 +789,10 @@ namespace hpx | |
{ | ||
return get_runtime().get_config().get_entry(key, dflt); | ||
} | ||
if (!resource::is_partitioner_valid()) | ||
{ | ||
return dflt; | ||
} | ||
return resource::get_partitioner() | ||
.get_command_line_switches().rtcfg_.get_entry(key, dflt); | ||
} | ||
|
@@ -799,6 +803,10 @@ namespace hpx | |
{ | ||
return get_runtime().get_config().get_entry(key, dflt); | ||
} | ||
if (!resource::is_partitioner_valid()) | ||
{ | ||
return std::to_string(dflt); | ||
} | ||
return resource::get_partitioner() | ||
.get_command_line_switches().rtcfg_.get_entry(key, dflt); | ||
} | ||
|
@@ -808,22 +816,28 @@ namespace hpx | |
{ | ||
if (get_runtime_ptr() != nullptr) | ||
{ | ||
return get_runtime_ptr()->get_config().add_entry(key, value); | ||
get_runtime_ptr()->get_config().add_entry(key, value); | ||
This comment has been minimized.
Sorry, something went wrong. |
||
} | ||
if (resource::is_partitioner_valid()) | ||
{ | ||
resource::get_partitioner() | ||
This comment has been minimized.
Sorry, something went wrong.
msimberg
Contributor
|
||
.get_command_line_switches().rtcfg_.add_entry(key, value); | ||
} | ||
return resource::get_partitioner() | ||
.get_command_line_switches().rtcfg_.add_entry(key, value); | ||
} | ||
|
||
void set_config_entry(std::string const& key, std::size_t value) | ||
{ | ||
if (get_runtime_ptr() != nullptr) | ||
{ | ||
return get_runtime_ptr()->get_config().add_entry( | ||
get_runtime_ptr()->get_config().add_entry( | ||
This comment has been minimized.
Sorry, something went wrong. |
||
key, std::to_string(value)); | ||
} | ||
return resource::get_partitioner() | ||
.get_command_line_switches().rtcfg_. | ||
add_entry(key, std::to_string(value)); | ||
if (resource::is_partitioner_valid()) | ||
{ | ||
resource::get_partitioner() | ||
.get_command_line_switches().rtcfg_. | ||
add_entry(key, std::to_string(value)); | ||
} | ||
} | ||
|
||
void set_config_entry_callback(std::string const& key, | ||
|
@@ -832,12 +846,15 @@ namespace hpx | |
{ | ||
if (get_runtime_ptr() != nullptr) | ||
{ | ||
return get_runtime_ptr()->get_config().add_notification_callback( | ||
get_runtime_ptr()->get_config().add_notification_callback( | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
||
key, callback); | ||
} | ||
return resource::get_partitioner() | ||
.get_command_line_switches() | ||
.rtcfg_.add_notification_callback(key, callback); | ||
if (resource::is_partitioner_valid()) | ||
{ | ||
return resource::get_partitioner() | ||
.get_command_line_switches() | ||
.rtcfg_.add_notification_callback(key, callback); | ||
} | ||
} | ||
|
||
/////////////////////////////////////////////////////////////////////////// | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Also missing a
return
?