Salome HOME
Documentation corrections and code performance update
[modules/adao.git] / doc / fr / scripts / simple_ParallelFunctionTest.py
1 # -*- coding: utf-8 -*-
2 #
3 import numpy
4 from adao import adaoBuilder
5 #
6 def SomeOperator( x ):
7     return numpy.dot(numpy.eye(x.size), numpy.ravel(x))
8 #
9 case = adaoBuilder.New()
10 case.setAlgorithmParameters(
11     Algorithm='ParallelFunctionTest',
12     Parameters={
13         'NumberOfRepetition' : 50,
14         'NumberOfPrintedDigits' : 2,
15         "ShowElementarySummary":False,
16         },
17     )
18 case.setCheckingPoint( Vector = range(30) )
19 case.setObservationOperator(
20     OneFunction = SomeOperator,
21     Parameters  = {
22         "EnableParallelEvaluations":True,
23         "NumberOfProcesses":5,
24         },
25     )
26 case.execute()