Skip to content

Commit

Permalink
Merge pull request #708 from KineticTheory/fix_queryenv_unsigned
Browse files Browse the repository at this point in the history
Return uint32_t instead of int.
  • Loading branch information
brryan authored Jan 2, 2020
2 parents 766eb7a + 9115e62 commit 2517224
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions src/c4/QueryEnv.hh
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,16 @@ std::pair<bool, T> get_env_val(std::string const &key, T default_value = T{}) {
class SLURM_Task_Info {
public:
/**\brief Get SLURM_CPUS_PER_TASK */
int get_cpus_per_task() const { return cpus_per_task_; }
uint32_t get_cpus_per_task() const { return cpus_per_task_; }

/**\brief Get SLURM_NTASKS */
int get_ntasks() const { return ntasks_; }
uint32_t get_ntasks() const { return ntasks_; }

/**\brief Get SLURM_JOB_NUM_NODES */
int get_job_num_nodes() const { return job_num_nodes_; }
uint32_t get_job_num_nodes() const { return job_num_nodes_; }

/**\brief Get SLURM_CPUS_ON_NODE */
int get_cpus_on_node() const { return cpus_on_node_; }
uint32_t get_cpus_on_node() const { return cpus_on_node_; }

//! Return value of SLURM_NODELIST
std::string get_nodelist() const { return nodelist_; }
Expand Down Expand Up @@ -114,17 +114,20 @@ public:

// state
private:
int cpus_per_task_{0xFFFFFFF}; //!< arg to -c
bool def_cpus_per_task_{false}; //!< whether SLURM_CPUS_PER_TASK was defined
int ntasks_{0xFFFFFFE}; //!< arg to -n
bool def_ntasks_{false}; //!< whether SLURM_NTASKS was defined
int job_num_nodes_{0xFFFFFFD}; //!< arg to -N
bool def_job_num_nodes_{false}; //!< whether SLURM_JOB_NUM_NODES was defined
int cpus_on_node_{0xFFFFFFD}; //!< SLURM_CPUS_ON_NODE
bool def_cpus_on_node_{false}; //!< was SLURM_CPUS_ON_NODE defined?
std::string nodelist_{"not set"}; //!< SLURM_NODELIST
bool def_nodelist_{false}; //!< was SLURM_NODELIST defined?
}; // SLURM_Task_Info
uint32_t cpus_per_task_{0xFFFFFFF}; //!< arg to -c
//! whether SLURM_CPUS_PER_TASK was defined
bool def_cpus_per_task_{false};
uint32_t ntasks_{0xFFFFFFE}; //!< arg to -n
bool def_ntasks_{false}; //!< whether SLURM_NTASKS was defined
uint32_t job_num_nodes_{0xFFFFFFD}; //!< arg to -N
//! whether SLURM_JOB_NUM_NODES was defined
bool def_job_num_nodes_{false};
uint32_t cpus_on_node_{0xFFFFFFD}; //!< SLURM_CPUS_ON_NODE
bool def_cpus_on_node_{false}; //!< was SLURM_CPUS_ON_NODE defined?
std::string nodelist_{"not set"}; //!< SLURM_NODELIST
bool def_nodelist_{false}; //!< was SLURM_NODELIST defined?

}; // SLURM_Task_Info

} // namespace rtt_c4

Expand Down

0 comments on commit 2517224

Please sign in to comment.