Originally posted by: SystemAdmin
here is an undocumented way to do this while using oplrun.
When using oplrun -profile, the following example will output the profiler output in the scripting log, which you can redirect for example in a IloOplOutputFile.
This way, if you launch multiple sub problems, you will be able to see the memory consumption of each of them.
======================================================================
range r = 1..10; dvar int+ x[r] in 1..10; execute PRE
{ writeln(
"Hello PRE");
} execute
{ writeln(
"Hello");
} subject to
{ ct: sum(i in r) x[i] >= 0; forall(i in r) cts: x[i] >= i;
} execute POST
{ writeln(
"Hello POST");
} main
{ thisOplModel.generate(); cplex.solve(); thisOplModel.postProcess();
static function printProfile(n,prefix)
{
for(; n; n=n.next)
{ writeln(prefix,
"n.name = ",n.name); writeln(prefix,
"n.section = ",n.section); writeln(prefix,
"n.time = ",n.time); writeln(prefix,
"n.selfTime = ",n.selfTime); writeln(prefix,
"n.peakMemory = ",n.peakMemory); writeln(prefix,
"n.localMemory = ",n.localMemory); printProfile(n.firstChild,prefix+
" ");
}
} writeln(
"Profiler:"); printProfile(thisOplModel.settings._profilerRootNode,
" ");
}
==================================================
#DecisionOptimization#OPLusingCPLEXOptimizer