1 // Copyright (c) 2007-2015 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_PBS_ENVIRONMENT_HPP) 8 #define HPX_UTIL_PBS_ENVIRONMENT_HPP 9 10 #include <hpx/config.hpp> 11 #include <hpx/util_fwd.hpp> 12 13 #include <cstddef> 14 #include <string> 15 #include <vector> 16 17 namespace hpx { namespace util { namespace batch_environments { 18 19 struct pbs_environment 20 { 21 HPX_EXPORT pbs_environment(std::vector<std::string> & nodelist, 22 bool debug, util::runtime_configuration const& cfg); 23 validhpx::util::batch_environments::pbs_environment24 bool valid() const 25 { 26 return valid_; 27 } 28 node_numhpx::util::batch_environments::pbs_environment29 std::size_t node_num() const 30 { 31 return node_num_; 32 } 33 num_threadshpx::util::batch_environments::pbs_environment34 std::size_t num_threads() const 35 { 36 return num_threads_; 37 } 38 num_localitieshpx::util::batch_environments::pbs_environment39 std::size_t num_localities() const 40 { 41 return num_localities_; 42 } 43 44 private: 45 std::size_t node_num_; 46 std::size_t num_localities_; 47 std::size_t num_threads_; 48 bool valid_; 49 50 HPX_EXPORT void read_nodefile(std::vector<std::string> & nodelist, 51 bool debug, util::runtime_configuration const& cfg); 52 HPX_EXPORT void read_nodelist(std::vector<std::string> & nodelist, 53 bool debug); 54 }; 55 }}} 56 57 #endif 58