Ejemplo n.º 1
0
        public MachineManager(string machineIp, int[] ports, int vcpus = -1, bool isGpu = false)
        {
            //_functionParams = functionParams;
            vcpus = vcpus == -1 ? System.Environment.ProcessorCount : vcpus;
            if (ports.Length < vcpus)
            {
                ports = ports.Concat(Enumerable.Range(PortFinder.FreeTcpPort(), vcpus - ports.Length)).ToArray();
            }

            _vCpuManagers = new VCpuManager[vcpus];
            for (int i = 0; i < vcpus; i++)
            {
                _vCpuManagers[i] = new VCpuManager(machineIp, ports[i], i.ToString());
                _vCpuManagers[i].StartTcpNodeService();
                if (i > 0)
                {
                    _vCpuManagers[i].NetworkNodeManager.Register(_vCpuManagers[i - 1].GetMyNetworkNodeInfo());
                }
            }
            if (isGpu)
            {
                _gpuManager = new GpuManager();
            }
        }
Ejemplo n.º 2
0
        public MachineManager(string machineIp, int[] ports, int vcpus = -1, bool isGpu = false)
        {
            //_functionParams = functionParams;
            vcpus = vcpus == -1 ? System.Environment.ProcessorCount : vcpus;
            if (ports.Length < vcpus)
            {
                ports = ports.Concat(Enumerable.Range(PortFinder.FreeTcpPort(), vcpus - ports.Length)).ToArray();
            }

            _vCpuManagers = new VCpuManager[vcpus];
            for (int i = 0; i < vcpus; i++)
            {
                _vCpuManagers[i] = new VCpuManager(machineIp, ports[i], i.ToString());
                _vCpuManagers[i].StartTcpNodeService();
                if (i > 0)
                {
                    _vCpuManagers[i].NetworkNodeManager.Register(_vCpuManagers[i - 1].GetMyNetworkNodeInfo());
                }
            }
            if (isGpu)
            {
                _gpuManager = new GpuManager();
            }
        }