Option.cpp 16.3 KB
Newer Older
gsell's avatar
gsell committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
// ------------------------------------------------------------------------
// $RCSfile: Option.cpp,v $
// ------------------------------------------------------------------------
// $Revision: 1.1.1.1 $
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
//
// Class: Option
//   The class for the OPAL OPTION command.
//
// ------------------------------------------------------------------------
//
// $Date: 2000/03/27 09:33:37 $
// $Author: Andreas Adelmann $
//
// ------------------------------------------------------------------------

#include "BasicActions/Option.h"
#include "Attributes/Attributes.h"
#include "Parser/FileStream.h"
kraus's avatar
kraus committed
22
#include "Utilities/Options.h"
23
#include "Utilities/OptionTypes.h"
24 25
#include "Utilities/ClassicRandom.h"
#include "Utility/IpplInfo.h"
26
#include "Utilities/Util.h"
27

winklehner_d's avatar
-DW  
winklehner_d committed
28 29
#include "Utilities/OpalException.h"

frey_m's avatar
frey_m committed
30 31
#include "Utility/IpplMemoryUsage.h"

32
#include <ctime>
gsell's avatar
gsell committed
33
#include <iostream>
34 35
#include <limits>
#include <cstddef>
36

gsell's avatar
gsell committed
37 38
extern Inform *gmsg;

kraus's avatar
kraus committed
39 40
using namespace Options;

41 42
std::string DumpFrameToString(DumpFrame df);

gsell's avatar
gsell committed
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
// Class Option
// ------------------------------------------------------------------------

namespace {
    // The attributes of class Option.
    enum {
        ECHO,
        INFO,
        TRACE,
        WARN,
        SEED,
        TELL,
        PSDUMPFREQ,
        STATDUMPFREQ,
        PSDUMPEACHTURN,
winklehner_d's avatar
-DW  
winklehner_d committed
58
        PSDUMPFRAME,
gsell's avatar
gsell committed
59 60 61 62
        SPTDUMPFREQ,
        REPARTFREQ,
        REBINFREQ,
        SCSOLVEFREQ,
63
        MTSSUBSTEPS,
64
	REMOTEPARTDEL,
gsell's avatar
gsell committed
65 66
        SCAN,
        RHODUMP,
67
        EBDUMP,
68
	CSRDUMP,
gsell's avatar
gsell committed
69 70 71 72 73 74 75 76
        AUTOPHASE,
        PPDEBUG,
        SURFDUMPFREQ,
        NUMBLOCKS,
        RECYCLEBLOCKS,
        NLHS,
        CZERO,
        RNGTYPE,
adelmann's avatar
adelmann committed
77
        ENABLEHDF5,
adelmann's avatar
adelmann committed
78
        ASCIIDUMP,
adelmann's avatar
adelmann committed
79
        BOUNDPDESTROYFQ,
80
	BEAMHALOBOUNDARY,
81 82 83 84
        CLOTUNEONLY,
        IDEALIZED,
        LOGBENDTRAJECTORY,
        VERSION,
85
#ifdef ENABLE_AMR
86
        AMR,
frey_m's avatar
frey_m committed
87
#endif
frey_m's avatar
frey_m committed
88
        MEMORYDUMP,
89
        SIZE
gsell's avatar
gsell committed
90 91 92 93 94 95
    };
}


Option::Option():
    Action(SIZE, "OPTION",
96 97
           "The \"OPTION\" statement defines OPAL execution options.")
    {
98

gsell's avatar
gsell committed
99 100
    itsAttr[ECHO] = Attributes::makeBool
                    ("ECHO", "If true, give echo of input", echo);
101

gsell's avatar
gsell committed
102 103
    itsAttr[INFO] = Attributes::makeBool
                    ("INFO", "If true, print information messages", info);
104

gsell's avatar
gsell committed
105 106
    itsAttr[TRACE] = Attributes::makeBool
                     ("TRACE", "If true, print execution trace", mtrace);
107

gsell's avatar
gsell committed
108 109
    itsAttr[WARN] = Attributes::makeBool
                    ("WARN", "If true, print warning messages", warn);
110

gsell's avatar
gsell committed
111
    itsAttr[SEED] = Attributes::makeReal
112
                    ("SEED", "The seed for the random generator, -1 will use time(0) as seed ");
113

gsell's avatar
gsell committed
114
    itsAttr[TELL] = Attributes::makeBool
adelmann's avatar
adelmann committed
115
                    ("TELL", "If true, print the current settings. Must be the last option in the inputfile in order to render correct results", false);
116

gsell's avatar
gsell committed
117 118
    itsAttr[PSDUMPFREQ] = Attributes::makeReal
                          ("PSDUMPFREQ", "The frequency to dump the phase space, i.e.dump data when step%psDumpFreq==0, its default value is 10.");
119

gsell's avatar
gsell committed
120 121
    itsAttr[STATDUMPFREQ] = Attributes::makeReal
                            ("STATDUMPFREQ", "The frequency to dump statistical data (e.g. RMS beam quantities), i.e. dump data when step%statDumpFreq == 0, its default value is 10.");
122

gsell's avatar
gsell committed
123 124
    itsAttr[PSDUMPEACHTURN] = Attributes::makeBool
                              ("PSDUMPEACHTURN", "If true, dump phase space after each turn ,only aviable for OPAL-cycl, its default value is false");
125

gsell's avatar
gsell committed
126 127
    itsAttr[SCSOLVEFREQ] = Attributes::makeReal
                           ("SCSOLVEFREQ", "The frequency to solve space charge fields. its default value is 1");
128

129
    itsAttr[MTSSUBSTEPS] = Attributes::makeReal("MTSSUBSTEPS", "How many small timesteps are inside the large timestep used in multiple time stepping (MTS) integrator");
130

131
    itsAttr[REMOTEPARTDEL] = Attributes::makeReal
adelmann's avatar
adelmann committed
132
      ("REMOTEPARTDEL", "Artifically delete the remote particle if its distance to the beam mass is larger than REMOTEPARTDEL times of the beam rms size, its default values is 0 (no delete) ",0.0);
133

winklehner_d's avatar
-DW  
winklehner_d committed
134 135
    itsAttr[PSDUMPFRAME] = Attributes::makeString
                                ("PSDUMPFRAME", "Controls the frame of phase space dump in stat file and h5 file. If 'GLOBAL' OPAL will dump in the lab (global) Cartesian frame; if 'BUNCH_MEAN' OPAL will dump in the local Cartesian frame of the beam mean; if 'REFERENCE'  OPAL will dump in the local Cartesian frame of the reference particle 0. Only aviable for OPAL-cycl, its default value is 'GLOBAL'");
136

gsell's avatar
gsell committed
137 138
    itsAttr[SPTDUMPFREQ] = Attributes::makeReal
                           ("SPTDUMPFREQ", "The frequency to dump single particle trajectory of particles with ID = 0 & 1, its default value is 1. ");
139

gsell's avatar
gsell committed
140 141
    itsAttr[REPARTFREQ] = Attributes::makeReal
                          ("REPARTFREQ", "The frequency to do particles repartition for better load balance between nodes,its default value is 10. ");
142

gsell's avatar
gsell committed
143 144 145 146 147 148 149 150 151
    itsAttr[REBINFREQ] = Attributes::makeReal
                         ("REBINFREQ", "The frequency to reset energy bin ID for all particles, its default value is 100. ");

    itsAttr[SCAN] = Attributes::makeBool
                    ("SCAN", "If true, each new track starts at the begin of the lattics with a new distribution", scan);

    itsAttr[RHODUMP] = Attributes::makeBool
                       ("RHODUMP", "If true, in addition to the phase space the scalar rho field is also dumped (H5Block)", rhoDump);

152 153 154
    itsAttr[EBDUMP] = Attributes::makeBool
                       ("EBDUMP", "If true, in addition to the phase space the E and B field at each particle is also dumped into the H5 file)", ebDump);

155 156 157
    itsAttr[CSRDUMP] = Attributes::makeBool
                       ("CSRDUMP", "If true, the csr E field, line density and the line density derivative is dumped into the data directory)", csrDump);

gsell's avatar
gsell committed
158 159 160 161 162
    itsAttr[AUTOPHASE] = Attributes::makeReal
                         ("AUTOPHASE", "If greater than zero OPAL is scaning the phases of each rf structure in order to get maximum acceleration. Defines the number of refinements of the search range", autoPhase);

    itsAttr[PPDEBUG] = Attributes::makeBool
                       ("PPDEBUG", "If true, use special initial velocity distribution for parallel plate and print special debug output", ppdebug);
163

gsell's avatar
gsell committed
164 165 166 167 168 169 170
    itsAttr[SURFDUMPFREQ] =  Attributes::makeReal
                             ("SURFDUMPFREQ", "The frequency to dump surface-partcle interaction data, its default value is -1 (no dump). ");

    itsAttr[CZERO] =  Attributes::makeBool
                      ("CZERO", "If set to true a symmetric distribution is created -> centroid == 0.0 ", cZero);

    itsAttr[RNGTYPE] =  Attributes::makeString
adelmann's avatar
adelmann committed
171
                        ("RNGTYPE", "RANDOM (default), Quasi-random number gernerators: HALTON, SOBOL, NIEDERREITER (Gsl ref manual 18.5)", rngtype);
gsell's avatar
gsell committed
172 173


174 175 176
    itsAttr[CLOTUNEONLY] =  Attributes::makeBool
                                   ("CLOTUNEONLY", "If set to true stop after CLO and tune calculation ", cloTuneOnly);

gsell's avatar
gsell committed
177 178 179 180 181 182
    itsAttr[NUMBLOCKS] = Attributes::makeReal
                          ("NUMBLOCKS", "Maximum number of vectors in the Krylov space (for RCGSolMgr). Default value is 0 and BlockCGSolMgr will be used.");
    itsAttr[RECYCLEBLOCKS] = Attributes::makeReal
                          ("RECYCLEBLOCKS", "Number of vectors in the recycle space (for RCGSolMgr). Default value is 0 and BlockCGSolMgr will be used.");
    itsAttr[NLHS] = Attributes::makeReal
                          ("NLHS", "Number of stored old solutions for extrapolating the new starting vector. Default value is 1 and just the last solution is used.");
adelmann's avatar
adelmann committed
183

adelmann's avatar
adelmann committed
184
    itsAttr[ENABLEHDF5] = Attributes::makeBool
185
        ("ENABLEHDF5", "If true, HDF5 actions are enabled", enableHDF5);
adelmann's avatar
adelmann committed
186

adelmann's avatar
adelmann committed
187 188 189
    itsAttr[ASCIIDUMP] = Attributes::makeBool
        ("ASCIIDUMP", "If true, some of the elements dump in ASCII instead of HDF5", false);

adelmann's avatar
adelmann committed
190 191
    itsAttr[BOUNDPDESTROYFQ] = Attributes::makeReal
      ("BOUNDPDESTROYFQ", "The frequency to do boundp_destroy to delete lost particles. Default 10",10.0);
192

193
    itsAttr[BEAMHALOBOUNDARY] = Attributes::makeReal
194 195 196 197 198 199 200 201 202 203
      ("BEAMHALOBOUNDARY", "Defines in therms of sigma where the halo starts. Default 0.0",0.0);

    itsAttr[IDEALIZED] = Attributes::makeBool
        ("IDEALIZED", "Using the hard edge model for the calculation of path length. Default: false", false);

    itsAttr[LOGBENDTRAJECTORY] = Attributes::makeBool
        ("LOGBENDTRAJECTORY", "Writing the trajectory of every bend to disk. Default: false", false);

    itsAttr[VERSION] = Attributes::makeReal
        ("VERSION", "Version of OPAL for which input file was written", 10000);
frey_m's avatar
frey_m committed
204
    
205
#ifdef ENABLE_AMR
frey_m's avatar
frey_m committed
206
    itsAttr[AMR] = Attributes::makeBool
207
        ("AMR", "Use adaptive mesh refinement.", amr);
frey_m's avatar
frey_m committed
208
#endif
frey_m's avatar
frey_m committed
209 210
    itsAttr[MEMORYDUMP] = Attributes::makeBool
        ("MEMORYDUMP", "If true, write memory to SDDS file", memoryDump);
frey_m's avatar
frey_m committed
211
    
212 213
    registerOwnership(AttributeHandler::STATEMENT);

gsell's avatar
gsell committed
214 215 216 217
    FileStream::setEcho(echo);
}


218
Option::Option(const std::string &name, Option *parent):
219
    Action(name, parent) {
gsell's avatar
gsell committed
220 221 222 223 224 225 226 227
    Attributes::setBool(itsAttr[ECHO],       echo);
    Attributes::setBool(itsAttr[INFO],       info);
    Attributes::setBool(itsAttr[TRACE],      mtrace);
    Attributes::setBool(itsAttr[WARN],       warn);
    Attributes::setReal(itsAttr[SEED],       seed);
    Attributes::setReal(itsAttr[PSDUMPFREQ], psDumpFreq);
    Attributes::setReal(itsAttr[STATDUMPFREQ], statDumpFreq);
    Attributes::setBool(itsAttr[PSDUMPEACHTURN], psDumpEachTurn);
228
    Attributes::setString(itsAttr[PSDUMPFRAME], DumpFrameToString(psDumpFrame));
gsell's avatar
gsell committed
229 230
    Attributes::setReal(itsAttr[SPTDUMPFREQ], sptDumpFreq);
    Attributes::setReal(itsAttr[SCSOLVEFREQ], scSolveFreq);
231
    Attributes::setReal(itsAttr[MTSSUBSTEPS], mtsSubsteps);
232
    Attributes::setReal(itsAttr[REMOTEPARTDEL], remotePartDel);
gsell's avatar
gsell committed
233 234 235 236
    Attributes::setReal(itsAttr[REPARTFREQ], repartFreq);
    Attributes::setReal(itsAttr[REBINFREQ], rebinFreq);
    Attributes::setBool(itsAttr[SCAN], scan);
    Attributes::setBool(itsAttr[RHODUMP], rhoDump);
237
    Attributes::setBool(itsAttr[EBDUMP], ebDump);
238
    Attributes::setBool(itsAttr[CSRDUMP], csrDump);
gsell's avatar
gsell committed
239 240 241 242
    Attributes::setReal(itsAttr[AUTOPHASE], autoPhase);
    Attributes::setBool(itsAttr[PPDEBUG], ppdebug);
    Attributes::setReal(itsAttr[SURFDUMPFREQ], surfDumpFreq);
    Attributes::setBool(itsAttr[CZERO], cZero);
243
    Attributes::setBool(itsAttr[CLOTUNEONLY], cloTuneOnly);
244
    Attributes::setString(itsAttr[RNGTYPE], std::string(rngtype));
gsell's avatar
gsell committed
245 246 247
    Attributes::setReal(itsAttr[NUMBLOCKS], numBlocks);
    Attributes::setReal(itsAttr[RECYCLEBLOCKS], recycleBlocks);
    Attributes::setReal(itsAttr[NLHS], nLHS);
adelmann's avatar
adelmann committed
248
    Attributes::setBool(itsAttr[ENABLEHDF5], enableHDF5);
adelmann's avatar
adelmann committed
249
    Attributes::setBool(itsAttr[ASCIIDUMP], asciidump);
250 251 252 253 254
    Attributes::setReal(itsAttr[BOUNDPDESTROYFQ], boundpDestroyFreq);
    Attributes::setReal(itsAttr[BEAMHALOBOUNDARY], beamHaloBoundary);
    Attributes::setBool(itsAttr[IDEALIZED], idealized);
    Attributes::setBool(itsAttr[LOGBENDTRAJECTORY], writeBendTrajectories);
    Attributes::setReal(itsAttr[VERSION], version);
255
#ifdef ENABLE_AMR
frey_m's avatar
frey_m committed
256 257
    Attributes::setBool(itsAttr[AMR], amr);
#endif
frey_m's avatar
frey_m committed
258
    Attributes::setBool(itsAttr[MEMORYDUMP], memoryDump);
gsell's avatar
gsell committed
259 260 261 262 263 264 265
}


Option::~Option()
{}


266
Option *Option::clone(const std::string &name) {
gsell's avatar
gsell committed
267 268 269 270 271 272 273 274 275 276 277 278 279
    return new Option(name, this);
}


void Option::execute() {
    // Store the option flags.
    echo      = Attributes::getBool(itsAttr[ECHO]);
    info      = Attributes::getBool(itsAttr[INFO]);
    mtrace     = Attributes::getBool(itsAttr[TRACE]);
    warn      = Attributes::getBool(itsAttr[WARN]);
    psDumpEachTurn =   Attributes::getBool(itsAttr[PSDUMPEACHTURN]);
    scan = Attributes::getBool(itsAttr[SCAN]);
    rhoDump = Attributes::getBool(itsAttr[RHODUMP]);
280
    ebDump = Attributes::getBool(itsAttr[EBDUMP]);
281
    csrDump = Attributes::getBool(itsAttr[CSRDUMP]);
gsell's avatar
gsell committed
282
    ppdebug = Attributes::getBool(itsAttr[PPDEBUG]);
adelmann's avatar
adelmann committed
283
    enableHDF5 = Attributes::getBool(itsAttr[ENABLEHDF5]);
284
    version = Attributes::getReal(itsAttr[VERSION]);
285
#ifdef ENABLE_AMR
frey_m's avatar
frey_m committed
286 287
    amr = Attributes::getBool(itsAttr[AMR]);
#endif
frey_m's avatar
frey_m committed
288 289 290 291 292
    memoryDump = Attributes::getBool(itsAttr[MEMORYDUMP]);
    
    if ( memoryDump ) {
        IpplMemoryUsage::IpplMemory_p memory = IpplMemoryUsage::getInstance(
                IpplMemoryUsage::Unit::GB, false);
frey_m's avatar
frey_m committed
293
        memory->sample();
frey_m's avatar
frey_m committed
294 295
    }
    
Andreas Adelmann's avatar
Andreas Adelmann committed
296 297 298 299 300 301 302 303 304
    seed = Attributes::getReal(itsAttr[SEED]);

    /// note: rangen is used only for the random number generator in the OPAL language
    ///       not for the distributions

    if (Options::seed == -1)
      rangen.init55(time(0));
    else
      rangen.init55(seed);
305
    
306 307 308

    IpplInfo::Info->on(info);
    IpplInfo::Warn->on(warn);
gsell's avatar
gsell committed
309

310
    handlePsDumpFrame(Util::toUpper(Attributes::getString(itsAttr[PSDUMPFRAME])));
winklehner_d's avatar
-DW  
winklehner_d committed
311

adelmann's avatar
adelmann committed
312 313 314 315
    if(itsAttr[ASCIIDUMP]) {
        asciidump = Attributes::getBool(itsAttr[ASCIIDUMP]);
    }

Andreas Adelmann's avatar
Andreas Adelmann committed
316 317
    /// note: rangen is used only for the random number generator in the OPAL language
    ///       not for the distributions
gsell's avatar
gsell committed
318 319
    if(itsAttr[SEED]) {
        seed = int(Attributes::getReal(itsAttr[SEED]));
320
	if (seed == -1)
kraus's avatar
kraus committed
321
            rangen.init55(time(0));
322
	else
kraus's avatar
kraus committed
323
            rangen.init55(seed);
gsell's avatar
gsell committed
324 325 326 327
    }

    if(itsAttr[PSDUMPFREQ]) {
        psDumpFreq = int(Attributes::getReal(itsAttr[PSDUMPFREQ]));
328 329
        if (psDumpFreq==0)
            psDumpFreq = std::numeric_limits<int>::max();
gsell's avatar
gsell committed
330
    }
adelmann's avatar
adelmann committed
331

gsell's avatar
gsell committed
332 333
    if(itsAttr[STATDUMPFREQ]) {
        statDumpFreq = int(Attributes::getReal(itsAttr[STATDUMPFREQ]));
334 335
        if (statDumpFreq==0)
            statDumpFreq = std::numeric_limits<int>::max();
gsell's avatar
gsell committed
336 337 338 339
    }

    if(itsAttr[SPTDUMPFREQ]) {
        sptDumpFreq = int(Attributes::getReal(itsAttr[SPTDUMPFREQ]));
340 341
        if (sptDumpFreq==0)
            sptDumpFreq = std::numeric_limits<int>::max();
gsell's avatar
gsell committed
342 343 344 345 346 347 348
    }


    if(itsAttr[SCSOLVEFREQ]) {
        scSolveFreq = int(Attributes::getReal(itsAttr[SCSOLVEFREQ]));
    }

349

350 351 352 353
    if(itsAttr[MTSSUBSTEPS]) {
        mtsSubsteps = int(Attributes::getReal(itsAttr[MTSSUBSTEPS]));
    }

354 355

    if(itsAttr[REMOTEPARTDEL]) {
adelmann's avatar
adelmann committed
356
        remotePartDel = Attributes::getReal(itsAttr[REMOTEPARTDEL]);
357 358
    }

gsell's avatar
gsell committed
359 360 361 362 363 364 365 366 367 368 369 370 371 372 373
    if(itsAttr[REPARTFREQ]) {
        repartFreq = int(Attributes::getReal(itsAttr[REPARTFREQ]));
    }

    if(itsAttr[REBINFREQ]) {
        rebinFreq = int(Attributes::getReal(itsAttr[REBINFREQ]));
    }

    if(itsAttr[AUTOPHASE]) {
        autoPhase = int(Attributes::getReal(itsAttr[AUTOPHASE]));
    }
    if(itsAttr[SURFDUMPFREQ]) {
        surfDumpFreq = int(Attributes::getReal(itsAttr[SURFDUMPFREQ]));
    }
    if(itsAttr[NUMBLOCKS]) {
kraus's avatar
kraus committed
374
        numBlocks = int(Attributes::getReal(itsAttr[NUMBLOCKS]));
gsell's avatar
gsell committed
375 376 377 378 379 380 381
    }
    if(itsAttr[RECYCLEBLOCKS]) {
        recycleBlocks = int(Attributes::getReal(itsAttr[RECYCLEBLOCKS]));
    }
    if(itsAttr[NLHS]) {
        nLHS = int(Attributes::getReal(itsAttr[NLHS]));
    }
382

gsell's avatar
gsell committed
383 384 385 386 387
    if(itsAttr[CZERO]) {
        cZero = bool(Attributes::getBool(itsAttr[CZERO]));
    }

    if(itsAttr[RNGTYPE]) {
388
        rngtype = std::string(Attributes::getString(itsAttr[RNGTYPE]));
gsell's avatar
gsell committed
389
    } else {
390
        rngtype = std::string("RANDOM");
gsell's avatar
gsell committed
391
    }
kraus's avatar
kraus committed
392

393
    if(itsAttr[BEAMHALOBOUNDARY]) {
kraus's avatar
kraus committed
394
        beamHaloBoundary  = Attributes::getReal(itsAttr[BEAMHALOBOUNDARY]);
adelmann's avatar
adelmann committed
395 396
    }
    else {
kraus's avatar
kraus committed
397
        beamHaloBoundary = 0;
398 399
    }

400 401 402 403
    idealized = Attributes::getBool(itsAttr[IDEALIZED]);

    writeBendTrajectories = Attributes::getBool(itsAttr[LOGBENDTRAJECTORY]);

404 405 406 407 408
    if(itsAttr[CLOTUNEONLY]) {
        cloTuneOnly = bool(Attributes::getBool(itsAttr[CLOTUNEONLY]));
    } else {
        cloTuneOnly = false;
    }
409
    
gsell's avatar
gsell committed
410 411 412 413
    // Set message flags.
    FileStream::setEcho(echo);

    if(Attributes::getBool(itsAttr[TELL])) {
kraus's avatar
kraus committed
414
        *gmsg << "\nCurrent settings of options:\n" << *this << endl;
gsell's avatar
gsell committed
415
    }
winklehner_d's avatar
-DW  
winklehner_d committed
416 417
}

418
void Option::handlePsDumpFrame(const std::string &dumpFrame) {
419
    if (dumpFrame == "GLOBAL") {
420
        psDumpFrame = GLOBAL;
421
    } else if (dumpFrame == "BUNCH_MEAN") {
422
        psDumpFrame = BUNCH_MEAN;
423
    } else if (dumpFrame == "REFERENCE") {
424
        psDumpFrame = REFERENCE;
winklehner_d's avatar
-DW  
winklehner_d committed
425 426
    } else {
        std::string msg = std::string("Did not recognise PSDUMPFRAME '")+\
427
                    dumpFrame+std::string("'. It should be one of 'GLOBAL',")+\
winklehner_d's avatar
-DW  
winklehner_d committed
428 429 430 431 432
                    std::string(" 'BUNCH_MEAN' or 'REFERENCE'");
        throw OpalException("Option::handlePsDumpFrame", msg);
    }
}

433 434 435 436 437 438 439 440 441 442
std::string DumpFrameToString(DumpFrame df) {
    switch (df) {
    case BUNCH_MEAN:
        return std::string("BUNCH_MEAN");
    case REFERENCE:
        return std::string("REFERENCE");
    case GLOBAL:
    default:
        return std::string("GLOBAL");
    }
443
}