Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ShmThroughput demo help and documentation #1516

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/shm_throughput/readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ It is recommended that you run the publisher and subscriber in separate terminal
- In the second terminal start the subscriber by running ShmThroughputSubscriber

subscriber usage (parameters must be supplied in order):
``./ShmThroughputSubscriber [maxCycles (0=infinite)] [pollingDelay (ms, 0 = event based)] [partitionName] [payloadSize (bytes]``
``./ShmThroughputSubscriber [maxCycles (0=infinite)] [pollingDelay (ms, 0 = event based)] [partitionName] [payloadSize (bytes)]``
defaults:
``./ShmThroughputSubscriber 0 0 "Throughput example" 8192``

Expand All @@ -85,14 +85,14 @@ It is recommended that you run the publisher and subscriber in separate terminal
publisher usage:
``taskset -c 0 chrt -f 80 ./ShmThroughputPublisher [payloadSize (bytes)] [burstInterval (ms)] [burstSize (samples)] [timeOut (seconds)] [partitionName]``
subscriber usage:
``taskset -c 1 chrt -f 80 ./ShmThroughputSubscriber [maxCycles (0 = infinite)] [pollingDelay (ms, 0 = event based)] [partitionName] [payloadSize (bytes]``
``taskset -c 1 chrt -f 80 ./ShmThroughputSubscriber [maxCycles (0 = infinite)] [pollingDelay (ms, 0 = event based)] [partitionName] [payloadSize (bytes)]``

On Windows the CPU affinity and prioritized scheduling class can be set as follows:

publisher usage:
``START /affinity 1 /high cmd /k "ShmThroughputPublisher.exe" [payloadSize (bytes)] [burstInterval (ms)] [burstSize (samples)] [timeOut (seconds)] [partitionName]``
subscriber usage:
``START /affinity 2 /high cmd /k "ShmThroughputSubscriber.exe" [maxCycles (0 = infinite)] [pollingDelay (ms, 0 = event based)] [partitionName] [payloadSize (bytes]``
``START /affinity 2 /high cmd /k "ShmThroughputSubscriber.exe" [maxCycles (0 = infinite)] [pollingDelay (ms, 0 = event based)] [partitionName] [payloadSize (bytes)]``



Expand Down
6 changes: 3 additions & 3 deletions examples/shm_throughput/shmpublisher.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,14 @@ static int parse_args(
int result = EXIT_SUCCESS;
/*
* Get the program parameters
* Parameters: publisher [payloadSize] [burstInterval] [burstSize] [timeOut] [partitionName]
* Parameters: ShmThroughputPublisher [payloadSize] [burstInterval] [burstSize] [timeOut] [partitionName]
*/
if (argc == 2 && (strcmp (argv[1], "-h") == 0 || strcmp (argv[1], "--help") == 0))
{
printf ("Usage (parameters must be supplied in order):\n");
printf ("./publisher [payloadSize (bytes)] [burstInterval (ms)] [burstSize (samples)] [timeOut (seconds)] [partitionName]\n");
printf ("./ShmThroughputPublisher [payloadSize (bytes)] [burstInterval (ms)] [burstSize (samples)] [timeOut (seconds)] [partitionName]\n");
printf ("Defaults:\n");
printf ("./publisher 8192 0 1 0 \"Throughput example\"\n");
printf ("./ShmThroughputPublisher 8192 0 1 0 \"Throughput example\"\n");
return EXIT_FAILURE;
}
if (argc > 1)
Expand Down
6 changes: 3 additions & 3 deletions examples/shm_throughput/shmsubscriber.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,14 @@ static int parse_args(int argc, char **argv, unsigned long long *maxCycles, char
{
/*
* Get the program parameters
* Parameters: subscriber [maxCycles] [pollingDelay] [partitionName]
* Parameters: ShmThroughputSubscriber [maxCycles] [pollingDelay] [partitionName] [payloadSize]
*/
if (argc == 2 && (strcmp (argv[1], "-h") == 0 || strcmp (argv[1], "--help") == 0))
{
printf ("Usage (parameters must be supplied in order):\n");
printf ("./subscriber [maxCycles (0 = infinite)] [pollingDelay (ms, 0 = waitset, -1 = listener)] [partitionName]\n");
printf ("./ShmThroughputSubscriber [maxCycles (0 = infinite)] [pollingDelay (ms, 0 = waitset, -1 = listener)] [partitionName] [payloadSize (bytes)] \n");
printf ("Defaults:\n");
printf ("./subscriber 0 0 \"Throughput example\"\n");
printf ("./ShmThroughputSubscriber 0 0 \"Throughput example\" 8192\n");
return EXIT_FAILURE;
}

Expand Down