source: branches/UQ/NOTES @ 157

Revision 157, 10.0 KB checked in by mmckerns, 7 years ago (diff)

added branch for UQ toy, and branch for initial distributed computing with pp

Line 
1src/Simulation.cpp: a simple model function
2 * invoke main
3   - Simulation.exe simulation.in simulation.out
4 * read simulation.in
5   - one column, three rows: x1, x2, x3
6 * write simulation.out
7   - one value: x1*x2 + x3 + 2.0
8
9src/simulation.template: file template for simulation.in
10 * keys from a python dictionary of name and value (?)
11   - one column, three rows: {X1}, {X2}, {X3}
12
13========================================================================
14test/dakota.in.template: dakota input file, without the "variables" section
15 * edited by Concentration.exe
16   - replaces value of 'evaluation_concurrency' with that from concentration.in
17 * variables section
18   - added by Concentration.exe (?)
19
20test/driver.sh: core diameter calculation script
21 * invoke main
22   - driver params.in.<num> results.out.<num>
23   - where num ==> function_eval_num
24 * params.in
25   - dict of variable name = variable value, created by Dakota
26 * results.out
27   - value of the objective function returned to Dakota
28 * <make a working directory for the function eval, and save param.in (to ?)>
29   - simulation.x & simulation_prime.x, where x = in, out, get stored here
30 * generate simulation.in, and run F(X)
31   - dprepro param.in.<num> simulation.template simulation.in
32   - Simulation.exe simulation.in simulation.out
33 * generate simulation_prime.in, and run F(X')
34   - (simulation_prime.template generated by Concentration.exe)
35   - dprepro param.in.<num> simulation_prime.template simulation_prime.in
36   - Simulation.exe simulation_prime.in simulation_prime.out
37 * Compute |F(X)-F(X')|^2
38   - read "F" from simulation.out and "Fprime" from simulation_prime.out
39   - "Fdiffsqrd" = -1.0 * (F-Fprime)^2 * CM_DK_SCALING
40   - (CM_DK_SCALING generated (?) in ComputeDiameter.cc)
41 * write results.out.<num>
42   - echo "$Fdiffsqrd" > results.out.<num>
43
44test/Makefile: launch "simulation" or concentration-of-measure calculation
45 * Simulation.exe simulation.in simulation.out
46   - (see Simulation.cpp)
47 * Concentration.exe -s concentration.in concentration.variables \
48   dakota.in.template concentration.diameters concentration.fxnevals \
49   concentration.metadata concentration.rstrt 2> concentration.err
50   - (see main.cc)
51   - files except concentration.x; x=in,variables created by Concentration.exe
52
53test/Dakota_Makefile: launch "serial" or parallel Dakota jobs
54 * serial execution
55   - dakota -input dakota.in -write_restart dakota.rst > dakota.out
56 * parallel execution
57   - mpirun -np 1 <serial execution call>
58
59test/dprepro: dakota input file pre-processor
60 * replace {Xn} with values in param.in, write input file
61   - dprepro param.in simulation.template simulation.in
62
63test/Application_Dakota_Makefile: red-headed step-child of Dakota_Makefile
64 * ignore this file... simply a combination of Makefile & Dakota_Makefile
65   - (see test/README for explaination)
66
67test/concentration.in: primary input file for Concentration.exe
68 * UI to configure mpirun, optimization type, and random variable selection
69   - (see src/README for explaination)
70
71test/concentration.variables: random variable declarations for dakota
72 * UI to configure dakota parameter values (order, name, and bounds)
73   - (see src/README for explaination)
74
75========================================================================
76src/MAKEDEPEND: includes for compiling *.cc files
77 * header paths for x.o, where x=CM,RV,QN,GA,Dakota,Sample,ComputeDiameter,main
78   - very hard-wired and very specific... and thus very fragile
79   - is this input, or just a log?
80
81src/Makefile: compile source
82 * x.exe, where x=Concentration,Simulation,DifferenceSquared,Scaling,Probability
83
84src/Probability.ccp: probability calculation
85 * Compute exp(-2 * max(mean - threshold,0)^2 / diameter)
86   - Probability.exe mean diameter threshold probability factor
87   - "factor" used to scale "mean - threshold"; should be: 1 or -1
88   - assert(diameter > 0.0)
89   - input files: mean, diameter, threshold
90   - output files: probability
91   - mean, diameter, threshold, and probability contain a single value (?)
92
93src/DifferenceSquared.ccp: difference squared calculation
94 * Compute |F(X)-F(X')|^2
95   - DifferenceSquared.exe simulation.in simulation_prime.in difference
96   - input files: simulation.in simulation_prime.in
97   - output files: difference
98   - simulation*.in is one column & three rows, difference is a single value (?)
99
100src/Scaling.cpp: scale the difference squared value (for the optimizer)
101 * Multiply result from DifferenceSquared.cpp by scaling factor
102   - Scaling.exe scaling scaling.in scaling.out
103   - input files: scaling scaling.in
104   - output files: scaling.out
105   - scaling* is a single value (?)
106
107========================================================================
108src/main.cc: calculate concentration of measure
109 * invoke main
110   - Concentration.exe -s concentration.in concentration.variables \
111     dakota.in.template concentration.diameters concentration.fxnevals \
112     concentration.metadata concentration.rstrt 2> concentration.err
113 * parse input files
114   - read all args except concentration.x where x=rstrt,err
115 * build Dakota "dak" object
116   - init with: Concentration.exe, dakota.in.template, \
117     concentration.diameter, concentration.fxnevals
118 * initialize (NOTE: assume not restarting)
119   - dak.concentrationInputReader(concentration.in)
120   - restartRVnumber = -1
121 * process dakota input data
122   - dak.dakotaInputReader(concentration.variables,1)
123 * save "concentration.metadata" (?) to $CM_DK_METADATA
124   - ...don't know what this is for, or if it's necessary...
125 * compute diameters
126   - dak.runCM(1,concentration.metadata,concentration.rstrt,restartRVnumber)
127
128src/CM.cc: concentration-of-measure object
129 * instantiate
130   - constructor(concentration.diameter,concentration.fxnevals)
131 * read CM from input file
132   - concentrationInputReader(concentration.in)
133 * check CM data read for validity
134   - assert(cmNumberRVstart <= cmNumberRVs)
135   - assert((cmNumberRVend <= cmNumberRVs)&&(cmNumberRVend >= cmNumberRVstart))
136   - assert(abs(dakotaScaling) >= 1.0e-15)
137   - assert(machineComputeNodes >= 1)
138   - assert(machineProcsPerNodes >= 1)
139   - assert(dakotaEvaluationConcurrency >= 1)
140   - assert(cmDiameterType <= 2) [actually: 0, 1, or 2]
141   - assert(_temp_test_run == 'serial' or 'parallel')
142
143src/Dakota.cc: dakota input parameters (random variables) object
144 * instantiate
145   - constructor(Concentration.exe,dakota.in.template, \
146                 concentration.diameters,concentration.fxnevals)
147 * read parameters from input file
148   - dakotaInputReader(concentration.variables,1)
149   - set dakotaInputFileType = 1
150 * check parameters read for validity
151   - assert(no random variable "duplicates" [bubble sort by descriptor_number])
152
153========================================================================
154src/ComputeDiameter.cc: create dakota input file from input information
155 * launch a concentration-of-measure (sub)diameter calculation
156   - runCM(1,concentration.metadata,concentration.rstrt,restartRVnumber)
157   - set dakotaInputFileType = 1
158   - build make_commands
159     . test_run = "serial": "make -f Dakota_Makefile dak"
160     . test_run = "parallel": "make -f Dakota_Makefile dakprocs PROCS=" + m*n
161                  where m = machineComputeNodes, n=machineProcsPerNode
162   - set $CM_DK_ENDRV = cnNumberRVs
163   - set $CM_DK_SCALING = dakotaScaling
164   - create dakota Input File from scratch (i.e. dakotaInputFileType=0)
165     . ...skip this, as it seems that always dakotaInputFileType=1...
166   - create dakota Input File from template
167     . if "not a restart" (i.e. restartRVnumber<0): RVstart = cmNumberRVstart
168     . else RVstart = restartRVnumber
169     . loop (i) from RVstart to cmNumberRVend
170       - set $CM_DK_CURRENTRV = i
171       - compute the diameter
172         . createDAKOTAInputFileFromSample(i)
173         . createPerturbedSimulationTemplate(i,cmNumberRVs)
174         . execute "make_command"
175         . recoverDAKOTAData(i)
176       - write restart file, and issue "make clean" command
177 * createDAKOTAInputFileGA
178   - ...skipping; not used when dakotaInputFileType=1...
179 * createDAKOTAInputFileQN
180   - ...skipping; not used when dakotaInputFileType=1...
181 * createDAKOTAInputFileFromSample
182   - copy dakota.in.template to dakota.in
183     . build sed command to modify dakota.in.template
184     . use sed to update evaluation_concurrency, and save to dakota.in.temp
185     . mv dakota.in.temp to dakota.in
186   - if # of cdv > 0, add cdv-specific bounds and descriptor info to dakota.in
187     . add entries for each cdv-type variable
188     . if ith variable is cdv, then also add it as the (n+1)th variable
189     . (n+1)th variable is named 'Xk' where k=numRVs+1
190   - similarly for the other variable types (i.e. ddv)
191 * createPreturbedSimulationTemplate
192   - copy simulation.template to simulation_prime.template
193     . build sed command to change {Xi} to {X(cmNumberRVs+1)}
194     . use sed to update tag name, and save to simulation_prime.template
195 * recoverDAKOTAData
196   - read function evaluations and diameter from dakota.out
197     . read # of function evaluations, then store: (rvNum,fxnevals)
198     . read diameter, then -diameter/dakotaScaling, then store: (rvNum,diameter)
199   - move dakota.out to dakota.out.${CM_DK_CURRENTRV}
200   - write diameter and function evaluations to file
201     . write computed (sub)diameters to concentration.diameters (?)
202     . write total_diameter (sum of sub-diameters) to concentration.diameters
203     . write # of function_evals to concentration.fxnevals (?)
204     . write total_function_evaluations (i.e. sum) to concentration.fxnevals
205 * writeMetaDataFile
206   - log currentrv,computed_Diameter,computed_FxnEval to concentration.metadata
207
208src/restart.cc: read/write restart data to restart file
209 * write restart file
210   - copy concentration.in info to concentration.rstrt
211   - append (diameterNumber+1)... to restart after last completed loop
212   - append rvname, computed diameters, and function_evaluations
213 * read restart file info to "Dakota" object (i.e. 'dak')
214   - read "concentration.in" info from concentration.rstrt
215   - read diameterNumber
216   - read rvname, computed diameters, and function_evaluations
217   - return: diameterNumber
218
219
220========================================================================
221"Empty": src/GA.cc, src/QN.cc, src/RV.cc, src/Sample.cc
222
Note: See TracBrowser for help on using the repository browser.