Getting the Strategy Name

Since every Allocator is represented by the same type after it’s been created, it can be difficult to determine exactly what kind of strategy the allocator is using. The name of the strategy can be accessed using the Allocator::getStrategyName() method:

// Copyright (c) 2016-21, Lawrence Livermore National Security, LLC and Umpire
// project contributors. See the COPYRIGHT file for details.
// SPDX-License-Identifier: (MIT)
#include <iostream>

#include "umpire/Allocator.hpp"
#include "umpire/ResourceManager.hpp"
#include "umpire/strategy/QuickPool.hpp"

int main(int, char**)
  auto& rm = umpire::ResourceManager::getInstance();
  auto allocator = rm.getAllocator("HOST");

  // _sphinx_tag_tut_strategy_name_start
  auto pool = rm.makeAllocator<umpire::strategy::QuickPool>("POOL", allocator);
  std::cout << pool.getStrategyName() << std::endl;
  // _sphinx_tag_tut_strategy_name_end


  return 0;