CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > SU2

parallel_computation.py not working

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 24, 2017, 08:21
Post parallel_computation.py not working
  #1
New Member
 
Osman Mirza Demircan
Join Date: May 2017
Location: Ankara, Türkiye
Posts: 29
Rep Power: 9
omdemircan is on a distinguished road
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'
omdemircan is offline   Reply With Quote

Old   May 25, 2017, 23:23
Default
  #2
New Member
 
WANG,Hao
Join Date: Sep 2016
Location: Xi'an China
Posts: 19
Rep Power: 10
Haowang is on a distinguished road
Quote:
Originally Posted by omdemircan View Post
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'
Hi there,
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
Haowang is offline   Reply With Quote

Old   May 26, 2017, 10:25
Default
  #3
New Member
 
Osman Mirza Demircan
Join Date: May 2017
Location: Ankara, Türkiye
Posts: 29
Rep Power: 9
omdemircan is on a distinguished road
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.
omdemircan is offline   Reply With Quote

Old   May 30, 2017, 21:44
Default
  #4
New Member
 
Join Date: May 2017
Posts: 5
Rep Power: 9
nuaa_bird is on a distinguished road
Quote:
Originally Posted by omdemircan View Post
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'


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!
nuaa_bird is offline   Reply With Quote

Old   June 13, 2017, 01:02
Default
  #5
New Member
 
jit
Join Date: Jun 2015
Location: bangalore
Posts: 25
Rep Power: 11
jitendraseregar@gmail.com is on a distinguished road
Quote:
Originally Posted by omdemircan View Post
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.
Hi Omdemircan,
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/
jitendraseregar@gmail.com is offline   Reply With Quote

Old   June 13, 2017, 04:16
Default
  #6
New Member
 
Osman Mirza Demircan
Join Date: May 2017
Location: Ankara, Türkiye
Posts: 29
Rep Power: 9
omdemircan is on a distinguished road
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.
omdemircan is offline   Reply With Quote

Old   June 13, 2017, 04:57
Default
  #7
New Member
 
jit
Join Date: Jun 2015
Location: bangalore
Posts: 25
Rep Power: 11
jitendraseregar@gmail.com is on a distinguished road
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.
jitendraseregar@gmail.com is offline   Reply With Quote

Old   June 13, 2017, 08:41
Default
  #8
New Member
 
Osman Mirza Demircan
Join Date: May 2017
Location: Ankara, Türkiye
Posts: 29
Rep Power: 9
omdemircan is on a distinguished road
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.
omdemircan is offline   Reply With Quote

Old   June 14, 2017, 08:37
Default
  #9
New Member
 
jit
Join Date: Jun 2015
Location: bangalore
Posts: 25
Rep Power: 11
jitendraseregar@gmail.com is on a distinguished road
Thanks a lot.
jitendraseregar@gmail.com is offline   Reply With Quote

Old   April 2, 2018, 06:50
Default How to add SU2_RUN to path?
  #10
New Member
 
lee
Join Date: Mar 2018
Posts: 4
Rep Power: 8
Duter LEE is on a distinguished road
Quote:
Originally Posted by nuaa_bird View Post
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!

How to add SU2_RUN to path?
Duter LEE is offline   Reply With Quote

Old   April 3, 2018, 06:13
Default
  #11
New Member
 
lee
Join Date: Mar 2018
Posts: 4
Rep Power: 8
Duter LEE is on a distinguished road
Quote:
Originally Posted by omdemircan View Post
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'
With regard to the parallel problem, have you solved it now? How is it solved?
Duter LEE is offline   Reply With Quote

Old   April 3, 2018, 08:27
Default
  #12
New Member
 
Osman Mirza Demircan
Join Date: May 2017
Location: Ankara, Türkiye
Posts: 29
Rep Power: 9
omdemircan is on a distinguished road
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
omdemircan is offline   Reply With Quote

Reply

Tags
parallel, parallel computation, python, su2


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 12:16.