diff --git a/.github/workflows/docker-image-intel.yml b/.github/workflows/docker-image-intel.yml index ff0975f..53c5dea 100644 --- a/.github/workflows/docker-image-intel.yml +++ b/.github/workflows/docker-image-intel.yml @@ -2,9 +2,9 @@ name: Docker Image Build - Intel drivers on: push: - branches: [ master, dev*, test* ] + branches: [ master, dev*, test*, experimental ] pull_request: - branches: [ master, dev*, test* ] + branches: [ master, dev*, test*, experimental ] jobs: @@ -28,11 +28,10 @@ jobs: - name: Run the Docker image run: | - ./run.sh + echo "Skipping actual run of Intel Docker image, due to segfaults observed on GitHub runners" + #sudo apt-get update && sudo apt-get install -y x11-xserver-utils # for xhost + #./run.sh - name: Info on generated files run: | ls -alth - ls -alth output - ls -alth output/* - more output/*/report.json diff --git a/.github/workflows/docker-image-quickrun.yml b/.github/workflows/docker-image-quickrun.yml index 4c07b99..5ab9b37 100644 --- a/.github/workflows/docker-image-quickrun.yml +++ b/.github/workflows/docker-image-quickrun.yml @@ -2,9 +2,9 @@ name: Docker Image Quick Run on: push: - branches: [ master, dev*, test* ] + branches: [ master, dev*, test*, experimental ] pull_request: - branches: [ master, dev*, test* ] + branches: [ master, dev*, test*, experimental ] jobs: @@ -25,6 +25,7 @@ jobs: docker images - name: Run the Docker image run: | + sudo apt-get update && sudo apt-get install -y x11-xserver-utils # for xhost ./run-quick.sh - name: Info on generated files run: | diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 950a116..b886ba0 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -2,9 +2,9 @@ name: Docker Image Build and Run on: push: - branches: [ master, dev*, test* ] + branches: [ master, dev*, experimental, test* ] pull_request: - branches: [ master, dev*, test* ] + branches: [ master, dev*, experimental, test* ] jobs: @@ -14,18 +14,33 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Build the Docker image run: | chmod a+w output/ ls -alth ./build.sh + - name: Info on Docker images run: | docker -v docker images - - name: Run the Docker image + + - name: Run the Docker image with the default falling cube demo from sibernetic + run: | + sudo apt-get update && sudo apt-get install -y x11-xserver-utils # for xhost + ./run.sh -d 20 -c demo1 + + - name: Run the Docker image with a worm simulation - no c302 + run: | + ./stop.sh + ./run.sh -d 10 -n + + - name: Run the Docker image with a worm simulation run: | - ./run.sh + ./stop.sh + ./run.sh -d 150 # temp longer simulation for testing + - name: Info on generated files run: | ls -alth diff --git a/.gitignore b/.gitignore index 676e1f4..5c43697 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,10 @@ output/C2* /output/siminfo.py /output/wor* /output/Sibernetic_* +/output/test* +/output/box +/output/swim* +/output/alone* +/output/cube* +/output/master* +/output/deep_swim* diff --git a/Dockerfile b/Dockerfile index 9cba703..81da640 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,12 +29,11 @@ RUN apt-get install -y --no-install-recommends apt-utils \ wget nano htop build-essential make git automake autoconf \ g++ rpm libtool libncurses5-dev zlib1g-dev bison flex \ sudo xorg openbox x11-xserver-utils \ - libxext-dev libncurses-dev mercurial \ + libxext-dev libncurses-dev \ freeglut3-dev libglu1-mesa-dev libglew-dev python3-dev python3-pip \ kmod dkms linux-source linux-headers-generic \ - maven openjdk-8-jdk \ + openjdk-21-jdk \ libnuma1 \ - openmpi-bin libopenmpi-dev \ libgl1 libglx-mesa0 libgl1-mesa-dri libfreetype6-dev \ libxft-dev unzip ffmpeg xvfb tmux @@ -96,7 +95,8 @@ ENV NEURON_MODULE_OPTIONS=-nogui RUN wget https://master.dl.sourceforge.net/project/nicehashsgminerv5viptools/APP%20SDK%20A%20Complete%20Development%20Platform/AMD%20APP%20SDK%203.0%20for%2064-bit%20Linux/AMD-APP-SDKInstaller-v3.0.130.136-GA-linux64.tar.bz2 && \ tar -xf AMD-APP-SDKInstaller-v3.0.130.136-GA-linux64.tar.bz2 && \ printf 'Y\n\n' | sudo ./AMD-APP-SDK-v3.0.130.136-GA-linux64.sh && \ - rm AMD-APP-SDKInstaller-v3.0.130.136-GA-linux64.tar.bz2 + rm AMD-APP-SDKInstaller-v3.0.130.136-GA-linux64.tar.bz2 && \ + rm AMD-APP-SDK-v3.0.130.136-GA-linux64.sh RUN sudo ln -s /opt/AMDAPPSDK-3.0/lib/x86_64/sdk/libOpenCL.so.1 /usr/lib/libOpenCL.so.1 RUN sudo ln -s /opt/AMDAPPSDK-3.0/lib/x86_64/sdk/libamdocl64.so /usr/lib/libamdocl64.so @@ -116,6 +116,12 @@ RUN cd sibernetic && \ make clean && make all && ldd ./Release/Sibernetic # Use python 3 libs +################################################################################ +######## Set up JupyterLab + +RUN sudo pip install notebook jupyterlab --break-system-packages + + ################################################################################ ######## Copy master python script @@ -125,6 +131,9 @@ RUN sudo chown $USER:$USER $HOME/master_openworm.py RUN printf '\n\nalias cd..="cd .."\nalias h=history\nalias ll="ls -alth"\n' >> ~/.bashrc + + RUN pip list RUN echo "Built the OpenWorm Docker image!" + diff --git a/Dockerfile_intel b/Dockerfile_intel index e8c5291..1109ecd 100644 --- a/Dockerfile_intel +++ b/Dockerfile_intel @@ -1,4 +1,9 @@ -FROM ubuntu:22.04 +FROM ubuntu:24.04 + +################################################################################ +######## Note: main Dockerfile using AMD libraries should be used unless +######## there is a specific reason to use Intel OpenCL libraries +################################################################################ LABEL maintainer="David Lung (lungdm@gmail.com); Padraig Gleeson (p.gleeson@gmail.com)" @@ -18,42 +23,40 @@ RUN mkdir -p /etc/sudoers.d && \ chmod 0440 /etc/sudoers.d/$USER && \ chown ${uid}:${gid} -R /home/$USER -ENV DEBIAN_FRONTEND noninteractive # TODO: change +ENV DEBIAN_FRONTEND=noninteractive ################################################################################ ######## Update/install essential libraries -RUN apt-get update && apt-get install -y --no-install-recommends apt-utils \ +RUN apt-get update +RUN apt-get install -y --no-install-recommends apt-utils \ wget nano htop build-essential make git automake autoconf \ - g++ rpm libtool libncurses5-dev zlib1g-dev bison flex lsb-core \ + g++ rpm libtool libncurses5-dev zlib1g-dev bison flex \ sudo xorg openbox x11-xserver-utils \ - libxext-dev libncurses-dev python3-dev mercurial \ - freeglut3-dev libglu1-mesa-dev libglew-dev python3-dev python3-pip python3-lxml python3-scipy python3-tk \ + libxext-dev libncurses-dev mercurial \ + freeglut3-dev libglu1-mesa-dev libglew-dev python3-dev python3-pip \ kmod dkms linux-source linux-headers-generic \ maven openjdk-8-jdk \ - python3-setuptools python3-yaml libnuma1 \ + libnuma1 \ openmpi-bin libopenmpi-dev \ - libgl1-mesa-glx libgl1-mesa-dri libfreetype6-dev \ - libxft-dev python3-matplotlib unzip ffmpeg xvfb tmux + libgl1 libglx-mesa0 libgl1-mesa-dri libfreetype6-dev \ + libxft-dev unzip ffmpeg xvfb tmux #RUN sudo pip install --upgrade pip RUN sudo usermod -a -G video $USER #USER $USER -ENV HOME /home/$USER +ENV HOME=/home/$USER WORKDIR $HOME -#### TODO: check that this is the best way to switch to py3... -RUN sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10 -RUN sudo update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 10 ################################################################################ ######## Install NEURON simulator -RUN pip3 install neuron==8.2.6 +RUN sudo pip install neuron==8.2.6 --break-system-packages ################################################################################ @@ -61,13 +64,11 @@ RUN pip3 install neuron==8.2.6 RUN git clone https://github.com/openworm/c302.git && \ cd c302 && \ - git checkout ow-0.9.5 && \ - sudo pip install . + git checkout ow-0.9.7 && \ + sudo pip install . --break-system-packages # Note: pyNeuroML installed with the above library -RUN pip3 install owmeta-core==0.13.5 -RUN owm bundle remote --user add ow 'https://raw.githubusercontent.com/openworm/owmeta-bundles/master/index.json' ################################################################################ @@ -75,7 +76,13 @@ RUN owm bundle remote --user add ow 'https://raw.githubusercontent.com/openworm/ RUN git clone https://github.com/openworm/sibernetic.git && \ cd sibernetic && \ - git checkout ow-0.9.5 # fixed to a specific branch + git checkout ow-0.9.7 # fixed to a specific branch + + +################################################################################ +######## Install extra Python dependencies + +RUN sudo pip install ruff --break-system-packages ################################################################################ @@ -83,7 +90,9 @@ RUN git clone https://github.com/openworm/sibernetic.git && \ ENV C302_HOME=$HOME/c302/c302 ENV SIBERNETIC_HOME=$HOME/sibernetic -ENV PYTHONPATH=$PYTHONPATH:$HOME/c302:$SIBERNETIC_HOME +ENV PYTHONPATH=$HOME/c302:$SIBERNETIC_HOME + +ENV NEURON_MODULE_OPTIONS=-nogui ################################################################################ @@ -124,7 +133,7 @@ RUN cd sibernetic && \ COPY ./master_openworm.py $HOME/master_openworm.py RUN sudo chown $USER:$USER $HOME/master_openworm.py -RUN echo '\n\nalias cd..="cd .."\nalias h=history\nalias ll="ls -alt"' >> ~/.bashrc +RUN printf '\n\nalias cd..="cd .."\nalias h=history\nalias ll="ls -alth"\n' >> ~/.bashrc RUN pip list diff --git a/build_intel.sh b/build_intel.sh index 8553e74..b8af92e 100755 --- a/build_intel.sh +++ b/build_intel.sh @@ -3,4 +3,14 @@ # A version of the docker container using the Intel libraries for OpenCL version=$(>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>") @@ -101,8 +54,13 @@ def execute_with_realtime_output(command, directory, env=None): print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n") if p.returncode != 0: - print("Exiting as the last command failed") - exit(p.returncode) + print("Exiting master Python script as the last command failed") + if exit_on_failure: + sys.exit(p.returncode) + else: + return False + + return True sys.path.append(os.environ["C302_HOME"]) @@ -112,8 +70,6 @@ def execute_with_realtime_output(command, directory, env=None): except Exception: print("Unexpected error: %s" % sys.exc_info()[0]) -OW_OUT_DIR = os.environ["OW_OUT_DIR"] - try: if os.access(OW_OUT_DIR, os.W_OK) is not True: @@ -130,20 +86,26 @@ def execute_with_realtime_output(command, directory, env=None): if "DURATION" in os.environ: sim_duration = float(os.environ["DURATION"]) -noc302 = False + +configuration = "worm_crawl_half_resolution" +if "CONFIGURATION" in os.environ: + configuration = os.environ["CONFIGURATION"] + if "NOC302" in os.environ: - noc302 = bool(os.environ["NOC302"]) + noc302 = os.environ["NOC302"] == "1" +else: + noc302 = "worm" not in configuration -DEFAULTS = { +PARAMETERS = { "duration": sim_duration, "dt": 0.005, "dtNrn": 0.05, "logstep": 100, - "reference": "FW", + "reference": "FW", # "TargetMuscle", "c302params": "C2", "verbose": False, "device": "CPU", - "configuration": "worm_crawl_half_resolution", + "configuration": configuration, "noc302": noc302, "datareader": "UpdatedSpreadsheetDataReader2", "outDir": OW_OUT_DIR, @@ -161,6 +123,10 @@ def execute_with_realtime_output(command, directory, env=None): ) # TODO: terminate xvfb after recording try: + print("Starting Sibernetic simulation with parameters:") + for p in PARAMETERS: + print(" %s: %s" % (p, PARAMETERS[p])) + command = """python3 sibernetic_c302.py -duration %s -dt %s @@ -172,23 +138,26 @@ def execute_with_realtime_output(command, directory, env=None): -c302params %s -datareader %s -outDir %s""" % ( - DEFAULTS["duration"], - DEFAULTS["dt"], - DEFAULTS["dtNrn"], - DEFAULTS["logstep"], - DEFAULTS["device"], - DEFAULTS["configuration"], - DEFAULTS["reference"], - DEFAULTS["c302params"], - DEFAULTS["datareader"], + PARAMETERS["duration"], + PARAMETERS["dt"], + PARAMETERS["dtNrn"], + PARAMETERS["logstep"], + PARAMETERS["device"], + PARAMETERS["configuration"], + PARAMETERS["reference"], + PARAMETERS["c302params"], + PARAMETERS["datareader"], "simulations", ) - # DEFAULTS['outDir']) + # PARAMETERS['outDir']) if noc302: command += " -noc302" - execute_with_realtime_output(command, os.environ["SIBERNETIC_HOME"], env=my_env) + success = execute_with_realtime_output( + command, os.environ["SIBERNETIC_HOME"], env=my_env, exit_on_failure=False + ) + except KeyboardInterrupt: pass @@ -198,7 +167,7 @@ def execute_with_realtime_output(command, directory, env=None): for dirpath, dirnames, filenames in os.walk(sibernetic_sim_dir): for directory in dirnames: if directory.startswith( - "%s_%s" % (DEFAULTS["c302params"], DEFAULTS["reference"]) + "%s_%s" % (PARAMETERS["c302params"], PARAMETERS["reference"]) ): all_subdirs.append(os.path.join(dirpath, directory)) if directory.startswith("Sibernetic"): @@ -220,106 +189,110 @@ def execute_with_realtime_output(command, directory, env=None): new_sim_out = "%s/output/%s" % (OW_OUT_DIR, os.path.split(latest_subdir)[-1]) try: os.mkdir(new_sim_out) + print("Created new output directory: %s" % new_sim_out) except OSError as e: if e.errno != errno.EEXIST: raise +if success: + # Copy PNGs, created during the Sibernetic simulation, in a separate child-directory to find them more easily + figures = glob.glob("%s/*.png" % latest_subdir) + for figure in figures: + print("Moving %s to %s" % (figure, new_sim_out)) + shutil.move(figure, new_sim_out) + + # Copy reports etc. + reports = glob.glob("%s/report*" % latest_subdir) + for report in reports: + print("Moving %s to %s" % (report, new_sim_out)) + shutil.move(report, new_sim_out) + + # Copy position files etc. + txt_files = glob.glob("%s/*.txt" % latest_subdir) + for txt_file in txt_files: + print("Moving %s to %s" % (txt_file, new_sim_out)) + shutil.move(txt_file, new_sim_out) + dat_files = glob.glob("%s/*.dat" % latest_subdir) + for dat_file in dat_files: + print("Moving %s to %s" % (dat_file, new_sim_out)) + shutil.move(dat_file, new_sim_out) + + # Copy WCON file(s) + wcons = glob.glob("%s/*.wcon" % latest_subdir) + for wcon in wcons: + print("Moving %s to %s" % (wcon, new_sim_out)) + shutil.move(wcon, new_sim_out) + + time.sleep(2) + + # Rerun and record simulation + execute_with_realtime_output( + "ls -alt /tmp/.X11-unix", os.environ["SIBERNETIC_HOME"], env=my_env + ) + os.system("export DISPLAY=%s" % DISPLAY) + execute_with_realtime_output( + "ls -alt /tmp/.X11-unix", os.environ["SIBERNETIC_HOME"], env=my_env + ) + sibernetic_movie_name = "%s.mp4" % os.path.split(latest_subdir)[-1] + command = ( + 'tmux new-session -d -P -s SiberneticRecording "DISPLAY=%s ffmpeg -r 30 -f x11grab -draw_mouse 0 -s 1920x1080 -i %s -filter:v "crop=1200:800:100:100" -cpu-used 0 -b:v 384k -qmin 10 -qmax 42 -maxrate 384k -bufsize 1000k -an %s/%s"' + % (DISPLAY, DISPLAY, new_sim_out, sibernetic_movie_name) + ) + execute_with_realtime_output(command, os.environ["SIBERNETIC_HOME"], env=my_env) -# Copy PNGs, created during the Sibernetic simulation, in a separate child-directory to find them more easily -figures = glob.glob("%s/*.png" % latest_subdir) -for figure in figures: - print("Moving %s to %s" % (figure, new_sim_out)) - shutil.move(figure, new_sim_out) - -# Copy reports etc. -reports = glob.glob("%s/report*" % latest_subdir) -for report in reports: - print("Moving %s to %s" % (report, new_sim_out)) - shutil.move(report, new_sim_out) + time.sleep(3) -# Copy WCON file(s) -wcons = glob.glob("%s/*.wcon" % latest_subdir) -for wcon in wcons: - print("Moving %s to %s" % (wcon, new_sim_out)) - shutil.move(wcon, new_sim_out) + execute_with_realtime_output( + "tmux list-sessions", os.environ["SIBERNETIC_HOME"], env=my_env + ) -time.sleep(2) + command = "./Release/Sibernetic -f %s -l_from lpath=%s" % ( + PARAMETERS["configuration"], + latest_subdir, + ) + execute_with_realtime_output(command, os.environ["SIBERNETIC_HOME"], env=my_env) -# Rerun and record simulation -execute_with_realtime_output( - "ls -alt /tmp/.X11-unix", os.environ["SIBERNETIC_HOME"], env=my_env -) -os.system("export DISPLAY=%s" % DISPLAY) -execute_with_realtime_output( - "ls -alt /tmp/.X11-unix", os.environ["SIBERNETIC_HOME"], env=my_env -) -sibernetic_movie_name = "%s.mp4" % os.path.split(latest_subdir)[-1] -command = ( - 'tmux new-session -d -P -s SiberneticRecording "DISPLAY=%s ffmpeg -r 30 -f x11grab -draw_mouse 0 -s 1920x1080 -i %s -filter:v "crop=1200:800:100:100" -cpu-used 0 -b:v 384k -qmin 10 -qmax 42 -maxrate 384k -bufsize 1000k -an %s/%s"' - % (DISPLAY, DISPLAY, new_sim_out, sibernetic_movie_name) -) -execute_with_realtime_output(command, os.environ["SIBERNETIC_HOME"], env=my_env) + execute_with_realtime_output( + "tmux send-keys -t SiberneticRecording q", + os.environ["SIBERNETIC_HOME"], + env=my_env, + ) + execute_with_realtime_output( + 'tmux send-keys -t SiberneticRecording "exit" C-m', + os.environ["SIBERNETIC_HOME"], + env=my_env, + ) -time.sleep(3) + time.sleep(3) -execute_with_realtime_output( - "tmux list-sessions", os.environ["SIBERNETIC_HOME"], env=my_env -) + execute_with_realtime_output( + "ls -alt %s" % latest_subdir, os.environ["SIBERNETIC_HOME"], env=my_env + ) -command = "./Release/Sibernetic -f %s -l_from lpath=%s" % ( - DEFAULTS["configuration"], - latest_subdir, -) -execute_with_realtime_output(command, os.environ["SIBERNETIC_HOME"], env=my_env) + # Remove black frames at the beginning of the recorded video + command = ( + "ffmpeg -i %s/%s -vf blackdetect=d=0:pic_th=0.70:pix_th=0.10 -an -f null - 2>&1 | grep blackdetect" + % (new_sim_out, sibernetic_movie_name) + ) + outstr = str(check_output(command, shell=True).decode("utf-8")) + outstr = outstr.split("\n") -execute_with_realtime_output( - "tmux send-keys -t SiberneticRecording q", os.environ["SIBERNETIC_HOME"], env=my_env -) -execute_with_realtime_output( - 'tmux send-keys -t SiberneticRecording "exit" C-m', - os.environ["SIBERNETIC_HOME"], - env=my_env, -) + black_start = 0.0 + black_dur = None -time.sleep(3) + out = outstr[0] -execute_with_realtime_output( - "ls -alt %s" % latest_subdir, os.environ["SIBERNETIC_HOME"], env=my_env -) + black_start_pos = out.find("black_start:") + black_end_pos = out.find("black_end:") + black_dur_pos = out.find("black_duration:") + if black_start_pos != -1: + black_start = float(out[black_start_pos + len("black_start:") : black_end_pos]) + black_dur = float(out[black_dur_pos + len("black_duration:") :]) -# Remove black frames at the beginning of the recorded video -command = ( - "ffmpeg -i %s/%s -vf blackdetect=d=0:pic_th=0.70:pix_th=0.10 -an -f null - 2>&1 | grep blackdetect" - % (new_sim_out, sibernetic_movie_name) -) -outstr = str(check_output(command, shell=True).decode("utf-8")) -outstr = outstr.split("\n") - -black_start = 0.0 -black_dur = None - - -out = outstr[0] - -black_start_pos = out.find("black_start:") -black_end_pos = out.find("black_end:") -black_dur_pos = out.find("black_duration:") -if black_start_pos != -1: - black_start = float(out[black_start_pos + len("black_start:") : black_end_pos]) - black_dur = float(out[black_dur_pos + len("black_duration:") :]) - -if black_start == 0.0 and black_dur: - black_dur = math.ceil(black_dur) - command = "ffmpeg -ss 00:00:0%s -i %s/%s -c copy -avoid_negative_ts 1 %s/cut_%s" % ( - black_dur, - new_sim_out, - sibernetic_movie_name, - new_sim_out, - sibernetic_movie_name, - ) - if black_dur > 9: + if black_start == 0.0 and black_dur: + black_dur = math.ceil(black_dur) command = ( - "ffmpeg -ss 00:00:%s -i %s/%s -c copy -avoid_negative_ts 1 %s/cut_%s" + "ffmpeg -ss 00:00:0%s -i %s/%s -c copy -avoid_negative_ts 1 %s/cut_%s" % ( black_dur, new_sim_out, @@ -328,38 +301,50 @@ def execute_with_realtime_output(command, directory, env=None): sibernetic_movie_name, ) ) - os.system(command) - -# SPEED-UP -try: - os.mkdir("tmp") -except OSError as e: - if e.errno != errno.EEXIST: - raise - -os.system( - 'ffmpeg -ss 1 -i %s/cut_%s -vf "select=gt(scene\,0.1)" -vsync vfr -vf fps=fps=1/1 %s' - % (new_sim_out, sibernetic_movie_name, "tmp/out%06d.jpg") -) -os.system( - "ffmpeg -r 100 -i %s -r 100 -vb 60M %s/speeded_%s" - % ("tmp/out%06d.jpg", new_sim_out, sibernetic_movie_name) -) + if black_dur > 9: + command = ( + "ffmpeg -ss 00:00:%s -i %s/%s -c copy -avoid_negative_ts 1 %s/cut_%s" + % ( + black_dur, + new_sim_out, + sibernetic_movie_name, + new_sim_out, + sibernetic_movie_name, + ) + ) + os.system(command) -os.system("rm -r tmp/*") + # SPEED-UP + try: + os.mkdir("tmp") + except OSError as e: + if e.errno != errno.EEXIST: + raise + + os.system( + 'ffmpeg -ss 1 -i %s/cut_%s -vf "select=gt(scene\,0.1)" -vsync vfr -vf fps=fps=1/1 %s' + % (new_sim_out, sibernetic_movie_name, "tmp/out%06d.jpg") + ) + os.system( + "ffmpeg -r 100 -i %s -r 100 -vb 60M %s/speeded_%s" + % ("tmp/out%06d.jpg", new_sim_out, sibernetic_movie_name) + ) + os.system("rm -r tmp/*") -print("****************************") -print("Step 4: Run movement analysis") -print("****************************") -print("Not yet implemented.") -print( - "Note however the following WCON files have been generated into %s during the simulation: %s" - % (new_sim_out, [w.split("/")[-1] for w in wcons]) -) + print("****************************") + print(" Step 2: Run movement analysis") + print("****************************") + print("Not yet implemented.") + print( + "Note however the following WCON files have been generated into %s during the simulation: %s" + % (new_sim_out, [w.split("/")[-1] for w in wcons]) + ) + print("****************************") + print(" Step 3: Report on movement analysis fit to real worm videos") + print("****************************") + print("Not yet implemented.") -print("****************************") -print("Step 5: Report on movement analysis fit to real worm videos") -print("****************************") -print("Not yet implemented.") +else: + print("Simulation failed, skipping other steps.") diff --git a/run-jl.sh b/run-jl.sh new file mode 100755 index 0000000..fb39de1 --- /dev/null +++ b/run-jl.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +version=$(&2 + *) echo "Usage: $0 [-d duration_in_ms] [-c configuration] [-n]" >&2 + exit 1 ;; esac done @@ -15,9 +23,8 @@ done OW_OUT_DIR=/home/ow/shared HOST_OUT_DIR=$PWD -version=$(