Dynamic Mini-batch SGD for Elastic Distributed Training: Learning in the Limbo of Resources