Class Mass#
Defined in File Mass.h
Class Documentation#
-
class Mass#
Public Static Functions
-
static void init(int argc, char *argv[])#
Initializes the MASS environment based on the CLI arguments Must be called prior to all other MASS methods.
-
static void init()#
Initializes the MASS environment with default setting.
In this case, the current host is treated as the master node and no other nodes will join the simulation
Must be called prior to all other MASS methods.
-
static void finish()#
Shuts down the MASS environment, releasing all resources.
-
static std::shared_ptr<Places> getPlaces(EntityHandle handle)#
Gets the places object for this handle.
- Parameters:
handle – an int that uniquely identifies a places collection.
- Returns:
NULL if not found.
-
static const internal::DeviceDriver &getLocalDeviceDriver(DeviceRank rank)#
-
static const std::vector<DeviceRank> &getLocalDeviceRanks()#
Get the list of device ranks of the GPUs on this host
- Returns:
a vector of the device ranks
-
static Count getHostCount()#
Get the number of hosts joined in this simulation
- Returns:
number of hosts
-
template<typename DeviceRankCollection, internal::type_deduction::require_span_convertible_t<DeviceRankCollection, DeviceRank> = 0>
static std::unique_ptr<CudaEventTimer> createCudaTimer(const DeviceRankCollection &includedDeviceRanks)# Create a timer based on GPU events for measuring execution time
- Parameters:
includedDeviceRanks – the collection of ranks of the devices that should be included for the time measurement. Leave empty to include all the devices on this host
- Returns:
the created timer
-
static std::unique_ptr<CudaEventTimer> createCudaTimer(std::initializer_list<DeviceRank> includedDeviceRanks = {})#
Create a timer based on GPU events for measuring execution time
- Parameters:
includedDeviceRanks – the collection of ranks of the devices that should be included for the time measurement Leave empty to include all the devices on this host
- Returns:
the created timer
Creates a Places instance with the provided parameters.
- Parameters:
handle – The unique handle for this Places collection.
dimensions – The number of dimensions of the grid of places.
size – The size of the grid of places.
majorType – The major type of the grid of places. It can be either
Place::ROW_MAJORorPlace::COL_MAJOR. This will be used to calculate the offset from relative coordinates when updating neighbors of a place.ghostSize – The size of the
- Returns:
The Places instance created.
Creates a Places instance with the provided parameters.
- Parameters:
handle – The unique handle for this Places collection.
dimensions – The number of dimensions of the grid of places.
size – The size of the grid of places.
majorType – The major type of the grid of places. It can be either
Place::ROW_MAJORorPlace::COL_MAJOR. This will be used to calculate the offset from relative coordinates when updating neighbors of a place.ghostSize – the size of the ghost regions
- Returns:
The Places instance created.
Create a Places instance with the provided parameters
- Template Parameters:
PlaceType – the type of the custom mass::Place implementation
- Parameters:
- Returns:
the created Places
Create a Places instance with the provided parameters
See also
- Template Parameters:
PlaceType – the type of the custom mass::Place implementation
- Parameters:
- Returns:
the created Places
Creates a Agents instance with the provided parameters.
- Parameters:
handle – the unique handle used for the newly created Agents
nAgents – is the initial number of agents instantiated in the system
placesHandle – is the handle of the Places over which to instantiate the Agents.
maxAgents – is the maximum number of agents that can be present in the system thoughout the whole simulation. If the maxAgents parameter is omitted the library set it to the default value of nAgents*2.
placeIdxs – is the array of size nAgents, specifying the index of a place for where each of the Agents should be instantiated. If placeIdxs parameter is omitted, the libary randomly distributes agents over the grid of places.
Creates a Agents instance with the provided parameters.
- Parameters:
handle – the unique handle used for the newly created Agents
nAgents – is the initial number of agents instantiated in the system
places – is the handle of the Places collection over which to instantiate the Agents collection.
maxAgents – is the maximum number of agents that can be present in the system thoughout the whole simulation. If the maxAgents parameter is omitted the library set it to the default value of nAgents*2.
placeIdxs – is the array of size nAgents, specifying the index of a place for where each of the Agents should be instantiated. If placeIdxs parameter is omitted, the libary randomly distributes agents over the grid of places.
Creates a Agents instance with the provided parameters.
See also
- Template Parameters:
AgentType – the type of the custom mass::Agent implementation
- Parameters:
- Returns:
the created Agents
-
static void init(int argc, char *argv[])#