Skip to content

Commit

Permalink
Turn shm-monitor off by default
Browse files Browse the repository at this point in the history
 resolves #459
  • Loading branch information
rbx authored and dennisklein committed Feb 24, 2023
1 parent 61d2797 commit 4566318
Show file tree
Hide file tree
Showing 24 changed files with 66 additions and 4 deletions.
2 changes: 2 additions & 0 deletions examples/1-1/test-ex-1-1.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ SAMPLER+=" --transport $transport"
SAMPLER+=" --verbosity veryhigh"
SAMPLER+=" --session $session"
SAMPLER+=" --shm-segment-size 100000000"
SAMPLER+=" --shm-monitor true"
SAMPLER+=" --control static --color false"
SAMPLER+=" --max-iterations 1"
SAMPLER+=" --channel-config name=$chan,type=push,method=bind,address=ipc://$chanAddr,rateLogging=0"
Expand All @@ -36,6 +37,7 @@ SINK+=" --transport $transport"
SINK+=" --verbosity veryhigh"
SINK+=" --session $session"
SINK+=" --shm-segment-size 100000000"
SINK+=" --shm-monitor true"
SINK+=" --control static --color false"
SINK+=" --max-iterations 1"
SINK+=" --channel-config name=$chan,type=pull,method=connect,address=ipc://$chanAddr,rateLogging=0"
Expand Down
4 changes: 4 additions & 0 deletions examples/1-n-1/test-ex-1-n-1.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ SAMPLER+=" --verbosity veryhigh"
SAMPLER+=" --session $session"
SAMPLER+=" --severity debug"
SAMPLER+=" --shm-segment-size 100000000"
SAMPLER+=" --shm-monitor true"
SAMPLER+=" --control static --color false"
SAMPLER+=" --max-iterations 2"
SAMPLER+=" --channel-config name=$chan1,type=push,method=bind,address=ipc://$chan1Addr,rateLogging=0"
Expand All @@ -39,6 +40,7 @@ PROCESSOR1+=" --verbosity veryhigh"
PROCESSOR1+=" --session $session"
PROCESSOR1+=" --severity debug"
PROCESSOR1+=" --shm-segment-size 100000000"
PROCESSOR1+=" --shm-monitor true"
PROCESSOR1+=" --control static --color false"
PROCESSOR1+=" --channel-config name=$chan1,type=pull,method=connect,address=ipc://$chan1Addr,rateLogging=0"
PROCESSOR1+=" name=$chan2,type=push,method=connect,address=ipc://$chan2Addr,rateLogging=0"
Expand All @@ -52,6 +54,7 @@ PROCESSOR2+=" --verbosity veryhigh"
PROCESSOR2+=" --session $session"
PROCESSOR2+=" --severity debug"
PROCESSOR2+=" --shm-segment-size 100000000"
PROCESSOR2+=" --shm-monitor true"
PROCESSOR2+=" --control static --color false"
PROCESSOR2+=" --channel-config name=$chan1,type=pull,method=connect,address=ipc://$chan1Addr,rateLogging=0"
PROCESSOR2+=" name=$chan2,type=push,method=connect,address=ipc://$chan2Addr,rateLogging=0"
Expand All @@ -65,6 +68,7 @@ SINK+=" --verbosity veryhigh"
SINK+=" --session $session"
SINK+=" --severity debug"
SINK+=" --shm-segment-size 100000000"
SINK+=" --shm-monitor true"
SINK+=" --control static --color false"
SINK+=" --max-iterations 2"
SINK+=" --channel-config name=$chan2,type=pull,method=bind,address=ipc://$chan2Addr,rateLogging=0"
Expand Down
7 changes: 7 additions & 0 deletions examples/builtin-devices/test-ex-builtin-devices.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ SAMPLER+=" --color false"
SAMPLER+=" --control static"
SAMPLER+=" --verbosity veryhigh"
SAMPLER+=" --shm-segment-size 100000000"
SAMPLER+=" --shm-monitor true"
SAMPLER+=" --severity debug"
SAMPLER+=" --msg-size 100000"
SAMPLER+=" --multipart $multipart"
Expand All @@ -64,6 +65,7 @@ SPLITTER+=" --color false"
SPLITTER+=" --control static"
SPLITTER+=" --verbosity veryhigh"
SPLITTER+=" --shm-segment-size 100000000"
SPLITTER+=" --shm-monitor true"
SPLITTER+=" --multipart $multipart"
SPLITTER+=" --in-channel $chan1"
SPLITTER+=" --out-channel $chan2"
Expand All @@ -80,6 +82,7 @@ PROXY1+=" --color false"
PROXY1+=" --control static"
PROXY1+=" --verbosity veryhigh"
PROXY1+=" --shm-segment-size 100000000"
PROXY1+=" --shm-monitor true"
PROXY1+=" --multipart $multipart"
PROXY1+=" --in-channel $chan2"
PROXY1+=" --out-channel $chan3"
Expand All @@ -96,6 +99,7 @@ PROXY2+=" --color false"
PROXY2+=" --control static"
PROXY2+=" --verbosity veryhigh"
PROXY2+=" --shm-segment-size 100000000"
PROXY2+=" --shm-monitor true"
PROXY2+=" --multipart $multipart"
PROXY2+=" --in-channel $chan2"
PROXY2+=" --out-channel $chan3"
Expand All @@ -112,6 +116,7 @@ MERGER+=" --color false"
MERGER+=" --control static"
MERGER+=" --verbosity veryhigh"
MERGER+=" --shm-segment-size 100000000"
MERGER+=" --shm-monitor true"
MERGER+=" --multipart $multipart"
MERGER+=" --in-channel $chan3"
MERGER+=" --out-channel $chan4"
Expand All @@ -128,6 +133,7 @@ MULTIPLIER+=" --color false"
MULTIPLIER+=" --control static"
MULTIPLIER+=" --verbosity veryhigh"
MULTIPLIER+=" --shm-segment-size 100000000"
MULTIPLIER+=" --shm-monitor true"
MULTIPLIER+=" --multipart $multipart"
MULTIPLIER+=" --in-channel $chan4"
MULTIPLIER+=" --out-channel $chan5"
Expand All @@ -145,6 +151,7 @@ SINK+=" --control static"
SINK+=" --verbosity veryhigh"
SINK+=" --severity debug"
SINK+=" --multipart $multipart"
SINK+=" --shm-monitor true"
SINK+=" --max-iterations 2"
SINK+=" --in-channel $chan5"
SINK+=" --channel-config name=$chan5,type=pull,method=bind,sndBufSize=50,rcvBufSize=50,address=ipc://$chan5Addr"
Expand Down
3 changes: 3 additions & 0 deletions examples/copypush/test-ex-copypush.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ SAMPLER+=" --transport $transport"
SAMPLER+=" --verbosity veryhigh"
SAMPLER+=" --severity debug"
SAMPLER+=" --shm-segment-size 100000000"
SAMPLER+=" --shm-monitor true"
SAMPLER+=" --session $session"
SAMPLER+=" --control static --color false"
SAMPLER+=" --max-iterations 1"
Expand All @@ -37,6 +38,7 @@ SINK1+=" --transport $transport"
SINK1+=" --verbosity veryhigh"
SINK1+=" --severity debug"
SINK1+=" --shm-segment-size 100000000"
SINK1+=" --shm-monitor true"
SINK1+=" --session $session"
SINK1+=" --control static --color false"
SINK1+=" --max-iterations 1"
Expand All @@ -50,6 +52,7 @@ SINK2+=" --transport $transport"
SINK2+=" --verbosity veryhigh"
SINK2+=" --severity debug"
SINK2+=" --shm-segment-size 100000000"
SINK2+=" --shm-monitor true"
SINK2+=" --session $session"
SINK2+=" --control static --color false"
SINK2+=" --max-iterations 1"
Expand Down
2 changes: 2 additions & 0 deletions examples/multipart/test-ex-multipart.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ SAMPLER+=" --transport $transport"
SAMPLER+=" --verbosity veryhigh"
SAMPLER+=" --session $session"
SAMPLER+=" --shm-segment-size 100000000"
SAMPLER+=" --shm-monitor true"
SAMPLER+=" --max-iterations 1"
SAMPLER+=" --control static --color false"
SAMPLER+=" --channel-config name=$chan,type=pair,method=connect,rateLogging=0,address=$chanAddr,linger=1000"
Expand All @@ -41,6 +42,7 @@ SINK+=" --transport $transport"
SINK+=" --verbosity veryhigh"
SINK+=" --session $session"
SINK+=" --shm-segment-size 100000000"
SINK+=" --shm-monitor true"
SINK+=" --control static --color false"
SINK+=" --channel-config name=$chan,type=pair,method=bind,rateLogging=0,address=$chanAddr"
@CMAKE_CURRENT_BINARY_DIR@/$SINK &
Expand Down
3 changes: 3 additions & 0 deletions examples/multiple-channels/test-ex-multiple-channels.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ SINK+=" --session $session"
SINK+=" --transport $transport"
SINK+=" --verbosity veryhigh --severity debug"
SINK+=" --shm-segment-size 100000000"
SINK+=" --shm-monitor true"
SINK+=" --max-iterations 1"
SINK+=" --control static --color false"
SINK+=" --channel-config name=$dataChan,type=pull,method=connect,rateLogging=0,address=ipc://$dataChanAddr"
Expand All @@ -40,6 +41,7 @@ SAMPLER+=" --session $session"
SAMPLER+=" --transport $transport"
SAMPLER+=" --verbosity veryhigh --severity debug"
SAMPLER+=" --shm-segment-size 100000000"
SAMPLER+=" --shm-monitor true"
SAMPLER+=" --max-iterations 1"
SAMPLER+=" --control static --color false"
SAMPLER+=" --channel-config name=$dataChan,type=push,method=bind,rateLogging=0,address=ipc://$dataChanAddr"
Expand All @@ -53,6 +55,7 @@ BROADCASTER+=" --session $session"
BROADCASTER+=" --transport $transport"
BROADCASTER+=" --verbosity veryhigh --severity debug"
BROADCASTER+=" --shm-segment-size 100000000"
BROADCASTER+=" --shm-monitor true"
BROADCASTER+=" --control static --color false"
BROADCASTER+=" --channel-config name=$broadcastChan,type=pub,method=bind,rateLogging=0,address=ipc://$broadcastChanAddr"
@CMAKE_CURRENT_BINARY_DIR@/$BROADCASTER &
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ SINK="fairmq-ex-multiple-transports-sink"
SINK+=" --id sink1"
SINK+=" --verbosity veryhigh --severity debug"
SINK+=" --shm-segment-size 100000000"
SINK+=" --shm-monitor true"
SINK+=" --session $session"
SINK+=" --max-iterations 1"
SINK+=" --control static --color false"
Expand All @@ -33,6 +34,7 @@ SAMPLER1+=" --id sampler1"
SAMPLER1+=" --session $session"
SAMPLER1+=" --verbosity veryhigh --severity debug"
SAMPLER1+=" --shm-segment-size 100000000"
SAMPLER1+=" --shm-monitor true"
SAMPLER1+=" --max-iterations 1"
SAMPLER1+=" --control static --color false"
SAMPLER1+=" --transport shmem"
Expand All @@ -46,6 +48,7 @@ SAMPLER2+=" --id sampler2"
SAMPLER2+=" --session $session"
SAMPLER2+=" --verbosity veryhigh --severity debug"
SAMPLER2+=" --shm-segment-size 100000000"
SAMPLER2+=" --shm-monitor true"
SAMPLER2+=" --max-iterations 1"
SAMPLER2+=" --control static --color false"
SAMPLER2+=" --transport zeromq"
Expand Down
4 changes: 2 additions & 2 deletions examples/region/fairmq-start-ex-region.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ SAMPLER+=" --msg-size $msgSize"
SAMPLER+=" --transport $transport"
# SAMPLER+=" --external-region true"
# SAMPLER+=" --shm-no-cleaup true"
# SAMPLER+=" --shm-monitor false"
SAMPLER+=" --shm-monitor true"
# SAMPLER+=" --shmid 1"
SAMPLER+=" --channel-config name=data,type=push,method=bind,address=tcp://127.0.0.1:7777,sndKernelSize=212992"
xterm -geometry 120x60+0+0 -hold -e @EX_BIN_DIR@/$SAMPLER &
Expand All @@ -31,7 +31,7 @@ SINK+=" --id sink1"
SINK+=" --severity debug"
SINK+=" --transport $transport"
# SINK+=" --shm-no-cleaup true"
# SINK+=" --shm-monitor false"
SINK+=" --shm-monitor true"
# SINK+=" --shmid 1"
SINK+=" --channel-config name=data,type=pull,method=connect,address=tcp://127.0.0.1:7777,rcvKernelSize=212992"
xterm -geometry 120x60+750+0 -hold -e @EX_BIN_DIR@/$SINK &
2 changes: 2 additions & 0 deletions examples/region/test-ex-region.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ SAMPLER+=" --transport $transport"
SAMPLER+=" --severity debug"
SAMPLER+=" --session $session"
SAMPLER+=" --shm-segment-size 100000000"
SAMPLER+=" --shm-monitor true"
SAMPLER+=" --verbosity veryhigh"
SAMPLER+=" --control static --color false"
SAMPLER+=" --max-iterations 1"
Expand All @@ -39,6 +40,7 @@ SINK+=" --transport $transport"
SINK+=" --severity debug"
SINK+=" --session $session"
SINK+=" --shm-segment-size 100000000"
SINK+=" --shm-monitor true"
SINK+=" --verbosity veryhigh"
SINK+=" --control static --color false"
SINK+=" --max-iterations 1"
Expand Down
2 changes: 2 additions & 0 deletions examples/req-rep/test-ex-req-rep.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ CLIENT+=" --transport $transport"
CLIENT+=" --verbosity veryhigh"
CLIENT+=" --session $session"
CLIENT+=" --shm-segment-size 100000000"
CLIENT+=" --shm-monitor true"
CLIENT+=" --control static --color false"
CLIENT+=" --max-iterations 1"
CLIENT+=" --channel-config name=$chan,type=req,method=connect,rateLogging=0,address=ipc://$chanAddr"
Expand All @@ -35,6 +36,7 @@ SERVER+=" --transport $transport"
SERVER+=" --verbosity veryhigh"
SERVER+=" --session $session"
SERVER+=" --shm-segment-size 100000000"
SERVER+=" --shm-monitor true"
SERVER+=" --control static --color false"
SERVER+=" --max-iterations 1"
SERVER+=" --channel-config name=$chan,type=rep,method=bind,rateLogging=0,address=ipc://$chanAddr"
Expand Down
2 changes: 2 additions & 0 deletions fairmq/devices/startMQBenchmark.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ echo "Usage: startBenchmark [message size=1000000] [number of iterations=0] [tra

SAMPLER="fairmq-bsampler"
SAMPLER+=" --id bsampler1"
SAMPLER+=" --shm-monitor true"
#SAMPLER+=" --io-threads 2"
#SAMPLER+=" --control static"
SAMPLER+=" --transport $transport"
Expand All @@ -81,6 +82,7 @@ echo "pid: $!"

SINK="fairmq-sink"
SINK+=" --id sink1"
SINK+=" --shm-monitor true"
#SINK+=" --io-threads 2"
#SINK+=" --control static"
SINK+=" --transport $transport"
Expand Down
2 changes: 1 addition & 1 deletion fairmq/plugins/config/Config.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Plugin::ProgOptions ConfigPluginProgramOptions()
("shm-throw-bad-alloc", po::value<bool >()->default_value(true), "Shared memory: throw fair::mq::MessageBadAlloc if cannot allocate a message (retry if false).")
("bad-alloc-max-attempts", po::value<int >(), "Maximum number of allocation attempts before throwing fair::mq::MessageBadAlloc. -1 is infinite. There is always at least one attempt, so 0 has safe effect as 1.")
("bad-alloc-attempt-interval", po::value<int >()->default_value(50), "Interval between attempts if cannot allocate a message (in ms).")
("shm-monitor", po::value<bool >()->default_value(true), "Shared memory: run monitor daemon.")
("shm-monitor", po::value<bool >()->default_value(false), "Shared memory: run monitor daemon.")
("shm-no-cleanup", po::value<bool >()->default_value(false), "Shared memory: do not cleanup the memory when last device leaves.")
("ofi-size-hint", po::value<size_t >()->default_value(0), "EXPERIMENTAL: OFI size hint for the allocator.")
("rate", po::value<float >()->default_value(0.), "Rate for conditional run loop (Hz).")
Expand Down
1 change: 1 addition & 0 deletions test/channel/_channel.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ auto testConnectedPeers(std::string const& transport)

ProgOptions config;
config.SetProperty<string>("session", tools::Uuid());
config.SetProperty<bool>("shm-monitor", true);
string const address(tools::ToString("ipc://", config.GetProperty<string>("session")));
unsigned long constexpr zero(0), one(1);
auto factory(TransportFactory::CreateTransportFactory(transport, tools::Uuid(), &config));
Expand Down
2 changes: 2 additions & 0 deletions test/memory_resources/_memory_resources.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ TEST(MemoryResources, transportAllocatorMap)
size_t session{tools::UuidHash()};
ProgOptions config;
config.SetProperty<string>("session", to_string(session));
config.SetProperty<bool>("shm-monitor", true);

FactoryType factoryZMQ = TransportFactory::CreateTransportFactory("zeromq", fair::mq::tools::Uuid(), &config);
FactoryType factorySHM = TransportFactory::CreateTransportFactory("shmem", fair::mq::tools::Uuid(), &config);
Expand Down Expand Up @@ -129,6 +130,7 @@ TEST(MemoryResources, getMessage)
size_t session{tools::UuidHash()};
ProgOptions config;
config.SetProperty<string>("session", to_string(session));
config.SetProperty<bool>("shm-monitor", true);

FactoryType factoryZMQ = TransportFactory::CreateTransportFactory("zeromq", fair::mq::tools::Uuid(), &config);
FactoryType factorySHM = TransportFactory::CreateTransportFactory("shmem", fair::mq::tools::Uuid(), &config);
Expand Down
7 changes: 7 additions & 0 deletions test/message/_message.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ auto RunPushPullWithMsgResize(string const & transport, string const & _address)
ProgOptions config;
config.SetProperty<string>("session", tools::Uuid());
config.SetProperty<size_t>("shm-segment-size", 100000000);
config.SetProperty<bool>("shm-monitor", true);
auto factory(TransportFactory::CreateTransportFactory(transport, tools::Uuid(), &config));

Channel push{"Push", "push", factory};
Expand Down Expand Up @@ -104,6 +105,7 @@ auto RunMsgRebuild(const string& transport) -> void
ProgOptions config;
config.SetProperty<string>("session", tools::Uuid());
config.SetProperty<size_t>("shm-segment-size", 100000000);
config.SetProperty<bool>("shm-monitor", true);
auto factory(TransportFactory::CreateTransportFactory(transport, tools::Uuid(), &config));

size_t const msgSize{100};
Expand Down Expand Up @@ -137,6 +139,7 @@ auto RunPushPullWithAlignment(string const& transport, string const& _address) -
ProgOptions config;
config.SetProperty<string>("session", tools::Uuid());
config.SetProperty<size_t>("shm-segment-size", 100000000);
config.SetProperty<bool>("shm-monitor", true);
auto factory(TransportFactory::CreateTransportFactory(transport, tools::Uuid(), &config));

Channel push{"Push", "push", factory};
Expand Down Expand Up @@ -191,6 +194,7 @@ auto EmptyMessage(string const& transport, string const& _address) -> void
ProgOptions config;
config.SetProperty<string>("session", tools::Uuid());
config.SetProperty<size_t>("shm-segment-size", 100000000);
config.SetProperty<bool>("shm-monitor", true);
auto factory(TransportFactory::CreateTransportFactory(transport, tools::Uuid(), &config));

Channel push{"Push", "push", factory};
Expand Down Expand Up @@ -242,6 +246,7 @@ auto ZeroCopy() -> void
ProgOptions config;
config.SetProperty<string>("session", tools::Uuid());
config.SetProperty<size_t>("shm-segment-size", 100000000);
config.SetProperty<bool>("shm-monitor", true);
auto factory(TransportFactory::CreateTransportFactory("shmem", tools::Uuid(), &config));

unique_ptr<string> str(make_unique<string>("asdf"));
Expand Down Expand Up @@ -274,8 +279,10 @@ auto ZeroCopyFromUnmanaged(string const& address) -> void
string session(tools::Uuid());
config1.SetProperty<string>("session", session);
config1.SetProperty<size_t>("shm-segment-size", 100000000);
config1.SetProperty<bool>("shm-monitor", true);
config2.SetProperty<string>("session", session);
config2.SetProperty<size_t>("shm-segment-size", 100000000);
config2.SetProperty<bool>("shm-monitor", true);
// ref counts should be accessible accross different segments
config2.SetProperty<uint16_t>("shm-segment-id", 2);
auto factory1(TransportFactory::CreateTransportFactory("shmem", tools::Uuid(), &config1));
Expand Down
2 changes: 2 additions & 0 deletions test/poller/_poller.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ auto RunPoller(string transport, int pollType) -> void
<< " --id pollout_"<< transport
<< " --control static"
<< " --color false"
<< " --shm-monitor true"
<< " --session " << session
<< " --channel-config name=data1,type=push,method=bind,address=" << data1Address
<< " name=data2,type=push,method=bind,address=" << data2Address;
Expand All @@ -51,6 +52,7 @@ auto RunPoller(string transport, int pollType) -> void
<< " --id pollin_" << transport
<< " --control static"
<< " --color false"
<< " --shm-monitor true"
<< " --session " << session
<< " --poll-type " << pollType
<< " --channel-config name=data1,type=pull,method=connect,address=" << data1Address
Expand Down
2 changes: 2 additions & 0 deletions test/protocols/_pair.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ auto RunPair(string transport) -> void
cmd << runTestDevice
<< " --id pairleft_" << transport
<< " --control static"
<< " --shm-monitor true"
<< " --shm-segment-size 100000000"
<< " --session " << session
<< " --color false"
Expand All @@ -52,6 +53,7 @@ auto RunPair(string transport) -> void
cmd << runTestDevice
<< " --id pairright_" << transport
<< " --control static"
<< " --shm-monitor true"
<< " --shm-segment-size 100000000"
<< " --session " << session
<< " --color false"
Expand Down
2 changes: 2 additions & 0 deletions test/protocols/_push_pull.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ auto RunPushPull(string transport) -> void
cmd << runTestDevice
<< " --id push_" << transport
<< " --control static"
<< " --shm-monitor true"
<< " --shm-segment-size 100000000"
<< " --session " << session
<< " --color false"
Expand All @@ -47,6 +48,7 @@ auto RunPushPull(string transport) -> void
cmd << runTestDevice
<< " --id pull_" << transport
<< " --control static"
<< " --shm-monitor true"
<< " --shm-segment-size 100000000"
<< " --session " << session
<< " --color false"
Expand Down
Loading

0 comments on commit 4566318

Please sign in to comment.