|
[Sponsors] |
Speed difference of "scalar, label" with"double, int" |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 18, 2015, 05:31 |
Speed difference of "scalar, label" with"double, int"
|
#1 |
Senior Member
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 848
Rep Power: 18 |
Hi guys,
We know that in OpenFOAM we can use label instead of int and scalar instead of double. If we just wanna to use the simple mathematical manipulation. Is the code using double or int faster than scalar of label? Or...std::cout is faster than Info? Cause for now Im solving population balance model. For a mesh with 17m cells. It uses 3.12s to calculate the source term(only some tedious algebraic manipulation). 1.29 to solve NS equations. 0.29s to solve moments equations. Thanks,
__________________
My OpenFOAM algorithm website: http://dyfluid.com By far the largest Chinese CFD-based forum: http://www.cfd-china.com/category/6/openfoam We provide lots of clusters to Chinese customers, and we are considering to do business overseas: http://dyfluid.com/DMCmodel.html |
|
April 25, 2017, 08:04 |
|
#2 |
New Member
Lukas Lebovitz
Join Date: Mar 2017
Location: Zürich, Switzerland
Posts: 25
Rep Power: 9 |
Hey did you ever find out more about this? Label/Scalar vs Int/Double?
|
|
April 25, 2017, 09:00 |
|
#3 | |
Senior Member
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 342
Rep Power: 28 |
Quote:
The data type scalar is a floating point number, depending on your compiler settings, either a float (32bit) or double (64bit). Study the source code in $FOAM_SRC/OpenFOAM/primitives/ints and $FOAM_SRC/OpenFOAM/primitives/Scalar The Info keyword, widely used in OpenFOAM, at some point will use std::cout. So, label, scalar and Info is there for our convenience. There should be no performance penalty. |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] snappyHexMesh and cyclic boundaries | Ruli | OpenFOAM Meshing & Mesh Conversion | 2 | December 9, 2013 07:51 |
operation speed Difference between 32bit & 64bit | IUIU | FLUENT | 1 | February 9, 2011 23:06 |
Parallel with Windoze, speed difference between PV | Charles | CFX | 3 | March 10, 2005 02:25 |