Example #1
0
        private void ProcessRecordAllocationAlgorithm(string gpu_group)
        {
            RunApiCall(() =>
            {
                allocation_algorithm obj = XenAPI.GPU_group.get_allocation_algorithm(session, gpu_group);

                WriteObject(obj, true);
            });
        }
        public static string ToString(allocation_algorithm x)
        {
            switch (x)
            {
            case allocation_algorithm.breadth_first:
                return("breadth_first");

            case allocation_algorithm.depth_first:
                return("depth_first");
            }
            return("unknown");
        }
 public static string ToString(allocation_algorithm x)
 {
     switch (x)
     {
         case allocation_algorithm.breadth_first:
             return "breadth_first";
         case allocation_algorithm.depth_first:
             return "depth_first";
         default:
             return "unknown";
     }
 }
Example #4
0
        public static string ToString(allocation_algorithm x)
        {
            switch (x)
            {
            case allocation_algorithm.breadth_first:
                return(Messages.GPU_PLACEMENT_POLICY_MAX_PERFORMANCE_DESCRIPTION);

            case allocation_algorithm.depth_first:
                return(Messages.GPU_PLACEMENT_POLICY_MAX_DENSITY_DESCRIPTION);

            default:
                return(Messages.GPU_PLACEMENT_POLICY_MIXED_DESCRIPTION);
            }
        }
Example #5
0
        public static string StringOf(this allocation_algorithm x)
        {
            switch (x)
            {
            case allocation_algorithm.breadth_first:
                return("breadth_first");

            case allocation_algorithm.depth_first:
                return("depth_first");

            default:
                return("unknown");
            }
        }
Example #6
0
 public GPU_group(string uuid,
                  string name_label,
                  string name_description,
                  List <XenRef <PGPU> > PGPUs,
                  List <XenRef <VGPU> > VGPUs,
                  string[] GPU_types,
                  Dictionary <string, string> other_config,
                  allocation_algorithm allocation_algorithm,
                  List <XenRef <VGPU_type> > supported_VGPU_types,
                  List <XenRef <VGPU_type> > enabled_VGPU_types)
 {
     this.uuid                 = uuid;
     this.name_label           = name_label;
     this.name_description     = name_description;
     this.PGPUs                = PGPUs;
     this.VGPUs                = VGPUs;
     this.GPU_types            = GPU_types;
     this.other_config         = other_config;
     this.allocation_algorithm = allocation_algorithm;
     this.supported_VGPU_types = supported_VGPU_types;
     this.enabled_VGPU_types   = enabled_VGPU_types;
 }
        private void PopulatePlacementPolicyPanel()
        {
            currentAllocationAlgorithm = allocation_algorithm.unknown;

            foreach (GPU_group gpu_group in gpu_groups)
            {
                if (gpu_group.allocation_algorithm != currentAllocationAlgorithm && currentAllocationAlgorithm != allocation_algorithm.unknown)
                {
                    // a mixture of allocation algorithms
                    currentAllocationAlgorithm = allocation_algorithm.unknown;
                    break;
                }
                currentAllocationAlgorithm = gpu_group.allocation_algorithm;
            }

            radioButtonDepth.Checked   = currentAllocationAlgorithm == allocation_algorithm.depth_first;
            radioButtonBreadth.Checked = currentAllocationAlgorithm == allocation_algorithm.breadth_first;

            radioButtonMixture.Checked = currentAllocationAlgorithm == allocation_algorithm.unknown;
            radioButtonMixture.Visible = currentAllocationAlgorithm == allocation_algorithm.unknown;
            radioButtonMixture.Enabled = currentAllocationAlgorithm == allocation_algorithm.unknown;
        }
Example #8
0
 public static void set_allocation_algorithm(Session session, string _gpu_group, allocation_algorithm _allocation_algorithm)
 {
     session.proxy.gpu_group_set_allocation_algorithm(session.uuid, (_gpu_group != null) ? _gpu_group : "", allocation_algorithm_helper.ToString(_allocation_algorithm)).parse();
 }
 public static string ToString(allocation_algorithm x)
 {
     switch (x)
     {
         case allocation_algorithm.breadth_first:
             return Messages.GPU_PLACEMENT_POLICY_MAX_PERFORMANCE_DESCRIPTION;
         case allocation_algorithm.depth_first:
             return Messages.GPU_PLACEMENT_POLICY_MAX_DENSITY_DESCRIPTION;
         default:
             return Messages.GPU_PLACEMENT_POLICY_MIXED_DESCRIPTION;
     }
 }
Example #10
0
        private void PopulatePlacementPolicyPanel()
        {
            currentAllocationAlgorithm = allocation_algorithm.unknown;

            foreach (GPU_group gpu_group in gpu_groups)
            {
                if (gpu_group.allocation_algorithm != currentAllocationAlgorithm && currentAllocationAlgorithm != allocation_algorithm.unknown)
                {
                    // a mixture of allocation algorithms
                    currentAllocationAlgorithm = allocation_algorithm.unknown;
                    break;
                }
                currentAllocationAlgorithm = gpu_group.allocation_algorithm;
            }

            radioButtonDepth.Checked = currentAllocationAlgorithm == allocation_algorithm.depth_first;
            radioButtonBreadth.Checked = currentAllocationAlgorithm == allocation_algorithm.breadth_first;

            radioButtonMixture.Checked = currentAllocationAlgorithm == allocation_algorithm.unknown;
            radioButtonMixture.Visible = currentAllocationAlgorithm == allocation_algorithm.unknown;
            radioButtonMixture.Enabled = currentAllocationAlgorithm == allocation_algorithm.unknown;
        }
Example #11
0
 /// <summary>
 /// Set the allocation_algorithm field of the given GPU_group.
 /// First published in XenServer 6.2 SP1 Tech-Preview.
 /// </summary>
 /// <param name="session">The session</param>
 /// <param name="_gpu_group">The opaque_ref of the given gpu_group</param>
 /// <param name="_allocation_algorithm">New value to set</param>
 public static void set_allocation_algorithm(Session session, string _gpu_group, allocation_algorithm _allocation_algorithm)
 {
     if (session.JsonRpcClient != null)
     {
         session.JsonRpcClient.gpu_group_set_allocation_algorithm(session.opaque_ref, _gpu_group, _allocation_algorithm);
     }
     else
     {
         session.proxy.gpu_group_set_allocation_algorithm(session.opaque_ref, _gpu_group ?? "", allocation_algorithm_helper.ToString(_allocation_algorithm)).parse();
     }
 }
Example #12
0
 public SetGpuPlacementPolicyAction(Pool pool, allocation_algorithm allocationAlgorithm)
     : base(pool.Connection, Messages.SET_GPU_PLACEMENT_POLICY_ACTION_TITLE,
            Messages.SET_GPU_PLACEMENT_POLICY_ACTION_DESCRIPTION, true)
 {
     this.allocationAlgorithm = allocationAlgorithm;
 }
 public SetGpuPlacementPolicyAction(Pool pool, allocation_algorithm allocationAlgorithm)
     : base(pool.Connection, Messages.SET_GPU_PLACEMENT_POLICY_ACTION_TITLE, 
     Messages.SET_GPU_PLACEMENT_POLICY_ACTION_DESCRIPTION, true)
 {
     this.allocationAlgorithm = allocationAlgorithm;
 }
Example #14
0
 public static string ToString(allocation_algorithm x)
 {
     return(x.StringOf());
 }