Commit 9ec9aa9b authored by Jean-Eric Campagne's avatar Jean-Eric Campagne
Browse files

(JEC) 25/3/15 adaptation pour compiler sous Linux et sans NTL installee

parent 0860eb95
......@@ -4,10 +4,14 @@ include $(SOPHYABASE)/include/sophyamake.inc
SHARPDIR = /Users/campagne/Travail/kits/libsharp-code/auto/
SHARPLIB = $(SHARPDIR)/lib
SHARPINC = $(SHARPDIR)/include
SHARPLIBN = -lc_utils -lfftpack -lsharp
SHARPLIBN = -lsharp -lc_utils -lfftpack
# ===== NTL
NTLLIB = /opt/local/lib/libntl.a
CPPFLAGS += -I$(SHARPINC) -I/opt/local/include
LDFLAGS += -L$(SHARPLIB) $(SHARPLIBN) /opt/local/lib/libntl.a -lm
LDFLAGS += -L$(SHARPLIB) $(SHARPLIBN) $(NTLLIB) -lm
OBJ = ./Objs/
EXE = ./Objs/
......
Laguerre Spherical Harmonic Transform
-------------------------------------
Download en Guest
git clone https://gitlab.in2p3.fr/campagne/LagSHT.git
Download en Personne enregistree sur gitlab
git clone git@gitlab.in2p3.fr:campagne/LagSHT.git
o creation 25/3/15
------------------
. laguerreBuilder.h (.cc) : class Polynomes de Laguerre generalises
. laguerreTransform.h (.cc) : class Transformation de Laguerre (et Inverse)
. lagSphericTransform.h (.cc) : class Transformation Harmonique Spherique & Laguerre (et Inverse)
. tstlag.cc: un programme de test (utiliser #define TEST <valeur> 1,..,4)
. Makefile: modifier le lieu ou est installe libsharp
. Makefile:
modifier le lieu ou est installe libsharp
desactiver NTLLIB si NTL pas installee
. SOPHYA
Sophya doit avoir ete configure avec
......@@ -21,5 +30,71 @@ il faut configurer Sophya avec egalement:
. LIBSHARP
git clone git://git.code.sf.net/p/libsharp/code libsharp-code
voir dans libsharp-code/libsharp/sharp_cxx.h et ajouter si necessaire
sharp_geom_info* get_geom_info() { return ginfo; }
sharp_alm_info* get_alm_info() { return ainfo; }
. Compilation
> mkdir Objs
> edit tstlag.cc pour changer la variable TESTLEVEL [1,4]
> make
. Running
> ./Objs/tstlag (default)
> ./Objs/tstlag -l 100 -n 100 (Lmax = 100, Nmax = 100)
. Plateform ou le code a ete teste
> Mac OS X 10.9.5 + gcc 4.8.4
> Linux SLC 6.6 + gcc 4.9.1 20140922
. Exemple de run (Linux)
opera3Exp:opera/campagne/LagSHT$./Objs/tstlag -l 100 -n 1000
PIOPersist::Initialize() Starting Sophya Persistence management service
SOPHYA Version 2.3 Revision 45 (V_Dec2014) -- Mar 25 2015 15:14:56 gcc 4.9.1 20140922 (Red Hat 4.9.1-10)
sizeof(long double): 16 bytes min 3.3621e-4932 max 1.18973e+4932 min exp_10 -4931 max exp_10 4932
Tests Level (1): L: 100 N: 1000
r_16 Sum roots = 1.002e+06 ->0
r_16 Sum weights = 2 ->-3.6787e-15
***Timing Test 1 (r_16)
CPU Time: Total= 0.15 (Partial= 0.15) s
Elapsed Time: Total=00.150 s (Partial= 00.150 s)
opera3Exp:opera/campagne/LagSHT$./Objs/tstlag -l 100 -n 100
PIOPersist::Initialize() Starting Sophya Persistence management service
SOPHYA Version 2.3 Revision 45 (V_Dec2014) -- Mar 25 2015 15:14:56 gcc 4.9.1 20140922 (Red Hat 4.9.1-10)
sizeof(long double): 16 bytes min 3.3621e-4932 max 1.18973e+4932 min exp_10 -4931 max exp_10 4932
Tests Level (4): L: 100 N: 100
LaguerreSphericalTransform::Ctor done
SetThetaPhiMap: Nring, Nphi, Npix, Nalm 199, 199, 39601, 5050
***Timing SHTL r_16/end init
CPU Time: Total= 0 (Partial= 0) s
Elapsed Time: Total=00.001 s (Partial= 00.001 s)
verif : Ntot 505000 id value = 505000
***Timing SHTL r_16/end rndm filling
CPU Time: Total= 0.05 (Partial= 0.05) s
Elapsed Time: Total=00.043 s (Partial= 00.043 s)
NDataBlock::Print(0x7fff1c366580,Sz=505000,IsTemp=0)
mSRef=0xce9dd0(nref=1,data=0x7f553ebbc010,bridge=0)
(-0.998029,0) (-0.916738,0) (-0.646715,0) (-0.270796,0) (-0.817339,0) (-0.815405,0) (-0.0255656,0) (0.0535006,0)
(-0.0911332,0) (-0.533643,0)
Main:Synthesis...
***Timing SHTL r_16/end synthesis
CPU Time: Total= 4.08 (Partial= 4.03) s
Elapsed Time: Total=01.172 s (Partial= 01.172 s)
Main:Analysis...
***Timing SHTL r_16/end analysis
CPU Time: Total= 8.68 (Partial= 4.6) s
Elapsed Time: Total=02.221 s (Partial= 01.221 s)
Error analysis...
>>>>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<<<<<<<
r_16 Err. Max. 9.37109e-14 [459748], Err. Rel. 7.85865e-11
>>>>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<<<<<<<
***Timing Test 4 r_16
CPU Time: Total= 8.73 (Partial= 0.05) s
Elapsed Time: Total=02.282 s (Partial= 00.282 s)
......@@ -14,9 +14,10 @@
#define DEBUG 1
#define TESTLEVEL 1
#ifdef SO_NTLXDBLE
#include "NTL/xdouble.h"
using namespace NTL;
#endif
#include "lagSphericTransform.h"
......@@ -24,9 +25,6 @@ int main(int narg, char *arg[]) {
int debug=0;
cout << "NTL/xdouble parameters: NTL_XD_HBOUND: " << NTL_XD_HBOUND
<< " NTL_XD_BOUND: " << NTL_XD_BOUND
<< endl;
cout << " sizeof(long double): " << sizeof(r_16) << " bytes"
<< " min " << std::numeric_limits<r_16>::min()
<< " max " << std::numeric_limits<r_16>::max()
......@@ -63,15 +61,18 @@ int main(int narg, char *arg[]) {
int rc=0;
try {
xdouble::SetOutputPrecision(10);
int alpha=2;
cout << "Tests Level ("<<TESTLEVEL<<"): L: " << Lmax << " N: " << N << endl;
int alpha=2;
#if TESTLEVEL == 1
#ifdef SO_NTLXDBLE
{//Test Laguerre quadrature nodes & weights Xdouble
xdouble::SetOutputPrecision(20);
cout << "NTL/xdouble parameters: NTL_XD_HBOUND: " << NTL_XD_HBOUND
<< " NTL_XD_BOUND: " << NTL_XD_BOUND
<< endl;
cout << "Tests Level ("<<TESTLEVEL<<"): L: " << Lmax << " N: " << N << endl;
Timer tm("Test 1 (xdble)");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment