10 bool repeat_loop =
true;
17 int x[ 4 ] = { 0, 0, 0, 0 };
44 int job_length = job.
length;
48 DbgLv(1) <<
"w:" <<
my_rank <<
": offs cnt" << offset << dataset_count
52 int ds_points = scan_count * radius_points;
63 (
parameters[
"tinoise_option" ].toInt() > 0 ? 1 : 0 )
64 + (
parameters[
"rinoise_option" ].toInt() > 0 ? 2 : 0 );
72 MPI_Recv( simulation_values.
zsolutes.data(),
85 int nn = simulation_values.
zsolutes.size() - 1;
87 DbgLv(1) <<
"w:" <<
my_rank <<
": offs dscnt" << offset << dataset_count
104 int nn = simulation_values.
zsolutes.size() - 1;
107 << simulation_values.
zsolutes.size() <<
"c:sol0 solm soln"
114 int sizes[ 4 ] = { simulation_values.
zsolutes.size(),
119 DbgLv(1) <<
"w:" <<
my_rank <<
": result sols size" << sizes[0]
120 <<
"max_rss" << sizes[ 3 ];
123 DbgLv(1) <<
"w:" <<
my_rank <<
": result sols size" << sizes[0]
135 MPI_Send( simulation_values.
zsolutes.data(),
142 MPI_Send( &simulation_values.
variance,
149 MPI_Send( simulation_values.
variances.data(),
156 MPI_Send( simulation_values.
ti_noise.data(),
163 MPI_Send( simulation_values.
ri_noise.data(),
175 DbgLv(1) <<
"w:" <<
my_rank <<
":Recv:PROCESS_MC" <<
"mc_iter" << mc_iter;
176 double varrmsd = 0.0;
186 MPI_Recv( simulation_values.
zsolutes.data(),
196 for (
int ss = 0; ss < scan_count; ss++ )
198 for (
int rr = 0; rr < radius_points; rr++, index++ )
202 varrmsd +=
sq( vari );
208 varrmsd = sqrt( varrmsd / (
double)ds_points );
209 qDebug() <<
" Box_Muller Variation RMSD"
210 << QString::number( varrmsd,
'f', 7 )
211 <<
" for MC_Iteration" << mc_iter;
218 int nn = simulation_values.
zsolutes.size() - 1;
220 DbgLv(1) <<
"w:" <<
my_rank <<
": offs dscnt" << offset << dataset_count
224 <<
data_sets[offset]->centerpiece_bottom;
234 qDebug() <<
"Base-Sim RMSD" << sqrt( simulation_values.
variance )
235 <<
" for MC_Iteration" << mc_iter;
240 int nn = simulation_values.
zsolutes.size() - 1;
243 << simulation_values.
zsolutes.size() <<
"c:sol0 solm soln"
250 int sizes[ 4 ] = { simulation_values.
zsolutes.size(),
255 DbgLv(1) <<
"w:" <<
my_rank <<
": result sols size" << sizes[0]
256 <<
"max_rss" << sizes[ 3 ];
259 DbgLv(1) <<
"w:" <<
my_rank <<
": result sols size" << sizes[0]
264 << sizes[0] << sizes[1] << sizes[2] << sizes[3];
273 MPI_Send( simulation_values.
zsolutes.data(),
280 MPI_Send( &simulation_values.
variance,
287 MPI_Send( simulation_values.
variances.data(),
299 DbgLv(1) <<
"w:" <<
my_rank <<
":Recv:NEWDATA joblen" << job_length;
303 long memdata = job_length *
sizeof( double );
304 int grid_reps = qMax(
parameters[
"uniform_grid" ].toInt(), 1 );
306 double ff0_pts = 60.0;
308 s_pts =
parameters[
"s_grid_points" ].toDouble();
309 else if (
parameters.contains(
"s_resolution" ) )
310 s_pts =
parameters[
"s_resolution" ].toDouble() * grid_reps;
311 if (
parameters.contains(
"ff0_grid_points" ) )
312 ff0_pts =
parameters[
"ff0_grid_points" ].toDouble();
313 else if (
parameters.contains(
"ff0_resolution" ) )
314 ff0_pts =
parameters[
"ff0_resolution" ].toDouble() * grid_reps;
315 int nsstep = (int)( s_pts );
316 int nkstep = (int)( ff0_pts );
317 int maxsols = nsstep * nkstep;
318 long memamatr = memdata * maxsols;
319 long membmatr = memdata;
320 long memneed = memdata + memamatr + membmatr;
321 const double mb_bytes = ( 1024. * 1024. );
322 const double gb_bytes = ( mb_bytes * 1024. );
323 double gb_need = (double)memneed / gb_bytes;
324 gb_need = qRound( gb_need * 1000.0 ) * 0.001;
325 double gb_used = (double)memused / mb_bytes;
326 gb_used = qRound( gb_used * 1000.0 ) * 0.001;
327 long pgavail = sysconf( _SC_PHYS_PAGES );
328 long pgsize = sysconf( _SC_PAGE_SIZE );
329 long memavail = pgavail * pgsize;
330 double gb_avail = (double)memavail / gb_bytes;
331 gb_avail = qRound( gb_avail * 1000.0 ) * 0.001;
332 long pgcurav = sysconf( _SC_AVPHYS_PAGES );
333 long memcurav = pgcurav * pgsize;
334 double gb_curav = (double)memcurav / gb_bytes;
335 gb_curav = qRound( gb_curav * 1000.0 ) * 0.001;
337 qDebug() <<
"++ Worker" <<
my_rank <<
": MC iteration"
338 << mc_iter <<
": Memory Profile :"
339 <<
"\n Maximum memory used to this point" << memused
340 <<
"\n Composite data memory needed" << memdata
341 <<
"\n Maximum subgrid solute count" << maxsols
342 <<
"\n NNLS A matrix memory needed" << memamatr
343 <<
"\n NNLS B matrix memory needed" << membmatr
344 <<
"\n Total memory (GB) used" << gb_used
345 <<
"\n Total memory (GB) needed" << gb_need
346 <<
"\n Total memory (GB) available" << gb_avail
347 <<
"\n Memory (GB) currently available" << gb_curav;
352 if (
mc_data.size() != job_length )
354 DbgLv(0) <<
"*ERROR* mc_data.size() job_length"
355 <<
mc_data.size() << job_length;
361 DbgLv(1) <<
"newD:" <<
my_rank <<
" scld/newdat rcv : offs dsknt"
362 << offset << dataset_count <<
"joblen" << job_length;
377 DbgLv(1) <<
"newD:" <<
my_rank <<
":offset ODlimit" << offset
378 <<
data_sets[ offset ]->run_data.ODlimit;
381 bool is_simdat = ( mc_iter >= 10000 );
383 DbgLv(1) <<
"newD:" <<
my_rank <<
": is_simdat" << is_simdat;
394 for (
int ss = 0; ss < scan_count; ss++ )
395 for (
int rr = 0; rr < radius_points; rr++ )
398 for (
int ss = 0; ss < scan_count; ss++ )
399 for (
int rr = 0; rr < radius_points; rr++ )
411 for (
int ee = offset; ee < offset + dataset_count; ee++ )
418 int indxh=((scan_count/2)*radius_points)+(radius_points/2);
419 for (
int ss = 0; ss < scan_count; ss++ )
421 for (
int rr = 0; rr < radius_points; rr++, index++ )
424 dsum+=edata->
value(ss,rr);
426 && (index<5 || index>(job_length-6) || (index>(indxh-4)&&index<(indxh+3))) )
427 DbgLv(1) <<
"newD:" <<
my_rank <<
":index" << index <<
"edat" << edata->
value(ss,rr)
434 DbgLv(1) <<
"newD:" <<
my_rank <<
" length index" << job_length << index