|
|
|
|
|
## Creating a Makefile
|
|
|
|
|
|
Consider including SGE_RREQ at the top of Makefile specify a queue which the scheduler should use.
|
|
|
|
|
|
SGE_RREQ="-q all.q"
|
|
|
|
|
|
This also works for individual recipes. Include the same call right before the recipe.
|
|
|
|
|
|
target: prereqs
|
|
|
SGE_RREQ="-q all.q" recipe
|
|
|
|
|
|
|
|
|
|
|
|
## Running qmake
|
|
|
|
|
|
### Interactive mode
|
|
|
|
|
|
|
|
|
qmake -V -cwd -l arch=linux-x64 -inherit -- -j 100
|
|
|
|
|
|
- The **-V** option specifies that all active environment variables be passed to the job environments.
|
|
|
- The **-inherit** option is needed if you use recursion.
|
|
|
- Everything after the **--** is passed to **make**.
|
|
|
Logging in interactive mode:
|
|
|
|
|
|
qmake -V -cwd -l arch=linux-x64 -inherit -- -j 100 2>&1 | tee qmake.$(/bin/date '+%F_%T').log
|
|
|
|
|
|
- The **2>&1** redirects stderr to stdout.
|
|
|
- The **| tee qmake.*.log** writes stdout (which now also includes stderr) to a log file while also printing it to your screen.
|
|
|
|
|
|
### Non-interactive mode
|
|
|
|
|
|
GNU screen can be used to detach your process from the current shell, so you can safely break your connection with Shark and return to it at a later time while the process keeps running.
|
|
|
|
|
|
screen -L -d -m qmake -V -cwd -l arch=linux-x64 -inherit -- -j 100
|
|
|
|
|
|
- The **-L** option turns on logging.
|
|
|
- The **-d -m** option detaches the process (**qmake**) immemiately.
|
|
|
|
|
|
Put the following line in your **.bashrc** to change the previous line into a handy command:
|
|
|
|
|
|
alias deploy='screen -L -d -m qmake -V -cwd -l arch=linux-x64 -inherit -- -j 100'
|
|
|
|
|
|
|
|
|
Some commands for working with screen sessions:
|
|
|
- `screen -list` to list running sessions.
|
|
|
- `screen -rd` to re-attach to the (only) session.
|
|
|
- `screen -rd <session number>` to re-attach to a specific session.
|
|
|
- `Ctrl+a d` (press `Ctrl` and `a` together, release, then `d`) to detach the session.
|
|
|
|
|
|
### qmake differences from GNU make
|
|
|
|
|
|
- The backslash (`\`) does not seem to work as expected, it sometimes gets expanded as a newline (`\n`).
|
|
|
- Recursion only seems to work if the recipe contains one command, so no chaining with a semicolon (`;`) should be used.
|
|
|
- The `$(shell)` function should not be used in a recipe. This may have something to do with spawning a new process that is not reserved.
|
|
|
|
|
|
### Specifying SGE parameters
|
|
|
|
|
|
You can prefix rule with the `SGE_RREQ` environment variable to specify any custom SGE parameters.
|
|
|
|
|
|
For example, if a rule needs more than the default assigned amount of memory:
|
|
|
|
|
|
%.bw: %.wig
|
|
|
SGE_RREQ="-l h_vmem=30G" ./some_program $< > $@
|
|
|
|
|
|
|
|
|
## Documentation
|
|
|
|
|
|
See the **qmake** [manual](http://www.giref.ulaval.ca/~ctibirna/parallele/sge/man_qmake.html).
|
|
|
|
|
|
More information about how to make a [Makefile](http://www.gnu.org/software/make/manual/make.html).
|
|
|
|
|
|
See a [presentation](JLaros_Makefile_Utrecht_23-03-12.pdf) about using make for pipelines.
|
|
|
|
|
|
It takes a bit of work to [run qmake jobs under another project than your default project](https://gist.github.com/3714158). |
|
|
\ No newline at end of file |