Equation Solver A Grid solution Important hint A

  • Slides: 18
Download presentation
Equation Solver A Grid solution Important hint: A follow up example demonstrating the Parameter

Equation Solver A Grid solution Important hint: A follow up example demonstrating the Parameter Study solution for the mass calculations using the same Equation Solver can be found in the Document Parameter Study support in P-GRADE Portal 2. 5, Pinciples & Practices. ppt LPDS MTA SZTAKI

Outline • • • Access to the Demo program The Mathematic problem The Matrix

Outline • • • Access to the Demo program The Mathematic problem The Matrix operation package The Grid Workflow solution Example Basic solution Advanced solution • Summary LPDS MTA SZTAKI

Access to the Demo Program 1. The demo applications discussed here can be uploaded

Access to the Demo Program 1. The demo applications discussed here can be uploaded and used directly within the P-PGRADE Portals administrated by the MTA Sztaki (Seegrid, Voce, Gilda), (Example shows tab Workflow/Upload of the Seegrid Portal): where, “Equation solver” contains the basic solution, “Equation solver single input” the more advanced one. Before eventual workflow submission do not forget to: 2. Open and Save the uploaded application with the Workflow Editor. (The Workflow Editor can be started in the tab Workflow / Workflow Manager) 3. Define a proxy Certificate within tab Certificates / Download LPDS MTA SZTAKI

The mathematical problem Let us solve the equation A*x = B where the coefficients

The mathematical problem Let us solve the equation A*x = B where the coefficients ai, j bi are real: A-1*A*x = A-1*B A-1*A = E x = E*x x = A-1*B LPDS MTA SZTAKI

The Matrix Operation Package(1) Base conventions • sequential program written in C (Matrix. Demo.

The Matrix Operation Package(1) Base conventions • sequential program written in C (Matrix. Demo. New) • Input(s) and output are matrices represented by files (Minput 1 , Minput 2 , Moutput) • operation is controlled by command line arguments: • Moutput = OP (Minput 1) • Moutput = OP (Minput 1, scalar. Arg) • Moutput = OP (Minput 1, Minput 2 ) LPDS MTA SZTAKI

The Matrix Operation Package(2) Detailed I/O conventions • The input(s) and the output of

The Matrix Operation Package(2) Detailed I/O conventions • The input(s) and the output of the Matrix. Demo. New are files containing the representation of the matrices. They are referred i. e. opened within the executable as "INPUT 1" (, "INPUT 2") and "OUTPUT". INPUT 1 INPUT 2 OP OUTPUT • The structures the ASCII files are uniform: a space separated list of the following tokens: Number of lines, number of columns, floating point elements ordered first along the lines of the matrix. Example: 2 3 1. 1 1. 2 1. 3 2. 1 2. 2 2. 3 represents the following matrix: 1. 1 2. 1 1. 2 2. 2 1. 3 2. 3 LPDS MTA SZTAKI

The Matrix Operation Package(3) Operations Syntax: <OP_code> [<Extension>] [V[erbose]] OP Extension A S M

The Matrix Operation Package(3) Operations Syntax: <OP_code> [<Extension>] [V[erbose]] OP Extension A S M R T I c floting L integer C integer Example: Explanation Short. Name I 1+I 2 -> O Add I 1–I 2 -> O Subtract I 1*I 2 -> O Multiply I 2*I 1 -> O Reverse Multiply transpose of I 1 -> O Transpose invert of I 1 -> O Invert value * I 1 -> O constant multiply I 1[value, *]-> O Line of I 1[*, value]-> O Column of Operation and I/0 files will be printed on standard output L 3 V Eventual extension values are defined as command line values LPDS MTA SZTAKI

The Grid Workflow solution Part 1 basic algorithm • • Two additional jobs (“Copy_A”,

The Grid Workflow solution Part 1 basic algorithm • • Two additional jobs (“Copy_A”, “Copy_B”) simplify the work of the user. They copy their inputs to their outputs, with the consequence that the user may to define each input file just at a single Port. If these jobs would have be omitted it were the responsibility of the user to define files with the same content at the proper places: port 0 of Invert_A should be equal with port 0 of “A_Mull_X” and port 1 of Multip_B should be equal with port 1 of “A_Mull_X” The job Invert_A performs the inversion of matrtix A, The jobs Multip_B, A_mul_X perform matrix multiplications, The job Subtr_B compares the results by performing subtraction operation LPDS MTA SZTAKI

The Grid Workflow solution(1) LPDS MTA SZTAKI

The Grid Workflow solution(1) LPDS MTA SZTAKI

The Grid Workflow solution (2) Input Matrix association Location of file representing “B” in

The Grid Workflow solution (2) Input Matrix association Location of file representing “B” in the A*x=B LPDS MTA SZTAKI

The Grid Workflow solution (3) Matrix Operation Input Definition Expected file names are INPUT

The Grid Workflow solution (3) Matrix Operation Input Definition Expected file names are INPUT 1 and INPUT 2 LPDS MTA SZTAKI

The Grid Workflow solution (4) Matrix operation definition Matrix Operation Package Op Code LPDS

The Grid Workflow solution (4) Matrix operation definition Matrix Operation Package Op Code LPDS MTA SZTAKI

The Grid Workflow solution(5) The progress 5 5 10. 0 9. 0 8. 0

The Grid Workflow solution(5) The progress 5 5 10. 0 9. 0 8. 0 7. 0 6. 0 30. 0 8. 0 7. 0 5. 0 9. 0 40. 0 11. 0 5. 0 71. 0 6. 0 5. 0 0. 0 4. 0 21. 0 7. 0 4. 0 8. 0 0. 0 5 1 110. 0 132. 0 448. 0 79. 0 A B A*(A-1*B)-B A-1*B Result x reached at this point, control follows LPDS MTA SZTAKI A*(A-1*B) This value should be zero

The Grid Workflow solution (6) Workflow result LPDS MTA SZTAKI

The Grid Workflow solution (6) Workflow result LPDS MTA SZTAKI

The Grid Workflow solution (6) Workflow result Test results 1, 2, 3, 4, 5

The Grid Workflow solution (6) Workflow result Test results 1, 2, 3, 4, 5 modified by the numerical instability, due to the division operations inside of matrix inversion LPDS MTA SZTAKI

The Grid Workflow solution Part 2 advanced algorithm The jobs “Copy_A”, “Copy_B” will be

The Grid Workflow solution Part 2 advanced algorithm The jobs “Copy_A”, “Copy_B” will be substituted by the single one, by the Separator”. By convention it receives just one file containing the values of the matrices A and B. The values are represented in a text form and separated by a # character. The jobs algorithm finds this character and yields the files containing A and B an separate output ports. Listing the content of the input file of the separator job is the following: 5 5 10. 0 9. 0 8. 0 7. 0 6. 0 30. 0 8. 0 7. 0 5. 0 9. 0 40. 0 11. 0 5. 0 71. 0 6. 0 5. 0 0. 0 4. 0 21. 0 7. 0 4. 0 8. 0 0. 0#5 1 110. 0 132. 0 448. 0 79. 0 LPDS MTA SZTAKI

The Grid Workflow solution Part 2 advanced algorithm view 5 5 10. 0 9.

The Grid Workflow solution Part 2 advanced algorithm view 5 5 10. 0 9. 0 8. 0 7. 0 6. 0 30. 0 8. 0 7. 0 5. 0 9. 0 40. 0 11. 0 5. 0 71. 0 6. 0 5. 0 0. 0 4. 0 21. 0 7. 0 4. 0 8. 0 0. 0#5 1 110. 0 132. 0 448. 0 79. 0 5 5 10. 0 9. 0 8. 0 7. 0 6. 0 30. 0 8. 0 7. 0 5. 0 9. 0 40. 0 11. 0 5. 0 71. 0 6. 0 5. 0 0. 0 4. 0 21. 0 7. 0 4. 0 8. 0 0. 0 5 1 110. 0 132. 0 448. 0 79. 0 A#B A B LPDS MTA SZTAKI

Summary • • Simple way of calculation Extendibility Graphical usage Immediate access LPDS MTA

Summary • • Simple way of calculation Extendibility Graphical usage Immediate access LPDS MTA SZTAKI