Skip to content

Commit

Permalink
format: apply clang-format to all our code
Browse files Browse the repository at this point in the history
problem: we spend a lot of time on code formatting, and have a somewhat
inconsistent style

solution: automate it with clang-format
  • Loading branch information
trws committed Jul 8, 2024
1 parent bed5cfe commit ffb487f
Show file tree
Hide file tree
Showing 142 changed files with 6,896 additions and 6,861 deletions.
14 changes: 7 additions & 7 deletions qmanager/config/queue_system_defaults.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@

namespace Flux {
namespace queue_manager {
const unsigned int MAX_QUEUE_DEPTH = 1000000;
const unsigned int DEFAULT_QUEUE_DEPTH = 32;
const unsigned int MAX_RESERVATION_DEPTH = 100000;
const unsigned int HYBRID_RESERVATION_DEPTH = 64;
} // namespace resource_model
} // namespace Flux
const unsigned int MAX_QUEUE_DEPTH = 1000000;
const unsigned int DEFAULT_QUEUE_DEPTH = 32;
const unsigned int MAX_RESERVATION_DEPTH = 100000;
const unsigned int HYBRID_RESERVATION_DEPTH = 64;
} // namespace queue_manager
} // namespace Flux

#endif // QUEUE_SYSTEM_DEFAULT_HPP
#endif // QUEUE_SYSTEM_DEFAULT_HPP

/*
* vi:tabstop=4 shiftwidth=4 expandtab
Expand Down
288 changes: 143 additions & 145 deletions qmanager/modules/qmanager.cpp

Large diffs are not rendered by default.

298 changes: 150 additions & 148 deletions qmanager/modules/qmanager_callbacks.cpp

Large diffs are not rendered by default.

74 changes: 29 additions & 45 deletions qmanager/modules/qmanager_callbacks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,64 +25,48 @@ struct qmanager_cb_ctx_t {
flux_watcher_t *prep{nullptr};
flux_watcher_t *check{nullptr};
flux_watcher_t *idle{nullptr};
bool pls_sched_loop {false};
bool pls_post_loop {false};
bool pls_sched_loop{false};
bool pls_post_loop{false};

schedutil_t *schedutil{nullptr};
Flux::opts_manager::optmgr_composer_t<
Flux::opts_manager::qmanager_opts_t> opts;
std::map<std::string, std::shared_ptr<
Flux::queue_manager::queue_policy_base_t>> queues;
Flux::opts_manager::optmgr_composer_t<Flux::opts_manager::qmanager_opts_t> opts;
std::map<std::string, std::shared_ptr<Flux::queue_manager::queue_policy_base_t>> queues;

int find_queue (
flux_jobid_t id, std::string &queue_name,
std::shared_ptr<Flux::queue_manager::queue_policy_base_t> &queue);
int find_queue (flux_jobid_t id,
std::string &queue_name,
std::shared_ptr<Flux::queue_manager::queue_policy_base_t> &queue);
};

class qmanager_cb_t {
protected:
static int jobmanager_hello_cb (flux_t *h, const flux_msg_t *msg,
const char *R, void *arg);
static void jobmanager_alloc_cb (flux_t *h, const flux_msg_t *msg,
void *arg);
static void jobmanager_free_cb (flux_t *h, const flux_msg_t *msg,
const char *R, void *arg);
static void jobmanager_cancel_cb (flux_t *h, const flux_msg_t *msg,
void *arg);
static void jobmanager_prioritize_cb (flux_t *h, const flux_msg_t *msg,
void *arg);
static void prep_watcher_cb (flux_reactor_t *r, flux_watcher_t *w,
int revents, void *arg);
static void check_watcher_cb (flux_reactor_t *r, flux_watcher_t *w,
int revents, void *arg);
static int post_sched_loop (flux_t *h,
protected:
static int jobmanager_hello_cb (flux_t *h, const flux_msg_t *msg, const char *R, void *arg);
static void jobmanager_alloc_cb (flux_t *h, const flux_msg_t *msg, void *arg);
static void jobmanager_free_cb (flux_t *h, const flux_msg_t *msg, const char *R, void *arg);
static void jobmanager_cancel_cb (flux_t *h, const flux_msg_t *msg, void *arg);
static void jobmanager_prioritize_cb (flux_t *h, const flux_msg_t *msg, void *arg);
static void prep_watcher_cb (flux_reactor_t *r, flux_watcher_t *w, int revents, void *arg);
static void check_watcher_cb (flux_reactor_t *r, flux_watcher_t *w, int revents, void *arg);
static int post_sched_loop (
flux_t *h,
schedutil_t *schedutil,
std::map<std::string, std::shared_ptr<
Flux::queue_manager::queue_policy_base_t>> &queues);
std::map<std::string, std::shared_ptr<Flux::queue_manager::queue_policy_base_t>> &queues);
};

struct qmanager_safe_cb_t : public qmanager_cb_t {
static int jobmanager_hello_cb (flux_t *h, const flux_msg_t *msg,
const char *R, void *arg);
static void jobmanager_alloc_cb (flux_t *h, const flux_msg_t *msg,
void *arg);
static void jobmanager_free_cb (flux_t *h, const flux_msg_t *msg,
const char *R, void *arg);
static void jobmanager_cancel_cb (flux_t *h, const flux_msg_t *msg,
void *arg);
static void jobmanager_prioritize_cb (flux_t *h, const flux_msg_t *msg,
void *arg);
static void prep_watcher_cb (flux_reactor_t *r, flux_watcher_t *w,
int revents, void *arg);
static void check_watcher_cb (flux_reactor_t *r, flux_watcher_t *w,
int revents, void *arg);
static int post_sched_loop (flux_t *h,
static int jobmanager_hello_cb (flux_t *h, const flux_msg_t *msg, const char *R, void *arg);
static void jobmanager_alloc_cb (flux_t *h, const flux_msg_t *msg, void *arg);
static void jobmanager_free_cb (flux_t *h, const flux_msg_t *msg, const char *R, void *arg);
static void jobmanager_cancel_cb (flux_t *h, const flux_msg_t *msg, void *arg);
static void jobmanager_prioritize_cb (flux_t *h, const flux_msg_t *msg, void *arg);
static void prep_watcher_cb (flux_reactor_t *r, flux_watcher_t *w, int revents, void *arg);
static void check_watcher_cb (flux_reactor_t *r, flux_watcher_t *w, int revents, void *arg);
static int post_sched_loop (
flux_t *h,
schedutil_t *schedutil,
std::map<std::string, std::shared_ptr<
Flux::queue_manager::queue_policy_base_t>> &queues);
std::map<std::string, std::shared_ptr<Flux::queue_manager::queue_policy_base_t>> &queues);
};

#endif // #define QMANAGER_CALLBACKS_HPP
#endif // #define QMANAGER_CALLBACKS_HPP

/*
* vi:tabstop=4 shiftwidth=4 expandtab
Expand Down
Loading

0 comments on commit ffb487f

Please sign in to comment.