aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetIOStreamedHDF5
diff options
context:
space:
mode:
authorThomas Radke <tradke@aei.mpg.de>2005-07-01 10:07:00 +0000
committerThomas Radke <tradke@aei.mpg.de>2005-07-01 10:07:00 +0000
commit0159cb67709926584ed150d93dd65c1abfa272bd (patch)
tree836f8be659b20dcfaaa2a70660f7d299d733309a /Carpet/CarpetIOStreamedHDF5
parentc239527dcd905d2153c3956de091416c6a408029 (diff)
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
Diffstat (limited to 'Carpet/CarpetIOStreamedHDF5')
-rw-r--r--Carpet/CarpetIOStreamedHDF5/doc/documentation.tex27
-rw-r--r--Carpet/CarpetIOStreamedHDF5/par/CarpetIOStreamedHDF5.par4
-rw-r--r--Carpet/CarpetIOStreamedHDF5/param.ccl5
-rw-r--r--Carpet/CarpetIOStreamedHDF5/src/CarpetIOStreamedHDF5.cc2
4 files changed, 29 insertions, 9 deletions
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;