TAGGED: input-file, matlab, mechanical-apdl, species-transport-model
-
-
August 18, 2020 at 2:41 pm
Koen_Franse
SubscriberHi,
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.
August 19, 2020 at 11:45 amAniket
Forum Moderatorcan 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 ForumnAugust 19, 2020 at 3:07 pmKoen_Franse
SubscriberHi 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:nViewing 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.
Ansys Innovation SpaceTrending discussionsTop Contributors-
3572
-
1188
-
1076
-
1063
-
952
Top Rated Tags© 2025 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.
-
Please Login to Report Topic
Please Login to Share Feed
Edit Discussion

Ansys Assistant

Welcome to Ansys Assistant!
An AI-based virtual assistant for active Ansys Academic Customers. Please login using your university issued email address.
Ansys Commercial Customers: Go to AnsysGPT
Your chat history is not stored
Hey there, you are quite inquisitive! You have hit your hourly question limit. Please retry after '10' minutes. For questions, please reach out to ansyslearn@ansys.com.
RETRY