The resource allocation for bag-of-tasks in the heterogeneous distributed system is to distribute the tasks to proper processors such that the makespan is minimized. It is a well-known NP-hard problem, and is even more complex and challenging when the processors have off-line time. To tackle this challenging problem, first, we set up a mathematical model for this problem which minimizes the makespan of the bag-oftasks with the off-line time segment of the processors. Second, to solve the model efficiently, we propose two new algorithms: a new scheduling algorithm referred to as sorting-allocation-pulling scheduling algorithm which first allocate the tasks to available time segment on proper processors and then pulls them to the formerly available time segment for the sake of minimizing the makespan, and an effective genetic algorithm with a novel local search operator and a well-designed modify operator. Finally, the numerical simulation experiments are conducted, and the two proposed algorithms are compared. The experimental results indicate the effectiveness of the proposed model and algorithms. INDEX TERMS Distributed computing, task scheduling, bag-of-tasks, generic algorithm.