Re: 答复: [pyfrmailinglist] Problem about artificial viscosity

2016-10-13 Thread Zeronaire
Hi!

After adding the cflags, OSError changed from 
this
OSError: /tmp/pyfr-8-h9fm36dc/libtmp.so: undefined symbol: _ZGVcN8v_sinf
to
OSError: /tmp/pyfr-2-8wfed_td/libtmp.so: undefined symbol: 
_ZGVcN8v___logf_finite

Then I tried g++ and gfortran and the gfortran compiler worked!

Thanks anyways!

在 2016年10月13日星期四 UTC+8下午9:59:58,Freddie Witherden写道:
>
> Hi, 
>
> On 13/10/2016 06:31, 個什伯 wrote: 
> > ‎Compiler is gcc and version is 6.1.1 
>
> For some compilers it is necessary to add: 
>
> [backend-openmp] 
> cflags = -lmvec 
>
> to your .ini file. 
>
> Regards, Freddie. 
>
>

-- 
You received this message because you are subscribed to the Google Groups "PyFR 
Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyfrmailinglist+unsubscr...@googlegroups.com.
To post to this group, send an email to pyfrmailinglist@googlegroups.com.
Visit this group at https://groups.google.com/group/pyfrmailinglist.
For more options, visit https://groups.google.com/d/optout.


Re: 答复: [pyfrmailinglist] Problem about artificial viscosity

2016-10-13 Thread Freddie Witherden
Hi,

On 13/10/2016 06:31, 個什伯 wrote:
> ‎Compiler is gcc and version is 6.1.1

For some compilers it is necessary to add:

[backend-openmp]
cflags = -lmvec

to your .ini file.

Regards, Freddie.

-- 
You received this message because you are subscribed to the Google Groups "PyFR 
Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyfrmailinglist+unsubscr...@googlegroups.com.
To post to this group, send an email to pyfrmailinglist@googlegroups.com.
Visit this group at https://groups.google.com/group/pyfrmailinglist.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: OpenPGP digital signature


答复: [pyfrmailinglist] Problem about artificial viscosity

2016-10-13 Thread 個什伯
  ‎Compiler is gcc and version is 6.1.1发件人: Vincent, Peter E已发送: 2016年10月13日星期四 21:02收件人: Zeronaire抄送: PyFR Mailing List主题: Re: [pyfrmailinglist] Problem about artificial viscosity




What compiler are you using?


Cheers


Peter




















Dr Peter Vincent MSci ARCS DIC PhD
Reader in Aeronautics and EPSRC Fellow
Department of Aeronautics
Imperial College London
South Kensington
London
SW7 2AZ


email: p.vinc...@imperial.ac.uk
web: 
www.imperial.ac.uk/aeronautics/research/vincentlab/
twitter: @Vincent_Lab














On 13 Oct 2016, at 10:23, Zeronaire <leecx...@gmail.com> wrote:


Hi guys!


I am running the latest version PyFR v1.5.0 for supersonic cases.


Backend is OpenMP. When adding artificial viscosity in config,



[solver]
system = navier-stokes
order = 3
;anti-alias = flux
viscosity-correction = none
shock-capturing = artificial-viscosity


[solver-artificial-viscosity]
max-artvisc = 0.01
s0 = 0.01
kappa = 5.0



it returns error like this:




Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/pyfr-1.5.0-py3.5.egg/pyfr/util.py", line 32, in __call__
KeyError: (, b'\x80\x03X\x0b\x00\x00\x00shocksensorq\x00X\x818\x00\x00\n\n#include \n#include \n#include \n\n#define
 PYFR_ALIGN_BYTES 64\n#define SOA_SZ 16\n\n#define min(a, b) ((a) < (b) ? (a) : (b))\n#define max(a, b) ((a) > (b) ? (a) : (b))\n\n// Typedefs\ntypedef float fpdtype_t;\n\n// OpenMP static loop scheduling functions\n\nstatic inline int\ngcd(int a, int b)\n{\n
    return (a == 0) ? b : gcd(b % a, a);\n}\n\nstatic inline void\nloop_sched_1d(int n, int align, int *b, int *e)\n{\n    int tid = omp_get_thread_num();\n    int nth = omp_get_num_threads();\n\n    // Round up n to be a multiple of nth\n    int rn = n + nth
 - 1 - (n - 1) % nth;\n\n    // Nominal tile size\n    int sz = rn / nth;\n\n    // Handle alignment\n    sz += align - 1 - (sz - 1) % align;\n\n    // Assign the starting and ending index\n    *b = sz * tid;\n    *e = min(*b + sz, n);\n\n    // Clamp\n    if
 (*b >= n)\n        *b = *e = 0;\n}\n\nstatic inline void\nloop_sched_2d(int nrow, int ncol, int colalign,\n              int *rowb, int *rowe, int *colb, int *cole)\n{\n    int tid = omp_get_thread_num();\n    int nth = omp_get_num_threads();\n\n    // Distribute
 threads\n    int nrowth = gcd(nrow, nth);\n    int ncolth = nth / nrowth;\n\n    // Row and column indices for our thread\n    int rowix = tid / ncolth;\n    int colix = tid % ncolth;\n\n    // Round up ncol to be a multiple of ncolth\n    int rncol = ncol
 + ncolth - 1 - (ncol - 1) % ncolth;\n\n    // Nominal tile size\n    int ntilerow = nrow / nrowth;\n    int ntilecol = rncol / ncolth;\n\n    // Handle column alignment\n    ntilecol += colalign - 1 - (ntilecol - 1) % colalign;\n\n    // Assign the starting
 and ending row to each thread\n    *rowb = ntilerow * rowix;\n    *rowe = *rowb + ntilerow;\n\n    // Assign the starting and ending column to each thread\n    *colb = ntilecol * colix;\n    *cole = min(*colb + ntilecol, ncol);\n\n    // Clamp\n    if (*colb
 >= ncol)\n        *colb = *cole = 0;\n}\n\n\n\n\n\n\n\nvoid shocksensor(int _nx, fpdtype_t* __restrict__ artvisc_v, const fpdtype_t* __restrict__ u_v, int ldu)\n               {\n                   #define X_IDX (_xi + _xj)\n                   #define X_IDX_AOSOA(v,
 nv)                       ((_xi/SOA_SZ*(nv) + (v))*SOA_SZ + _xj)\n                   int align = PYFR_ALIGN_BYTES / sizeof(fpdtype_t);\n                   #pragma omp parallel\n                   {\n                       \n                    int cb, ce;\n
                    loop_sched_1d(_nx, align, &cb, &ce);\n                    int nci = ((ce - cb) / SOA_SZ)*SOA_SZ;\n                    for (int _xi = cb; _xi < cb + nci; _xi += SOA_SZ)\n                    {\n                        #pragma omp simd\n  
                      for (int _xj = 0; _xj < SOA_SZ; _xj++)\n                        {\n                            \n    // Smoothness indicator\n    fpdtype_t totEn = 0.0f, pnEn = 1e-15f, tmp;\n\n    tmp = 0.28502482785773026f*u_v[ldu*0 + X_IDX_AOSOA(0,
 4)] + 0.05933405549618086f*u_v[ldu*1 + X_IDX_AOSOA(0, 4)] + 0.05933405549618086f*u_v[ldu*2 + X_IDX_AOSOA(0, 4)] + 0.05933405549618086f*u_v[ldu*3 + X_IDX_AOSOA(0, 4)] + 0.15853109467113707f*u_v[ldu*4 + X_IDX_AOSOA(0, 4)] + 0.15853109467113707f*u_v[ldu*5 + X_IDX_AOSOA(0,
 4)] + 0.15853109467113707f*u_v[ldu*6 + X_IDX_AOSOA(0, 4)] + 0.15853109467113707f*u_v[ldu*7 + X_IDX_AOSOA(0, 4)] + 0.15853109467113707f*u_v[ldu*8 + X_IDX_AOSOA(0, 4)] + 0.15853109467113707f*u_v[ldu*9 + X_IDX_AOSOA(0, 4)];\n\n    totEn +

Re: [pyfrmailinglist] Problem about artificial viscosity

2016-10-13 Thread Vincent, Peter E
What compiler are you using?

Cheers

Peter

Dr Peter Vincent MSci ARCS DIC PhD
Reader in Aeronautics and EPSRC Fellow
Department of Aeronautics
Imperial College London
South Kensington
London
SW7 2AZ

email: p.vinc...@imperial.ac.uk
web: 
www.imperial.ac.uk/aeronautics/research/vincentlab/
twitter: @Vincent_Lab

On 13 Oct 2016, at 10:23, Zeronaire 
mailto:leecx...@gmail.com>> wrote:

Hi guys!

I am running the latest version PyFR v1.5.0 for supersonic cases.

Backend is OpenMP. When adding artificial viscosity in config,

[solver]
system = navier-stokes
order = 3
;anti-alias = flux
viscosity-correction = none
shock-capturing = artificial-viscosity

[solver-artificial-viscosity]
max-artvisc = 0.01
s0 = 0.01
kappa = 5.0

it returns error like this:
Traceback (most recent call last):
  File 
"/usr/local/lib/python3.5/dist-packages/pyfr-1.5.0-py3.5.egg/pyfr/util.py", 
line 32, in __call__
KeyError: (, 
b'\x80\x03X\x0b\x00\x00\x00shocksensorq\x00X\x818\x00\x00\n\n#include 
\n#include \n#include \n\n#define PYFR_ALIGN_BYTES 
64\n#define SOA_SZ 16\n\n#define min(a, b) ((a) < (b) ? (a) : (b))\n#define 
max(a, b) ((a) > (b) ? (a) : (b))\n\n// Typedefs\ntypedef float 
fpdtype_t;\n\n// OpenMP static loop scheduling functions\n\nstatic inline 
int\ngcd(int a, int b)\n{\nreturn (a == 0) ? b : gcd(b % a, 
a);\n}\n\nstatic inline void\nloop_sched_1d(int n, int align, int *b, int 
*e)\n{\nint tid = omp_get_thread_num();\nint nth = 
omp_get_num_threads();\n\n// Round up n to be a multiple of nth\nint rn 
= n + nth - 1 - (n - 1) % nth;\n\n// Nominal tile size\nint sz = rn / 
nth;\n\n// Handle alignment\nsz += align - 1 - (sz - 1) % align;\n\n
// Assign the starting and ending index\n*b = sz * tid;\n*e = min(*b + 
sz, n);\n\n// Clamp\nif (*b >= n)\n*b = *e = 0;\n}\n\nstatic 
inline void\nloop_sched_2d(int nrow, int ncol, int colalign,\n  int 
*rowb, int *rowe, int *colb, int *cole)\n{\nint tid = 
omp_get_thread_num();\nint nth = omp_get_num_threads();\n\n// 
Distribute threads\nint nrowth = gcd(nrow, nth);\nint ncolth = nth / 
nrowth;\n\n// Row and column indices for our thread\nint rowix = tid / 
ncolth;\nint colix = tid % ncolth;\n\n// Round up ncol to be a multiple 
of ncolth\nint rncol = ncol + ncolth - 1 - (ncol - 1) % ncolth;\n\n// 
Nominal tile size\nint ntilerow = nrow / nrowth;\nint ntilecol = rncol 
/ ncolth;\n\n// Handle column alignment\nntilecol += colalign - 1 - 
(ntilecol - 1) % colalign;\n\n// Assign the starting and ending row to each 
thread\n*rowb = ntilerow * rowix;\n*rowe = *rowb + ntilerow;\n\n// 
Assign the starting and ending column to each thread\n*colb = ntilecol * 
colix;\n*cole = min(*colb + ntilecol, ncol);\n\n// Clamp\nif (*colb 
>= ncol)\n*colb = *cole = 0;\n}\n\n\n\n\n\n\n\nvoid shocksensor(int 
_nx, fpdtype_t* __restrict__ artvisc_v, const fpdtype_t* __restrict__ u_v, int 
ldu)\n   {\n   #define X_IDX (_xi + _xj)\n  
 #define X_IDX_AOSOA(v, nv)   ((_xi/SOA_SZ*(nv) + 
(v))*SOA_SZ + _xj)\n   int align = PYFR_ALIGN_BYTES / 
sizeof(fpdtype_t);\n   #pragma omp parallel\n   
{\n   \nint cb, ce;\n   
 loop_sched_1d(_nx, align, &cb, &ce);\nint nci = ((ce - cb) 
/ SOA_SZ)*SOA_SZ;\nfor (int _xi = cb; _xi < cb + nci; _xi 
+= SOA_SZ)\n{\n#pragma omp simd\n   
 for (int _xj = 0; _xj < SOA_SZ; _xj++)\n   
 {\n\n// Smoothness indicator\n
fpdtype_t totEn = 0.0f, pnEn = 1e-15f, tmp;\n\ntmp = 
0.28502482785773026f*u_v[ldu*0 + X_IDX_AOSOA(0, 4)] + 
0.05933405549618086f*u_v[ldu*1 + X_IDX_AOSOA(0, 4)] + 
0.05933405549618086f*u_v[ldu*2 + X_IDX_AOSOA(0, 4)] + 
0.05933405549618086f*u_v[ldu*3 + X_IDX_AOSOA(0, 4)] + 
0.15853109467113707f*u_v[ldu*4 + X_IDX_AOSOA(0, 4)] + 
0.15853109467113707f*u_v[ldu*5 + X_IDX_AOSOA(0, 4)] + 
0.15853109467113707f*u_v[ldu*6 + X_IDX_AOSOA(0, 4)] + 
0.15853109467113707f*u_v[ldu*7 + X_IDX_AOSOA(0, 4)] + 
0.15853109467113707f*u_v[ldu*8 + X_IDX_AOSOA(0, 4)] + 
0.15853109467113707f*u_v[ldu*9 + X_IDX_AOSOA(0, 4)];\n\ntotEn += tmp*tmp;\n 
   tmp = 0.13984743197938582f*u_v[ldu*1 + X_IDX_AOSOA(0, 4)] + 
-0.06992371598969294f*u_v[ldu*2 + X_IDX_AOSOA(0, 4)] + 
-0.06992371598969294f*u_v[ldu*3 + X_IDX_AOSOA(0, 4)] + 
-0.025423665347721516f*u_v[ldu*4 + X_IDX_AOSOA(0, 4)] + 
-0.025423665347721516f*u_v[ldu*5 + X_IDX_AOSOA(0, 4)] + 
-0.17694361695401856f*u_v[ldu*6 + X_IDX_AOSOA(0, 4)] + 
-0.17694361695401856f*u_v[ldu*7 + X_IDX_AOSOA(0, 4)] + 
0.20236728230174011f*u_v[ldu*8 +

[pyfrmailinglist] Problem about artificial viscosity

2016-10-13 Thread Zeronaire
Hi guys!

I am running the latest version PyFR v1.5.0 for supersonic cases.

Backend is OpenMP. When adding artificial viscosity in config,

*[solver]*
*system = navier-stokes*
*order = 3*
*;anti-alias = flux*
*viscosity-correction = none*
*shock-capturing = artificial-viscosity*

*[solver-artificial-viscosity]*
*max-artvisc = 0.01*
*s0 = 0.01*
*kappa = 5.0*

it returns error like this:
Traceback (most recent call last):
  File 
"/usr/local/lib/python3.5/dist-packages/pyfr-1.5.0-py3.5.egg/pyfr/util.py", 
line 32, in __call__
KeyError: (, 
b'\x80\x03X\x0b\x00\x00\x00shocksensorq\x00X\x818\x00\x00\n\n#include 
\n#include \n#include \n\n#define 
PYFR_ALIGN_BYTES 64\n#define SOA_SZ 16\n\n#define min(a, b) ((a) < (b) ? 
(a) : (b))\n#define max(a, b) ((a) > (b) ? (a) : (b))\n\n// 
Typedefs\ntypedef float fpdtype_t;\n\n// OpenMP static loop scheduling 
functions\n\nstatic inline int\ngcd(int a, int b)\n{\nreturn (a == 0) ? 
b : gcd(b % a, a);\n}\n\nstatic inline void\nloop_sched_1d(int n, int 
align, int *b, int *e)\n{\nint tid = omp_get_thread_num();\nint nth 
= omp_get_num_threads();\n\n// Round up n to be a multiple of nth\n   
 int rn = n + nth - 1 - (n - 1) % nth;\n\n// Nominal tile size\nint 
sz = rn / nth;\n\n// Handle alignment\nsz += align - 1 - (sz - 1) % 
align;\n\n// Assign the starting and ending index\n*b = sz * tid;\n 
   *e = min(*b + sz, n);\n\n// Clamp\nif (*b >= n)\n*b = *e 
= 0;\n}\n\nstatic inline void\nloop_sched_2d(int nrow, int ncol, int 
colalign,\n  int *rowb, int *rowe, int *colb, int *cole)\n{\n   
 int tid = omp_get_thread_num();\nint nth = omp_get_num_threads();\n\n 
   // Distribute threads\nint nrowth = gcd(nrow, nth);\nint ncolth 
= nth / nrowth;\n\n// Row and column indices for our thread\nint 
rowix = tid / ncolth;\nint colix = tid % ncolth;\n\n// Round up 
ncol to be a multiple of ncolth\nint rncol = ncol + ncolth - 1 - (ncol 
- 1) % ncolth;\n\n// Nominal tile size\nint ntilerow = nrow / 
nrowth;\nint ntilecol = rncol / ncolth;\n\n// Handle column 
alignment\nntilecol += colalign - 1 - (ntilecol - 1) % colalign;\n\n   
 // Assign the starting and ending row to each thread\n*rowb = ntilerow 
* rowix;\n*rowe = *rowb + ntilerow;\n\n// Assign the starting and 
ending column to each thread\n*colb = ntilecol * colix;\n*cole = 
min(*colb + ntilecol, ncol);\n\n// Clamp\nif (*colb >= ncol)\n 
   *colb = *cole = 0;\n}\n\n\n\n\n\n\n\nvoid shocksensor(int _nx, 
fpdtype_t* __restrict__ artvisc_v, const fpdtype_t* __restrict__ u_v, int 
ldu)\n   {\n   #define X_IDX (_xi + _xj)\n 
  #define X_IDX_AOSOA(v, nv)   
((_xi/SOA_SZ*(nv) + (v))*SOA_SZ + _xj)\n   int align = 
PYFR_ALIGN_BYTES / sizeof(fpdtype_t);\n   #pragma omp 
parallel\n   {\n   \n   
 int cb, ce;\nloop_sched_1d(_nx, align, &cb, &ce);\n   
 int nci = ((ce - cb) / SOA_SZ)*SOA_SZ;\n   
 for (int _xi = cb; _xi < cb + nci; _xi += SOA_SZ)\n{\n 
   #pragma omp simd\nfor (int 
_xj = 0; _xj < SOA_SZ; _xj++)\n{\n 
   \n// Smoothness indicator\nfpdtype_t totEn = 0.0f, pnEn 
= 1e-15f, tmp;\n\ntmp = 0.28502482785773026f*u_v[ldu*0 + X_IDX_AOSOA(0, 
4)] + 0.05933405549618086f*u_v[ldu*1 + X_IDX_AOSOA(0, 4)] + 
0.05933405549618086f*u_v[ldu*2 + X_IDX_AOSOA(0, 4)] + 
0.05933405549618086f*u_v[ldu*3 + X_IDX_AOSOA(0, 4)] + 
0.15853109467113707f*u_v[ldu*4 + X_IDX_AOSOA(0, 4)] + 
0.15853109467113707f*u_v[ldu*5 + X_IDX_AOSOA(0, 4)] + 
0.15853109467113707f*u_v[ldu*6 + X_IDX_AOSOA(0, 4)] + 
0.15853109467113707f*u_v[ldu*7 + X_IDX_AOSOA(0, 4)] + 
0.15853109467113707f*u_v[ldu*8 + X_IDX_AOSOA(0, 4)] + 
0.15853109467113707f*u_v[ldu*9 + X_IDX_AOSOA(0, 4)];\n\ntotEn += 
tmp*tmp;\ntmp = 0.13984743197938582f*u_v[ldu*1 + X_IDX_AOSOA(0, 4)] + 
-0.06992371598969294f*u_v[ldu*2 + X_IDX_AOSOA(0, 4)] + 
-0.06992371598969294f*u_v[ldu*3 + X_IDX_AOSOA(0, 4)] + 
-0.025423665347721516f*u_v[ldu*4 + X_IDX_AOSOA(0, 4)] + 
-0.025423665347721516f*u_v[ldu*5 + X_IDX_AOSOA(0, 4)] + 
-0.17694361695401856f*u_v[ldu*6 + X_IDX_AOSOA(0, 4)] + 
-0.17694361695401856f*u_v[ldu*7 + X_IDX_AOSOA(0, 4)] + 
0.20236728230174011f*u_v[ldu*8 + X_IDX_AOSOA(0, 4)] + 
0.20236728230174011f*u_v[ldu*9 + X_IDX_AOSOA(0, 4)];\n\ntotEn += 
tmp*tmp;\ntmp = -0.27426526848231325f*u_v[ldu*0 + X_IDX_AOSOA(0, 4)] + 
0.18395319285197836f*u_v[ldu*1 + X_IDX_AOSOA(0, 4)] + 
0.06026010710330017f*u_v[ldu*2 + X_IDX_AOSOA(0, 4)] + 
0.06026010710330017f*u_v[ldu*3 + X_IDX_AOSOA(0, 4)] + 
-0.13478444022110087f*u_v[ldu*4 + X_IDX_AOSOA(0, 4)] + 
-0.13478444022110087f*u_v[ldu*5 + X_IDX_AOSOA(0, 4)] + 
0.13380860728687555f*u_v[ldu*6 + X_IDX_AOSOA(0, 4)