33
© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced. Utilisation de SALOME pour la distribution de calculs Code_Carmel3D en CND avec remaillage M. Pallud [email protected] IMACS travail en collaboration avec N. Béreux O. Moreau EDF R&D / CLAMART

Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced.

Utilisation de SALOME pour la distribution de calculs Code_Carmel3D en CND avec remaillage

M. [email protected]

IMACS

travail en collaboration avecN. BéreuxO. Moreau EDF R&D / CLAMART

Page 2: Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced.

Salome Journée Utilisateur 22/11/2012 2

Partenariat EDF R&D - IMACS

Page 3: Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced.

Salome Journée Utilisateur 22/11/2012 3

IMACShttp://imacs.polytechnique.fr

� Spin-off de l'Ecole Polytechnique

� Modélisation physique, analyse mathématique, calcul scientifique et HPC

� 13 p., forte activité R&D interne (thèses)

� Principaux clients : EADS IW, EDF R&D, PSA, Thales

� Partenariat avec EDF R&D (département THEMIS) depuis 2007 autour du calcul de champ en électromagnétisme et en particulier de Code_Carmel3D :

� Formulations mathématiques et schémas numériques

� Architecture et développement de logiciels

� Industrialisation de chaînes de calcul ←

Page 4: Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced.

Salome Journée Utilisateur 22/11/2012 4

CND-CF avec Code_Carmel3D

Page 5: Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced.

Salome Journée Utilisateur 22/11/2012 5

Problématique CND-CF

� Contrôle non-destructif par courants de Foucault� Objectif : détection de fissures dans les tubes GV (générateurs

de vapeur du circuit primaire) des centrales nucléaires

� Principe : mesure du flux magnétique différentiel entre les bobines réceptrices d'une sonde, constituée d'une bobine émettrice et de bobines réceptrices

� Objet de la simulation numérique : qualification des sondes proposées par des constructeurs

Page 6: Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced.

Salome Journée Utilisateur 22/11/2012 6

Problématique CND-CF

� Contrôle non-destructif par courants de Foucault� Mode opératoire :

� la sonde se déplace à l'intérieur du tube selon un parcours bien défini « le scan »

� la présence d'une fissure modifie l'allure de la réponse au voisinage de celle-ci

Page 7: Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced.

Salome Journée Utilisateur 22/11/2012 7

Utilisation de Code_Carmel3D en CND-CF

Simulation des contrôles non-destructifs par courants de Foucault sur un tube GV :étude réalisée par O. Moreau (EDF/THEMIS) dans le cadre du projet APEX

Mesure code_Carmel

Page 8: Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced.

Salome Journée Utilisateur 22/11/2012 8

Chaîne de calcul pour un scan complet

Page 9: Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced.

Salome Journée Utilisateur 22/11/2012 9

Pourquoi une chaîne automatisée ?

� Difficultés des simulations Code_Carmel3D en CND-CF :� la différence de flux induit est une quantité du deuxième ordre → besoin

d'une très grande précision de calcul via un maillage localement très raffiné

� problème de grande taille (maillage à plusieurs millions de tétraèdres) →fichier MED volumineux + durée du calcul > 10 min./pos

� maillage à regénérer pour chaque position du scan

� grand nombre de positions pour réaliser un scan (fréquemment +eurscentaines de positions)

Page 10: Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced.

Salome Journée Utilisateur 22/11/2012 10

La chaîne « Pas bloqué » (2009)

Maillage réglé testé pour une position (stabilité des mailleurs)

� Maillage de la sonde et du tube sont générés séparément. L'interface entre les deux est un maillage réglé conforme

� La sonde peut avancer en translation et en rotation maille par maille

� Un code intermédiaire permet derenuméroter les degrés de liberté entre la sonde et le tube

Page 11: Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced.

Salome Journée Utilisateur 22/11/2012 11

La chaîne « Pas bloqué » (2009)

� L'utilisateur prépare son maillage et les paramètres de calculs pour une position 0

� Un script python gère l'ensemble des calculs pour latrajecoire de la sonde� Encapsulation des données

� Envoie sur le cluster

� Lancement des calculs et récupération des résultats dans un répertoire unique (result)

� Possibilité de relancer le calcul uniquement pour les positions qui ont échoué (restart)

� Récupération des résultats sur la machine locale

Page 12: Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced.

Salome Journée Utilisateur 22/11/2012 12

Remaillage (2011)

� Nouveaux besoins

� Trajectoire quelconque

� Tube déformé

� Impose de générer les maillages sur le cluster à la volée sans contrôle possible de l'utilisateur

� Maturité des mailleurs (stabilité & rapidité)

� Intégration/Utilisation plus poussée de Salome

Page 13: Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced.

Salome Journée Utilisateur 22/11/2012 13

Déroulement du calcul pour une position� Génération du maillage

UNV/MED parSalome/GHS3D BLSURF

� Préparation des fichiers de paramètres

� Encapsulatation de l'ensemble des calculs dans un script shell

� Lancement du script et résultats entièrement contenu dans le répertoire contenant les données

Page 14: Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced.

Salome Journée Utilisateur 22/11/2012 14

Demande des utilisateurs THEMIS

� Automatisation d'une chaîne :� Réalisant la distribution des calculs sur cluster avec

génération automatique du maillage

� Réalisant le rapatriement des résultats

� Ré-utilisant au maximum des scripts existants d'une ancienne chaîne de calcul (chaîne en «pas bloqué»)

� D'utilisation simple (les utilisateurs ne sont pas des développeurs)

� Si possible intégrée à SALOME, utilisé par ailleurs pour la réalisation de la CAO, du maillage et du post-traitement

Page 15: Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced.

Salome Journée Utilisateur 22/11/2012 15

Stratégie adoptée par IMACS

� Utilisation des modules SALOME :� YACS : pour le schéma de calcul (schéma YACS

indépendant du cas de calcul et donc ré-utilisable (remaillage.xml)

� GEOM et SMESH : pour la génération du modèle

� JOBMANAGER : pour le lancement des calculs sur cluster

� Pré-requis à la charge de l'utilisateur :� un script python (carmel.py) pour la génération du modèle

et des données d'entrée paramétré par la position de la sonde

� la liste des positions constituant le scan(listepositions.txt)

Page 16: Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced.

Salome Journée Utilisateur 22/11/2012 16

Procédure

Page 17: Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced.

Salome Journée Utilisateur 22/11/2012 17

carmel.py (défini par l'utilisateur)

� Le script porte toujours le même nom carmel.py

� Possède une fonction do_geom qui génère l'ensemble des données de calcul et un fichier script.shdans un répertoire donné

� On peut lancer manuellement ce script dans son répertoire pour exécuter l'intégralité du calcul

Page 18: Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced.

Salome Journée Utilisateur 22/11/2012 18

Schéma YACS

Page 19: Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced.

Salome Journée Utilisateur 22/11/2012 19

Motivations

� Utiliser le parallélisme de tâches intégré dans les boucles ForEach du schéma Yacs

� Utiliser durant les calculs sur cluster les modules GEOM & SMESH pour générer le maillage à chaque position

Page 20: Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced.

Salome Journée Utilisateur 22/11/2012 20

Schéma remaillage.xml

Page 21: Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced.

Salome Journée Utilisateur 22/11/2012 21

Initialisation

� Définition du nombre de branches parallèles : 3 choix� Prédéfini

� Fichier de paramètres

� Variable d'environnement LIBATCH_NODEFILE

� Chargement de la trajectoirelistepositions.txt

� Chargement du cas de calcul carmel.py

Page 22: Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced.

Salome Journée Utilisateur 22/11/2012 22

La boucle de calcul� Transporter pour chaque position

les données sur un répertoire temporaire de calcul

� Générer le maillage do_geom()

� Nettoyer les structures SALOME geométrique et maillage après l'export

� Lancer le calcul dans ce répertoire (script.sh)

� Récupérer les résultats et logsdans le répertoire utilisateur RESULT

� Nettoyer le répertoire de calcul temporaire

Page 23: Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced.

Salome Journée Utilisateur 22/11/2012 23

Post-traitement

� Organisation des résultats dans le répertoire RESULT

� Génération de courbes sur l'ensemble des résultats

Page 24: Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced.

Salome Journée Utilisateur 22/11/2012 24

JOBMANAGER

Page 25: Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced.

Salome Journée Utilisateur 22/11/2012 25

Interface du JOBMANAGER

Ressources

Jobs

État des calculs

Page 26: Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced.

Salome Journée Utilisateur 22/11/2012 26

Déploiement

� Création du catalogue des ressources (machines) disponibles

� Déploiement des codes de calculs sur les machines du catalogue

� Positionner l'environnement SALOME (env.d) sur ces mêmes machines

Page 27: Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced.

Salome Journée Utilisateur 22/11/2012 27

Création d'un job de calcul (de type YACS schema)

� Définiton des fichiers de données (carmel.py,listepositions.txt)

� Répertoire de résultat àrécupérer à la fin du calcul et sa destination sur la machine locale

� Le ressource sur laquelleexecuter le calcul

� Le nombre de tâches, mémoire, temps maximum …

Page 28: Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced.

Salome Journée Utilisateur 22/11/2012 28

Déploiement (suite)

� On définit l'environnement par le fichierenvCarmel.sh placé dans le répertoire env.d des installation de SALOME sur chaque machine

� On y fournit PATH, LD_LIBRARY_PATH, PYTHONPATH pour l'ensemble des codes de calculs et le script des utilitaires python (remaillage. py)

� Pour JOBMANGER et YACS (au moins jusqu'à la version 6.5.0)� ulimit -s 12500

� YACS_MAX_THREADS=500

Page 29: Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced.

Salome Journée Utilisateur 22/11/2012 29

Lancement et suivi du calcul depuis l'interface

� Gérer l 'ensemble des calculs depuis la machine locale

� Possibilité de lancer plusieurs calculs en même temps sur différentes machines

� Suivre l'état des jobs

� Récupérer les résultats des jobs terminés

Page 30: Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced.

Salome Journée Utilisateur 22/11/2012 30

CONCLUSION

Page 31: Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced.

Salome Journée Utilisateur 22/11/2012 31

Du point de vue de l'utilisateur : objectifs atteints

� L'utilisateur a uniquement à assurer la génération du fichier carmel.py et listepositions.txt pour chaque cas de calcul

� Aucune connaissance YACS n'est requise par l'utilisateur : la création du JOB YACS se fait à partir du schéma prédéfini remaillage.xml et du catalogue de ressources renseigné au déploiement de l'application

� Le lancement des calculs sur cluster et la récupération des résultats sont gérés de façon transparente depuis la machine locale via l'interface du JOBMANAGER

Page 32: Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced.

Salome Journée Utilisateur 22/11/2012 32

Perspectives

� Depuis les premiers déploiements de la chaîne remaillage on constate une forte augmentation du nombre de positions et de la taille des calculs

� De nouvelles limites sont maintenant atteintes� Visualisation de maillage très fin dans SALOME

� Format de fichier ascii interne à Code_Carmel3D devenu trop volumineux

� Ce succès milite pour une intégration toujours plus forte de Code_Carmel3D dans la plate-forme SALOME

Page 33: Utilisation de SALOME pour la distribution de calculs Code ... · © 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference

© 2012 EDF, IMACS. No partial distribution of information from this document and no changes are permitted. Reference to the http://www.salome-platform.org is mandatory when distributed or referenced.

Salome Journée Utilisateur 22/11/2012 33

Difficultés rencontrées

� JOBMANAGER : absence d'un mécanisme de nettoyage des résultats sur la machine distante (automatique ou à la demande) après récupération des résultats sur la machine locale

� Absence d'interaction entre schéma YACS et JOBMANAGER. On souhaiterait :� pouvoir récupérer directement des paramètres du job

(nombre de processeurs, mémoire …) depuis le schéma

� pouvoir définir des états 'utilisateur' (autres que les états standards du JOBMANAGER) depuis le schéma YACS