CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   SU2 (https://www.cfd-online.com/Forums/su2/)
-   -   SU2 Parallel Computation problem (https://www.cfd-online.com/Forums/su2/119501-su2-parallel-computation-problem.html)

Gramanzini June 18, 2013 16:52

SU2 Parallel Computation problem
 
I am trying to get the parallel computation working for Windows 7, I and using a Structured grid to model an RAE 2822 airfoil, that works with the SU2 serial. When I try to use the parallel processing it gives me a Keyerror, I am not familiar with python, my command prompt show the following:

C:\ Program Files (x86)\Standford ADL\SU2\trunk\bin\windows\64-bit\Parallel> python parallel_computation.py -f turb_RAE.cfg -p 3

file "parallel_computation.py" line 27, in <module>
SU2_RUN = os.environ['SU2_RUN']
file "C:\Program Files (x86)\Standford ADL\SU2\trunk\bin\windows\64-bit\Parallel\os.py",line 423, in_getitem_ return self.data[key.upper()]
KeyError: 'SU2_RUN'

Any help would be greatly appreciated.

mcolonno June 28, 2013 20:21

Please note that the Python scripts are not yet fully supported in Windows. You need to define the SU2_RUN environment variable in Windows for the parallel_computation.py script to work.

JMvanDijk September 27, 2018 15:52

SU2 windows 10 parallel computing
 
I am afraid that I won't be helping the TS anymore, since this thread is quite old. However I hope I can help some other SU2 users with the same problem. I downloaded 6.0.0 "Falcon" for windows from the download page of the SU2 website. I assume here that the reader managed to use sequential computing in windows CMD.

- Set python.exe as your standard program for ‘.py’ files (just press right mouse button on a ‘.py’ file and select open with -> choose another app -> make sure ‘always use this app for .py files’ is checked -> click python.exe -> click ok). If the program is not installed on you computer: download it from python.com and get+install the latest python 3 release. Let python add itself to your windows environment path (if it asks you to disable the maximum length for paths, please click yes).

- In my version there was an error in SU2/run/interface.py. At line 237, you should change {the_Command = 'SU2_SOL ' + tempname} to {the_Command = 'SU2_SOL%s %s' % (quote, tempname)} (both without the curly brackets).

- Open cmd and make the location where your simulation file is the current directory (cd).

- Then try to run your cfg-file in cmd by entering: ‘parallel_computation.py -f YOURSIMULATION.cfg -n 4’ if you have a 4-core computer (change the 4 if yours is different).

- The first time it probably gives one or more errors on missing modules. Numpy was missing in my case, so I entered ‘pip3 install numpy’ in cmd (doesn’t matter at which directory you are). If other modules are missing, some google searches will help you installing them.

- Make sure you are in your cfg-file's directory again and enter ‘parallel_computation.py -f YOURSIMULATION.cfg -n 4’ again.


Edit:
You can even make it yourself more comfortable by saving a file called SU2_PAR.bat in the same directory as for example SU2_CFD, with the following code in it: parallel_computation.py -f %~f1 -n 4
(again the four can be changed for a different number of cores). In this way you can just call any cfg file like you did with SU2_CFD, but now for the parallel version with SU2_PAR YOURSIMULATION.cfg, in the cmd-window.

lejonetfrannorden September 27, 2018 22:19

Quote:

Originally Posted by JMvanDijk (Post 707973)
I am afraid that I won't be helping the TS anymore, since this thread is quite old. However I hope I can help some other SU2 users with the same problem. I downloaded 6.0.0 "Falcon" for windows from the download page of the SU2 website. I assume here that the reader managed to use sequential computing in windows CMD.

- Set python.exe as your standard program for ‘.py’ files (just press right mouse button on a ‘.py’ file and select open with -> choose another app -> make sure ‘always use this app for .py files’ is checked -> click python.exe -> click ok). If the program is not installed on you computer: download it from python.com and get+install the latest python 3 release. Let python add itself to your windows environment path (if it asks you to disable the maximum length for paths, please click yes).

- In my version there was an error in SU2/run/interface.py. At line 237, you should change {the_Command = 'SU2_SOL ' + tempname} to {the_Command = 'SU2_SOL%s %s' % (quote, tempname)} (both without the curly brackets).

- Open cmd and make the location where your simulation file is the current directory (cd).

- Then try to run your cfg-file in cmd by entering: ‘parallel_computation.py -f YOURSIMULATION.cfg -n 4’ if you have a 4-core computer (change the 4 if yours is different).

- The first time it probably gives one or more errors on missing modules. Numpy was missing in my case, so I entered ‘pip3 install numpy’ in cmd (doesn’t matter at which directory you are). If other modules are missing, some google searches will help you installing them.

- Make sure you are in your cfg-file's directory again and enter ‘parallel_computation.py -f YOURSIMULATION.cfg -n 4’ again.

Hello,

Thanks for sharing this! How did you exactly compile the parallel version in Windows? When I try the steps you have provided I get n number of separate serial jobs.

JMvanDijk September 28, 2018 08:19

Quote:

Originally Posted by lejonetfrannorden (Post 707996)
Hello,

Thanks for sharing this! How did you exactly compile the parallel version in Windows? When I try the steps you have provided I get n number of separate serial jobs.

I do not recognize your situation, but let me explain how I run my simulations now (after the initalization of my previous post).

The only thing I now have to do to start a parallel computation is entering 'parallel_computation.py -f YOURSIMULATION.cfg -n 4' without the quotes in cmd. So when I want to run the quick start of SU2 (https://su2code.github.io/docs/Quick-Start/) in parallel, I do (so you should change the file directories to yours):
  • Start cmd.exe
  • Enter the directory of my .cfg file: cd C:\Program1\SU2\Quickstart\ in the cmd terminal.
  • then I enter parallel_computation.py -f Inv_NACA0012.cfg -n 4 in the cmd terminal.
  • Now it runs the whole simulation for me on 4 cores (the simulation time is reduced with almost a factor of 4 as expected), showing every iteration.
I cannot drop the file on top of the python file to run it, neither did I manage to do it in any other way, but this works for me. Please make sure that your windows path is (still) directing to the folder where SU2_CFD, SU2_SOL and parallel_computation.py are located.

hlk September 29, 2018 13:32

Thanks for your interest in SU2.


What you describe is a common symptom of the parallel installation not succeeding in finding all the needed mpi libraries etc. Some of the things you can do to troubleshoot this are:
- remove or rename previous installations to ensure that you aren't accidentally calling them
- read through the config.log and look for any points where it was not able to find the mpi compilers (for example, mpicxx and mpicc) or any other errors



For reference (both for you and others who find this post), the parallel build directions are now here:
https://su2code.github.io/docs/Parallel-Build/



Quote:

Originally Posted by lejonetfrannorden (Post 707996)
Hello,

Thanks for sharing this! How did you exactly compile the parallel version in Windows? When I try the steps you have provided I get n number of separate serial jobs.



All times are GMT -4. The time now is 03:33.