🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

configForTime in GPU cuda

User: "Yang_QI1"
Altair Community Member
Updated by Yang_QI1

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

Find more posts tagged with

Sort by:
1 - 1 of 11
    User: "Stephen Cole"
    Altair Employee
    Accepted Answer
    Updated by Stephen Cole

    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:

    1. 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.
    2. 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.
    3. 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