]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
*** empty log message ***
authorsage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Tue, 28 Feb 2006 22:09:42 +0000 (22:09 +0000)
committersage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Tue, 28 Feb 2006 22:09:42 +0000 (22:09 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@702 29311d96-e01e-0410-9327-a35deaab8ce9

ceph/config.cc
ceph/config.h
ceph/tcpsyn.cc

index 41e9747f6e26f67a69a53cec347a1326790b0a18..68670e6a62eb4a8a581ffb5be2a2800bc3e6f317 100644 (file)
@@ -74,6 +74,7 @@ md_config_t g_conf = {
   debug_after: 0,
 
   tcp_skip_rank0: false,
+  tcp_overlay_clients: false,  // over osds!
   tcp_log: false,
   tcp_serial_marshall: true,
   tcp_serial_out: false,
@@ -290,6 +291,8 @@ void parse_config_options(vector<char*>& args)
 
        else if (strcmp(args[i], "--tcp_skip_rank0") == 0)
          g_conf.tcp_skip_rank0 = true;
+       else if (strcmp(args[i], "--tcp_overlay_clients") == 0)
+         g_conf.tcp_overlay_clients = true;
 
        else if (strcmp(args[i], "--mkfs") == 0) 
          g_conf.osd_mkfs = g_conf.mkfs = 1; //atoi(args[++i]);
index fe2c16caefde4a71509133cc74ab237863e7aed3..3df068d510b0d2d75545b3e954ad1d627ef524fb 100644 (file)
@@ -46,6 +46,7 @@ struct md_config_t {
   int debug_after;
 
   bool tcp_skip_rank0;
+  bool tcp_overlay_clients;
   bool tcp_log;
   bool tcp_serial_marshall;
   bool tcp_serial_out;
index 5f64e766d013aab0df5b1d661380e347ba4db7ff..87161278db7d920d99becc6aca4d6856900eedd2 100644 (file)
@@ -102,10 +102,19 @@ int main(int argc, char **argv)
   int myrank = mpiwho.first;
   int world = mpiwho.second;
 
-  if (myrank == 0)
-       cerr << "nummds " << NUMMDS << "  numosd " << NUMOSD << "  numclient " << NUMCLIENT << endl;
-  assert(NUMMDS + NUMOSD + (NUMCLIENT?1:0) <= world);
+  int need = 0;
+  if (g_conf.tcp_skip_rank0) need++;
+  need += NUMMDS;
+  need += NUMOSD;
+  if (NUMCLIENT) {
+       if (!g_conf.tcp_overlay_clients)
+         need += 1;
+  }
+  assert(need <= world);
 
+  if (myrank == 0)
+       cerr << "nummds " << NUMMDS << "  numosd " << NUMOSD << "  numclient " << NUMCLIENT << " .. need " << need << ", have " << world << endl;
+  
   MDCluster *mdc = new MDCluster(NUMMDS, NUMOSD);
 
 
@@ -140,7 +149,10 @@ int main(int argc, char **argv)
   }
   
   // create client
-  int client_nodes = world - NUMMDS - NUMOSD - g_conf.tcp_skip_rank0;
+  int skip_osd = NUMOSD;
+  if (g_conf.tcp_overlay_clients) 
+       skip_osd = 0;        // put clients with osds too!
+  int client_nodes = world - NUMMDS - skip_osd - g_conf.tcp_skip_rank0;
   int clients_per_node = 1;
   if (NUMCLIENT) clients_per_node = (NUMCLIENT-1) / client_nodes + 1;
   set<int> clientlist;
@@ -148,7 +160,7 @@ int main(int argc, char **argv)
   SyntheticClient *syn[NUMCLIENT];
   for (int i=0; i<NUMCLIENT; i++) {
        //if (myrank != NUMMDS + NUMOSD + i % client_nodes) continue;
-       if (myrank != g_conf.tcp_skip_rank0+NUMMDS + NUMOSD + i / clients_per_node) continue;
+       if (myrank != g_conf.tcp_skip_rank0+NUMMDS + skip_osd + i / clients_per_node) continue;
        clientlist.insert(i);
        client[i] = new Client(new TCPMessenger(MSG_ADDR_CLIENT_NEW));//(i)) );