29 <<
"HOST=" << QHostInfo::localHostName();
33 MPI_Barrier( MPI_COMM_WORLD );
54 DbgLv(1) <<
"Final-my_rank" <<
my_rank <<
" msecs=" <<
startTime.msecsTo(QDateTime::currentDateTime());
62 if ( xmlfile.isEmpty() )
64 if (
my_rank == 0 )
DbgLv(0) <<
"No separate jobxmlfile";
68 if (
my_rank==0)
DbgLv(0) <<
"task_parse xmlfile" << xmlfile;
69 QFile file ( xmlfile );
73 if ( ! file.open( QIODevice::ReadOnly | QIODevice::Text) )
75 if (
my_rank == 0 )
DbgLv(0) <<
"Cannot open file " << xmlfile;
80 if (
my_rank == 0 )
DbgLv(0) <<
" Value of mgroupcount set to"
86 if ( xmlfile ==
"us3.pbs" )
88 QTextStream ts( &file );
90 while ( ! ts.atEnd() )
92 QString line = ts.readLine();
93 int jwt = line.indexOf(
"walltime=" );
94 int jgr = line.indexOf(
"pmgroups=" );
98 QString svalu = line.mid( jwt ).section(
"=", 1, 1 );
99 int valu1 = svalu.section(
":", 0, 0 ).toInt();
100 int valu2 = svalu.section(
":", 1, 1 ).toInt();
101 svalu = QString::number( valu1 * 60 + valu2 );
103 if (
my_rank==0)
DbgLv(0) <<
"h m" << valu1 << valu2 <<
"svalu" << svalu;
108 QString svalu = line.mid( jgr ).section(
"=", 1, 1 );
109 int valu1 = svalu.toInt();
110 valu1 = valu1 < 0 ? 1 : valu1;
111 svalu = QString::number( valu1 );
113 if (
my_rank==0)
DbgLv(0) <<
"group" << svalu <<
"valu1" << valu1;
123 QXmlStreamReader xml( &file );
125 while ( ! xml.atEnd() )
129 if ( xml.isStartElement() )
131 QString name = xml.name().toString();
133 if ( name !=
"Message" && name !=
"Header" )
135 QString value = xml.readElementText();
141 if ( xml.isEndElement() && xml.name() ==
"Header" )
157 long int maxrssma = 0L;
176 msg = analysisDate.toAscii();
185 MPI_Send( msg.data(),
215 DbgLv(1) <<
"SUPER: wait on iter done/udp";
226 master = status.MPI_SOURCE;
227 tag = status.MPI_TAG;
229 DbgLv(1) <<
"SUPER: wait recv'd iwork" << iwork <<
"master tag" << master << tag;
237 DbgLv(1) <<
"SUPER: wait on UDPmsg - master" << master;
238 MPI_Recv( msg.data(),
246 DbgLv(1) <<
"SUPER: UDPmsg:" << QString(msg);
260 DbgLv(0) <<
"Unknown message type in supervisor" << tag;
264 if ( udpmsg )
continue;
276 master = status.MPI_SOURCE;
278 int mgroup = mstates.indexOf(
READY );
280 int jgroup = ( mgroup < 0 ) ? kgroup : mgroup;
281 mstates[ kgroup ] =
READY;
282 int nileft = mstates.count(
WORKING );
283 DbgLv(1) <<
"SUPER: mgr kgr jgr" << mgroup << kgroup << jgroup
288 mstates[ kgroup ] =
INIT;
289 maxrssma += (long)( iwork );
290 DbgLv(1) <<
"SUPER: (A)maxrssma" << maxrssma <<
"iwork" << iwork;
312 master = ( jgroup == 0 ) ? 1 : ( jgroup *
gcores_count );
314 DbgLv(1) <<
"SUPER: Send next iter" << iter_wk <<
"gr ma tg" << jgroup << master << tag;
331 QDateTime endTime = QDateTime::currentDateTime();
335 DbgLv(1) <<
"SUPER: maxrss maxrssma" <<
maxrss << maxrssma;
338 int walltime = qRound(
340 int cputime = qRound(
341 startTime .msecsTo( endTime ) / 1000.0 );
342 int maxrssmb = qRound( (
double)
maxrss / 1024.0 );
343 int kc_iters =
parameters[
"mc_iterations" ].toInt();
353 int wt_hr = walltime / 3600;
354 int wt_min = ( walltime - wt_hr * 3600 ) / 60;
355 int wt_sec = walltime - wt_hr * 3600 - wt_min * 60;
356 int ct_hr = cputime / 3600;
357 int ct_min = ( cputime - ct_hr * 3600 ) / 60;
358 int ct_sec = cputime - ct_hr * 3600 - ct_min * 60;
359 printf(
"Us_Mpi_Analysis has finished successfully"
360 " (Wall=%d:%02d:%02d Cpu=%d:%02d:%02d).\n"
361 , wt_hr, wt_min, wt_sec, ct_hr, ct_min, ct_sec );
366 send_udp(
"Finished: maxrss " + QString::number( maxrssmb )
367 +
" MB, total run seconds " + QString::number( cputime )
368 +
" (Reduced MC Iterations)" );
369 DbgLv(0) <<
"Finished: maxrss " << maxrssmb
370 <<
"MB, total run seconds " << cputime
371 <<
" (Reduced MC Iterations)";
376 send_udp(
"Finished: maxrss " + QString::number( maxrssmb )
377 +
" MB, total run seconds " + QString::number( cputime ) );
378 DbgLv(0) <<
"Finished: maxrss " << maxrssmb
379 <<
"MB, total run seconds " << cputime;
390 DbgLv(1) <<
" MASTER Recv from super. my_rank" <<
my_rank
402 DbgLv(1) <<
" MASTER: wait recv'd isize" << isize;
406 MPI_Recv( msg.data(),
415 DbgLv(1) <<
" MASTER: Recv'd from super. (g r m)" << my_group <<
group_rank
419 if ( analysis_type.startsWith(
"2DSA" ) )
424 else if ( analysis_type.startsWith(
"GA" ) )
429 else if ( analysis_type.startsWith(
"DMGA" ) )
468 QDateTime currTime = QDateTime::currentDateTime();
469 int mins_so_far = (
startTime.secsTo( currTime ) + 59 ) / 60;
471 int mc_iters_left = ( mins_left_allow *
mc_iteration ) / mins_so_far;
483 QString msg = tr(
"MC Iterations reduced from %1 to %2, "
484 "due to max. time restrictions." )
489 DbgLv(0) <<
" Number of minutes used so far: " << mins_so_far;
490 DbgLv(0) <<
" Allowed minutes remaining: " << mins_left_allow;
492 DbgLv(0) <<
" Estimated allowed iterations left: " << mc_iters_left;
493 DbgLv(0) <<
" Actual adjusted iterations left: " << ac_iters_left;
494 DbgLv(0) <<
"MC Iterations reduced from" << old_mciters <<
"to"
530 int tag = status.MPI_TAG;
555 "Iteration: " + QString::number(
iterations ) +
557 "; Meniscus: (Run 1 of 1)" +
614 tag = status.MPI_TAG;
621 DbgLv(0) <<
"Unexpected tag in PMG 2DSA Master" << tag;
646 worker = status.MPI_SOURCE;
651 switch( status.MPI_TAG )
663 QString msg =
"Master 2DSA: Received invalid status " +
664 QString::number( status.MPI_TAG );
702 empty_fitness.
index = i;
706 QDateTime time = QDateTime::currentDateTime();
724 int tag = status.MPI_TAG;
725 DbgLv(1) <<
" MASTER: iter" << iter <<
"gr" <<
my_group <<
"tag" << tag;
736 DbgLv(0) <<
"Unknown message to PMG Master" << tag;
750 <<
"buck size" <<
buckets.size();
755 DbgLv(1) <<
"GaMast: calc_resids return";
767 bool have_s = ( attrxs.indexOf(
ATTR_S ) >= 0 );
768 bool have_k = ( attrxs.indexOf(
ATTR_K ) >= 0 );
769 bool have_w = ( attrxs.indexOf(
ATTR_W ) >= 0 );
770 bool have_d = ( attrxs.indexOf(
ATTR_D ) >= 0 );
771 bool have_f = ( attrxs.indexOf(
ATTR_F ) >= 0 );
772 bool vary_v = ( attr_z !=
ATTR_V );
778 mcomp.
s = have_s ? solu->
s : 0.0;
779 mcomp.
f_f0 = have_k ? solu->
k : 0.0;
780 mcomp.
mw = have_w ? solu->
d : 0.0;
781 mcomp.
vbar20 = vary_v ? solu->
v : vbar20;
782 mcomp.
D = have_d ? solu->
d : 0.0;
783 mcomp.
f = have_f ? solu->
d : 0.0;
788 solu->
k = mcomp.
f_f0;
826 DbgLv(1) <<
"GaMast: iter done: maxrss" << iter <<
"tag" << tag <<
DONELAST;
854 for (
int worker = 1; worker <=
my_workers; worker++ )
890 int ntscan =
data_sets[ 0 ]->run_data.scanCount();
891 for (
int ii = 1; ii <
data_sets.size(); ii++ )
892 ntscan +=
data_sets[ ii ]->run_data.scanCount();
903 QString cmfname =
"../" +
parameters[
"DC_model" ];
924 empty_fitness.
index = ii;
928 QDateTime time = QDateTime::currentDateTime();
946 int tag = status.MPI_TAG;
947 DbgLv(1) <<
" MASTER: iter" << iter <<
"gr" <<
my_group <<
"tag" << tag;
958 DbgLv(0) <<
"Unknown message to PMG Master" << tag;
1008 DbgLv(1) <<
"GaMast: iter done: maxrss" << iter <<
"tag" << tag <<
DONELAST;
1037 for (
int worker = 1; worker <=
my_workers; worker++ )