COMPASS  5.0.0
End-to-end AO simulation tool using GPU acceleration
PLOOP.py
1 
37 
38 import numpy as np
39 from . import config_setter_utils as csu
40 
41 
42 
45 class Param_loop:
46 
47  def __init__(self):
48  self.__niter = 0
49  self.__ittime = 0.
50  self.__devices = np.array([0], dtype=np.int32)
51 
52  def get_devices(self):
53  """ Get the list of GPU devices used
54 
55  :return: (np.ndarray[ndim=1, dtype=np.int32_t]) : list of GPU devices
56  """
57  return self.__devices
58 
59  def set_devices(self, devices):
60  """ Set the list of GPU devices used
61 
62  :parameters:
63  devices: (np.ndarray[ndim=1, dtype=np.int32_t]) : list of GPU devices
64  """
65  self.__devices = csu.enforce_array(devices, len(devices), dtype=np.int32,
66  scalar_expand=False)
67 
68  devices = property(get_devices, set_devices)
69 
70  def get_niter(self):
71  """ Get the number of iteration
72 
73  :return: (long) : number of iteration
74  """
75  return self.__niter
76 
77  def set_niter(self, n):
78  """ Set the number of iteration
79 
80  :parameters:
81  n: (long) : number of iteration
82  """
83  self.__niter = csu.enforce_int(n)
84 
85  niter = property(get_niter, set_niter)
86 
87  def get_ittime(self):
88  """ Get iteration time
89 
90  :return: (float) :iteration time
91  """
92  return self.__ittime
93 
94  def set_ittime(self, t):
95  """ Set iteration time
96 
97  :parameters:
98  t: (float) :iteration time
99  """
100  self.__ittime = csu.enforce_float(t)
101 
102  ittime = property(get_ittime, set_ittime)
shesha.config.PLOOP.Param_loop.get_niter
def get_niter(self)
Get the number of iteration.
Definition: PLOOP.py:74
shesha.config.PLOOP.Param_loop.set_devices
def set_devices(self, devices)
Set the list of GPU devices used.
Definition: PLOOP.py:64
shesha.config.PLOOP.Param_loop.__ittime
__ittime
Definition: PLOOP.py:49
shesha.config.PLOOP.Param_loop
P-Class (parametres) Param_loop.
Definition: PLOOP.py:45
shesha.config.PLOOP.Param_loop.__devices
__devices
Definition: PLOOP.py:50
shesha.config.PLOOP.Param_loop.__init__
def __init__(self)
Definition: PLOOP.py:47
shesha.config.PLOOP.Param_loop.set_niter
def set_niter(self, n)
Set the number of iteration.
Definition: PLOOP.py:82
shesha.config.PLOOP.Param_loop.get_ittime
def get_ittime(self)
Get iteration time.
Definition: PLOOP.py:91
shesha.config.PLOOP.Param_loop.__niter
__niter
Definition: PLOOP.py:48
shesha.config.PLOOP.Param_loop.set_ittime
def set_ittime(self, t)
Set iteration time.
Definition: PLOOP.py:99
shesha.config.PLOOP.Param_loop.get_devices
def get_devices(self)
Get the list of GPU devices used.
Definition: PLOOP.py:56