Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
| fenics [2012/05/22 13:42] – [Programme C++] admin | fenics [2018/06/27 14:51] (Version actuelle) – [Version installée] admin | ||
|---|---|---|---|
| Ligne 14: | Ligne 14: | ||
| * Postprocessing (live plotting, advanced postprocessing, | * Postprocessing (live plotting, advanced postprocessing, | ||
| * C++ and Python interface” | * C++ and Python interface” | ||
| + | |||
| + | {{ : | ||
| + | |||
| Full features can be found here: | Full features can be found here: | ||
| ====== Version installée ====== | ====== Version installée ====== | ||
| + | * [[fenics: | ||
| - | **1.0.0**\\ | + | **1.6.0** (séquentielle)\\ |
| <code bash> | <code bash> | ||
| - | module load fenics | + | module load fenics/1.6.0 |
| </ | </ | ||
| Ligne 112: | Ligne 116: | ||
| # Create mesh and define function space | # Create mesh and define function space | ||
| - | mesh = UnitSquare(6, 4) | + | |
| - | V = FunctionSpace(mesh, | + | mesh = UnitIntervalMesh(50) |
| + | V = FunctionSpace(mesh, | ||
| + | |||
| # Define boundary conditions | # Define boundary conditions | ||
| Ligne 153: | Ligne 160: | ||
| python poisson.py | python poisson.py | ||
| </ | </ | ||
| + | |||
| + | <note warning> | ||
| + | |||
| + | </ | ||
| + | |||
| {{ : | {{ : | ||
| Ligne 251: | Ligne 263: | ||
| Voic un exemple d'un Makefile pour compiler l' | Voic un exemple d'un Makefile pour compiler l' | ||
| - | < | + | < |
| - | CFLAGS | + | |
| - | LIBS | + | CFLAGS=`pkg-config --cflags dolfin` |
| - | CXX | + | LIBS=`pkg-config --libs dolfin` |
| - | CFLAGS= | + | CXX=`pkg-config --variable=compiler dolfin` |
| - | LIBS= 'pkg-config --libs dolfin' | + | |
| - | CXX= pkg-config --variable=compiler dolfin‘ | + | |
| DEST= poisson | DEST= poisson | ||
| Ligne 268: | Ligne 278: | ||
| clean: | clean: | ||
| - | rm -f *.o poisson *.poisson $(OBJECTS) $(DEST) | + | |
| $(DEST): $(OBJECTS) | $(DEST): $(OBJECTS) | ||
| - | $(CXX) -o $@ $(OBJECTS) $(CFLAGS) $(LIBS) | + | |
| .cpp.o: | .cpp.o: | ||
| + | $(CXX) $(CFLAGS) -c $< | ||
| - | $(CXX) $(CFLAGS) -c $< | ||
| </ | </ | ||
| + | <code bash> | ||
| + | | ||
| + | </ | ||
| <code bash> | <code bash> | ||
| - | icc main.cpp -o poisson | + | ./poisson |
| </ | </ | ||
| + | ====== Script SGE ====== | ||
| + | Exemple de script SGE pour lancer la version séquentielle de Fenics. | ||
| - | ====== Exécution en parallèle (MPI) ====== | + | <code bash> |
| - | Fenics est compilé avec MPI (OpenMPI). Pour exécuter un programme en parallèle on utilise '' | + | # |
| + | |||
| + | #$ -N test_sge | ||
| + | #$ -o $JOB_NAME.$JOB_ID.out | ||
| + | #$ -e $JOB_NAME.$JOB_ID.err | ||
| - | < | + | module load fenics/1.6.0 |
| - | module load fenics | + | |
| - | </code> | + | export PATH=$WORK |
| + | |||
| + | python poisson.py | ||
| - | < | ||
| - | mpirun -np 4 ./poisson | ||
| </ | </ | ||
| - | 4 fichiers (vtk) seront générés à la fin de l' | ||
| - | ===== Utilisation avec SGE ===== | + | <note tip>Les fichiers de sortie (VTK) peuvent être visualisés avec le logiciel '' |
| + | |||
| + | |||
| + | ===== SGE, version MPI ===== | ||
| <code bash> | <code bash> | ||
| #!/bin/bash -l | #!/bin/bash -l | ||
| - | #$ -q normal15d | + | #$ -q parallel.q |
| #$ -V | #$ -V | ||
| #$ -N fenics_sge | #$ -N fenics_sge | ||
| - | #$ -pe impi_tight | + | #$ -pe mpi 16 |
| #$ -o $JOB_NAME.$JOB_ID.out | #$ -o $JOB_NAME.$JOB_ID.out | ||
| #### on charge le module fenics | #### on charge le module fenics | ||
| - | module load fenics | + | module load fenics/mpi |
| + | |||
| + | export HOME=$WORK | ||
| ## lancement de l' | ## lancement de l' | ||
| Ligne 319: | Ligne 342: | ||
| mpirun -np $NSLOTS ./ | mpirun -np $NSLOTS ./ | ||
| + | ## OR | ||
| + | |||
| + | mpirun -np $NSLOTS python ./ | ||
| </ | </ | ||
| ====== Liens ====== | ====== Liens ====== | ||