-
Notifications
You must be signed in to change notification settings - Fork 10
How To Run Your Program
You've created the configuration file, now you just need to add it to the project. From the main Processing menu, click Sketch->Add File and point it to your configuration.xml file. Now the file will be located at data/configuration.xml relative to the sketch.
Note: This section will likely change soon when full integration with the Processing IDE is complete.
To run your program, you must first export the application from the Processing environment. You may first wish to press the play button to make sure it actually executes. You will only see a window, but if you get any compile errors, you will know there are things you should fix. Otherwise, it will successfully export:
You can use mperun to execute the sketch if your nodes share a filesystem.
mperun is located in the examples directory of the MPE source code. You can download it from Github here
- Copy the mperun script to a directory directly above you exported sketch.
- Run mperun through the command line, pointing it at your exported sketch:
./mperun /path/to/your/sketch/sketchfile
- The sketch should run in a distributed manner as specified in the configuration file.
NOTE: It is important that you point mperun to the correct file. On our systems with the peasycam example here, we execute the command:
./mperun /home/user/exports/peasyex/MPEPeasy
MPEPeasy is the script or executable that Processing produces for you during export.
To run on a single computer or a cluster without a shared filesystem, you can create an executable bash script using the following in a file entitled run.sh:
# head process
export RANK=0; ./peasytest.app/Contents/MacOS/JavaApplicationStub &
# render processes
export RANK=1; ./peasytest.app/Contents/MacOS/JavaApplicationStub &
export RANK=2; ./peasytest.app/Contents/MacOS/JavaApplicationStub &
export RANK=3; ./peasytest.app/Contents/MacOS/JavaApplicationStub &
export RANK=4; ./peasytest.app/Contents/MacOS/JavaApplicationStub
# head process
export RANK=0; sh peasytest &
# render processes
export RANK=1; sh peasytest &
export RANK=2; sh peasytest &
export RANK=3; sh peasytest &
export RANK=4; sh peasytest
This bash script should be located in the directory in which you exported your app. The directory should be named application.osx or application.linux, etc.
Finally, do a chmod a+x run.sh
to make the file executable. Then run it in a terminal: ./run.sh
Congratulations, you've run your first example. If you have questions, please check out the FAQ's section. If you still have questions, email the author!