Limiting the number of cores for a scenario with parametric distribution

sjerra
sjerra Altair Community Member
edited February 2021 in Community Q&A

Hi,

I run flux simulations via matlab without flux gui. we use it to automatically solve hundreds of different design generated through matlab. I setup parametric distribution in my solve scenarios and setup the distribution manager with the cores I want to dedicate (48). 

However, the problem is, I run multiple simulations in parallel via the matlab parallel toolbox. So I don't want one simulation to go and run off with all the cores in my distribution manager. But this is what's happening now. The first solver to start gets all the cores assigned, the others have to wait. One can argue that theoretically the total calculation time remains the same but that's not the case. Depending on how many parameters there are, above a certain amount of cores, the calculation time goes back up. Significantly. example: parametric sweep of 300 values. 1 core=350s, 10c=140s, 15c=120s, 48c=250s. Preparing the runs on 48c just takes more time then the solving. 

So when sending my scenario to the distribution manager for solving, it would be great if I can assign the number of cores I want to use for that job.

The help is very vague in this. in the best practices 'setup flux for batch schedulers', there is a section on parametric distribution where one can set three environment variables FLUX_PARAMETRIC FLUX_PARAM_AUTO and FLUX_PARAM_MAXCORES. These environment variables seem to do exactly what I need and if I read the document they seem variables that are passed to flux and not to the batch scheduler. But I'm not sure. I tried to replicate them via the matlab and pass them to the flux debug window but they don't work.  

The other document I found was with PBS via compute manager. But I don't know if this works well with matlab. It requires the compute manager interface to set it up. In my case I need full control in matlab because we run heavily automated.

Does anybody know if it is possible to limit the number of cores that a scenario uses so that the distribution manager can take on more jobs in parallel? 

 

Thank you for your help,

 

Sjerra

 

 

Tagged:

Best Answer

  • asoualmi
    asoualmi
    Altair Employee
    edited February 2021 Answer ✓

    Hi,

    I checked with our R&D team, unfortunately, if you want to use CDE, each resolution will always run on the number of cores entered in the Manager. The FLUX_PARAMETRIC, FLUX_PARAM_AUTO and FLUX_PARAM_MAXCORES variables are not used via CDE.

    If you have another batch scheduler, like PBS, LSF or other, you can use the FLUX_PARAMETRIC, FLUX_PARAM_AUTO and FLUX_PARAM_MAXCORES variables.

     

    Best regards.

Answers

  • asoualmi
    asoualmi
    Altair Employee
    edited February 2021

    Hi,

    You will find attached a PDF file explain how to choose the number of core (see page 3 section: environment variables, 1-mandatory environment variables).

    Best regards.

  • sjerra
    sjerra Altair Community Member
    edited February 2021

    Hi Abdessamed,

     

    I'm aware of this environment variable. This is however not the variable that determines how many cores will be used in a parameter distribution. This determines the amount of cores used to solve a single calculation ie multicore. 

    In my case I set it to 1 and SYNC_SOCKET to 0. I don't want to solve multicore. it's inefficient. I want to spread my parameter sweeps across different cores. 

    This value has no effect on the number of cores that gets assigned to distributing a parameter run. 

    Kind regards,

     

    sjerra

     

     

  • asoualmi
    asoualmi
    Altair Employee
    edited February 2021
    sjerra said:

    Hi Abdessamed,

     

    I'm aware of this environment variable. This is however not the variable that determines how many cores will be used in a parameter distribution. This determines the amount of cores used to solve a single calculation ie multicore. 

    In my case I set it to 1 and SYNC_SOCKET to 0. I don't want to solve multicore. it's inefficient. I want to spread my parameter sweeps across different cores. 

    This value has no effect on the number of cores that gets assigned to distributing a parameter run. 

    Kind regards,

     

    sjerra

     

     

    Hi,

    Try to use this commande : FLUX_NCORES=1

    Best regards.

  • sjerra
    sjerra Altair Community Member
    edited February 2021

    I'm not sure you understood my previous post. It's already on set to 1. FLUX_NCORES=1 

    FLUX_NCORES does not control how many cores you assign to a parametric distributed run. it controls how many cores you want to assign to a single multicore solve. 

    sjerra

  • Q.Nguyen-Dai
    Q.Nguyen-Dai Altair Community Member
    edited February 2021

    You need a job manager, like Altair PBS, or alot of others: Slurm, SGE,....

  • asoualmi
    asoualmi
    Altair Employee
    edited February 2021 Answer ✓

    Hi,

    I checked with our R&D team, unfortunately, if you want to use CDE, each resolution will always run on the number of cores entered in the Manager. The FLUX_PARAMETRIC, FLUX_PARAM_AUTO and FLUX_PARAM_MAXCORES variables are not used via CDE.

    If you have another batch scheduler, like PBS, LSF or other, you can use the FLUX_PARAMETRIC, FLUX_PARAM_AUTO and FLUX_PARAM_MAXCORES variables.

     

    Best regards.

  • sjerra
    sjerra Altair Community Member
    edited February 2021

    Hi Abdessamed,

    Thanks for checking. I started to suspect this. But it's good to have a clear answer. 

    sjerra

     

     

     

     

  • asoualmi
    asoualmi
    Altair Employee
    edited February 2021
    sjerra said:

    Hi Abdessamed,

    Thanks for checking. I started to suspect this. But it's good to have a clear answer. 

    sjerra

     

     

     

     

    You are welcome.