Sunteți pe pagina 1din 7

ANSYS Cloud CLI

Command line interface to submit jobs

Installation

Commands
Help
Login
Logout
GetQueues
RunMAPDL
RunFluent
RunAedt
JobInfo
GetOutputs
JobState
deleteJob
Monitor
Installation
The ANSYS Cloud Command Line Interface is distributed with the ANSYS Cloud installation
downloadable from ​https://cloud.ansys.com/downloads​.

With the Windows Installation the ANSYS Cloud CLI is directly accessible for a command
windows with the simple command : ​ansyscloudcli

Commands

Help
> AnsysCloudCLI -h
Or
> AnsysCloudCLI --help
List all commands. In the same way, for any command the help can be displayed.

> AnsysCloudCLI getqueues -h

Login
> AnsysCloudCLI login
Allows the user to login to his account.
The token generated is saved so next commands can use it to connect again.

Logout
> AnsysCloudCLI logout

Allows the user to logout.

GetQueues
> AnsysCloudCLI getQueues [-p <product>] [-v <version>] [-r
<region>]

Lists all allowed queues. Can be filtered per product, version or region.

Example:
> AnsysCloudCLI getQueues -v 192 -r eastus

ANSYS Cloud CLI


----------------------------------------

Version 1.0.1902.7
List of queues:
Small_EastUS_Fluent_192
Medium_EastUS_Fluent_192
Large_EastUS_Fluent_192
Small_EastUS_MAPDL_192
Medium_EastUS_MAPDL_192
Large_EastUS_MAPDL_192

RunMAPDL
> AnsysCloudCLI.exe runMAPDL -j <job name> -q <queue> -i <input
file> -v <solver version> [-n <num nodes>] [-m <max cores>] [-w
[-d <result file>]] [-f <filter>

This command has to be run in the folder where the input files are.
● -j: job name
● -q: name of the queue (cf. GetQueues)
● -v target solver version (192, 2019R1)
● -i: name of the input file for the solver
● -w: (optional) wait end of the job
● -d: (optional) download the output folder at the end
● -f: (optional) filter the files sent to VMs for the solve. By default, all the files of the
current folder are sent. Filter accepts wildcard and more than one can be added
separated by ; :
-f “.*[.]dat;.*[.]txt”

Example:

> AnsysCloudCLI.exe runMAPDL -j FromCLI -q


“Small_EastUS_MAPDL_2019R1” -v 2019R1 -i V18sp-1.dat -n 1 -w -d
V18sp-1_results -f “V18sp-1[.]dat;V18sp-1geom[.]dat” > V18sp-1.dat

RunFluent
This command has to be run in the folder where the input files are.
> AnsysCloudCLI.exe runFluent -j <job name> -q <queue> -i <input
file> -v <solver version> [--jou <journal>] [-n <num nodes>] [-m
<max cores>] [-w [-d <dest folder>] [-f <filter>]
● -j: job name
● -q: name of the queue (cf. GetQueues)
● -i: name of the input file for the solver
● --jou: journal to execute (if set, -i is not used).
● -2d: switch to 2ddp (by default the solve is done using 3ddp)
● -v target solver version (192, 2019R1)
● -w: (optional) wait the job to finish
● -d: (optional) download the result files at the end into the provided folder.
● -f: (optional) filter the files sent to VMs for the solve. By default, all the files of the
current folder are sent. Filter accepts wildcard and more than one can be added
separated by ; :
-f “.*[.]dat;.*[.]txt”

Example:

> AnsysCloudCLI.exe runFluent -j FluentCLI -q


“Small_EastUS_Fluent_192” -i "elbow3-steady-0.cas.gz" -v 192 -f
"elbow3-steady-0.cas.gz" -w -d FluentCLIoutput

RunAedt
This command has to be run in the folder where the input files are.
> AnsysCloudCLI.exe runAedt -j <job name> -q <queue> -v <solver
version> -i <input file> [-n <num nodes>] [-m <max cores>] [-w [-d
<dest folder>]] [-f <filter>

● -j: job name


● -q: name of the queue (cf. GetQueues)
● -v target solver version
● -i: name of the input file for the solver
● --iter: number of iterations
● --jou: journal to execute (if set, --iter and -i are not used)
● -n: number of nodes
● -m: (optional) max number of cores. Useful if you want to make a run with 4 cores on
a computer with 16 cores
● -w: (optional) wait end of the job
● -d: (optional) download the result files at the end into the provided folder.
● -f: (optional) filter the files sent to VMs for the solve. By default, all the files of the
current folder are sent. Filter accepts wildcard and more than one can be added
separated by ; :
-f *.dat;*.txt

Example:
> AnsysCloudCLI.exe runAedt -j AedtCLI -r westeurope -i
viawizard.aedtz -p "D2v2 182" -v 182 -n 1 -f viawizard.aedtz -w -d
output

JobInfo
> AnsysCloudCLI.exe jobInfo [-j <job name> | -i <job id>]

● -j: job name


● -i: job id

If more than one job have this job name, only the list of the job will be printed with their ids.
In this case, you need to issue a new command with the id of the job to display more info.

GetOutputs
> AnsysCloudCLI.exe getOutputs [-j <job name> | -i <job id>] [-f
<filter>]

● -j: job name


● -i: job id
● -f: (optional) filter the files sent to VMs for the solve. By default, all the files of the
current folder are sent. Filter accepts wildcard and more than one can be added
separated by ; :
-f *.dat;*.txt

Retrieve the outputs of the referenced job.

JobState
> AnsysCloudCLI.exe jobState [-j <job name> | -i <job id>]

● -j: job name


● -i: job id

Retrieve the state of the job (Complete, Running…).

deleteJob
> AnsysCloudCLI.exe deleteJob [-j <job name> | -i <job id>]

● -j: job name


● -i: job id

Delete a job.

Monitor
> AnsysCloudCLI.exe monitor [-j <job name> | -i <job id>] [-t
<task name>] [-l <last line count>] [-n <number of lines>] [-p
<last position>]

● -j: job name


● -i: job id
● -t: task name, optional. Task names: WorkflowEventOrState, Debug, Analytics... If
the option is not selected, the default value retrieved is main (Transcript output).
● -l: last line count, optional. Retrieves the N last lines. If the option is not selected the
full outputs will be retrieve
● -n: number of lines to retrieve
● -p: last position in the thread

Retrieve the differents monitors available on the Portal.

Example:

Retrieve all the main output for job JobCLI:


> AnsysCloudCLI.exe monitor -j JobCLI

Retrieve the 10 last lines for the WorkflowState output for job JobCLI:
> AnsysCloudCLI.exe monitor -j JobCLI -t WorkflowEventOrState -l
10

Retrieve the 20 next lines from top:


> AnsysCloudCLI.exe monitor -j JobCLI -n 20 -p 0

Retrieve the 20 next lines from last position:


> AnsysCloudCLI.exe monitor -j JobCLI -n 20 -p 368
Last position in printed at the end of the previous command output. Position is dependent on
the background storage. Don’t assume that it’s the message number or line number…

Interrupt
> AnsysCloudCLI interrupt -i <job id> [--hard]
● -i : job id
● --hard: hard interrupt (no data saved), optionnal

Share Job
> AnsysCloudCLI sharejob [-j <job name> | -i <job id>] [-e email]
● -j | --job <name> : Job name
● -i | --id <jobId> : Job Id
● -e | --email <email>: Email to share with.

S-ar putea să vă placă și