Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Runing multiple instances of Ansys Mechanical at the same time

  1. Oct 25, 2014 #1
    Hello experts,

    Is it possible to run several instances of Ansys Mechanical in Windows or Linux in parallel? How?

    I need to dramatically speed up the solution of a large list of Ansys Mechanical jobs, typically more than 50000. Such analyses are performed by some script that runs each job in batch mode.

    First, I tried to vary the number of processors from 1 to 4 with the "-np" option but the acceleration was very small, i.e. 10-20% only. This probably is caused by the small size of my system, typical execution time per job is between 1 and 10 seconds.

    Second, as a workaround, I tried to split up the job list in two and run each part in different terminals, but unfortunately Ansys crashes.

    This was the command I used in this test under Windows, is it ok?
    #> "<MY_ANSYS_PATH>\ansys145.exe" -p ansys -dir <MY_WORK_DIRECTORY> -j [JOB_NAME] -s noread -l en-us -b nolist -np 2 -i <INPUT_FILE> -o <OUTPUT_FILE>

    Third, I also tried to run two different jobs at the same time in different terminals that used a different working directory. Unforutnately one of them crashes first (windows alerts that Ansys stopped working) while the other finishes normally later. Note that to avoid Ansys-lock-related problems I set the Ansys´ environment variable ANSYS_LOCK to OFF (Ansys manual says that by default ANSYS_LOCK is ON "to create file locks that prevent users from opening a new job with the same name and in the same directory as the current job").

    These were the new windows commands tested:

    On_Terminal_1#> "<MY_ANSYS_PATH>\ANSYS145.exe" -p ansys -dir "<WORK_DIR_A>" -j job_A -s noread -l en-us -b nolist -np 1 -m 512 -db 256 -i my_job_A.txt -o my_job_A.out

    On_Terminal_2#> "<MY_ANSYS_PATH>\ANSYS145.exe" -p ansys -dir "<WORK_DIR_B>" -j job_B -s noread -l en-us -b nolist -np 1 -m 512 -db 256 -i my_job_B.txt -o my_job_B.out

    Any suggestion? I really don´t know what to do next... Thanks!
  2. jcsd
  3. Oct 25, 2014 #2

    You can launch N runs with N licences in N different directories. Please show the content of your .err file for the third test.

    Let me know if it's usefull.
  4. Oct 25, 2014 #3
    Very useful! Now I can run several instances of Ansys Mechanical at the same time and obtain the expected speed up!!!

    Your indication highlighted the problem: both input files used the same working directory. The following ansys command overrode the "-dir" option of the input command at some point and caused the input/output error:


    Thanks a lot for your excellent help!

    PS: Here is a record of the log and error files that lead to the solution of the problem to facilitate other users to solve their problems.

    While the job_A.err file was ok, the job_B.err indicated some Input/output error:

    /COM,ANSYS RELEASE 14.5 UP20120918 21:39:14 10/25/2014
    0***** process error reported by subroutine xdslor see xdslor abstract (ier = -202)
    *** ERROR *** CP = 3.666 TIME= 21:39:21
    Input/output error on unit = 20. Please check to see if the disk is full.

    After checking that my disk is not full, I checked the output files. The first one (my_job_A.out) was OK, including the requested buckling factors. However, the second (my_job_B.out) had i/o errors after finishing static and buckling analyses. When I checked

    1) After the static analysis:

    23.500 MB WRITTEN ON ELEMENT MATRIX FILE: buckling.emat
    5.938 MB WRITTEN ON ELEMENT SAVED DATA FILE: buckling.esav
    4.875 MB WRITTEN ON ASSEMBLED MATRIX FILE: buckling.full
    5.938 MB WRITTEN ON RESULTS FILE: buckling.rst

    *** error while closing file. *** subroutine hdsan1 encountered
    i/o error on i/o file no. = 20, 25, 9, 11, 31, 32, 22
    ***** ROUTINE COMPLETED ***** CP = 3.229

    2) After the buckilng analysis:

    ********** CURRENT DISK AND DIRECTORY USAGE **********
    Directory C:<SOME_DIRECTORY_NAME>\test\ansys1

    25/10/2014 21:39 <DIR> .
    25/10/2014 21:39 <DIR> ..
    25/10/2014 21:39 2.191 buckling.BCS
    25/10/2014 21:37 9.371.648 buckling.db
    25/10/2014 21:39 24.641.536 buckling.emat
    25/10/2014 21:39 6.225.920 buckling.esav
    25/10/2014 21:39 9.502.720 buckling.full
    25/10/2014 21:39 16.515.072 buckling.LN07
    25/10/2014 21:39 0 buckling.LN09
    25/10/2014 21:39 2.359.296 buckling.LN11
    25/10/2014 21:39 0 buckling.LN20
    25/10/2014 21:39 1.286.336 buckling.LN21
    25/10/2014 21:39 0 buckling.LN22
    25/10/2014 21:39 1.856.648 buckling.LN25
    25/10/2014 21:39 1.856.648 buckling.LN28
    25/10/2014 21:39 0 buckling.LN31
    25/10/2014 21:39 0 buckling.LN32
    25/10/2014 21:39 732 buckling.mntr
    25/10/2014 21:37 2.883.584 buckling.mode
    25/10/2014 21:39 0 buckling.rst
    25/10/2014 21:39 151 buckling.stat
    25/10/2014 21:36 136 job_a.err
    25/10/2014 21:36 292 job_a.log
    21 files 76.502.910 bytes
    2 dirs 402.278.866.944 bytes free

    *** ERROR *** CP = 3.666 TIME= 21:39:21
    Input/output error on unit = 20. Please check to see if the disk is
    *** error while closing file. *** subroutine hdsan1 encountered
    i/o error on i/o file no. = 20, 21, 22, 25, 28, 7, 9, 11, 31, 32
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook