name: Splitter
synopsis:

>     g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_mmedia.a

>     #include <Splitter.h>

>     static boolean diagnose(Integral::DEBUG debug_level);
>     SPLIT_MODE getSplitMode();
>     boolean setSplitMode(SPLIT_MODE arg);
>     Filename& getParamFile();
>     boolean setParamFile(Filename& arg);
>     Filename& getIdentifierList();
>     boolean setIdentifierList(Filename& arg);
>     Filename& getMachineList();
>     boolean setMachineList(Filename& arg);
>     Filename& getAccumulatorList();
>     boolean setAccumulatorList(Filename& arg);
>     MachineDatabase& getMachineDatabase();
>     boolean getMachineDatabase(MachineDatabase& arg);
>     boolean createUtterLists(Filename& identifier_list, Filename& machine_list, Filename& accumulator_list, Vector<Filename>& identifiers_lookup, Vector<Machine>& machine_lookup, Vector<Filename>& accumulator_lookup, Vector<SingleLinkedList<Filename> >& items);
>     boolean divideAndConquer(Filename& identifier_list, Filename& machine_list, Vector<SingleLinkedList<Filename> >& items);

quick start:

>     Splitter splt_00;

>     splt_00.setSplitMode(Splitter::SPEED);
>     splt_00.run();

description:
This class is used to split a file list and launch jobs on machines during parallel training of models in the Baum-Welch re-estimation phase.
dependencies:

- String.h

public constants:

- define the class name:

      static const String CLASS_NAME = L"Splitter";

- define the split mode choices:

      enum SPLIT_MODE { NONE = 0, SPEED, MEMORY, DEF_SPLIT_MODE = NONE };

- define the NameMap objects:

      static const NameMap SPLIT_MAP;

- define i/o related constants:

      static const String DEF_PARAM;

      static const String PARAM_SPLIT_MODE;

      static const String PARAM_PARAMETER_FILE;

      static const String PARAM_MACHINE_LIST;

      static const String PARAM_IDENTIFIER_LIST;

      static const String PARAM_ACCUMULATOR_LIST;

      static const String PARAM_MACHINE_DATABASE;

- define default values and arguments:

      static const String DEF_RECOGNIZER;

      static const String DEF_RSH_PROTOCOL;

      static const String DEF_SSH_PROTOCOL;

- define option flags:

      static const String OPTION_PARAM_FLAG;

      static const String OPTION_LIST_FLAG;

      static const String OPTION_ACCUM_FLAG;

error codes:

- error codes indicating general errors:

protected data:

- declare the split mode:

      SPLIT_MODE split_mode_d;

- declare the parameter file name:

      Filename param_file_d;

- declare the list of identifiers:

      Filename ident_list_d;

- declare the list of machines:

      Filename machine_list_d;

- declare the list of accumulators:

      Filename accum_list_d;

- declare the machine database:

      MachineDatabase mdb_d;

- declare the debugging parameters:

      static Integral::DEBUG debug_level_d;

- declare the memory manager:

      static MemoryManager mgr_d;

required public methods:

- static methods:

      static const String& name();

- debug methods:

      boolean debug(const unichar* msg) const;

      static boolean setDebug(Integral::DEBUG arg);

      static boolean diagnose(Integral::DEBUG debug_level);

- destructor/constructor(s):

      ~Splitter();

      Splitter();

      Splitter(const Splitter& arg);

- assign methods:

      boolean assign(const Splitter& arg);

- operator= method:

      not present.

- i/o methods:

      long sofSize() const;

      boolean read(Sof& sof, long tag);

      boolean read(Sof& sof, long tag, const String& name);

      boolean write(Sof& sof, long tag) const;

      boolean write(Sof& sof, long tag, const String& name) const;

      boolean readData(Sof& sof, const String& pname = DEF_PARAM, long size = SofParser::FULL_OBJECT, boolean param = true, boolean nested = false);

      boolean writeData(Sof& sof, const String& pname =  DEF_PARAM) const;

- equality methods:

      boolean eq(const Splitter& arg) const;

- memory management methods:

      static void* operator new(size_t arg);

      static void* operator new[](size_t arg);

      static void operator delete(void* arg);

      static void operator delete[](void* arg);

      static boolean setGrowSize(long arg);

      boolean clear(Integral::CMODE cmode = Integral::DEF_CMODE);

class-specific public methods:

- declare split mode methods:

      SPLIT_MODE getSplitMode();

      boolean setSplitMode(SPLIT_MODE arg);

- declare parameter file methods:

      Filename& getParamFile();

      boolean setParamFile(Filename& arg);

- declare identifier methods:

      Filename& getIdentifierList();

      boolean setIdentifierList(Filename& arg);

- declare machine list methods:

      Filename& getMachineList();

      boolean setMachineList(Filename& arg);

- declare accumulator list methods:

      Filename& getAccumulatorList();

      boolean setAccumulatorList(Filename& arg);

- declare machine database methods:

      MachineDatabase& getMachineDatabase();

      boolean getMachineDatabase(MachineDatabase& arg);

- declare splitting methods:

      boolean createUtterLists(Filename& identifier_list, Filename& machine_list, Filename& accumulator_list, Vector<Filename>& identifiers_lookup, Vector<Machine>& machine_lookup, Vector<Filename>& accumulator_lookup, Vector<SingleLinkedList<Filename> >& items);

      boolean divideAndConquer(Filename& identifier_list, Filename& machine_list, Vector<SingleLinkedList<Filename> >& items);

      boolean splitJobList(Filename& input_file, Filename& cpus, String& command_to_execute, String& walltime, String& batch_command, Sdb& sdb_list, String& cluster_name);

      boolean pollLogFile(Vector& log_files);

      boolean waitAndAccumulate(Vector& log_files, String& proc_id_str);

      boolean sendEmail(Long& start_time, Long& finish_time, String& begin_time, String& end_time, String& proc_id_str);

      String getDiffTime(Long& start_time, Long& finish_time);

- declare cluster specific methods:

private methods:

- declare private methods:

examples:

- This example shows how to use the Splitter object.

notes:

- none.