Пример #1
0
    def __init__(self,network):
        self.nodes=[]
        self.projections=[]
        self.network=network
        self.initialize(network)

        
        if NEFGPUInterface.getUseGPU():
            gpuNodes = LocalSimulator.collectNodes(self.nodes) 
            gpuNetworkArrays = LocalSimulator.collectNetworkArraysForGPU(self.nodes) 
            gpuProjections = LocalSimulator.collectProjections(self.nodes, self.projections) 

            self.thread_pool=NEFGPUInterface(gpuNodes, gpuProjections, gpuNetworkArrays)

        elif NodeThreadPool.isMultithreading():
            multithread_nodes = LocalSimulator.collectNodes(self.nodes) 
            multithread_projs = LocalSimulator.collectProjections(self.nodes, self.projections) 

            self.thread_pool=NodeThreadPool(multithread_nodes, multithread_projs)
        else:    
            self.thread_pool=None