|
[Sponsors] |
May 24, 2017, 08:21 |
parallel_computation.py not working
|
#1 |
New Member
Osman Mirza Demircan
Join Date: May 2017
Location: Ankara, Türkiye
Posts: 29
Rep Power: 9 |
Everytime I try to run a parallel simulation using "/usr/local/bin/parallel_computation.py" I get the following error:
Traceback (most recent call last): File "/usr/local/bin/parallel_computation.py", line 112, in <module> main() File "/usr/local/bin/parallel_computation.py", line 63, in main options.compute ) File "/usr/local/bin/parallel_computation.py", line 90, in parallel_computation info = SU2.run.CFD(config) File "/usr/local/bin/SU2/run/interface.py", line 89, in CFD auto_diff = konfig.MATH_PROBLEM == 'DISCRETE_ADJOINT' File "/usr/local/bin/SU2/io/config.py", line 130, in __getattr__ raise AttributeError , 'Config parameter not found' AttributeError: Config parameter not found I call the script as following on the terminal window: python /usr/local/bin/parallel_computation.py -f filename.cfg -n 4 I wonder what am I doing wrong here? I also tried sudo python /usr/local/bin/parallel_computation.py -f filename.cfg -n 4 but this time get: Traceback (most recent call last): File "/usr/local/bin/parallel_computation.py", line 36, in <module> sys.path.append(os.environ['SU2_RUN']) File "/usr/lib/python2.7/UserDict.py", line 40, in __getitem__ raise KeyError(key) KeyError: 'SU2_RUN' |
|
May 25, 2017, 23:23 |
|
#2 | |
New Member
WANG,Hao
Join Date: Sep 2016
Location: Xi'an China
Posts: 19
Rep Power: 10 |
Quote:
Please change your MATH_PROBLEM as "DIRECT", I guess you are using DISCRETE_ADJOINT. Command: python /usr/local/bin/parallel_computation.py -f filename.cfg -n 4 |
||
May 26, 2017, 10:25 |
|
#3 |
New Member
Osman Mirza Demircan
Join Date: May 2017
Location: Ankara, Türkiye
Posts: 29
Rep Power: 9 |
Actually I am using "DIRECT". However, I have realized that I haven't enabled the python wrapper when I installed SU2. I am now trying to install the prerequisites swig and mpi4py.
Edit: I have successfully installed swig but mpi4py caused problems. The instructions on SU2 wiki aren't working anymore. Instead, I have downloaded mpi4py from github and installed it. I got the script working now. BUT, another problem is that parallel_computation only creates the first flow_00000.vtk file for an unsteady simulation, not even the last one. I need all of them in order to get the temporal statistics, is there a line that I should add in my config file before executing the script or there is another way of getting all the flow files? Another question is how to restart an unsteady case, it asks me for a turbulent restart file. Last edited by omdemircan; May 28, 2017 at 10:45. |
|
May 30, 2017, 21:44 |
|
#4 | |
New Member
Join Date: May 2017
Posts: 5
Rep Power: 9 |
Quote:
hello! Im new for SU2, and since your keyerror turned to be 'SU2_RUN', I guess you may not add SU2_RUN to your path. good luck! |
||
June 13, 2017, 01:02 |
|
#5 | |
New Member
jit
Join Date: Jun 2015
Location: bangalore
Posts: 25
Rep Power: 11 |
Quote:
I too have faced the problem. I didn`t get any solution files flow_0000.vtk. It generates only restart files. i am trying to run fsi problem. In local machine it generates all files at required intervals of time. But on cluster it is not writing any solution files for unsteady and fsi cases. Any help would be greatly appreciated/ |
||
June 13, 2017, 04:16 |
|
#6 |
New Member
Osman Mirza Demircan
Join Date: May 2017
Location: Ankara, Türkiye
Posts: 29
Rep Power: 9 |
Hi jitendraseregar, I couldn't solve the problem directly. However, I have written a python script which calls SU2_SOL for each of the restart files. This is the only way I could get all of the flow files in a quick way. Note that you have to change the simulation to unsteady in your config file for this to work.
|
|
June 13, 2017, 04:57 |
|
#7 |
New Member
jit
Join Date: Jun 2015
Location: bangalore
Posts: 25
Rep Power: 11 |
I am solving unsteady flow (DUAL_TIME_STEPPING _2ND_ORDER). Is it possible to share python script of yours?. It would be of great help.
|
|
June 13, 2017, 08:41 |
|
#8 |
New Member
Osman Mirza Demircan
Join Date: May 2017
Location: Ankara, Türkiye
Posts: 29
Rep Power: 9 |
Here you go:
#!/usr/bin/python import fileinput import sys import os ni = 0 nf = 10000 dn = 1000 for line in fileinput.input(inplace=True): if line.startswith('UNSTEADY_SIMULATION'): print('UNSTEADY_SIMULATION= NO') else: sys.stdout.write(line) for n in range(ni, nf+1, dn): for line in fileinput.input(inplace=True): if line.startswith('SOLUTION_FLOW_FILENAME'): print('SOLUTION_FLOW_FILENAME= restart_flow_%05d.dat' % n) elif line.startswith('SURFACE_FLOW_FILENAME'): print('SURFACE_FLOW_FILENAME= surface_flow_%05d' % n) else: sys.stdout.write(line) os.system('SU2_SOL config_SOL.cfg') os.system('mv flow.vtk flow_%05d.vtk' % n) You may run this by saving it as <script.py> and calling it with your config file using following command on your terminal: python script.py config_SOL.cfg Basically, it will edit your config file and run SU2_SOL for each iteration. This is the first script I wrote in python but it works for me, I hope it can be of some use to you as well. |
|
June 14, 2017, 08:37 |
|
#9 |
New Member
jit
Join Date: Jun 2015
Location: bangalore
Posts: 25
Rep Power: 11 |
Thanks a lot.
|
|
April 2, 2018, 06:50 |
How to add SU2_RUN to path?
|
#10 |
New Member
lee
Join Date: Mar 2018
Posts: 4
Rep Power: 8 |
||
April 3, 2018, 06:13 |
|
#11 | |
New Member
lee
Join Date: Mar 2018
Posts: 4
Rep Power: 8 |
Quote:
|
||
April 3, 2018, 08:27 |
|
#12 |
New Member
Osman Mirza Demircan
Join Date: May 2017
Location: Ankara, Türkiye
Posts: 29
Rep Power: 9 |
Regarding the use of the python script provided by SU2, the problem that I had encountered was due to my installation. I probably didn't install the py wrapper correctly since, after I reinstalled the code, I didn't encounter the same errors. The script ran correctly.
__________________
Osman Mirza Demircan |
|
Tags |
parallel, parallel computation, python, su2 |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Is the subsetMotionSolver working in parallel? | Arnoldinho | OpenFOAM Running, Solving & CFD | 7 | April 27, 2016 05:38 |
OpenFoam 1.7.1 in Ubuntu 10.04 won't start working | Leech | OpenFOAM Installation | 8 | August 10, 2014 21:42 |
DPM parallel is not working but serial is working | johnwinter | FLUENT | 1 | March 27, 2012 03:01 |
viewing cfx post while working on cfx solver manager | HMR | CFX | 5 | March 9, 2011 23:33 |
Error: Unable to retrieve mon from working directo | Atit Koonsrisuk | CFX | 6 | February 20, 2004 06:07 |