From 0159cb67709926584ed150d93dd65c1abfa272bd Mon Sep 17 00:00:00 2001 From: Thomas Radke Date: Fri, 1 Jul 2005 10:07:00 +0000 Subject: CarpetIOStreamedHDF5: introduce a parameter max_num_clients to limit the number of clients allowed to connect to a simulation at the same time darcs-hash:20050701100728-776a0-7964598e966223fa1db8dddfce86502d26992ac4.gz --- Carpet/CarpetIOStreamedHDF5/doc/documentation.tex | 27 +++++++++++++++------- .../par/CarpetIOStreamedHDF5.par | 4 ++++ Carpet/CarpetIOStreamedHDF5/param.ccl | 5 ++++ .../src/CarpetIOStreamedHDF5.cc | 2 +- 4 files changed, 29 insertions(+), 9 deletions(-) (limited to 'Carpet/CarpetIOStreamedHDF5') diff --git a/Carpet/CarpetIOStreamedHDF5/doc/documentation.tex b/Carpet/CarpetIOStreamedHDF5/doc/documentation.tex index e5742ecb1..55721f59d 100644 --- a/Carpet/CarpetIOStreamedHDF5/doc/documentation.tex +++ b/Carpet/CarpetIOStreamedHDF5/doc/documentation.tex @@ -64,14 +64,6 @@ any time. Parameters to control the \ThisThorn\ I/O method are: \begin{itemize} - \item {\tt IOStreamedHDF5::port}\\ - The initial port number which should be opened at startup for - client connections. If the given port is already in use by some other - program, {\tt IOStreamedHDF5} will search for the next available port - by advancing {\tt IOStreamedHDF5::port}.\\ - The actual port number used by \ThisThorn\ will be output in a INFO - message at startup, along with the hostname of the root processor. - \item {\tt IOStreamedHDF5::out\_every} (steerable)\\ How often to do periodic \ThisThorn\ output. If this parameter is set in the parameter file, it will override the setting of the shared @@ -106,6 +98,25 @@ t\_dt}) whether to output the data from multiple processors in chunked or unchunked format + \item {\tt IOStreamedHDF5::port}\\ + The initial port number which should be opened at startup for + client connections. If the given port is already in use by some other + program, {\tt IOStreamedHDF5} will search for the next available port + by advancing {\tt IOStreamedHDF5::port}.\\ + The actual port number used by \ThisThorn\ will be output in a INFO + message at startup, along with the hostname of the root processor. + + \item {\tt IOStreamedHDF5::max\_num\_clients}\\ + The overhead of serving many clients with streamed HDF5 data can slow + down your simulation notably. When you are running both the simulation + and the visualisation client on the same machine, it could also happen + that the client is fast enough to reconnect to the simulation while + it is still serving the same timestep -- which leads to duplicate + data streaming.\\ + In order to prevent this, you can set the {\tt max\_num\_clients} + parameter to limit the maximum number of clients allowed to connect + to the simulation at the same time. + \end{itemize} diff --git a/Carpet/CarpetIOStreamedHDF5/par/CarpetIOStreamedHDF5.par b/Carpet/CarpetIOStreamedHDF5/par/CarpetIOStreamedHDF5.par index 7818242dd..c1f8fd05b 100644 --- a/Carpet/CarpetIOStreamedHDF5/par/CarpetIOStreamedHDF5.par +++ b/Carpet/CarpetIOStreamedHDF5/par/CarpetIOStreamedHDF5.par @@ -57,3 +57,7 @@ IO::parfile_write = "no" IOBasic::outInfo_vars = "wavetoy::phi" IOStreamedHDF5::out_vars = "wavetoy::phi" + +# allow only one client at at time to connect to the simulation +# (to prevent potentially multiple connects from the same client) +IOStreamedHDF5::max_num_clients = 1 diff --git a/Carpet/CarpetIOStreamedHDF5/param.ccl b/Carpet/CarpetIOStreamedHDF5/param.ccl index 6db82cc93..1aacda901 100644 --- a/Carpet/CarpetIOStreamedHDF5/param.ccl +++ b/Carpet/CarpetIOStreamedHDF5/param.ccl @@ -37,6 +37,11 @@ INT port "Port number for clients to connect to" STEERABLE = RECOVER 1000:32000 :: "Ports below 1000 require root access" } 10000 +INT max_num_clients "Maximum number of clients allowed to connect at the same time" STEERABLE = RECOVER +{ + 1:20 :: "a small positive number" +} 3 + ############################################################################# ### import IOUtil parameters diff --git a/Carpet/CarpetIOStreamedHDF5/src/CarpetIOStreamedHDF5.cc b/Carpet/CarpetIOStreamedHDF5/src/CarpetIOStreamedHDF5.cc index 65e8ccdbf..92a47ff5a 100644 --- a/Carpet/CarpetIOStreamedHDF5/src/CarpetIOStreamedHDF5.cc +++ b/Carpet/CarpetIOStreamedHDF5/src/CarpetIOStreamedHDF5.cc @@ -266,7 +266,7 @@ static int OutputGH (const cGH* const cctkGH) fapl.increment = 0; fapl.socket = myGH->socket; fapl.do_socket_io = 1; - fapl.backlog = 5; + fapl.backlog = max_num_clients; fapl.broadcast_fn = NULL; fapl.broadcast_arg = NULL; -- cgit v1.2.3