1 // Copyright (c) 2007-2012 Hartmut Kaiser 2 // Copyright (c) 2013-2015 Thomas Heller 3 // 4 // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 7 #if !defined(HPX_UTIL_SLURM_ENVIRONMENT_HPP) 8 #define HPX_UTIL_SLURM_ENVIRONMENT_HPP 9 10 #include <hpx/config.hpp> 11 12 #include <cstddef> 13 #include <string> 14 #include <vector> 15 16 namespace hpx { namespace util { namespace batch_environments { 17 18 struct slurm_environment 19 { 20 HPX_EXPORT slurm_environment(std::vector<std::string> & nodelist, 21 bool debug); 22 validhpx::util::batch_environments::slurm_environment23 bool valid() const 24 { 25 return valid_; 26 } 27 node_numhpx::util::batch_environments::slurm_environment28 std::size_t node_num() const 29 { 30 return node_num_; 31 } 32 num_threadshpx::util::batch_environments::slurm_environment33 std::size_t num_threads() const 34 { 35 return num_threads_; 36 } 37 num_localitieshpx::util::batch_environments::slurm_environment38 std::size_t num_localities() const 39 { 40 return num_localities_; 41 } 42 43 private: 44 std::size_t node_num_; 45 std::size_t num_threads_; 46 std::size_t num_tasks_; 47 std::size_t num_localities_; 48 bool valid_; 49 50 HPX_EXPORT void retrieve_number_of_localities(bool debug); 51 HPX_EXPORT void retrieve_nodelist(std::vector<std::string> & nodes, 52 bool debug); 53 HPX_EXPORT void retrieve_number_of_threads(); 54 }; 55 }}} 56 57 #endif 58