# Run simulation from cmd

**URL:** <https://prepomax.discourse.group/t/run-simulation-from-cmd/2004>\
**Category:** General Questions\
**Created:** [September 12, 2024, 4:03pm UTC](https://prepomax.discourse.group/t/run-simulation-from-cmd/2004 "2024-09-12T16:03:41Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ainurritegui](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@ainurritegui](https://prepomax.discourse.group/u/ainurritegui)\
**Post date:** [September 12, 2024, 4:03pm UTC](https://prepomax.discourse.group/t/run-simulation-from-cmd/2004/1 "2024-09-12T16:03:41Z")

</div>

I am generating a PrePomax compatible .inp file and would like to run it without importing the file in PrePoMax and clicking in the file to run it.  
Is this possible to do?

I read apost which I think are related to what I am asking, but I am a bit new with this program and not sure if they are talking about the same thing ([Launch Calculix solver from PrePoMax?](https://prepomax.discourse.group/t/launch-calculix-solver-from-prepomax/967))

Thank you very much!

---

<div class="post-metadata">

**Author:** ![FEAnalyst](https://yyz2.discourse-cdn.com/free1/user_avatar/prepomax.discourse.group/feanalyst/32/688_2.png) [@FEAnalyst](https://prepomax.discourse.group/u/FEAnalyst)\
**Post date:** [September 12, 2024, 4:32pm UTC](https://prepomax.discourse.group/t/run-simulation-from-cmd/2004/2 "2024-09-12T16:32:27Z")

</div>

If you only want to prepare a simulation in PrePoMax, export it and run from the input file using CalculiX solver outside of PrePoMax (after completion you can import the results to PrePoMax or another postprocessor) then the thread linked in your post is for you.

However, if you want to automate PrePoMax usage from the command line, there is a new functionality for that: [A new developer/preview PrePoMax version v2.1.7 has been released - #3 by Matej](https://prepomax.discourse.group/t/a-new-developer-preview-prepomax-version-v2-1-7-has-been-released/1974/3)

---

<div class="post-metadata">

**Author:** ![Matej](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@Matej](https://prepomax.discourse.group/u/Matej)\
**Post date:** [September 13, 2024, 5:42am UTC](https://prepomax.discourse.group/t/run-simulation-from-cmd/2004/3 "2024-09-13T05:42:33Z")

</div>

> [@ainurritegui](#):
>
> I am generating a PrePomax compatible .inp file and would like to run it without importing the file in PrePoMax and clicking in the file to run it.  
> Is this possible to do?

Yes, use the command prompt to navigate to your .inp file, then call CalculiX with its full path (if you are using PrePoMax it can be found in Tools → Settings → CalculiX → Executable) and add the name of the .inp file without extension as an argument:

> c:\Temp\>c:\PrePoMax\Solver\ccx\_dynamic.exe fileName

---

<div class="post-metadata">

**Author:** ![ainurritegui](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@ainurritegui](https://prepomax.discourse.group/u/ainurritegui)\
**Post date:** [September 13, 2024, 6:51am UTC](https://prepomax.discourse.group/t/run-simulation-from-cmd/2004/4 "2024-09-13T06:51:39Z")

</div>

Good morning,  
I tried running one .inp file that I generated from a tutorial I made and cannot it make it work from the cmd.  
Should I put the .inp file in the same folder as the .exe file of calculix solver? should I add or modify any varables of the system?

 ![image](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/5/589d4cd2d64bb756a64491d823c788c9672c5fe6.png)  
Than you very much!

---

<div class="post-metadata">

**Author:** ![FEAnalyst](https://yyz2.discourse-cdn.com/free1/user_avatar/prepomax.discourse.group/feanalyst/32/688_2.png) [@FEAnalyst](https://prepomax.discourse.group/u/FEAnalyst)\
**Post date:** [September 13, 2024, 7:07am UTC](https://prepomax.discourse.group/t/run-simulation-from-cmd/2004/5 "2024-09-13T07:07:55Z")

</div>

> [@ainurritegui](#):
>
> Should I put the .inp file in the same folder as the .exe file of calculix solver? should I add or modify any varables of the system?

This is explained here: [Using standalone CalculiX](https://prepomax.discourse.group/t/using-standalone-calculix/846)

You can either put the solver binary in the same folder as the input file or set the PATH environment variable so that it’s not necessary to have those files in the same folder.

---

<div class="post-metadata">

**Author:** ![Matej](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@Matej](https://prepomax.discourse.group/u/Matej)\
**Post date:** [September 13, 2024, 7:24am UTC](https://prepomax.discourse.group/t/run-simulation-from-cmd/2004/6 "2024-09-13T07:24:49Z")

</div>

You have to use the file name without the extension! (.inp)

You do not have to put both files in the same folder. As I explained:

> [@Matej](#):
>
> Yes, use the command prompt to navigate to your .inp file, then call CalculiX with its full path

you can use the full path to call CalculiX in any folder.

---

<div class="post-metadata">

**Author:** ![ainurritegui](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@ainurritegui](https://prepomax.discourse.group/u/ainurritegui)\
**Post date:** [September 13, 2024, 1:50pm UTC](https://prepomax.discourse.group/t/run-simulation-from-cmd/2004/7 "2024-09-13T13:50:19Z")

</div>

DId not completely understood all you told me, but I reached to make it work with this command in cmd: `ccx_dynamic prueba\Analysis-42_gears_Aurea`  
I runned this inside the location of the calculix solver and put my inputs in a folder named “prueba” to test.

 ![image](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/2/2e1ad9460c621331499e3b7a75450b3b7eddba2e.png)

It worked, so I will work this way! I prefer not to change path or variables in the computer.  
To determine the number of CPUs, I read you have to write this in cmd, but not sure I make it work properly.  
Should I run it in the same way??

> [@Using standalone CalculiX](https://prepomax.discourse.group/t/using-standalone-calculix/846/1):
>
> setx OMP\_NUM\_THREADS “number\_of\_your\_cpus”

---

<div class="post-metadata">

**Author:** ![FEAnalyst](https://yyz2.discourse-cdn.com/free1/user_avatar/prepomax.discourse.group/feanalyst/32/688_2.png) [@FEAnalyst](https://prepomax.discourse.group/u/FEAnalyst)\
**Post date:** [September 13, 2024, 3:12pm UTC](https://prepomax.discourse.group/t/run-simulation-from-cmd/2004/8 "2024-09-13T15:12:01Z")

</div>

> [@Using standalone CalculiX](https://prepomax.discourse.group/t/using-standalone-calculix/846/1):
>
> Should I run it in the same way??
> 
> > [@Using standalone CalculiX](https://prepomax.discourse.group/t/using-standalone-calculix/846/1):
> >
> > setx OMP\_NUM\_THREADS “number\_of\_your\_cpus”

The _setx_ command just sets this environment variable needed for parallel computations with CalculiX. You could use the _set_ command instead to set it temporarily.

---

<div class="post-metadata">

**Author:** ![ainurritegui](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@ainurritegui](https://prepomax.discourse.group/u/ainurritegui)\
**Post date:** [September 13, 2024, 4:03pm UTC](https://prepomax.discourse.group/t/run-simulation-from-cmd/2004/9 "2024-09-13T16:03:00Z")

</div>

I think I am doing something wrong. If I only use `set` command nothing works.  
This way it seems something is done:

 ![image](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/0/0dbbba10bb3ec431fb7dca4516b42714757a0fc0.png)e  
However, when the calculus is working, `Using up to 1 cpu(s) for the stress calculation.` so I think it is not working right?

---

<div class="post-metadata">

**Author:** ![FEAnalyst](https://yyz2.discourse-cdn.com/free1/user_avatar/prepomax.discourse.group/feanalyst/32/688_2.png) [@FEAnalyst](https://prepomax.discourse.group/u/FEAnalyst)\
**Post date:** [September 13, 2024, 4:08pm UTC](https://prepomax.discourse.group/t/run-simulation-from-cmd/2004/10 "2024-09-13T16:08:46Z")

</div>

You may have to reopen the command line to have it available after _setx_. You can also use the _echo_ command mentioned in that other forum thread or check in environment variables editor to see if it’s saved.
