Paramotopy
parallel parameter homotopy through bertini
|
master process for basic searches and brute-force runs. More...
#include <master.hpp>
Public Member Functions | |
master_process () | |
void | master_main (ProgSettings input_settings, runinfo input_p_info, timer &process_timer) |
Private Member Functions | |
void | MasterSetup () |
void | SeedSwitch (timer &process_timer) |
void | SeedBasic (timer &process_timer) |
void | SeedSearch (timer &process_timer) |
void | LoopSwitch (timer &process_timer) |
void | LoopBasic (timer &process_timer) |
void | LoopSearch (timer &process_timer) |
void | CleanupSwitch (timer &process_timer) |
void | CleanupBasic (timer &process_timer) |
void | CleanupSearch (timer &process_timer) |
void | SendInput (timer &process_timer) |
void | SendStart (timer &process_timer) |
void | NextRandomValue (int pointcounter, double tempsends[]) |
void | FormNextValues (int pointcounter, std::vector< std::vector< std::pair< double, double > > > Values, double tempsends[]) |
void | FormNextValues_mc (int pointcounter, double tempsends[]) |
void | GetTerminationInt () |
void | OpenMC () |
void | SetTmpFolder () |
void | SetUpFolders () |
void | TerminateInactiveWorker (int worker_id, timer &process_timer) |
void | TerminateActiveWorker (int worker_id, timer &process_timer) |
void | ReadyCheck () |
Private Attributes | |
runinfo | paramotopy_info |
the parsed paramotopy input file. More... | |
ProgSettings | paramotopy_settings |
the ProgSettings for this process More... | |
std::vector< int > | lastnumsent |
progress tracker More... | |
int | numprocs |
number of processors in the communicator More... | |
int | myid |
my MPI id relative to communicator More... | |
int | numparam |
number of parameters in problem More... | |
boost::filesystem::path | filename |
filename for problem More... | |
int | standardstep2 |
switch for total degree vs. coeff. homotopy More... | |
int | numfilesatatime |
current number of files passed out at each distribution More... | |
int | numfilesatatime_orig |
given number of files passed out at each distribution More... | |
int | terminationint |
maximum absolute_current_index value before loop breaks. More... | |
int | current_absolute_index |
the current absolute index. More... | |
boost::filesystem::path | lastoutfilename |
name of the progress file More... | |
boost::filesystem::path | tmpfolder |
where the temp files at? More... | |
boost::filesystem::path | called_dir |
where was I when I was instantiated? More... | |
boost::filesystem::path | homedir |
where is /Users/ofloveandhate? More... | |
std::ofstream | mc_out_stream |
parameter point out file More... | |
std::ifstream | mc_in_stream |
parameter point in file More... | |
std::vector< int > | index_conversion_vector |
std::map< int, bool > | active_workers |
map for tracking the active workers. More... | |
int | num_active_workers |
parity checker More... | |
master process for basic searches and brute-force runs.
process for distribution of parameter points and termination of workers.
Definition at line 41 of file master.hpp.
|
inline |
Definition at line 60 of file master.hpp.
References called_dir, homedir, myid, num_active_workers, numprocs, and stackoverflow_getcwd().
|
private |
basic mode cleanup function.
process_timer | current timer |
Definition at line 849 of file master.cpp.
References active_workers, timer::add_time(), current_absolute_index, runinfo::location, mc_in_stream, mc_out_stream, num_active_workers, paramotopy_info, paramotopy_settings, timer::press_start(), ProgSettings::settings, TerminateActiveWorker(), and runinfo::userdefined.
Referenced by CleanupSearch(), and CleanupSwitch().
|
private |
search mode cleanup function.
process_timer | current timer |
Definition at line 933 of file master.cpp.
References CleanupBasic().
Referenced by CleanupSwitch().
|
private |
cleanup switch
process_timer | current timer |
Definition at line 818 of file master.cpp.
References CleanupBasic(), CleanupSearch(), paramotopy_settings, ProgSettings::settings, and tmpfolder.
Referenced by master_main().
|
private |
the function for determining the parameter values to send next.
numparam | the number of parameters in the problem being solved. |
pointcounter | counts the number of loops. determines which index in tempsends gets set. |
Values | the parameter discretization values. |
countingup | counter. |
tempsends | the variable in which the parameter points get set, for distribution to the workers via MPI. |
Definition at line 131 of file master.cpp.
References current_absolute_index, index_conversion_vector, and numparam.
Referenced by LoopBasic(), and SeedBasic().
|
private |
the user-defined parameter set function for setting the parameter values to send next
pointcounter | counts the number of loops. determines which index in tempsends gets set. |
tempsends | the variable in which the parameter points get set, for distribution to the workers via MPI. |
Definition at line 165 of file master.cpp.
References current_absolute_index, mc_in_stream, and numparam.
Referenced by LoopBasic(), and SeedBasic().
|
private |
sets the value of this->terminationint
Definition at line 1097 of file master.cpp.
References GetMcNumLines(), index_conversion_vector, runinfo::location, runinfo::NumMeshPoints, runinfo::numparam, paramotopy_info, paramotopy_settings, ProgSettings::settings, terminationint, and runinfo::userdefined.
Referenced by master_main().
|
private |
basic mode run loop
process_timer | current timer |
Definition at line 479 of file master.cpp.
References timer::add_time(), current_absolute_index, DATA_DOUBLE, FormNextValues(), FormNextValues_mc(), lastnumsent, lastoutfilename, mc_out_stream, NUM_PACKETS, numfilesatatime, runinfo::numparam, numprocs, paramotopy_info, paramotopy_settings, timer::press_start(), ReadyCheck(), ProgSettings::settings, terminationint, runinfo::userdefined, and runinfo::Values.
Referenced by LoopSwitch().
|
private |
search mode loop
process_timer | current timer |
Definition at line 637 of file master.cpp.
References timer::add_time(), current_absolute_index, DATA_DOUBLE, lastnumsent, lastoutfilename, mc_out_stream, NextRandomValue(), NUM_PACKETS, numfilesatatime, numfilesatatime_orig, runinfo::numparam, numprocs, paramotopy_info, paramotopy_settings, timer::press_start(), ReadyCheck(), ProgSettings::settings, TerminateActiveWorker(), and terminationint.
Referenced by LoopSwitch().
|
private |
main loop switch
process_timer | current timer |
Definition at line 457 of file master.cpp.
References LoopBasic(), LoopSearch(), paramotopy_settings, and ProgSettings::settings.
Referenced by master_main().
void master_process::master_main | ( | ProgSettings | input_settings, |
runinfo | input_p_info, | ||
timer & | process_timer | ||
) |
the main master process. to be used by which ever process gets myid==0. handles the distribution of the parameter points to the workers via MPI.
this is the only public method excepting the constructors.
input_settings | current input settings. |
input_p_info | current parser run info. |
process_timer | MUTABLE current timer, and returns to user for further use. |
Definition at line 9 of file master.cpp.
References CleanupSwitch(), GetTerminationInt(), LoopSwitch(), MasterSetup(), OpenMC(), paramotopy_info, paramotopy_settings, SeedSwitch(), SendInput(), SendStart(), SetTmpFolder(), and SetUpFolders().
Referenced by main().
|
private |
the master setup function
uses the runinfo and ProgSettings in memory to setup the rest of the necessaries.
Definition at line 67 of file master.cpp.
References filename, runinfo::inputfilename, lastoutfilename, runinfo::location, numfilesatatime, numfilesatatime_orig, runinfo::numparam, numparam, paramotopy_info, paramotopy_settings, ProgSettings::settings, and standardstep2.
Referenced by master_main().
|
private |
generates a random point in an interval, contained in the runinfo object.
paramotopy_info | holds configuration info |
numparam | the number of parameters in the problem being solved. |
pointcounter | counts the number of loops. determines which index in tempsends gets set. |
tempsends | the variable in which the parameter points get set, for distribution to the workers via MPI. |
Definition at line 102 of file master.cpp.
References runinfo::BoundsLeft, runinfo::BoundsRight, current_absolute_index, numparam, and paramotopy_info.
Referenced by LoopSearch(), and SeedSearch().
|
private |
opens the mc_in_stream and mc_out_stream files as necessary
Definition at line 1131 of file master.cpp.
References runinfo::location, mc_in_stream, mc_out_stream, paramotopy_info, paramotopy_settings, ProgSettings::settings, and runinfo::userdefined.
Referenced by master_main().
|
private |
just makin' sure we are ready to go before we do go.
Definition at line 1292 of file master.cpp.
References myid, numfilesatatime, terminationint, and tmpfolder.
Referenced by LoopBasic(), and LoopSearch().
|
private |
basic seeding function
process_timer | current timer |
Definition at line 233 of file master.cpp.
References active_workers, timer::add_time(), current_absolute_index, DATA_DOUBLE, FormNextValues(), FormNextValues_mc(), lastnumsent, mc_out_stream, num_active_workers, NUM_PACKETS, numfilesatatime, runinfo::numparam, numprocs, paramotopy_info, paramotopy_settings, timer::press_start(), ProgSettings::settings, TerminateInactiveWorker(), terminationint, runinfo::userdefined, and runinfo::Values.
Referenced by SeedSwitch().
|
private |
search mode seeding function
process_timer | current timer |
Definition at line 336 of file master.cpp.
References active_workers, timer::add_time(), current_absolute_index, DATA_DOUBLE, lastnumsent, mc_out_stream, NextRandomValue(), num_active_workers, NUM_PACKETS, numfilesatatime, runinfo::numparam, numprocs, paramotopy_info, paramotopy_settings, timer::press_start(), ProgSettings::settings, TerminateInactiveWorker(), terminationint, and runinfo::userdefined.
Referenced by SeedSwitch().
|
private |
switch for choosing seed process
process_timer | current timer |
Definition at line 208 of file master.cpp.
References paramotopy_settings, SeedBasic(), SeedSearch(), and ProgSettings::settings.
Referenced by master_main().
|
private |
sends input file to all workers in the communicator via a for loop MPI_Send
process_timer | current timer |
Definition at line 1013 of file master.cpp.
References timer::add_time(), runinfo::MakeRandomValues(), NUM_CHARACTERS, numprocs, paramotopy_info, paramotopy_settings, timer::press_start(), runinfo::steptwomode, TEXT_FILE, WriteFailStep2(), and WriteStep2().
Referenced by master_main().
|
private |
sends start file to all workers in communicator via a for loop MPI_Send
process_timer | current timer |
Definition at line 950 of file master.cpp.
References timer::add_time(), GetStart(), runinfo::location, NUM_CHARACTERS, numprocs, paramotopy_info, paramotopy_settings, timer::press_start(), ProgSettings::settings, and TEXT_FILE.
Referenced by master_main().
|
private |
sets the value of this->tmpfolder
Definition at line 1173 of file master.cpp.
References called_dir, runinfo::inputfilename, paramotopy_info, paramotopy_settings, ProgSettings::settings, and tmpfolder.
Referenced by master_main().
|
private |
creates the folders for the workers, and writes the names of the folders to a file in bfiles_filename/run#/folders
Definition at line 1197 of file master.cpp.
References runinfo::location, numprocs, and paramotopy_info.
Referenced by master_main().
|
private |
sends the TERMINATE tag to an ACTIVE worker, and removes it from the list, decrementing the num_active_workers counter.
Definition at line 1261 of file master.cpp.
References active_workers, timer::add_time(), num_active_workers, timer::press_start(), and TERMINATE.
Referenced by CleanupBasic(), and LoopSearch().
|
private |
sends the TERMINATE tag to an INACTIVE worker, but does not remove them from the list of active workers (cuz this worker shouldn't be on it).
Definition at line 1233 of file master.cpp.
References active_workers, timer::add_time(), timer::press_start(), and TERMINATE.
Referenced by SeedBasic(), and SeedSearch().
|
private |
map for tracking the active workers.
Definition at line 129 of file master.hpp.
Referenced by CleanupBasic(), SeedBasic(), SeedSearch(), TerminateActiveWorker(), and TerminateInactiveWorker().
|
private |
where was I when I was instantiated?
Definition at line 120 of file master.hpp.
Referenced by master_process(), and SetTmpFolder().
|
private |
the current absolute index.
Definition at line 115 of file master.hpp.
Referenced by CleanupBasic(), FormNextValues(), FormNextValues_mc(), LoopBasic(), LoopSearch(), NextRandomValue(), SeedBasic(), and SeedSearch().
|
private |
|
private |
where is /Users/ofloveandhate?
Definition at line 121 of file master.hpp.
Referenced by master_process().
|
private |
Definition at line 126 of file master.hpp.
Referenced by FormNextValues(), and GetTerminationInt().
|
private |
progress tracker
Definition at line 99 of file master.hpp.
Referenced by LoopBasic(), LoopSearch(), SeedBasic(), and SeedSearch().
|
private |
name of the progress file
Definition at line 118 of file master.hpp.
Referenced by LoopBasic(), LoopSearch(), and MasterSetup().
|
private |
parameter point in file
Definition at line 124 of file master.hpp.
Referenced by CleanupBasic(), FormNextValues_mc(), and OpenMC().
|
private |
parameter point out file
Definition at line 123 of file master.hpp.
Referenced by CleanupBasic(), LoopBasic(), LoopSearch(), OpenMC(), SeedBasic(), and SeedSearch().
|
private |
my MPI id relative to communicator
Definition at line 103 of file master.hpp.
Referenced by master_process(), and ReadyCheck().
|
private |
parity checker
Definition at line 130 of file master.hpp.
Referenced by CleanupBasic(), master_process(), SeedBasic(), SeedSearch(), and TerminateActiveWorker().
|
private |
current number of files passed out at each distribution
Definition at line 111 of file master.hpp.
Referenced by LoopBasic(), LoopSearch(), MasterSetup(), ReadyCheck(), SeedBasic(), and SeedSearch().
|
private |
given number of files passed out at each distribution
Definition at line 112 of file master.hpp.
Referenced by LoopSearch(), and MasterSetup().
|
private |
number of parameters in problem
Definition at line 105 of file master.hpp.
Referenced by FormNextValues(), FormNextValues_mc(), MasterSetup(), and NextRandomValue().
|
private |
number of processors in the communicator
Definition at line 101 of file master.hpp.
Referenced by LoopBasic(), LoopSearch(), master_process(), SeedBasic(), SeedSearch(), SendInput(), SendStart(), and SetUpFolders().
|
private |
the parsed paramotopy input file.
Definition at line 96 of file master.hpp.
Referenced by CleanupBasic(), GetTerminationInt(), LoopBasic(), LoopSearch(), master_main(), MasterSetup(), NextRandomValue(), OpenMC(), SeedBasic(), SeedSearch(), SendInput(), SendStart(), SetTmpFolder(), and SetUpFolders().
|
private |
the ProgSettings for this process
Definition at line 97 of file master.hpp.
Referenced by CleanupBasic(), CleanupSwitch(), GetTerminationInt(), LoopBasic(), LoopSearch(), LoopSwitch(), master_main(), MasterSetup(), OpenMC(), SeedBasic(), SeedSearch(), SeedSwitch(), SendInput(), SendStart(), and SetTmpFolder().
|
private |
switch for total degree vs. coeff. homotopy
Definition at line 109 of file master.hpp.
Referenced by MasterSetup().
|
private |
maximum absolute_current_index value before loop breaks.
Definition at line 114 of file master.hpp.
Referenced by GetTerminationInt(), LoopBasic(), LoopSearch(), ReadyCheck(), SeedBasic(), and SeedSearch().
|
private |
where the temp files at?
Definition at line 119 of file master.hpp.
Referenced by CleanupSwitch(), ReadyCheck(), and SetTmpFolder().