scieee AI-readable full text Open interactive document viewer

Services to support simulation workflows for next generation aircraft structures

Cecco, Riccardo

Abstract

In the intricate and rapidly advancing domain of aerospace engineering, the task of designing and manufacturing next-generation aircraft structures stands as a monumental challenge. The aerospace industry, with its relentless pursuit of innovation and efficiency, is constantly pushing the boundaries of what’s possible. As this industry propels forward, it becomes imperative to harness the power of high-performance computing (HPC) to drive these innovations. HPC, with its unparalleled computational capabilities, offers the potential to simulate complex sce- narios, model intricate structures, and predict outcomes with high precision. This is where the CAELESTIS project plays a pivotal role. The CAELESTIS project, a beacon of advancement in the aerospace sector, recognizes the transformative potential of HPC. By integrating HPC into the aerospace design process, simu- lation, when executed on HPC platforms, can drastically reduce the time and resources tradi- tionally required. This enables engineers to test and iterate designs with unprecedented speed and accuracy, ensuring that the aircrafts of tomorrow are not only cutting-edge but also safe and efficient. Central to this thesis is the exploration and development of a service to generate dynamic simulation workflows. These workflows, inherently adaptable, can evolve in response to changing requirements or conditions. This adaptability ensures that the simulation remains relevant and accurate throughout its lifecycle. The service aims to seamlessly connect traditional design approaches with the advanced requirements of contemporary aircraft structures. It places a strong emphasis on probabilistic design and predictive manufacturing, which are fundamental principles of the CAELESTIS project. Understanding the multifaceted needs of aerospace professionals, this service offers unpar- alleled adaptability. Users have the autonomy to select their desired simulation software for each workflow, ensuring compatibility and relevance across a spectrum of applications. Beyond choosing software, users can set various parameters, creating a customized simulation experience that fits their specific needs. An important point of this service is its adeptness at internally parallelizing the generated workflows using PyCOMPSs [Tej+17] [Bad+15]. This feature not only optimizes computational processes, ensuring efficient utilization of HPC resources, but also positions the service, and by extension the CAELESTIS project, as a prime contender for integration into top-tier simulation systems. Through this research, and with the support and insights from the CAELESTIS project, we endeavor to pioneer a robust, flexible, and dynamic toolset. This toolset has the potential to redefine how aerospace experts approach the design and manufacturing of next-generation aircraft structures, leveraging the might of HPC and the agility of dynamic workflows.

Full text

id178557   SERVICES TO SUPPORT SIMULATION WORKFLOWS FOR NEXT GENERATION AIRCRAFT STRUCTURES RICCARDO CECCO Thesis supervisor: ROSAMARIABADIASALA(DepartmentofComputerArchitecture) Thesis co-supervisor: JORGEEJARQUEARTIGAS Degree:MasterDegreeinInnovationandResearchinInformatics(ComputerNetworksandDistributed Systems) Master's thesis Facultat d'Informàtica de Barcelona (FIB) Universitat Politècnica de Catalunya (UPC) - BarcelonaTech It always seems impossible until it’s done. NELSON MANDELA, 2001 Abstract In the intricate and rapidly advancing domain of aerospace engineering, the task of designing and manufacturing next-generation aircraft structures stands as a monumental challenge. The aerospace industry, with its relentless pursuit of innovation and efficiency, is constantly pushing the boundaries of what’s possible. As this industry propels forward, it becomes imperative to harness the power of high-performance computing (HPC) to drive these innovations. HPC, with its unparalleled computational capabilities, offers the potential to simulate complex scenarios, model intricate structures, and predict outcomes with high precision. This is where the CAELESTIS project plays a pivotal role. The CAELESTIS project, a beacon of advancement in the aerospace sector, recognizes the transformative potential of HPC. By integrating HPC into the aerospace design process, simulation, when executed on HPC platforms, can drastically reduce the time and resources traditionally required. This enables engineers to test and iterate designs with unprecedented speed and accuracy, ensuring that the aircrafts of tomorrow are not only cutting-edge but also safe and efficient. Central to this thesis is the exploration and development of a service to generate dynamic simulation workflows. These workflows, inherently adaptable, can evolve in response to changing requirements or conditions. This adaptability ensures that the simulation remains relevant and accurate throughout its lifecycle. The service aims to seamlessly connect traditional design approaches with the advanced requirements of contemporary aircraft structures. It places a strong emphasis on probabilistic design and predictive manufacturing, which are fundamental principles of the CAELESTIS project. Understanding the multifaceted needs of aerospace professionals, this service offers unparalleled adaptability. Users have the autonomy to select their desired simulation software for each workflow, ensuring compatibility and relevance across a spectrum of applications. Beyond choosing software, users can set various parameters, creating a customized simulation experience that fits their specific needs. An important point of this service is its adeptness at internally parallelizing the generated workflows using PyCOMPSs [Tej+17] [Bad+15]. This feature not only optimizes computational processes, ensuring efficient utilization of HPC resources, but also positions the service, and by extension the CAELESTIS project, as a prime contender for integration into top-tier simulation systems. Through this research, and with the support and insights from the CAELESTIS project, we endeavor to pioneer a robust, flexible, and dynamic toolset. This toolset has the potential to redefine how aerospace experts approach the design and manufacturing of next-generation aircraft structures, leveraging the might of HPC and the agility of dynamic workflows. 2 Acknowledgements I would like to express my deepest gratitude to all those who have contributed to the completion of this master’s thesis. This journey has been a remarkable and transformative experience, and I could not have reached this point without the support and assistance of many individuals and institutions. First, I would like to thank my thesis advisors, Dr. Rosa Maria Badia and Dr. Jorge Ejarque, and all my colleagues in the workflows and distributed systems group at BSC, for helping me to achieve this result. Cari mamma, pap`a e Ary, questo risultato, anche se porta il mio nome, `e tanto mio quanto vostro. Il vostro incrollabile sostegno, i sacrifici che avete fatto e l’amore che mi avete sempre dimostrato sono stati essenziali per arrivare fino a qui. Questa importante tappa della mia vita la dedico a voi. Desidero esprimere un profondo ringraziamento a Edoardo. Ci siamo aiutati e sostenuti nei momenti belli e anche nei momenti difficili della nostra vita, la nostra amicizia rappresenta uno dei legami pi`u forti e autentici che abbia mai avuto. Se sono arrivato a questo risultato `e anche grazie a te. Voglio essere grato anche ai miei nonni, zii, cugini e cugine, mi avete visto e accompagnato nella crescita e per me `e un vanto avere un rapporto cos`ı voi che siete la mia famiglia. Un altro ringraziamento speciale va a tutti i miei amici di Milano, Gregorio, Jacopo, Carlo, Michele, Vincenzo, Francesco, i miei coinquilini di Gobetti e il gruppo Stase. Per cinque lunghissimi e bellissimi anni, siete stati una famiglia e come tale, ci siamo sempre supportati l’uno con l’altro. Nonostante siano passati due anni e ci siano 900 km tra noi, ogni volta che ritorno in citt`a, mi fate sentire a casa, siete speciali. Un sentito ringraziamento a Marco, Elena, Federica e a tutti i butei della Valpolicella. ´ Ultimo pero no menos importante, quiero expresar mi agradecimiento a mis panas del m´aster: Alba, Imanol y Oriol. Los dos a˜nos que pas´e trabajando a vuestro lado fueron verdaderamente maravillosos. 3 CONTENTS Contents 1 Introduction 7 1.1 Problemformulation.................................... 7 1.2 Motivationandobjectives ................................. 7 2 State-of-the-art 8 3 Background 9 3.1 ProgrammingFrameworks................................. 9 3.1.1 PyCOMPSs..................................... 9 3.1.2 PyDOE ....................................... 10 3.1.3 SALib........................................ 10 3.2 SSH Key Encryption with Security Tokens . . . . . . . . . . . . . . . . . . . . . . . . 10 3.3 Fault tolerance and checkpointing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.3.1 FaultTolerance................................... 11 3.3.2 Checkpointing ................................... 11 3.3.3 How Checkpointing Enhances Fault Tolerance . . . . . . . . . . . . . . . . . . 11 4 Architecture 13 4.1 Dynamicity of the workflows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 4.1.1 YAMLdescriptor.................................. 15 4.1.2 Dynamicity..................................... 16 4.2 Service............................................ 16 4.2.1 Data staging and preparation of the environment . . . . . . . . . . . . . . . . 16 4.2.2 Submission and execution of workflows . . . . . . . . . . . . . . . . . . . . . . 18 5 Implementation 19 5.1 Implementation of the architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 5.2 Definitionofaworkflow .................................. 19 5.2.1 Definition of a workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 5.3 Service............................................ 22 5.3.1 DeploymentSteps ................................. 22 5.3.2 Django ....................................... 23 5.3.3 Gunicorn (Green Unicorn) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 5.3.4 Nginx ........................................ 24 5.3.5 PostgreSQL..................................... 24 5.4 Paramiko .......................................... 24 5.4.1 User and Key Generation on Your Service . . . . . . . . . . . . . . . . . . . . 24 5.4.2 Usage and Security Mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . 25 5.5 Workflowssubmission ................................... 25 5.6 Implemented checkpoint settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 5.7 Executionsmanager .................................... 27 6 Phases 28 6.1 Samplers........................................... 28 6.1.1 SALib........................................ 28 6.1.2 PyDOE: Python Design of Experiments Library . . . . . . . . . . . . . . . . 29 6.2 Datapreparation...................................... 30 4 CONTENTS 6.3 Simulations ......................................... 31 6.3.1 Alya......................................... 31 6.4 Collectingtheresults.................................... 32 7 Workflows evaluation 33 7.1 Sensitivityanalysis..................................... 33 7.2 Montecarlosimulation ................................... 35 7.3 Modeltraining ....................................... 37 8 Future Works 39 8.1 Execution time optimization for job scheduling . . . . . . . . . . . . . . . . . . . . . 39 8.2 Implementation of new phases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 9 Conclusion 41 10 APPENDIX 42 10.1APICAELESTISIMAGE................................. 42 10.2Yamlfilesexamples..................................... 46 10.2.1 Sensitivity analysis yaml file . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 10.2.2 Montecarlo simulation YAML file . . . . . . . . . . . . . . . . . . . . . . . . . 47 10.3Templatesfiles ....................................... 49 10.3.1TemplateAlya ................................... 49 10.4Implementationdetails................................... 52 10.4.1Django’smodels .................................. 52 10.4.2 SSH Key Generation and Encryption . . . . . . . . . . . . . . . . . . . . . . . 53 10.4.3 Explanation of COMPSs’ Checkpoint Policies . . . . . . . . . . . . . . . . . . 54 10.5 Real definition of a workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 5 LIST OF FIGURES List of Figures 1 HPC CAELESTIS Simulation ecosystem . . . . . . . . . . . . . . . . . . . . . . . . . 13 2 Dynamicworkflows..................................... 16 3 Implementation of the concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 4 Implementation of dynamic workflows . . . . . . . . . . . . . . . . . . . . . . . . . . 20 5 Basic definition of a general workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 6 Parallelization of a general workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 7 Infrastructure of the service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 8 Databasediagram ..................................... 23 9 SensitivityAnalysis .................................... 33 10 SensitivityAnalysisgraph................................. 34 11 Sensitivity Analysis result . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 12 Montecarlosimulation1.................................. 35 13 Montecarlosimulation2.................................. 36 14 Montecarlo simulation 2 execution graph . . . . . . . . . . . . . . . . . . . . . . . . . 37 15 Modeltrainingworkflow.................................. 38 16 APIsignup......................................... 42 17 APIlogin .......................................... 42 18 APImachinedefinition................................... 42 19 APIredefinemachine ................................... 43 20 API choice of machine for which to generate SSH keys . . . . . . . . . . . . . . . . . 43 21 API result of the SSH keys generation for the chosen machine . . . . . . . . . . . . . 43 22 APIexecutionsdashboard................................. 44 23 APIrunanewexecution ................................. 44 24 API results of an execution that ended well . . . . . . . . . . . . . . . . . . . . . . . 45 25 API execution ended with errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 6 1 INTRODUCTION 1 Introduction With the ongoing surge in computing power and the impending exascale era, the scientific community faces a pivotal challenge in crafting software solutions that can effectively tap into the vast computational resources at hand. In the domain of materials science, there is a growing trend towards performing structure calculations in a high-throughput manner. This enables the rapid screening of numerous materials for a wide range of applications and the creation of extensive reference datasets. These datasets are essential for training machine learning algorithms, which in turn are used to forecast fundamental material properties or design interatomic potentials. Although it’s feasible to handle a limited number of calculations manually, the emerging paradigm where data takes the lead in scientific discoveries demands specialized workflow solutions. These solutions should autonomously initiate and retrieve calculations, maintain structured data repositories, and meticulously record the origins, historical context, and interrelationships of all data, referred to as data provenance. Moreover, it is ideal for these workflows to include informative descriptions for the data, facilitating easy access, comprehension, and utilization, even for individuals with limited expertise in the relevant field. This project has been developed with the Workflows and Distributed Computing group, led by Rosa Maria Badia at the Barcelona Supercomputer Center and with the support of Senior Researcher Jorge Ejarque. The group is currently engaged in the Caelestis project, an initiative funded by the EU’s Horizon Europe program. This project aims to pioneer technical research into virtual prototyping and digital twins, offering transformative potential for the aviation industry. The research from CAELESTIS could play a pivotal role in rapidly decreasing aircraft weight, thereby contributing to a significant reduction in fuel consumption and gas emissions in the aerospace sector by 2050. 1.1 Problem formulation The thesis will investigate how to develop a service for the generation of simulation workflows supporting probabilistic design and predictive manufacturing of next-generation aircraft structures. The user will be able to define which simulation software to use in each workflow and other parameters, and the service will generate the workflows that will be internally parallelized with PyCOMPSs. 1.2 Motivation and objectives The basic philosophy of this research is to offer dynamic workflows with the following qualities: •Flexibility: The Python scripting interface and a high degree of modularity provide users with almost unlimited freedom for developing and deploying workflows. •Modularity: The workflows are built based on common shared phases, each workflow should be thought of as a puzzle composed of common pieces, in this case, the different common phases. •Compatibility: The project is compatible with different simulators, and samplers and it’s open to any future implementation. The thesis contributes towards creating an ecosystem that is forward-compatible with future technologies. Simultaneously, it enables engineers without a deep computer science background to execute multiphysics simulations using high-performance computing techniques on distributed and shared memory supercomputers, without requiring extensive expertise in the intricate HPC domain. 7 2 STATE-OF-THE-ART 2 State-of-the-art During the project’s development, inspiration was drawn from Mattoso et al. (2015) [Mat+15] on dynamic steering of HPC scientific workflows. Their emphasis on ’human-in-the-loop’ integration, real-time monitoring, and workflow adaptability resonated with the project’s objectives. By embracing their taxonomy and grasping the challenges of dynamic workflows, mechanisms for realtime user engagement, monitoring, and dynamic adaptation were integrated, leading to an efficient, user-centric system. Research by Guo et al. (2022) [Guo+22] on the GEO-WMS system underscored the intricacies of scientific computing and the pivotal role of High Performance Computing (HPC) in geoscience. Their structured workflow description method was adopted, facilitating a streamlined HPC service interface. Their novel approach, which combined user habit analysis, data replication, resource allocation, and runtime prediction, set the foundation for this project. The emphasis of their system on user operations, efficient data management, and resource conservation accentuated the importance of a user-focused workflow management system. Drawing from these insights, efforts were made to enhance the project’s efficiency, reproducibility, and user experience. The paper ’Achieving dynamic workflow management system by applying provenance based checkpointing method’ [KKK15] provides a comprehensive perspective on dynamic checkpointing in high-performance computing, acting as a pivotal reference for projects focusing on fault tolerance and workflow management. Given that scientific workflows can span weeks due to extensive data and computation, they need to be adaptable to changing conditions. Such dynamic systems must be prepared to face unforeseen challenges, adapt, and optimize. This research underscores the importance of fault tolerance, ensuring system operation even in the face of obstacles, particularly addressing crash faults that require task and environment restoration. For the master’s thesis, the focus was on understanding, simulating, and optimizing scientific workflows in distributed environments. WorkflowSim[CD12], with its specialized features for workflow management, served as the foundational tool. Its emphasis on system overhead modeling, task clustering, and realistic failure simulation offered a solid research framework. Through WorkflowSim, the intricacies of scientific workflows, optimization techniques, fault tolerance, and overhead management were explored, all crucial for the effective execution of distributed system workflows. 8 4 ARCHITECTURE 4. Download workflows code: The YAML file describes which workflows have to be executed, therefore the service gets from the GitHub repository the requested code. The service gets only the described workflow code, without downloading the other workflow’s definitions. 5. Data staging, copy input files into the working directory: The service copies all the necessary input files for the simulations inside the distributed file system. 6. Data staging, copy workflows into the installation directory: The service copies the workflow’s downloaded code inside the distributed file system. 7. Workflow execution 8. Copy the result files: Once the job ends, service access to the DFS and gets back the results of the executions. 9. Upload result files: to store the result files permanently, the service service uploads them to the FTP server. This service is designed to facilitate the implementation and execution of dynamic workflows. To achieve this, I have chosen an approach that separates the definition of the overall workflow from the specification of its individual phases. With this implementation approach, we eliminate the static limitation that previously bound the phase definitions tightly to the workflow definition. This enables us to envision a new workflow as a modular puzzle. During its setup, we can integrate various phases that might have been part of other workflows. 4.1 Dynamicity of the workflows 4.1.1 YAML descriptor One of the main points of this project is the dynamicity of the workflows. To reach this objective, workflows are designed based on descriptions provided in a YAML file. --- workflow_type: name_of_wokflow phases: phase1: name: implmentation_name parameters: phase2: type: implmentation_name parameters: outputs: input: problem: In Appendix 10.2, there are some real examples of YAML files describing workflows. Above there is the basic structure of these files: •workflow type: each developed workflow needs a unique name to be identified. •phases: the description of the workflow composed by each phase and its parameters. •outputs: the name of the result files. 15 4 ARCHITECTURE •input: the source of each needed input file. •problem: the description of the simulation’s problem with its variables and information to build the data set. 4.1.2 Dynamicity As described in Figure 2, to ensure dynamicity, each phase has a universal class and the workflow executes the specific implementation of that phase by passing the specific implementation name described inside the YAML file. Each specific implementation is stored in a separate file inside the same folder of the universal class of that phase. From a workflow developer’s viewpoint looking to introduce a new phase, there are two options: workflow developers can design a distinct method for a current phase or introduce a new phase by creating its standard class along with the specific method. To develop a new workflow, they need to program it by invoking the standard class for each phase the workflow needs to execute. Figure 2: Dynamic workflows 4.2 Service 4.2.1 Data staging and preparation of the environment To kickstart the workflow loading process, the service, in conjunction with the yaml file upload and the workflow execution request, employs a series of methods to ensure an ideal work environment setup. This entails copying the input files and the distinct workflow code directly into the DFS. 16 4 ARCHITECTURE Initially, the service fetches input files such as the mesh and template files for the simulation from the FTP server. Subsequently, based on the designated workflow, the service retrieves solely the code pertinent to that workflow and its phases from the GitHub repository. Given that each workflow demands distinct modules for execution, the service, via an SSH connection, executes the script located within the downloaded specific workflow on the cluster machine. load-workflow.sh: This script is tailored to configure the environment for a particular workflow. It designates paths for the simulator binary and outlines the number of processes and processors per node. Following this, it clears all pre-loaded modules and introduces a unique set of modules essential for the workflow, encompassing software and libraries such as oneservice, intel, impi, ALYA, python, mkl, and boost. The rationale behind the described approach is: 1. Optimized Resource Use: The system streamlines the workflow loading with the YAML file upload and execution request, ensuring efficient resource utilization. 2. Data Specificity: By fetching specific input files from the FTP server and relevant code from GitHub, the system ensures accuracy and reduces data handling. 3. Tailored Environments: The service customizes the environment for each workflow by executing its specific script, ensuring precise requirements are met and minimizing conflicts. 4. Automated Setup with load-workflow.sh: This script automates environment setup, designating correct paths, managing processes, and loading necessary modules, ensuring the workflow runs efficiently and error-free. The modular approach, where each workflow has its setup script, allows for easy scalability. If a new workflow is introduced or an existing one is updated, only the relevant script needs to be modified without affecting the entire system. In summary, the approach prioritizes efficiency, accuracy, and adaptability to cater to different workflow needs. After preparing the environment for the specified workflow, the service executes a command tailored for the cluster machine, based on the parameter provided (as shown in Figure 23). To effectively facilitate the execution of extensive tasks in a sophisticated setting like the HPC, I have developed a checkpoint feature that offers two distinct usage options depending on user preference. •The initial feature is automatic checkpointing. If a job terminates due to a time constraint, a Python thread monitoring the status of active jobs will reinitiate the workflow submission, using the same parameters as the initial launch. This process can continue until the job concludes successfully. •The second feature provides users with the option to handle checkpointing manually. If a job ends due to a time constraint, it will appear in the execution dashboard under the ”timeout jobs” list, as shown in Figure 22. Users can then initiate a new job from the checkpoint by clicking on the blue button associated with the job ID of the prior task. The decision to offer two distinct checkpointing methods stems from considerations about the potential costs and constraints users might encounter on the cluster machine. For instance, if users execute a workflow containing errors, the automatic checkpointing option could inadvertently consume significant computational resources and time. In such scenarios, opting for manual checkpointing becomes a prudent choice, allowing users to exercise greater control and avoid unnecessary 17 4 ARCHITECTURE resource consumption. Conversely, if a user is confident about the successful outcome of their simulation but anticipates that it might exceed their allocated execution time, the automatic checkpointing feature becomes invaluable. This option ensures the simulation continues seamlessly without manual intervention, even if it hits the initial time limit. 4.2.2 Submission and execution of workflows In the realm of High-Performance Computing (HPC), job submission is a structured process that allows users to request computational resources for executing their tasks. The following steps provide a concise overview of this process: 1. Preparation: Before submitting a job, ensure that the code is optimized for the HPC environment. This might involve parallelizing the code, optimizing algorithms, or ensuring compatibility with specific libraries available on the HPC system. 2. Script Creation: Create a job script for the specific cluster machine. This script must contain: •Specifications for the required resources (e.g., number of CPUs, amount of memory, expected runtime). •The actual commands to run the application or simulation. •Any module loads or environment setup needed for the software to run. 3. Job Submission: Use the HPC system’s job scheduler to submit the job script. 18 5 IMPLEMENTATION 5 Implementation 5.1 Implementation of the architecture Figure 3, it’s described the actual implementation with more details. Figure 3: Implementation of the concept Items: •MareNostrum 4 and Nord 3 are the supercomputers used for the implementation of this ecosystem. •PyCOMPSs PyCOMPSs is a programming model and runtime system aimed at parallelizing and distributing the execution of Python applications. •GPFS: it’s the distributed files system provided by IBM Spectrum Scale. It’s available in NORD3 and MareNostrum 4. •SLURM: (Simple Linux Utility for Resource Management) is an open-source job scheduler and resource manager for Linux-based HPC clusters, as Marenostrum 4 and Nord 3. 5.2 Definition of a workflow To implement the workflow dynamicity, as described in 4.1.2, I used the importlib and getattr to perform dynamic calls. In Figure 4, it’s described how these dynamic calls are performed: 1. The workflow creates an instance of the universal class corresponding to that phase. 2. The specific implementation for the phase is retrieved from the YAML file. 19 5 IMPLEMENTATION Figure 4: Implementation of dynamic workflows Utilizing importlib, the module associated with the specific phase and its particular implementation is imported. The getattr function then enables the workflow to execute the specific method, with parameters detailed in the YAML file passed as kwargs. Utilizing importlib, the module associated with the specific phase and its particular implementation is imported. The getattr function then enables the workflow to execute the specific method, with parameters detailed in the YAML file passed as kwargs. module = importlib . import_module ( 'PHASES `+ namePhase + nameImplementation ) return getattr ( module , 'unique_name_method')( args , ** kwargs ) 20 5 IMPLEMENTATION 5.2.1 Definition of a workflow In this section, I outline the workflow implementation methods and the rationale behind the chosen approaches. In Figure 5, we present the foundational definition of a workflow, which comprises four phases that have already been implemented. 1. Sampling: This is the initial phase where data or samples are collected or chosen for further processing. Depending on the context, this could involve gathering raw data, selecting specific data points, or even collecting physical samples in some cases. 2. Data preparation: Once the samples are obtained, they undergo a preparation process. This phase involves cleaning, organizing, and structuring the data to make it suitable for analysis. It ensures that the data is in the right format and is free of any inconsistencies or errors. 3. Simulation: With the prepared data in hand, the next step is simulation. This phase involves running the data through models or simulations to predict outcomes, analyze patterns, or derive insights. The specific nature of the simulation can vary widely based on the goals of the workflow. 4. Result’s collection: After the simulation is completed, the results are collected and analyzed. This phase is crucial as it provides the outcomes or findings derived from the processed data. These results can then be used for decision-making, further research, or any other relevant purpose. Together, these four phases provide a comprehensive overview of the workflow, ensuring a systematic and organized approach to data processing and analysis. Figure 5: Basic definition of a general workflow From the figure 6, it’s evident that in the foundational parallelization of a workflow operated by COMPSs, as depicted in the diagram above 5, the process begins with the sampling phase. This phase is responsible for formulating the design of the experiment. The matrix, which encompasses all the data produced using various random distributions and adhering to the parameters outlined in the YAML file, operates in such a way that each matrix row drives the execution of a complete flow. This continues until all workflows converge to produce the results file. 21 5 IMPLEMENTATION Figure 6: Parallelization of a general workflow 5.3 Service For developing the service that support users in running, managing the execution of different workflows I used Django [Dja19], Nginx, PostgreSQL and Gunicorn. The service is accessible via this link: Caelestis. Figure 7 describes the infrastructure of my service. Figure 7: Infrastructure of the service 5.3.1 Deployment Steps The deployment setup for serving a Django application with Gunicorn and Nginx involves the following steps: 22 5 IMPLEMENTATION 1. Django Application: I developed my web application using Django, defining models, views, templates, and URL routing. 2. Gunicorn Configuration: I configured Gunicorn to run your Django application. Gunicorn serves as the application server that listens for incoming HTTPS requests on a specified port. 3. Nginx Configuration: Nginx is configured to act as a reverse proxy. It listens for incoming HTTPS requests on port 443 (HTTPS), terminates SSL if necessary, and forwards requests to Gunicorn. 4. Static File Handling: Nginx is configured to serve static files (for example: CSS, images) directly, without passing these requests to Gunicorn. This offloads some of the work from the application server, improving performance. 5. PostgreSQL: all the data are stored in relational SQL tables using PostgreSQL. 5.3.2 Django Django is a high-level Python web framework that simplifies the development of web applications by providing a robust set of tools and libraries for building dynamic websites and web services. Django handles application logic, URL routing, database management, and more. Developers write Python code to create web applications using Django. More details about the implemented Django models can be found in Appendix 10.4.1. Database diagram: Figure 8: Database diagram 23 5 IMPLEMENTATION 5.3.3 Gunicorn (Green Unicorn) Gunicorn is a Python WSGI (Web Server Gateway Interface) HTTP server. It’s responsible for serving Django applications by interfacing with Django’s Python code. When a request comes in, Gunicorn communicates with the Django application, processes the request, and sends the response back to the web client (e.g., a web browser) passing through the Nginx server. Gunicorn is designed to be a WSGI server and is good at handling Python web applications like Django. It can serve multiple Django processes, enabling concurrency. 5.3.4 Nginx Nginx, as mentioned earlier, is a high-performance web server and reverse proxy server. In the context of serving Django applications, Nginx is typically used as a reverse proxy. Nginx acts as an intermediary between external clients and Gunicorn. It handles tasks such as SSL termination (if HTTPS is used), load balancing, and serving static files. Nginx is known for its efficiency in handling a large number of concurrent connections and is often used to improve the security and performance of web applications. 5.3.5 PostgreSQL PostgreSQL, often referred to as ”Postgres,” is a robust open-source relational database management system (RDBMS). It’s known for its reliability, extensibility, and adherence to industry standards. PostgreSQL stores data in structured tables, supports complex queries with SQL, and offers advanced features like ACID compliance, data types for JSON and geospatial data, and strong security measures. PostgreSQL has a good integration with Django. The database schema 8 follows the descriptions of the implemented Django models. 5.4 Paramiko Paramiko [Zad19] is a Python library that provides an interface for working with SSH and SFTP (Secure FTP). It allows for secure connections to remote servers and the execution of commands or file transfers over these connections. I used Paramiko to connect via SSH because it offers a programmatic way to establish and manage SSH sessions, making it easier to automate tasks, execute remote commands, or transfer files to and from remote systems securely. In the current implementation, Paramiko is responsible for executing scripts and commands by interfacing with the HPC system. 5.4.1 User and Key Generation on Your Service 1. User Registration: Users sign up for your service, providing necessary details. 2. Machine Definition and SSH Key Creation: •After registration, when a user wants to add or define a new machine to be managed by the service, they initiate the process for that specific machine. •At this point, your service automatically generates a pair of SSH keys for that machine: a public key and a private key. 3. Returning Keys and Token: •The public key is sent back to the user. 24 6 PHASES input: template_fie: /path/template/OHT_Validation_D2-tem.fie.dat template_sld: /path/template/OHT_Validation_D2-tem.sld.dat template_dom: /path/template/OHT_Validation_D2-tem.dom.dat These template files contain variable tags, which follow the pattern %name of variable%. The application scans these files for these variable tags. Upon identifying a tag, the application extracts the variable’s name. Subsequently, it replaces the variable tags %name of variable% with the actual values provided in the data set. For a more detailed understanding, an example of Alya’s template file can be found in the appendix, specifically in Appendix 10.3.1. For those looking to expand the workflow by introducing a new simulator or a different case, it’s essential to provide the corresponding template file. This ensures that the new addition integrates seamlessly into the existing workflow and operates as intended. 6.3 Simulations 6.3.1 Alya Alya [Cas+14] is a simulation code for high performance computational mechanics. Alya solves coupled multiphysics problems using high-performance computing techniques for distributed and shared memory supercomputers, together with vectorization and optimization at the node level. I used the @mpi decorator to define a task is going to invoke a MPI executable, and as parameter I passed: •runner:String defining the mpi runner command. •binary: String defining the full path of the binary that must be executed, in this case Alya. •args: The name of the simulation •processes: Number of cpus used by Alya. •processes per node: Number of cpus for each node. •working directory: path of the working directory. PyCOMPSs can leverage MPI [Gro+96] for its internal communications and for executing tasks in parallel across distributed nodes. The integration of PyCOMPSs with MPI allows users to take advantage of the scalability and efficiency of MPI while still benefiting from the ease of use and task-based parallelism provided by PyCOMPSs. All the variables needed are set inside the environment that was prepared previously. @mpi ( runner ="mpirun", binary="$ALYA_BIN " , args = "{{ name }} ", processes =" $ALYA_PROCS", processes_per_node="$ALYA_PPN " , working_dir="{{ wdir }} ") @task ( returns =1 , time_out =3600) def simulation (wdir , name , ** kwargs ): return 31 6 PHASES 6.4 Collecting the results The provided Python code outlines two functions, collect and write file, designed for postsimulation operations in a parallel or distributed computing context. 1. collect Function: •Dynamically imports a module based on a provided type from PHASES.POSTSIMULATION. •Invokes the collect results method from this module to gather results, which are subsequently returned. 2. write file Function: •Constructs an output file path using given parameters and kwargs. •Similarly, imports a module based on the type. •Calls the write yFile method from this module to save the results to the specified file path. For the cases that have been implemented, the yis the strength of the mesh and it’s the result of the Alya simulation. @task ( wdir = DIRECTORY_INOUT , returns =1) def collect(type , wdir , nameSim ): module = importlib . import_module ( 'PHASES . POSTSIMULATION . '+type ) y= getattr(module , 'collect_results')( wdir , nameSim ) return y @task ( y_param = COLLECTION_IN ) def write_file ( type , output_folder , y_param , ** kwargs ): file=str ( kwargs . get ("outputs").get(" alya - output ")) y_file = output_folder +"/"+file module = importlib . import_module ( 'PHASES . POSTSIMULATION . '+type ) getattr( module , 'write_yFile')(y_file , y_param ) return 32 7 WORKFLOWS EVALUATION 7 Workflows evaluation This section outlines the three primary workflows that have been implemented, detailing the main objective of each. 7.1 Sensitivity analysis Sensitivity analysis is a systematic process used to understand how changes or variations in the values of input variables of a model affect the results or outcomes produced by that model. The main objectives of sensitivity analysis are to: •Identify Key Influences: Determine which input variables or parameters have the greatest influence on the output. This knowledge can help focus efforts on controlling or optimizing these influential factors. •Quantify Impact: Understand the magnitude and direction of the changes in the output caused by variations in the input variables. This information is crucial for risk assessment, decision-making, and scenario planning. •Enhance Understanding: Gain insights into the relationships between input and output variables, leading to a better understanding of the model’s behavior and limitations. Sensitivity analysis is particularly valuable when dealing with complex models or when input data includes uncertainties. It helps decision-makers understand the reliability and robustness of their models and supports informed decisions by providing insights into the potential consequences of different parameter variations. This workflow is composed of the following phases: 1. Sampling with SaLib, specifically the Morris implementation 2. Simulation using Alya 3. Sensitivity analysis using SaLib, specifically the Morris implementation Figure 9: Sensitivity Analysis The graph below is the execution graph generated by PyCOMPSs for a test with 8 simulations. 33 7 WORKFLOWS EVALUATION Figure 10: Sensitivity Analysis graph The graph presented in Figure 11 is derived from a sensitivity analysis case using 23 physical variables for the sample set. This dataset generated 480 simulations. The YAML file detailing this execution can be found in Appendix 10.2.1. 34 7 WORKFLOWS EVALUATION Figure 11: Sensitivity Analysis result 7.2 Montecarlo simulation A Monte Carlo simulation is a computational technique used to estimate complex mathematical results by using random sampling and probability distributions. It’s particularly useful when deterministic methods are impractical or impossible to apply due to the complexity of a problem, the involvement of numerous variables, or the presence of uncertainty. Two distinct versions of these workflows have been implemented, each corresponding to a different Alya configuration that the user might choose to utilize. Figure 12: Montecarlo simulation 1 35 7 WORKFLOWS EVALUATION Figure 13: Montecarlo simulation 2 The graph below is the execution graph generated by PyCOMPSs for a test with 8 simulations regarding the Montecarlo simulation described in Figure 13. 36 7 WORKFLOWS EVALUATION Figure 14: Montecarlo simulation 2 execution graph 7.3 Model training This workflow 15 is designed based on the phases outlined in Montecarlo’s model, as depicted in Figure 12. In addition to the original phases, this workflow incorporates additional stages to further process and interpret the results. While it’s currently in the developmental stages, the plan is to implement k-fold cross-validation. The dataset will be partitioned into a training set, comprising 80% of the data, and a test set, making up the remaining 20%. Both Dslib and sklearn 37 7 WORKFLOWS EVALUATION can be employed to train the model using the training set and subsequently make predictions with the test set. Upon completion, a comprehensive K-Fold-CV evaluation will be conducted to assess the model’s performance. As referenced in [´ Alv+19], Dislib is a specialized distributed computing library with a primary focus on machine learning, built atop the PyCOMPSs framework. Inspired by NumPy and scikit-learn, dislib provides various supervised and unsupervised learning algorithms through an easy-to-use API. Figure 15: Model training workflow 38 8 FUTURE WORKS 8 Future Works 8.1 Execution time optimization for job scheduling An interesting point to investigate is optimizing the time limit for job scheduling, particularly for workflows with unpredictable completion times, especially within SLURM-managed systems. In our subsequent research, we aim to delve deeper into the implications of allocating shorter execution times to jobs entering the HPC queue. The central hypothesis is that by granting a job a shorter execution window, it might potentially enter the queue faster, albeit with the risk of not completing its execution within the allocated time. To counteract this, we plan to leverage checkpointing mechanisms. Checkpointing, a technique that periodically saves the state of a running job, would allow us to restore and resume the job’s execution from the last saved state once it’s prematurely terminated due to the shorter execution window. Comparatively, the conventional approach of allocating a more extended execution time might delay a job’s entry into the queue, given the constraints of available slots fitting the longer duration. However, it offers the advantage of uninterrupted execution once the job starts. Our future investigations will focus on: •Evaluating the trade-offs between shorter execution times with checkpointing versus longer, uninterrupted execution times. •Analyzing the overhead introduced by the checkpointing process and its impact on the overall job completion time. •Assessing the potential benefits in terms of resource utilization, job throughput, and system efficiency. 8.2 Implementation of new phases Another important future workline is integrating new phases and workflows. I’m already working on these new implementations: 1. Integration of OpenFoam for Simulations: •OpenFoam, a renowned open-source computational fluid dynamics (CFD) software, can be integrated to provide more comprehensive simulation capabilities. This would allow for a broader range of applications, especially in fields requiring fluid dynamics simulations. 2. Introduction of Advanced Meshers: •TextGen: Incorporating TextGen as a mesher would enable the generation of structured grids, which can be crucial for certain types of simulations. •Gmsh: As a widely-used, three-dimensional finite element mesh generator, Gmsh’s inclusion would significantly enhance the meshing capabilities of the system, allowing for more complex and accurate simulations. 3. Incorporation of Artificial Intelligence (AI) Techniques: •Sklearn: Integrating Sklearn, a machine learning library, would provide a plethora of algorithms for data analysis and modeling. This can be particularly useful for predictive simulations and analysis. •Twinkle: By leveraging Twinkle, an advanced AI algorithm, the system can achieve more efficient data processing and potentially faster simulation results. 39 8 FUTURE WORKS •K-Cross Validation: Implementing K-Cross Validation would ensure that the machine learning models integrated into the system are robust and reliable. This validation technique divides the dataset into ‘K’ subsets and uses one subset for testing while the others are used for training. The process is repeated ‘K’ times, ensuring a comprehensive evaluation of the model’s performance. In conclusion, the future holds immense potential for expanding the capabilities of the current system. By integrating advanced simulation tools, meshers, and AI techniques, the system can cater to a wider range of applications and offer more accurate and efficient results. 40 10 APPENDIX -dmini: 0.0 -dmax: 1.0 -a0: 0.9250 -G2T: 0.28 -G6s: 0.79 -fGC: 0.0006 -Sp: 66.9000 -Kplas: 0.0500 -eta: 0.0000 -a11: -5.5000e-06 -a22: 2.5800e-05 -dT: 0.0000 -b11: 0.0000e+00 -b22: 5.0000e-03 -dM: 0.0000 -d1Max: 1.0000 -d2Max: 1.0000 -d3Max: 1.0000 -d4Max: 1.0000 -d5Max: 1.0000 -d6Max: 1.0000 -thick: 0.13 -muGSL: 0.0035 -YBT: 38.7 -YBC: 600.0 -mufXC: 0.1 -E11C: 150000 -Beta: 4.525e-8 variables-derivate: in1: method: insitu_strengths.in_situ_CAELESTIS_project_IN parameters: [thick,E11,E22,v12,G12,YT,YC,SL,Kplas,Sp,G6s,Beta,a0,GIc,GIIc] outputs: [YTIN1T,YCIN1T,SLIN1T] in2: method: insitu_strengths.in_situ_CAELESTIS_project_IN parameters: [eval(2*thick),E11,E22,v12,G12,YT,YC,SL,Kplas,Sp,G6s,Beta,a0,GIc,GIIc] outputs: [YTIN2T,YCIN2T,SLIN2T] out: method: insitu_strengths.in_situ_CAELESTIS_project_OUT parameters: [thick,E11,E22,v12,G12,YT,YC,SL,Kplas,Sp,G6s,Beta,a0,GIc,GIIc] outputs: [YTOUT1T,YCOUT1T,SLOUT1T] 10.2.2 Montecarlo simulation YAML file --- workflow_type: MONTECARLO_SIM_sld phases: sampler: 47 10 APPENDIX name: PYDOE sim: type: alya outputs: alya-output: alya_output.txt input: mesh: /gpfs/projects/bsce81/alya/tests/workflow_stable/meshs/FEM_OHT_nom template_sld: /gpfs/projects/bsce81/alya/tests/workflow_stable/BACKEND/templates/FEM_OHT_nom-tem.sld.dat template_dom: /gpfs/projects/bsce81/alya/tests/workflow_stable/BACKEND/templates/FEM_OHT_nom-tem.dom.dat problem: num_var: 37 ratio_norm: 0.75 n_samples: 5 criterion:'m' variables-sampler: -E11: {mean:171420.,cov:1.38} -E11C: {mean:150000.,cov:2.} -E22: {mean:9080.,cov:2.} -v12: {mean:0.32,cov:2.} -G12: {mean:5290.,cov:2.} -v23: {mean:0.487,cov:2.} -XT: {mean:2323.5,cov:5.49} -fXT: {mean:0.4,cov:2.} -XC: {mean:1200.1,cov:2.} -fXC: {mean:0.2,cov:2.} -YT: {mean:62.3,cov:2.} -YC: {mean:253.7,cov:2.} -SL: {mean:92.3,cov:2.} -YBC: {mean:600.,cov:2.} -YBT: {mean:38.7,cov:2.} -Sp: {mean:66.9,cov:2.} -Kplas: {mean:0.05,cov:2.} -G1T: {mean:133.3,cov:2.} -fGT: {mean:0.3,cov:2.} -G1C: {mean:100000.,cov:2.} -fGC: {mean:0.00061,cov:2.} -GIc: {mean:0.28,cov:2.} -G2C: {mean:1.312653028,cov:2.} -GIIc: {mean:0.79,cov:2.} -thick: {mean:0.125,cov:2.} -a0: {mean:0.9250,cov:2.} -dens: {mean:1.58e-9,cov:2.} -b11: {mean:0.0,cov:2.} -b22: {mean:0.005,cov:2.} -a11: {mean:-5.50E-6,cov:2.} -a22: {mean:2.58E-5,cov:2.} -mufXC: {mean:0.1,cov:2.} -cohDens: {mean:1.3e-9,cov:2.} 48 10 APPENDIX -Ct1: {mean:33.5137,cov:2.} -Ct2: {mean:56.2932,cov:2.} -etaBK: {mean:1.45,cov:2.} -G6s: {mean:0.802,cov:2.} variables-fixed: -rho: 0.0 -dmini: 0.0 -dmax: 1.0 -G2T: 0.2800 -eta: 0.0 -dT: 0.0 -dM: 0.0 -d1Max: 1.0000 -d2Max: 1.0000 -d3Max: 1.0000 -d4Max: 1.0000 -d5Max: 1.0000 -d6Max: 1.0000 -Kp: 1.0000e+06 -muGSL: 0.0035 -Beta: 4.525e-8 variables-derivate: in1: method: insitu_strengths.in_situ_CAELESTIS_project_IN parameters: [thick,E11,E22,v12,G12,YT,YC,SL,Kplas,Sp,G6s,Beta,a0,GIc,GIIc] outputs: [YTIN1T,YCIN1T,SLIN1T] in2: method: insitu_strengths.in_situ_CAELESTIS_project_IN parameters: [eval(2*thick),E11,E22,v12,G12,YT,YC,SL,Kplas,Sp,G6s,Beta,a0,GIc,GIIc] outputs: [YTIN2T,YCIN2T,SLIN2T] out: method: insitu_strengths.in_situ_CAELESTIS_project_OUT parameters: [thick,E11,E22,v12,G12,YT,YC,SL,Kplas,Sp,G6s,Beta,a0,GIc,GIIc] outputs: [YTOUT1T,YCOUT1T,SLOUT1T] 10.3 Templates files 10.3.1 Template Alya $------------------------------------------------------------------- $ $ OHT_Validation_D2 $ $ Details: $ Open-hole tension $ Dimensions (W x L x T): 12 mm x 24 mm x 3.35 mm $ Hole diameter: 2 mm $ Layup: [45/0/-45/90]_3S $ Ply thickness: 0.13 mm 49 10 APPENDIX $ Cohesive thickness: 0.01 mm $ $ Units: SI (mm) $ $ Reference: CAELESTIS project $ $------------------------------------------------------------------- PHYSICAL_PROBLEM PROBLEM_DEFINITION TEMPORAL_DERIVATIVES: DYNAMIC NLGEOM: OFF THERMAL_ANALYSIS: OFF END_PROBLEM_DEFINITION PROPERTIES $ ,,,,,, int ,,,,,, MATERIAL = 1 DENSITY = 1.3000e-09 1.0000e+05 $ GIc GIIc Ct1 Ct2 etaBK Kp rho dini dmax COHESIVE_MODEL: TURON, CURRENT \ %GIc% %GIIc% %Ct1% %Ct2% %etaBK% %Kp% %rho% %dmini% %dmax% $ ,,,,,, INN-1T ,,,,,, MATERIAL = 2 DENSITY = 1.6000e-09 $ E11 E22 v12 v23 G12 $ XT fXT XC fXC YTIN1T YCIN1T SLIN1T $ a0 $ G1T fGT G1C fGC G2T G2C G6s $ Sp Kplas $ eta $ a11 a22 dT b11 b22 dM $ d1Max d2Max d3Max d4Max d5Max d6Max $ thick muGSL YBT YBC mufXC E11C CONSTITUTIVE_MODEL: MAIMI \ %E11% %E22% %v12% %v23% %G12% \ %XT% %fXT% %XC% %fXC% %YTIN1T% %YCIN1T% %SLIN1T% \ %a0% \ %G1T% %fGT% %G1C% %fGC% %G2T% %G2C% %G6s% \ %Sp% %Kplas% \ %eta% \ %a11% %a22% %dT% %b11% %b22% %dM% \ %d1Max% %d2Max% %d3Max% %d4Max% %d5Max% %d6Max% \ %thick% %muGSL% %YBT% %YBC% %mufXC% %E11C% $ ,,,,,, INN-2T ,,,,,, MATERIAL = 3 DENSITY = 1.6000e-09 $ E11 E22 v12 v23 G12 $ XT fXT XC fXC YTIN2T YCIN2T SLIN2T $ a0 50 10 APPENDIX $ G1T fGT G1C fGC G2T G2C G6s $ Sp Kplas $ eta $ a11 a22 dT b11 b22 dM $ d1Max d2Max d3Max d4Max d5Max d6Max $ thick muGSL YBT YBC mufXC E11C CONSTITUTIVE_MODEL: MAIMI \ %E11% %E22% %v12% %v23% %G12% \ %XT% %fXT% %XC% %fXC% %YTIN2T% %YCIN2T% %SLIN2T% \ %a0% \ %G1T% %fGT% %G1C% %fGC% %G2T% %G2C% %G6s% \ %Sp% %Kplas% \ %eta% \ %a11% %a22% %dT% %b11% %b22% %dM% \ %d1Max% %d2Max% %d3Max% %d4Max% %d5Max% %d6Max% \ %thick% %muGSL% %YBT% %YBC% %mufXC% %E11C% $ ,,,,,, OUT-1T ,,,,,, MATERIAL = 4 DENSITY = 1.6000e-09 $ E11 E22 v12 v23 G12 $ XT fXT XC fXC YTOUT1T YCOUT1T SLOUT1T $ a0 $ G1T fGT G1C fGC G2T G2C G6s $ Sp Kplas $ eta $ a11 a22 dT b11 b22 dM $ d1Max d2Max d3Max d4Max d5Max d6Max $ thick muGSL YBT YBC mufXC E11C CONSTITUTIVE_MODEL: MAIMI \ %E11% %E22% %v12% %v23% %G12% \ %XT% %fXT% %XC% %fXC% %YTOUT1T% %YCOUT1T% %SLOUT1T% \ %a0% \ %G1T% %fGT% %G1C% %fGC% %G2T% %G2C% %G6s% \ %Sp% %Kplas% \ %eta% \ %a11% %a22% %dT% %b11% %b22% %dM% \ %d1Max% %d2Max% %d3Max% %d4Max% %d5Max% %d6Max% \ %thick% %muGSL% %YBT% %YBC% %mufXC% %E11C% END_PROPERTIES PARAMETERS CSYS_MATERIAL: FIELD= 1 ORIENTATION, TYPE= ELEMENT_NORMAL, ROTAXIS= 3, REFAXIS= 2 END_PARAMETERS END_PHYSICAL_PROBLEM 51 10 APPENDIX 10.4 Implementation details 10.4.1 Django’s models Django’s models used in this project: •Documet Model The Document model represents documents uploaded to the application. It includes the following fields: –document: A FileField that allows users to upload documents. The uploaded files are stored in a directory named ’documents/’. –uploaded at: A DateTimeField that automatically records the date and time when the document was uploaded. •WorkFlow Model The WorkFlow model represents a workflow configuration. It includes the following fields: –samplerName: A CharField with choices from the SAMPLER tuple, representing the name of the sampling method. –samplerParameters: A CharField to store parameters related to the sampling method. –simulation: A CharField with choices from the SIMULATION tuple, representing the type of simulation. –mesh: A CharField to store the path of the the mesh. –templateSim: A CharField to store a template for simulation. –sensitivity: A CharField with choices from the SENSITIVITY tuple, representing the sensitivity analysis method. –sensitivityOutput: A CharField to store the sensitivity analysis output. –outputs: A CharField to store information about the outputs. –numVarproblem: An IntegerField with choices from the INTEGER CHOICES tuple, representing the number of variable problems. –variablesSampler: A CharField to store variables related to the sampling method. –variablesFixed: A CharField to store fixed variables. •Execution Model The Execution model represents the execution of a workflow. It includes fields like jobID,user,author,nodes,status,time, and others to store executionrelated information. Additionally, it includes fields like name workflow,wdir,workflow path, autorestart, and name sim to store details about the workflow and its execution. •Key Gen Model The Key Gen model is used for key generation and storage. It includes fields for author,machine,public key, and private key to store information related to keys. •Machine Model The Machine model represents information about a machine. It includes fields for author, user,fqdn (fully qualified domain name), and wdir (working directory) to store machinerelated details. •Connection Model The Connection model represents user connections. It includes fields for user,idConn id (primary key), and status to store information about connections. 52 10 APPENDIX 10.4.2 SSH Key Generation and Encryption In the following code snippet, I generate SSH keys and encrypt the private key using the ‘paramiko‘ library for SSH key generation and the ‘Fernet‘ library for encryption. This line generates a secure encryption key (token) using the ‘Fernet‘ library. Fernet is a symmetric key generation library used for encryption and decryption of data. token = Fernet . generate_key () This line generates an RSA key pair (public and private keys) using the ‘paramiko‘ library. RSA is an asymmetric encryption algorithm that produces a public key for encryption and a private key for decryption. The ‘2048‘ argument specifies the key length (in bits), making the key more secure. key = paramiko . RSAKey . generate (2048) These lines initialize an empty string buffer called ‘privateString‘ and write the private key (in PEM format) generated by ‘paramiko‘ into the ‘privateString‘ buffer. The private key is then retrieved from the buffer and assigned to the ‘private key‘ variable. privateString = StringIO () key . write_private_key ( privateString ) private_key = privateString . getvalue () These lines split the ‘private key‘ string using single quotes as delimiters and assign the cleaned private key string (without single quotes) back to the ‘private key‘ variable. x = private_key . split ("'") private_key = x [0] This line retrieves the public key from the ‘paramiko‘ key object and converts it to a Base64- encoded string, which is assigned to the ‘public key‘ variable. public_key = key . get_base64 () These lines encrypt the private key using the encryption token (symmetric key) generated earlier. The ‘encrypt‘ function is expected to be a custom function used for encryption. It takes the ‘private key‘ string (encoded as bytes) and the ‘token‘ as arguments. After encryption, the resulting encrypted private key is converted to a string and cleaned up by removing any single quotes, leaving just the encrypted private key. enc_private_key = encrypt ( private_key . encode () , token ) enc_private_key = str( enc_private_key ).split ("'") [1] These lines split the ‘token‘ string using single quotes as delimiters to remove any single quotes from the string. The resulting clean token is assigned back to the ‘token‘ variable. 53 10 APPENDIX x = str ( token ). split ( "'") token = x[1] In summary, this code generates RSA key pairs, encrypts the private key using a security token, and ensures that the resulting keys and tokens are properly formatted for further use in secure communication and authentication in SSH connections. 10.4.3 Explanation of COMPSs’ Checkpoint Policies In a distributed computing or workflow management system, checkpoint policies are used to manage the creation of checkpoints, which are snapshots or copies of a program’s state at a specific point in time. These checkpoints serve various purposes, such as fault tolerance, debugging, or other system requirements. The provided information outlines key details of different checkpoint policies: Policy Details: 1. Policy Name: This is the identifier or name of the checkpoint policy used to reference and select a specific policy when configuring the system. 2. Class Name: The fully qualified name of the Java class responsible for implementing the checkpoint policy. It specifies the code that gets executed when the policy is triggered. 3. Params: This field may refer to configuration parameters or options associated with the checkpoint policy. These parameters customize the policy’s behavior, but their specific meanings depend on the implementation. 4. Description: A brief explanation or description of what the checkpoint policy does and under what conditions it is triggered. This description helps users understand the policy’s purpose and behavior. Available Policies: 1. Periodic Time (PT) •Policy Name: PT •Class Name:es.bsc.compss.checkpoint.policies.CheckpointPolicyPeriodicTime •Params:period.time (This parameter likely specifies the time interval for checkpointing, but its exact meaning depends on the implementation.) •Description: This policy triggers checkpoints at regular time intervals, where ’n’ represents the configured time interval. 2. Finished Tasks (FT) •Policy Name: FT •Class Name:es.bsc.compss.checkpoint.policies.CheckpointPolicyFinishedTasks •Params:finished.tasks (This parameter could specify the number of finished tasks required to trigger a checkpoint.) •Description: This policy triggers checkpoints after a certain number of tasks have finished, where ’n’ represents the configured number of finished tasks. 54 10 APPENDIX 3. Instantiated Tasks Group (ITG) •Policy Name: ITG •Class Name:es.bsc.compss.checkpoint.policies.CheckpointPolicyInstantiatedGroup •Params:instantiated.group (This parameter likely defines the group of instantiated tasks that trigger a checkpoint.) •Description: This policy triggers checkpoints after a certain number of tasks have been instantiated within a specific group, where ’n’ represents the configured number of instantiated tasks. These checkpoint policies offer different strategies to control when checkpoints are created in a distributed computing or workflow system, allowing users to balance fault tolerance, resource usage, and program execution efficiency according to their specific requirements. 10.5 Real definition of a workflow As the first implementation, the workflow calls the sampler that returns a matrix, our sample set. sample_set = sampler . sampler ( type_of_sampler , problem , parameters = parameters_of_sampler) Listing 4: First call of the workflow As I already explained in the section 6.1.1, each line of the sampler’s matrix is used to create a new simulation, therefore the workflow runs as many simulations as many rows the matrix has. To implement the concept I just explained in the text above, I create a variable that obtains a new line of the matrix at each new iteration of the loop. After this first phase regarding the preparation of the variables I’m going to use to create the simulation, I called a generic method preprare data to prepare the input file of a simulation. Once the simulation’s input file is done, the workflow runs the execution by calling the generic method run sim. Once the simulation is finished, it generates an output file, called name-of-simulation.output.yaml, therefore by calling postSimulation.collect the output file inside the working directory will be read and the results will be stored in a vector called ywith the results of the other simulations. for iin range (len( sample_set )): values = sample_set [i , :] parserSim . prepare_data ( type_sim , mesh , template , simulation_wdir , original_name , nameSim , variables ) sim . run_sim ( type_sim , simulation_wdir , nameSim ) new_y = postSimulation . collect ( type_sim , simulation_wdir , nameSim ) y. append ( new_y ) return Listing 5: Loop inside each workflows 55 REFERENCES References [´ Alv+19] Javier ´ Alvarez Cid-Fuentes et al. “dislib: Large Scale High Performance Machine Learning in Python”. In: 2019 15th International Conference on eScience (eScience). 2019, pp. 96–105. doi:10.1109/eScience.2019.00018. [Bad+15] Rosa M. Badia et al. “COMP Superscalar, an interoperable programming framework”. In: SoftwareX 3-4 (2015), pp. 32–36. issn: 2352-7110. doi:https://doi.org/10.1016/ j.softx.2015.10.004.url:https://www.sciencedirect.com/science/article/ pii/S2352711015000151. [Bau+13] M Baudin et al. “pyDOE: The experimental design package for python”. In: (2013). url: https://pythonhosted.org/pyDOE/index.html. [Cas+14] Eva Casoni et al. “Alya: Computational Solid Mechanics for Supercomputers”. In: Archives of Computational Methods in Engineering 22 (Jan. 2014), pp. 1–20. doi:10 . 1007 / s11831-014-9126-8. [CD12] Weiwei Chen and Ewa Deelman. “WorkflowSim: A toolkit for simulating scientific workflows in distributed environments”. In: 2012 IEEE 8th International Conference on E- Science. 2012, pp. 1–8. doi:10.1109/eScience.2012.6404430. [Dja19] Django Software Foundation. Django. Version 2.2. May 5, 2019. url:https://djangoproject. com. [Gro+96] William Gropp et al. “A high-performance, portable implementation of the MPI message passing interface standard”. In: Parallel computing 22.6 (1996), pp. 789–828. [Guo+22] Jiaxu Guo et al. “Geo-WMS: An improved approach to Geoscientific Workflow Management System on HPC”. In: CCF Transactions on High Performance Computing (2022). doi:10.1007/s42514-022-00131-x. [HU17] Jon Herman and Will Usher. “SALib: An open-source Python library for Sensitivity Analysis”. In: J. Open Source Softw. 2 (2017), p. 97. url:https://api.semanticscholar. org/CorpusID:53225567. [KKK15] Eszter Kail, P´eter Kacsuk, and Mikl´os Kozlovszky. “Achieving dynamic workflow management system by applying provenance based checkpointing method”. In: 2015 38th International Convention on Information and Communication Technology, Electronics and Microelectronics (MIPRO) (2015), pp. 250–253. url:https://api.semanticscholar. org/CorpusID:14068198. [Mat+15] Marta Mattoso et al. “Dynamic steering of HPC scientific workflows: A survey”. In: Future Generation Computer Systems 46 (2015), pp. 100–113. issn: 0167-739X. doi:https: //doi.org/10.1016/j.future.2014.11.017.url:https://www.sciencedirect. com/science/article/pii/S0167739X14002519. [Sas+23] Aravind Sasikumar et al. “Sensitivity analysis methodology to identify the critical material properties that affect the open hole strength of composites”. In: Journal of Composite Materials 57.10 (2023), pp. 1791–1805. doi:10.1177/00219983231163272. eprint: https://doi.org/10.1177/00219983231163272.url:https://doi.org/10.1177/ 00219983231163272. [Tej+17] Enric Tejedor et al. “PyCOMPSs: Parallel computational workflows in Python”. In: The International Journal of High Performance Computing Applications 31.1 (2017), pp. 66–82. doi:10.1177/1094342015594678. eprint: https://doi.org/10.1177/ 1094342015594678.url:https://doi.org/10.1177/1094342015594678. 56