9 bool repeat_loop =
true;
43 int job_length = job.
length;
44 DbgLv(1) <<
"w:" <<
my_rank <<
": offs cnt" << offset << dataset_count;
56 parameters[
"tinoise_option" ].toInt() > 0 ? 1 : 0;
58 parameters[
"rinoise_option" ].toInt() > 0 ? 2 : 0;
67 MPI_Recv( simulation_values.
solutes.data(),
80 int nn = simulation_values.
solutes.size() - 1;
82 DbgLv(1) <<
"w:" <<
my_rank <<
": offs dscnt" << offset << dataset_count
88 << simulation_values.
solutes[0].s << simulation_values.
solutes[0].k
89 << simulation_values.
solutes[mm].s << simulation_values.
solutes[mm].k
90 << simulation_values.
solutes[nn].s << simulation_values.
solutes[nn].k;
97 int size[ 4 ] = { simulation_values.
solutes.size(),
102 DbgLv(1) <<
"w:" <<
my_rank <<
": result sols size" << size[0]
103 <<
"max_rss" << size[ 3 ];
106 DbgLv(1) <<
"w:" <<
my_rank <<
": result sols size" << size[0]
118 MPI_Send( simulation_values.
solutes.data(),
125 MPI_Send( &simulation_values.
variance,
132 MPI_Send( simulation_values.
variances.data(),
139 MPI_Send( simulation_values.
ti_noise.data(),
146 MPI_Send( simulation_values.
ri_noise.data(),
164 long memdata = job_length *
sizeof( double );
165 int grid_reps = qMax(
parameters[
"uniform_grid" ].toInt(), 1 );
167 double ff0_pts = 60.0;
169 s_pts =
parameters[
"s_grid_points" ].toDouble();
170 else if (
parameters.contains(
"s_resolution" ) )
171 s_pts =
parameters[
"s_resolution" ].toDouble() * grid_reps;
172 if (
parameters.contains(
"ff0_grid_points" ) )
173 ff0_pts =
parameters[
"ff0_grid_points" ].toDouble();
174 else if (
parameters.contains(
"ff0_resolution" ) )
175 ff0_pts =
parameters[
"ff0_resolution" ].toDouble() * grid_reps;
176 int nsstep = (int)( s_pts );
177 int nkstep = (int)( ff0_pts );
178 int maxsols = nsstep * nkstep;
179 long memamatr = memdata * maxsols;
180 long membmatr = memdata;
181 long memneed = memdata + memamatr + membmatr;
182 const double mb_bytes = ( 1024. * 1024. );
183 const double gb_bytes = ( mb_bytes * 1024. );
184 double gb_need = (double)memneed / gb_bytes;
185 gb_need = qRound( gb_need * 1000.0 ) * 0.001;
186 double gb_used = (double)memused / mb_bytes;
187 gb_used = qRound( gb_used * 1000.0 ) * 0.001;
188 long pgavail = sysconf( _SC_PHYS_PAGES );
189 long pgsize = sysconf( _SC_PAGE_SIZE );
190 long memavail = pgavail * pgsize;
191 double gb_avail = (double)memavail / gb_bytes;
192 gb_avail = qRound( gb_avail * 1000.0 ) * 0.001;
193 long pgcurav = sysconf( _SC_AVPHYS_PAGES );
194 long memcurav = pgcurav * pgsize;
195 double gb_curav = (double)memcurav / gb_bytes;
196 gb_curav = qRound( gb_curav * 1000.0 ) * 0.001;
198 qDebug() <<
"++ Worker" <<
my_rank <<
": MC iteration"
199 << mc_iter <<
": Memory Profile :"
200 <<
"\n Maximum memory used to this point" << memused
201 <<
"\n Composite data memory needed" << memdata
202 <<
"\n Maximum subgrid solute count" << maxsols
203 <<
"\n NNLS A matrix memory needed" << memamatr
204 <<
"\n NNLS B matrix memory needed" << membmatr
205 <<
"\n Total memory (GB) used" << gb_used
206 <<
"\n Total memory (GB) needed" << gb_need
207 <<
"\n Total memory (GB) available" << gb_avail
208 <<
"\n Memory (GB) currently available" << gb_curav;
213 if (
mc_data.size() != job_length )
215 DbgLv(0) <<
"*ERROR* mc_data.size() job_length"
216 <<
mc_data.size() << job_length;
222 DbgLv(1) <<
"newD:" <<
my_rank <<
" scld/newdat rcv : offs dsknt"
223 << offset << dataset_count <<
"joblen" << job_length;
238 DbgLv(1) <<
"newD:" <<
my_rank <<
":offset ODlimit" << offset
239 <<
data_sets[ offset ]->run_data.ODlimit;
244 for (
int ee = offset; ee < offset + dataset_count; ee++ )
251 int indxh=((scan_count/2)*radius_points)+(radius_points/2);
252 for (
int ss = 0; ss < scan_count; ss++ )
254 for (
int rr = 0; rr < radius_points; rr++, index++ )
257 dsum+=edata->
value(ss,rr);
259 && (index<5 || index>(job_length-6) || (index>(indxh-4)&&index<(indxh+3))) )
260 DbgLv(1) <<
"newD:" <<
my_rank <<
":index" << index <<
"edat" << edata->
value(ss,rr)
266 DbgLv(1) <<
"newD:" <<
my_rank <<
" length index" << job_length << index
291 int nsoli=simu_values.
solutes.size();
292 QVector< US_Solute > isols = simu_values.
solutes;
302 int nsolo=simu_values.
solutes.size();
308 double d0 = edat->
scanData[0].rvalues[0];
309 double d1 = edat->
scanData[0].rvalues[1];
310 double dh = edat->
scanData[nsc/2].rvalues[nrp/2];
311 double dm = edat->
scanData[nsc-1].rvalues[nrp-2];
312 double dn = edat->
scanData[nsc-1].rvalues[nrp-1];
313 DbgLv(1) <<
"w:" <<
my_rank <<
":d(01hmn)" << d0 << d1 << dh << dm << dn;
315 for (
int ss=0;ss<nsc;ss++ )
316 for (
int rr=0;rr<nrp;rr++ ) dt += edat->
scanData[ss].rvalues[rr];
318 double s0 = sdat->
value(0,0);
319 double s1 = sdat->
value(0,1);
320 double sh = sdat->
value(nsc/2,nrp/2);
321 double sm = sdat->
value(nsc-1,nrp-2);
322 double sn = sdat->
value(nsc-1,nrp-1);
323 DbgLv(1) <<
"w:" <<
my_rank <<
": s(01hmn)" << s0 << s1 << sh << sm << sn;
324 if ( dataset_count > 1 ) {
331 dh = edat->
scanData[nsc/2].rvalues[nrp/2];
332 dm = edat->
scanData[nsc-1].rvalues[nrp-2];
333 dn = edat->
scanData[nsc-1].rvalues[nrp-1];
334 DbgLv(1) <<
"w:" <<
my_rank <<
":d2(01hmn)" << d0 << d1 << dh << dm << dn;
336 for (
int ss=0;ss<nsc;ss++ )
337 for (
int rr=0;rr<nrp;rr++ ) dt += edat->
scanData[ss].rvalues[rr];
339 s0 = sdat->
value(nxx+0,0);
340 s1 = sdat->
value(nxx+0,1);
341 sh = sdat->
value(nxx+nsc/2,nrp/2);
342 sm = sdat->
value(nxx+nsc-1,nrp-2);
343 sn = sdat->
value(nxx+nsc-1,nrp-1);
344 DbgLv(1) <<
"w:" <<
my_rank <<
": s2(01hmn)" << s0 << s1 << sh << sm << sn;
346 DbgLv(1) <<
"w:" <<
my_rank <<
": nsoli nsolo" << nsoli << nsolo;
347 DbgLv(1) <<
"w:" <<
my_rank <<
": simpt men bott temp coef1"
353 DbgLv(1) <<
"w:" <<
my_rank <<
": vbar soltype manual visc dens"
359 if ( dataset_count > 1 ) {
361 DbgLv(1) <<
"w:" <<
my_rank <<
": 2)simpt men bott temp coef1"
367 DbgLv(1) <<
"w:" <<
my_rank <<
": 2)vbar soltype manual visc dens"
374 int nn = isols.size() - 1;
376 DbgLv(1) <<
"w:" <<
my_rank <<
": sol0 solm soln" << isols[0].s << isols[0].k
377 << isols[mm].s << isols[mm].k << isols[nn].s << isols[nn].k;