mds_log_max_len: 10000,//MDS_CACHE_SIZE / 3,
mds_log_max_trimming: 16,
mds_log_read_inc: 65536,
+ mds_log_before_reply: true,
+ mds_log_flush_on_shutdown: true,
mds_bal_replicate_threshold: 500,
mds_bal_unreplicate_threshold: 200,
mds_bal_interval: 200,
mds_verify_export_dirauth: true,
- mds_log_before_reply: true,
// --- fakeclient (mds regression testing) ---
num_fakeclient: 100,
#include <stdlib.h>
#include <string.h>
+#include <iostream>
+using namespace std;
void parse_config_options(int argc, char **argv,
- int& nargc, (char**)&nargv)
+ int& nargc, char**&nargv)
{
// alloc new argc
- nargv = new (char*)[argc];
+ nargv = (char**)malloc(sizeof(char*) * argc);
nargc = 0;
nargv[nargc++] - argv[0];
for (int i=1; i<argc; i++) {
- if (strcmp(argv[i], "--nummds") == 0) g_conf.nummds = atoi(argv[++i]);
- else if (strcmp(argv[i], "--numclient") == 0) g_conf.numclient = atoi(argv[++i]);
- else if (strcmp(argv[i], "--numosd") == 0) g_conf.numosd = atoi(argv[++i]);
- else if (strcmp(argv[i], "--debug") == 0) g_conf.debug = atoi(argv[++i]);
- else if (strcmp(argv[i], "--mds_cache_size") == 0) g_conf.mds_cache_size = atoi(argv[++i]);
- else if (strcmp(argv[i], "--mds_log_max_len") == 0) g_conf.mds_log_max_len = atoi(argv[++i]);
- else if (strcmp(argv[i], "--mds_log_max_trimming") == 0) g_conf.mds_log_max_trimming = atoi(argv[++i]);
- else if (strcmp(argv[i], "--mds_bal_interval") == 0) g_conf.mds_bal_interval = atoi(argv[++i]);
- else
+ if (strcmp(argv[i], "--nummds") == 0)
+ g_conf.num_mds = atoi(argv[++i]);
+ else if (strcmp(argv[i], "--numclient") == 0)
+ g_conf.num_client = atoi(argv[++i]);
+ else if (strcmp(argv[i], "--numosd") == 0)
+ g_conf.num_osd = atoi(argv[++i]);
+ else if (strcmp(argv[i], "--debug") == 0)
+ g_conf.debug = atoi(argv[++i]);
+ else if (strcmp(argv[i], "--mds_cache_size") == 0)
+ g_conf.mds_cache_size = atoi(argv[++i]);
+ else if (strcmp(argv[i], "--mds_log_max_len") == 0)
+ g_conf.mds_log_max_len = atoi(argv[++i]);
+ else if (strcmp(argv[i], "--mds_log_max_trimming") == 0)
+ g_conf.mds_log_max_trimming = atoi(argv[++i]);
+ else if (strcmp(argv[i], "--mds_log_flush_on_shutdown") == 0)
+ g_conf.mds_log_flush_on_shutdown = atoi(argv[++i]);
+ else if (strcmp(argv[i], "--mds_bal_interval") == 0)
+ g_conf.mds_bal_interval = atoi(argv[++i]);
+ else {
+ cout << "passing arg " << argv[i] << endl;
nargv[nargc++] = argv[i];
-
+ }
}
}
int mds_log_max_len;
int mds_log_max_trimming;
int mds_log_read_inc;
+ bool mds_log_before_reply;
+ bool mds_log_flush_on_shutdown;
float mds_bal_replicate_threshold;
float mds_bal_unreplicate_threshold;
int mds_bal_interval;
bool mds_verify_export_dirauth; // debug flag
- bool mds_log_before_reply;
// fake client
int num_fakeclient;
#define dout(x) if ((x) <= g_conf.debug) cout
#define dout2(x) if ((x) <= g_conf.debug) cout
+void parse_config_options(int argc, char **argv,
+ int& nargc, char**&nargv);
+
#endif
};
-int main(int argc, char **argv) {
+int main(int oargc, char **oargv) {
//cerr << "mpisyn starting " << myrank << "/" << world << endl;
+ int argc;
+ char **argv;
+ parse_config_options(oargc, oargv,
+ argc, argv);
int start = 0;
else if (strcmp(argv[i], "--fullmkfs") == 0) {
mkfs = MDS_MKFS_FULL;
}
-
- else if (strcmp(argv[i],"--numosd") == 0) {
- g_conf.num_osd = atoi(argv[++i]);
- }
- else if (strcmp(argv[i],"--numclient") == 0) {
- g_conf.num_client = atoi(argv[++i]);
- }
- else if (strcmp(argv[i],"--nummds") == 0) {
- g_conf.num_mds = atoi(argv[++i]);
- }
else if (strcmp(argv[i],"--synthetic") == 0) {
synthetic = atoi(argv[++i]);
}