A set of changes to support better task management

* better task status
* revised script for running optimization problems