AmesimKnowledge

Using the HPC feature with command line > Commands

AMEHPCStudystart

This command can be submitted directly to the scheduler through the command line or in a scripted application. For advanced usage, it simplifies the introduction of Simcenter Amesim studies in complex workflows, and allows managing large simulations using Simcenter Amesim scripting APIs.

This command contains the same options and is similar to the templates previously introduced, but it operates at a lower level, being basically the script submitted to the job scheduler (bsub for LSF/Openlava, sbatch for Slurm or qsub for PBS, UGE, or SGE).

Note

The variable AME_HPC_PYTHON must be set when directly calling the AMEHPCStudyStart script (see the Setting up the Environment section).

Copy

AMEHPCStudyMain.py
[-h] [--driver DRIVER] [--remote-shell RSHELL] 
[--wdir WDIR][--dirmodel DIRMODEL] [--amehpcpython PYTHON] 
[--port-manager MANAGERPORT][--spread-port-manager MANAGERPORTSPREAD] 
[--amehpcpath AMEHPCPATH]        
[--unique_sub_dir] [--fargs FARGS] [--simtool {amesim,cosimbus,sysanalyst}]
[--model MODEL] [--amepath AMEPATH] 
[--type RUNTYPE][--studytype STUDYTYPE] [--studyname STUDYNAME] 
[--compiler COMPILER] [--no_compilation] 
[--save_as SAVE_AS] [--no_save][--xserver XSERVER] 
[--pathlistfile PATHLISTFILE] [--env XXX=value]        
[--precomp_preproc_archive PREC_PREP_ARCH]
[--precomp_preproc_script PREC_PREP_SCRIPT]
[--postcomp_preproc_archive POSTC_PREP_ARCH]
[--postcomp_preproc_script POSTC_PREP_SCRIPT]
[--postproc_archive POSTPROC_ARCH] 
[--postproc_script POSTPROC_SCRIPT]     

Submit a Simcenter Amesim study to HPC scheduler

Simcenter Amesim arguments:
  -h, --help            show this help message and exit
  --model MODEL         Define the model name of the study.
  --amepath AMEPATH     Define the Simcenter Amesim path, required if $AME not defined.
  --type RUNTYPE        Define the study type : single, batch or DE
  --studytype STUDYTYPE
                        Define the subtype of Design Exploration study: 0 or "Doe" for Design Of Experiments, 1 or "Optim" for Optimization 2 or "Mc" for Monte Carlo.
  --studyname STUDYNAME
                        Define the name of the Design Exploration study
  --compiler COMPILER   Set the compiler: gcc64 or intel64 ; default: gcc64.

HPC framework arguments:
  --driver DRIVER       Select the hpc scheduler: NATIVE, LSF, PBS, SLURM or UGE.
  --remote-shell RSHELL
                        Select the remote shell to launch remote processes: sched, ssh or mpi (default is "sched").
  --wdir WDIR           Define the working directory. Shall not be defined in a file with additional arguments.
  --dirmodel DIRMODEL   Define the directory containing input model(s) of the study.
  --amehpcpython PYTHON
                        Define the Python to use by Simcenter Amesim HPC framework
  --port-manager MANAGERPORT
                        first port that can be used by STDSIMManager; default is 40001 (if dedicated environment variable, $AME_SIMULATIONPORT, not defined).
  --spread-port-manager MANAGERPORTSPREAD
                        to define a range of the ports that can be used by STDSIMManager: [MANAGERPORT; MANAGERPORT+MANAGERPORTSPREAD]; default is 1000 (if
                        dedicated environment variable, $AME_SIMULATIONPORT_SPREAD, not defined).
  --amehpcpath AMEHPCPATH
                        Define the path to Simcenter Amesim HPC framework. Default is the one associated with --amepath option. Note: $AME_HPC_PATH is used if
                        defined.
  --simtool {amesim,cosimbus,sysanalyst}
                        Select the simulation tool to run.

Additional HPC framework arguments:
  --unique_sub_dir      Replace the working directory by a unique sub-directory created inside the working dir (see --wdir).
  --fargs FARGS         file including additional program arguments.Either a filename from wdir directory or a filename with its full absolute path

Additional Simcenter Amesim arguments:
  --no_compilation      No compilation of the model will be applied, considered already compiled.
  --save_as SAVE_AS     Save the model at the end of the study, define: - a canonical path ex: $HOME/my_result_dir/ , same initial system name will be used -
                        a canonical path to new ame file; ex: $HOME/my_result_dir/my_simulated_system.ame .
  --no_save             The model is not saved at the end of simulation, the model is still exploded in the working directory.
  --xserver XSERVER     Define the virtual X server environment command.
  --pathlistfile PATHLISTFILE
                        Use path list defined in file instead of Simcenter Amesim path list.
  --env XXX=value       Define an environment variable to be set prior to launching Amesim scripts. This option can be used multiple times to set multiple
                        environment variables. To set FOO variable without value use FOO=
  --precomp_preproc_archive PREC_PREP_ARCH
                        Define the scripts .zip archive for pre-compilation pre-processing.
  --precomp_preproc_script PREC_PREP_SCRIPT
                        Define the script name to launch for pre-compilation pre-processing. In case an archive is provided, this could be the relative path
                        to the script to call.
  --postcomp_preproc_archive POSTC_PREP_ARCH
                        Define the scripts .zip archive for post-compilation pre-processing.
  --postcomp_preproc_script POSTC_PREP_SCRIPT
                        Define the script name to launch for post-compilation pre-processing. In case an archive is provided, this could be the relative path
                        to the script to call.
  --postproc_archive POSTPROC_ARCH
                        Define the scripts .zip archive for post-processing.
  --postproc_script POSTPROC_SCRIPT
                        Define the script name to launch for post-processing. In case an archive is provided, this could be the relative path to the script to call.

The following example shows how to use the command in a python script with Slurm:

Copy

# submit hpc command
    _cmd = [
            'sbatch',
            '-N2 -J "Simcenter Amesim batch study"',
            '$AME' + '/scripting/python/hpc/AMEHPCStudyStart',
            '--driver=' + 'SLURM',
            '--dirmodel=' + wdir,
            '--model=' + model,
            '--type=' + 'batch',
            '--wdir=' + simdir,
            '--amepath=' + '$AME',
            '--compiler=' + 'gcc64',
            '--port-manager=' + '40100',
            '--save_as=' + save_model,
            '--env=' + 'SC1D_LICENSING_TYPE=$SC1D_LICENSING_TYPE',
            '--env=' + 'SPLM_LICENSE_SERVER=$SPLM_LICENSE_SERVER',
        ]
    os.system(' '.join(_cmd))

and the same example for LSF:

Copy

# submit hpc command
    _cmd = [
            'bsub',
            '-n16 –R span[ptile=8] -J "Simcenter Amesim batch study"',
            '$AME' + '/scripting/python/hpc/AMEHPCStudyStart',
            '--driver=' + 'LSF',
            '--dirmodel=' + wdir,
            '--model=' + model,
            '--type=' + 'batch',
            '--wdir=' + simdir,
            '--amepath=' + '$AME',
            '--compiler=' + 'gcc64',
            '--port-manager=' + '40100',
            '--save_as=' + save_model,
            '--env=' + 'SC1D_LICENSING_TYPE=$SC1D_LICENSING_TYPE',
            '--env=' + 'SPLM_LICENSE_SERVER=$SPLM_LICENSE_SERVER',
        ]
    os.system(' '.join(_cmd))

and for PBS:

Copy

# submit hpc command   
 _cmd = [
        'echo "' +
        '$AME' + '/scripting/python/hpc/AMEHPCStudyStart',
        '--driver=' + 'PBS',
        '--dirmodel=' + wdir,
        '--model=' + model,
        '--type=' + 'batch',
        '--wdir=' + simdir,
        '--amepath=' + '$AME',
        '--compiler=' + 'gcc64',
        '--port-manager=' + '41000',
        '--save_as=' + save_model,
        '--env=' + 'SC1D_LICENSING_TYPE=$SC1D_LICENSING_TYPE',
        '--env=' + 'SPLM_LICENSE_SERVER=$SPLM_LICENSE_SERVER',
        '"|  qsub  -v AME=$AME/ -l nodes=2:ppn=8'
]
    os.system(' '.join(_cmd))

and for UGE:

Copy

# submit hpc command
_cmd = [
       'qsub –b y –V -cwd',
        '-l f_node=2 -N "Simcenter Amesim batch study"',
        '$AME' + '/scripting/python/hpc/AMEHPCStudyStart',
        '--driver=' + 'UGE',
        '--dirmodel=' + wdir, 
        '--model=' + model,
        '--type=' + 'batch', 
        '--wdir=' + simdir,
        '--amepath=' + '$AME',
        '--compiler=' + 'gcc64',
        '--port-manager=' + '41000', 
        '--save_as=' + save_model,
        '--env=' + 'SC1D_LICENSING_TYPE=$SC1D_LICENSING_TYPE',
        '--env=' + 'SPLM_LICENSE_SERVER=$SPLM_LICENSE_SERVER',
]
os.system(' '.join(_cmd))

and for SGE:

Copy

# submit hpc command
_cmd = [
        'qsub –b y –V -cwd',
        '-pe multinode 2 -N "Simcenter Amesim batch study"',
        '$AME' + '/scripting/python/hpc/AMEHPCStudyStart',
        '--driver=' + 'UGE',
        '--dirmodel=' + wdir,
        '--model=' + model,
        '--type=' + 'batch',
        '--wdir=' + simdir,
        '--amepath=' + '$AME',
        '--compiler=' + 'gcc64',
        '--port-manager=' + '41000',
        '--save_as=' + save_model,
        '--env=' + 'SC1D_LICENSING_TYPE=$SC1D_LICENSING_TYPE',
        '--env=' + 'SPLM_LICENSE_SERVER=$SPLM_LICENSE_SERVER',
]
os.system(' '.join(_cmd))

Source: https://docs.sw.siemens.com/en-US/doc/254352342/PL20250521841123434.amesim_collection.HPC/xid1224119 · retrieved 2026-07-17