Modeling energy consumption for master–slave applications