Skip to content

Commit

Permalink
AllocationAdvisor added to replay
Browse files Browse the repository at this point in the history
  • Loading branch information
mcfadden8 committed Nov 27, 2018
1 parent ea78ece commit 3c6ee74
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/umpire/util/Replay.cpp
Expand Up @@ -72,7 +72,7 @@ Replay* Replay::getReplayLogger()
}

std::ostream& operator<< (std::ostream& out, umpire::Allocator& alloc) {
out << "," << alloc.getName();
out << alloc.getName();
return out;
}

Expand Down
2 changes: 1 addition & 1 deletion src/umpire/util/Replay.hpp
Expand Up @@ -40,7 +40,7 @@ class Replay {
template <typename T, typename... Args>
static std::string printReplayAllocator(T&& firstArg, Args&&... args) {
std::stringstream ss;
ss << firstArg << printReplayAllocator(std::forward<Args>(args)...);
ss << "," << firstArg << printReplayAllocator(std::forward<Args>(args)...);
return ss.str();
}
private:
Expand Down
13 changes: 13 additions & 0 deletions tests/integration/replay/replay_tests.cpp
Expand Up @@ -34,9 +34,22 @@ class replayTest {
"host_simpool_defaults", rm.getAllocator("HOST"));
allocatorNames.push_back("host_simpool_defaults");

rm.makeAllocator<umpire::strategy::DynamicPool>(
"host_simpool_spec1", rm.getAllocator("HOST"), 9876, 1234);
allocatorNames.push_back("host_simpool_spec1");

rm.makeAllocator<umpire::strategy::DynamicPool, false>(
"host_simpool_spec2", rm.getAllocator("HOST"), 9876, 1234);
allocatorNames.push_back("host_simpool_spec2");

rm.makeAllocator<umpire::strategy::AllocationAdvisor>(
"read_only_um", rm.getAllocator("UM"), "READ_MOSTLY");
allocatorNames.push_back("read_only_um");

rm.makeAllocator<umpire::strategy::AllocationAdvisor>(
"preferred_location_host", rm.getAllocator("UM"),
"PREFERRED_LOCATION", rm.getAllocator("HOST"));
allocatorNames.push_back("preferred_location_host");
}

~replayTest( void )
Expand Down
20 changes: 8 additions & 12 deletions tools/replay.cpp
Expand Up @@ -120,23 +120,19 @@ class Replay {
get_from_string(m_row[m_row.size() - 1], alloc_obj_ref);

if ( m_row[2] == "umpire::strategy::AllocationAdvisor" ) {
#if 0
const std::string& name = m_row[4];
int id; get_from_string(m_row[5], id);
const std::string& allocName = m_row[6];
const std::string& adviceOperation = m_row[7];

const std::string& allocName = m_row[5];
const std::string& adviceOperation = m_row[6];
// Now grab the optional fields
if (m_row.size() > 9) {
const std::string& accessingAllocatorName = m_row[8];
if ( introspection ) m_rm.makeAllocator<umpire::strategy::AllocationAdvisor, true>( name, id, m_rm.getAllocator(allocName), adviceOperation, m_rm.getAllocator(accessingAllocatorName));
else m_rm.makeAllocator<umpire::strategy::AllocationAdvisor, false>(name, id, m_rm.getAllocator(allocName), adviceOperation, m_rm.getAllocator(accessingAllocatorName));
if (m_row.size() > 8) {
const std::string& accessingAllocatorName = m_row[7];
if ( introspection ) m_rm.makeAllocator<umpire::strategy::AllocationAdvisor, true>( name, m_rm.getAllocator(allocName), adviceOperation, m_rm.getAllocator(accessingAllocatorName));
else m_rm.makeAllocator<umpire::strategy::AllocationAdvisor, false>(name, m_rm.getAllocator(allocName), adviceOperation, m_rm.getAllocator(accessingAllocatorName));
}
else {
if ( introspection ) m_rm.makeAllocator<umpire::strategy::AllocationAdvisor, true>( name, id, m_rm.getAllocator(allocName), adviceOperation);
else m_rm.makeAllocator<umpire::strategy::AllocationAdvisor, false>(name, id, m_rm.getAllocator(allocName), adviceOperation);
if ( introspection ) m_rm.makeAllocator<umpire::strategy::AllocationAdvisor, true>( name, m_rm.getAllocator(allocName), adviceOperation);
else m_rm.makeAllocator<umpire::strategy::AllocationAdvisor, false>(name, m_rm.getAllocator(allocName), adviceOperation);
}
#endif
}
else if ( m_row[2] == "umpire::strategy::DynamicPool" ) {
const std::string& name = m_row[4];
Expand Down

0 comments on commit 3c6ee74

Please sign in to comment.