def init_pbs(self):
        pbs_node_file = os.environ.get("PBS_NODEFILE")    
        if pbs_node_file == None:
            return
        f = open(pbs_node_file)
        self.freenodes = f.readlines()
        f.close()

        # check whether pbs node file contains the correct number of nodes
        num_cpus = self.get_num_cpus()
        node_dict={}
        for i in set(self.freenodes):
            node_dict[i] = self.freenodes.count(i)
            if node_dict[i] < num_cpus:
                node_dict[i] = num_cpus
    
        self.freenodes=[]
        for i in node_dict.keys():
            logging.debug("host: " + i + " nodes: " + str(node_dict[i]))
            for j in range(0, node_dict[i]):
                logging.debug("add host: " + i.strip())
                self.freenodes.append(i)
initialize free nodes list from PBS environment
dataset/ETHPy150Open saga-project/BigJob/bigjob/bigjob_agent_condor.py/bigjob_agent.init_pbs