Effective resource management for master-worker applications in opportunistic environments