Keeping the mac awake when running certain applications?
I use caffeine to avoid the system to sleep, you can configure the time is "awake" as well: http://lightheadsw.com/caffeine/

Edit to update as caffeine hasn't been updated for a long time, Amphetamine seems to work OK https://itunes.apple.com/us/app/amphetamine/id937984704?mt=12