General Mechanical

General Mechanical

Topics related to Mechanical Enterprise, Motion, Additive Print and more.

How to change the job file-name of files generated by Mechanical input file ran in APDL

    • Koen_Franse
      Subscriber

      Hi,

      I am running a simple structural problem in Ansys APDL, this is done in batch mode and the command is given in Matlab. I created the setup in Ansys Mechanical, and saved an input file which I am running in Matlab with:


      dos( "C:Program FilesANSYS Incv195ansysinwinx64ANSYS195.exe" -b -i "inputfilename.inp" -o "outputfilename.out" -np 1 )


      I want to perform an optimization process in Matlab on this simulation (using fmincon). Currently I've got this working correctly in serial mode. However, to speed up the optimization process, I want to perform this in parallel. The Matlab fmincon optimization solver is able to do this, and I already made sure that temporary input files are created for each evaluation (to prevent overwriting in parallel). However, somehow calling Ansys from Matlab in parallel mode does not work correctly. I get the error:


       *** ERROR *** Another ANSYS job with the same job name (file) is already running in this directory or the file.lock file has not been deleted from an abnormally terminated ANSYS run. To disable this check, set the ANSYS_LOCK environment variable to OFF.


      I suspect that the problem is that there is a set of automatically-generated job files in my working directory, all named 'file.*' (including file.lock, see image below). In parallel these job files are used by multiple processes, which is not allowed.

    • Aniket
      Forum Moderator
      can you use a unique folder for each run (assuming you have licenses available for parallel runs)?n-AniketnHow to access Ansys help linksnGuidelines for Posting on Ansys Learning Forumn
    • Koen_Franse
      Subscriber
      Hi Aniket,nI've got to the point now that every run gets its own jobfiles with a unique name, by using ' /filnam,jobname,1' in my input file. These files are also in a unique folder. While Ansys still creates a 'file.lock' in the working directory for every run, I managed to work around this by using:nndos( 'SET ANSYS_LOCK=OFF & C:\Program Files\ANSYS Inc\v195\ansys\bin\winx64\ANSYS195.exe -b -i inputfilename.inp -o outputfilename.out -np 1')nnHowever, now I get the following message in the .out-file for the first simulation in parallel:nn *** FATAL ***nAttempt to run ANSYS in a distributed mode failed.  Distributed ANSYS was unable to write into the working directory ( C:\Users\s134134\working_directory ) for process with MPI Rank ID =  0 which is located on machine: mycomputer.campus.tue.nl. Please verify that the working directory exists on this machine and that you have write permissions for the directory.nnFurthermore I get this error message:n
Viewing 4 reply threads
  • The topic ‘How to change the job file-name of files generated by Mechanical input file ran in APDL’ is closed to new replies.