Back to the main page.
Bug 3099 - support multiple buffers in buffer.exe stand-alone application
Status | CLOSED FIXED |
Reported | 2016-03-20 10:44:00 +0100 |
Modified | 2016-06-14 16:14:55 +0200 |
Product: | FieldTrip |
Component: | realtime |
Version: | unspecified |
Hardware: | PC |
Operating System: | Mac OS |
Importance: | P5 normal |
Assigned to: | Robert Oostenveld |
URL: | |
Tags: | |
Depends on: | |
Blocks: | |
See also: |
Robert Oostenveld - 2016-03-20 10:44:36 +0100
as discussed with Stephen, this is needed for https://github.com/eegsynth/eegsynth/issues/30
Robert Oostenveld - 2016-03-20 12:42:56 +0100
I wrote this --------------------------------------------------------------- /* * Copyright (C) 2016, Robert Oostenveld * Donders Centre for Cognitive Neuroimaging, Radboud University * Kapittelweg 29, 6525 EN Nijmegen, The Netherlands * * This application starts one or multiple FieldTrip buffers. * * Use as * ./buffer.exe * to start a buffer on the default port. * * Use as * ./buffer.exe 1972 * to start a buffer on the specific port. * * Use as * ./buffer.exe 1972,1973,1974 * to start multiple buffers on the specified ports * */ #include
Robert Oostenveld - 2016-03-20 15:15:11 +0100
The following bash script works to start jobs in parallel and to wait for them to finish. ----------------- #!/usr/bin/env bash # # Bash helper script to execute multiple instances of a program in parallel. # # This script is inspired by http://stackoverflow.com/questions/356100/how-to-wait-in-bash-for-several-subprocesses-to-finish-and-return-exit-code-0 # and by http://www.gnu.org/software/parallel/ # # Killing the child processes can be difficult if you only have the PID of the parent parallel script. Please see # http://stackoverflow.com/questions/392022/best-way-to-kill-all-child-processes/33556110#33556110 COMMAND=$1 ARGS=`echo $2 | tr ',' ' '` if [ -z "$COMMAND" ] ; then cat << EOF Use as: multiple
Robert Oostenveld - 2016-03-20 15:15:30 +0100
the bash script solves it
Robert Oostenveld - 2016-03-29 09:35:04 +0200
I have merged the various small changes to the buffer source code to the master branch and will delete the bug3099-buffer branch. mac011> git merge bug3099-buffer Updating 1b624e4..4851b0c Fast-forward realtime/bin/maci64/buffer | Bin 49580 -> 49580 bytes realtime/bin/maci64/buffer_rda | Bin 69716 -> 69716 bytes realtime/src/buffer/src/buffer.h | 5 +- realtime/src/buffer/src/dmarequest.c | 2 - realtime/src/buffer/src/tcprequest.c | 161 ++++++++++++------------ realtime/src/buffer/src/tcpserver.c | 401 ++++++++++++++++++++++++++++++------------------------------ realtime/src/buffer/src/tcpsocket.c | 7 +- realtime/src/buffer/src/util.c | 3 + realtime/src/buffer/test/demo_combined.c | 6 +- test/test_bug3089.m | 3 +- 10 files changed, 294 insertions(+), 294 deletions(-) mac011> git push upstream master X11 forwarding request failed on channel 0 You're about to push master, is that what you intended? [y|n] y Counting objects: 44, done. Delta compression using up to 4 threads. Compressing objects: 100% (24/24), done. Writing objects: 100% (24/24), 18.33 KiB | 0 bytes/s, done. Total 24 (delta 21), reused 0 (delta 0) To git@github.com:fieldtrip/fieldtrip.git 95dcd49..3cc3486 master -> master