#ifndef OPTIONS_H
#define OPTIONS_H
+#include <csignal> // std::sig_atomic_t
+#include <string>
#include "cost_func.h"
+#include "named_object_list.h"
+
+// These classes may use include options.h, so make forward declarations
+class deployment_generator;
+class process;
// Global parameters, shared by all the processes
namespace opt {
- extern const char* program_name;
-
- extern const char* platform_file;
- extern const char* application_file;
+ // Constants
+ extern const double load_ratio_threshold;
+ // Global options
+ extern std::string program_name;
extern int help_requested;
extern bool version_requested;
+ extern int option_x; // hidden option (int), for testing
+ extern double option_X; // hidden option (double), for testing
+
+ // Simulation parameters
+ extern int log_rate;
+ extern volatile std::sig_atomic_t exit_request;
+
+ // Platform and deployment
+ extern std::string platform_file;
+ extern std::string deployment_file;
+
+ // Automatic deployment
+ namespace auto_depl {
+ extern bool enabled;
+ extern std::string topology;
+ extern unsigned nhosts;
+ extern double load;
+ extern bool random_distribution;
+ extern unsigned long random_seed;
+ }
+ // Load balancing algorithm
+ extern std::string loba_algo;
+ extern bool bookkeeping;
+ extern bool egocentric;
+ extern double min_transfer_amount;
+ extern double max_transfer_amount;
+ extern double min_lb_iter_duration;
+ extern bool integer_transfer;
+ extern unsigned loba_best_divisor;
+
+ // Application parameters
extern cost_func comp_cost;
extern cost_func comm_cost;
+ extern double min_comp_iter_duration;
+ extern unsigned comp_iter_delay;
+ extern double comp_time_delay;
+
+ // Parameters for the end of the simulation
+ extern double avg_load_ratio;
+ extern unsigned lb_maxiter;
+ extern unsigned comp_maxiter;
+ extern double time_limit;
+ extern unsigned exit_on_convergence;
+ extern bool exit_on_close;
+
+ // Named parameters lists
+ extern struct loba_algorithms_type:
+ public named_object_list2<process, int, char** > {
+ loba_algorithms_type();
+ } loba_algorithms;
+
+ extern struct topologies_type:
+ public named_object_list<deployment_generator> {
+ topologies_type();
+ } topologies;
- int parse_args(int* argc, char* argv[]);
+ // Utility functions
+ bool parse_args(int* argc, char* argv[]);
void print();
void usage();