How to run the command in compiler instead of cmd.exe?

Dear All and @damarginal ,

I hope you are well and safe.

I am currently preparing a model in UQLink to do an uncertainty quantification. The third-party software that I am using is Abaqus 2020. I used the same Abaqus truss example in the UQLink manual but with a different material definition that uses user-subroutine and a python script to test the usage of the Python script as a template file.
But as the Python script that uses subroutine file must only run in “Compiler 19.1 Update 2 for Intel 64 Visual Studio 2019 environment” instead of cmd.exe and I can’t change it to compiler due to the .p Matlab files in UQLab, I should open the compiler in cmd first and then execute a command to run the Python script.
However, this can be done only when I run it in two commands separately, the first one is to open the compiler shell by:

“C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Intel Parallel Studio XE 2020\Compiler and Performance Libraries\Command Prompt with Intel Compiler 19.1 Update 2/Compiler 19.1 Update 2 for Intel 64 Visual Studio 2019 environment.lnk”

and wait a few seconds, and then I can run the python script by:

abaqus cae noGUI=TenBarTruss.py
Accordingly, I wrote the following command in my Uqlink model in “uq_Example_UQLink_02_Abaqus_TenBarTruss.m” file:

ModelOpts.Command = ‘“C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Intel Parallel Studio XE 2020\Compiler and Performance Libraries\Command Prompt with Intel Compiler 19.1 Update 2/Compiler 19.1 Update 2 for Intel 64 Visual Studio 2019 environment.lnk” && abaqus cae noGUI=TenBarTruss.py’;

But the above command only opens the compiler and does not execute the python script as the second command. I tried single “&” between two commands and didn’t work. I also tried to write the second command (abaqus cae noGUI=TenBarTruss.py) in the batch file of the compiler, but this also didn’t work, because the name of the python script updating in each run.

My main problem is that I have no access to the UQLink codes because of their extension (.p files), so I don’t know the order that UQLink runs the commands.

I appreciate any comments and permission you can give me.

Best regards,

Mojtaba Abdolkhani

HI @Mojtaba_Abdolkhani ,

Thanks for your detailed question. I am not sure why he && or & commands do not work. However you can definitely access the source codes for UQLink. The .p files are only for the core functions of UQLab. All the functions in the (scientific) modules, which are the only ones you actually need, are accessible.

You will find all the files related to UQLink in the following folder of your UQLab installation:

\modules\uq_model\builtin\uq_uqlink

When you run the command uq_createModel(myUQLinkOptions), the access point to this folder is through uq_initialize_uq_uqlink.m., where initialization is carried out.
Most importantly for you is the file uq_eval_uq_wrapper.m in the folder mentioned above. This is where the input file is parsed and the executable command created. This is specifically done in the lines 304-410. This created command is then run on line 412. Please have a look at these lines and may be you will figure out why the & doesn’t work in your case or eventually directly modify the source codes to fit to your use-case.

Let me know if this works for you.

Cheers,
Moustapha

Thank you very much, Dr. @moustapha
I solved this problem, but I added new question regarding multiple executions instead of one by one in this forum.
I appreciate any comment.