configForTime in GPU cuda
Hi,
I noticed that in GPU CUDA solver, the CPU code should include an empty implementation of function configForTimeStep but it has no effects. And I found it is devided into three different functions: configForTimeStepParticleProperty() ; configForTimeStepTriangleProperty() ;configForTimeStepSimulationProperty(). I am using EDEM2023.0 and could not see those function in the API document. I want to know how many times are these functions executed at the start of a timestep?Are they executed for each individual particle? I am also curious about how the CPU function configForTimeStep() work? Is it executed only once at the start of each timestep?
Regards,
Qi
Best Answer
-
hi Qi,
On GPU the function is split into 3 parts, particle, simulation and geometry are in the 3 different functions. On CPU it's all 1 function.
You should be able to find the documentation in the API Help
C:\Program Files\Altair\2023\EDEM\src\Api\Help > Index.html
On CUDA GPU:
- configForTimeStepParticleProperty. This will be run once for every particle once every timestep, before any contacts are computed. This is available for all 3 types of plugin shown above and an empty implementation must be provided if it is not required.
- configForTimeStepTriangleProperty. This will be run once for every triangle once every timestep before any contacts are computed. This is only applicable for particle-geometry contact models (2 above) and an empty implementation must be provided in the GPU file if it is not required.
- configForTimeStepSimulationProperty. This will be run once per timestep before any contacts are computed. This is available for all 3 types of plugin shown above and an empty implementation must be provided if it is not required. Note that this function is not available on the OpenCL solver.
On CPU:
virtual void configForTimeStep ( NApiCore::ICustomPropertyDataApi_1_0 * simPropData, NApiCore::IParticleManagerApi_1_5 * particleManager, NApiCore::IGeometryManagerApi_1_3 * geometryManager, double time Enables custom functionality to be carried out on a per timestep basis.
The function is called from the processor's performAnalysis routine at the start of each timestep.
Note: When using the CUDA solvers this will have no effect but an empty implementation must still be provided. In this case the config for time step function needs to be implemented in the CUDA .cu file. However, when using CPU or OpenCL solver this function will have to be implemented.
Default: Does nothing
- Parameters
-
simPropData Details of the associated simulation properties particleManager Particle property manager geometryManager Geometry property manager time current simulation time
1
Answers
-
hi Qi,
On GPU the function is split into 3 parts, particle, simulation and geometry are in the 3 different functions. On CPU it's all 1 function.
You should be able to find the documentation in the API Help
C:\Program Files\Altair\2023\EDEM\src\Api\Help > Index.html
On CUDA GPU:
- configForTimeStepParticleProperty. This will be run once for every particle once every timestep, before any contacts are computed. This is available for all 3 types of plugin shown above and an empty implementation must be provided if it is not required.
- configForTimeStepTriangleProperty. This will be run once for every triangle once every timestep before any contacts are computed. This is only applicable for particle-geometry contact models (2 above) and an empty implementation must be provided in the GPU file if it is not required.
- configForTimeStepSimulationProperty. This will be run once per timestep before any contacts are computed. This is available for all 3 types of plugin shown above and an empty implementation must be provided if it is not required. Note that this function is not available on the OpenCL solver.
On CPU:
virtual void configForTimeStep ( NApiCore::ICustomPropertyDataApi_1_0 * simPropData, NApiCore::IParticleManagerApi_1_5 * particleManager, NApiCore::IGeometryManagerApi_1_3 * geometryManager, double time Enables custom functionality to be carried out on a per timestep basis.
The function is called from the processor's performAnalysis routine at the start of each timestep.
Note: When using the CUDA solvers this will have no effect but an empty implementation must still be provided. In this case the config for time step function needs to be implemented in the CUDA .cu file. However, when using CPU or OpenCL solver this function will have to be implemented.
Default: Does nothing
- Parameters
-
simPropData Details of the associated simulation properties particleManager Particle property manager geometryManager Geometry property manager time current simulation time
1