Paramotopy
parallel parameter homotopy through bertini
|
slave process for basic searches and brute-force runs. More...
#include <slave.hpp>
Public Member Functions | |
slave_process () | |
void | slave_main (ProgSettings input_settings, runinfo input_p_info, timer &process_timer) |
Private Member Functions | |
void | SlaveSetup () |
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 | ReceiveInput (timer &process_timer) |
void | ReceiveStart (timer &process_timer) |
void | WriteStart () |
void | WriteInput () |
void | ReadDotOut () |
void | WriteDotOut () |
void | WriteNumDotOut (double current_params[]) |
void | SetWorkingFolder () |
void | PurgeWorkingFolder () |
void | MoveToWorkingFolder () |
void | GoCalledDir () |
void | ReadyCheck () |
Private Attributes | |
runinfo | paramotopy_info |
the parsed paramotopy input file. More... | |
ProgSettings | paramotopy_settings |
the ProgSettings for this process More... | |
boost::filesystem::path | filename |
the filename for the problem More... | |
int | numfilesatatime |
the expected number of files per send More... | |
int | numfilesatatime_orig |
the expected number of files per send More... | |
boost::filesystem::path | called_dir |
where was I instantiated? More... | |
boost::filesystem::path | homedir |
where is /Users/ofloveandhate? More... | |
boost::filesystem::path | workingfolder |
where should I go to perform work? More... | |
boost::filesystem::path | tmpfolder |
the basis for workingfolder More... | |
datagatherer | slavegatherer |
data member from datagatherer, which will gather bertini output files. More... | |
unsigned int | currentSeed |
the current seed for random number generator. More... | |
int | MPType |
MPType for current run. More... | |
int | linenumber |
what line is currently being run More... | |
int | numparam |
the number of parameters in the problem. More... | |
int | numprocs |
the number of processors in my MPI communicator. More... | |
int | myid |
my id withing my MPI communicator More... | |
int | standardstep2 |
flag for total degree or coefficient parameter homotopy. More... | |
std::vector< std::string > | numdotout |
num.out file. More... | |
std::vector< std::string > | arrdotout |
arr.out file. More... | |
std::vector< std::string > | degdotout |
degout file. More... | |
std::vector< std::string > | namesdotout |
names.out file. More... | |
std::vector< std::string > | config |
config file. More... | |
std::vector< std::string > | funcinput |
func_input file. More... | |
std::vector< std::string > | preproc_data |
preproc_data file. More... | |
bool | have_dotout |
flag indicating whether we have read the .out files into memory. More... | |
bool | have_input |
flag indicating whether we have received the INPUT file from master. More... | |
char * | input_file |
the input file in a c-friendly format More... | |
bool | have_start |
flag indicating whether we have received the START file from master. More... | |
char * | start_file |
the start file in a c-friendly format More... | |
bool | in_working_folder |
boolean indicating whether i think i am in the correct location to perform work. More... | |
slave process for basic searches and brute-force runs.
process for running Bertini to solve a problem.
|
inline |
default constructor.
for now, gets its membership in the default communicator MPI_COMM_WORLD.
sets stuff to empty or bad values for checking readiness later.
Definition at line 61 of file slave.hpp.
References called_dir, filename, have_dotout, have_input, have_start, homedir, in_working_folder, myid, numfilesatatime, numparam, numprocs, stackoverflow_getcwd(), standardstep2, and tmpfolder.
|
private |
|
private |
|
private |
|
private |
moves to called_dir and sets in_working_folder = false.
Definition at line 947 of file slave.cpp.
References called_dir, in_working_folder, and safe_chdir().
Referenced by slave_main().
|
private |
basic mode run loop
process_timer | current timer |
Definition at line 132 of file slave.cpp.
References timer::add_time(), currentSeed, DATA_DOUBLE, linenumber, MPType, myid, numfilesatatime, numparam, paramotopy_settings, parse_input_file_bertini(), timer::press_start(), ReadDotOut(), ReadyCheck(), run_zero_dim_main(), SLAVE_ITERATION_FINISHED, datagatherer::SlaveCollectAndWriteData(), slavegatherer, TERMINATE, datagatherer::WriteAllData(), WriteInput(), WriteNumDotOut(), and WriteStart().
Referenced by LoopSwitch().
|
private |
search mode loop
process_timer | current timer |
Definition at line 276 of file slave.cpp.
References timer::add_time(), currentSeed, DATA_DOUBLE, linenumber, MPType, myid, datagatherer::num_reals(), numfilesatatime, numparam, paramotopy_settings, parse_input_file_bertini(), timer::press_start(), ReadDotOut(), ReadyCheck(), run_zero_dim_main(), ProgSettings::settings, SLAVE_ITERATION_FINISHED, datagatherer::SlaveCollectAndWriteData(), slavegatherer, TERMINATE, datagatherer::WriteAllData(), WriteInput(), WriteNumDotOut(), and WriteStart().
Referenced by LoopSwitch().
|
private |
main loop switch
process_timer | current timer |
Definition at line 113 of file slave.cpp.
References LoopBasic(), LoopSearch(), paramotopy_settings, and ProgSettings::settings.
Referenced by slave_main().
|
private |
moves into the working folder, and sets in_working_folder = true.
Definition at line 937 of file slave.cpp.
References in_working_folder, safe_chdir(), and workingfolder.
Referenced by slave_main().
|
private |
clears the working_folder.
Definition at line 931 of file slave.cpp.
References workingfolder.
Referenced by slave_main().
|
private |
reads the preparsed bertini input file into memory.
Definition at line 639 of file slave.cpp.
References arrdotout, config, degdotout, funcinput, have_dotout, namesdotout, numdotout, and preproc_data.
Referenced by LoopBasic(), and LoopSearch().
|
private |
makes sure ready to roll. helps ensure reliability.
Definition at line 954 of file slave.cpp.
References filename, have_dotout, have_input, have_start, in_working_folder, myid, numfilesatatime, numparam, standardstep2, and tmpfolder.
Referenced by LoopBasic(), and LoopSearch().
|
private |
receives the input file to all workers in the communicator
process_timer | current timer |
Definition at line 504 of file slave.cpp.
References timer::add_time(), have_input, input_file, NUM_CHARACTERS, timer::press_start(), and TEXT_FILE.
Referenced by slave_main().
|
private |
receives the start file to all workers in the communicator
process_timer | current timer |
Definition at line 534 of file slave.cpp.
References timer::add_time(), have_start, NUM_CHARACTERS, timer::press_start(), start_file, and TEXT_FILE.
Referenced by slave_main().
|
private |
|
private |
|
private |
|
private |
sets the working_folder value.
Definition at line 900 of file slave.cpp.
References called_dir, runinfo::inputfilename, myid, paramotopy_info, paramotopy_settings, ProgSettings::settings, tmpfolder, and workingfolder.
Referenced by slave_main().
void slave_process::slave_main | ( | ProgSettings | input_settings, |
runinfo | input_p_info, | ||
timer & | process_timer | ||
) |
the main slave process. to be used by myid!=0.
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 16 of file slave.cpp.
References called_dir, GoCalledDir(), LoopSwitch(), MoveToWorkingFolder(), myid, paramotopy_info, paramotopy_settings, PurgeWorkingFolder(), ReceiveInput(), ReceiveStart(), SetWorkingFolder(), slavegatherer, SlaveSetup(), and datagatherer::SlaveSetup().
Referenced by main().
|
private |
the slave setup function
uses the runinfo and ProgSettings in memory to setup the rest of the necessaries.
Definition at line 55 of file slave.cpp.
References filename, runinfo::inputfilename, numfilesatatime, numfilesatatime_orig, runinfo::numparam, numparam, paramotopy_info, paramotopy_settings, ProgSettings::settings, and standardstep2.
Referenced by slave_main().
|
private |
writes the previously stored preparsed bertini input file to disk.
Definition at line 726 of file slave.cpp.
References arrdotout, config, degdotout, funcinput, namesdotout, and preproc_data.
|
private |
writes the input file to the current location with the name "input"
Definition at line 609 of file slave.cpp.
References have_input, in_working_folder, input_file, and myid.
Referenced by LoopBasic(), and LoopSearch().
|
private |
writes the previously stored num.out file to disk, replacing the old parameter values with our custom ones.
Definition at line 772 of file slave.cpp.
References computeNumDenom(), numdotout, numparam, and standardstep2.
Referenced by LoopBasic(), and LoopSearch().
|
private |
writes the start file to the current location with the name "start"
Definition at line 584 of file slave.cpp.
References have_start, in_working_folder, myid, and start_file.
Referenced by LoopBasic(), and LoopSearch().
|
private |
arr.out file.
Definition at line 140 of file slave.hpp.
Referenced by ReadDotOut(), and WriteDotOut().
|
private |
where was I instantiated?
Definition at line 111 of file slave.hpp.
Referenced by GoCalledDir(), SetWorkingFolder(), slave_main(), and slave_process().
|
private |
config file.
Definition at line 143 of file slave.hpp.
Referenced by ReadDotOut(), and WriteDotOut().
|
private |
the current seed for random number generator.
Definition at line 122 of file slave.hpp.
Referenced by LoopBasic(), and LoopSearch().
|
private |
degout file.
Definition at line 141 of file slave.hpp.
Referenced by ReadDotOut(), and WriteDotOut().
|
private |
the filename for the problem
Definition at line 108 of file slave.hpp.
Referenced by ReadyCheck(), slave_process(), and SlaveSetup().
|
private |
func_input file.
Definition at line 144 of file slave.hpp.
Referenced by ReadDotOut(), and WriteDotOut().
|
private |
flag indicating whether we have read the .out files into memory.
Definition at line 148 of file slave.hpp.
Referenced by ReadDotOut(), ReadyCheck(), and slave_process().
|
private |
flag indicating whether we have received the INPUT file from master.
Definition at line 149 of file slave.hpp.
Referenced by ReadyCheck(), ReceiveInput(), slave_process(), and WriteInput().
|
private |
flag indicating whether we have received the START file from master.
Definition at line 152 of file slave.hpp.
Referenced by ReadyCheck(), ReceiveStart(), slave_process(), and WriteStart().
|
private |
where is /Users/ofloveandhate?
Definition at line 112 of file slave.hpp.
Referenced by slave_process().
|
private |
boolean indicating whether i think i am in the correct location to perform work.
Definition at line 156 of file slave.hpp.
Referenced by GoCalledDir(), MoveToWorkingFolder(), ReadyCheck(), slave_process(), WriteInput(), and WriteStart().
|
private |
the input file in a c-friendly format
Definition at line 150 of file slave.hpp.
Referenced by ReceiveInput(), and WriteInput().
|
private |
what line is currently being run
Definition at line 126 of file slave.hpp.
Referenced by LoopBasic(), and LoopSearch().
|
private |
MPType for current run.
Definition at line 123 of file slave.hpp.
Referenced by LoopBasic(), and LoopSearch().
|
private |
my id withing my MPI communicator
Definition at line 134 of file slave.hpp.
Referenced by LoopBasic(), LoopSearch(), ReadyCheck(), SetWorkingFolder(), slave_main(), slave_process(), WriteInput(), and WriteStart().
|
private |
names.out file.
Definition at line 142 of file slave.hpp.
Referenced by ReadDotOut(), and WriteDotOut().
|
private |
num.out file.
Definition at line 139 of file slave.hpp.
Referenced by ReadDotOut(), and WriteNumDotOut().
|
private |
the expected number of files per send
Definition at line 109 of file slave.hpp.
Referenced by LoopBasic(), LoopSearch(), ReadyCheck(), slave_process(), and SlaveSetup().
|
private |
the expected number of files per send
Definition at line 110 of file slave.hpp.
Referenced by SlaveSetup().
|
private |
the number of parameters in the problem.
Definition at line 128 of file slave.hpp.
Referenced by LoopBasic(), LoopSearch(), ReadyCheck(), slave_process(), SlaveSetup(), and WriteNumDotOut().
|
private |
the number of processors in my MPI communicator.
Definition at line 131 of file slave.hpp.
Referenced by slave_process().
|
private |
the parsed paramotopy input file.
Definition at line 104 of file slave.hpp.
Referenced by SetWorkingFolder(), slave_main(), and SlaveSetup().
|
private |
the ProgSettings for this process
Definition at line 105 of file slave.hpp.
Referenced by LoopBasic(), LoopSearch(), LoopSwitch(), SetWorkingFolder(), slave_main(), and SlaveSetup().
|
private |
preproc_data file.
Definition at line 145 of file slave.hpp.
Referenced by ReadDotOut(), and WriteDotOut().
|
private |
data member from datagatherer, which will gather bertini output files.
Definition at line 120 of file slave.hpp.
Referenced by LoopBasic(), LoopSearch(), and slave_main().
|
private |
flag for total degree or coefficient parameter homotopy.
Definition at line 136 of file slave.hpp.
Referenced by ReadyCheck(), slave_process(), SlaveSetup(), and WriteNumDotOut().
|
private |
the start file in a c-friendly format
Definition at line 153 of file slave.hpp.
Referenced by ReceiveStart(), and WriteStart().
|
private |
the basis for workingfolder
Definition at line 116 of file slave.hpp.
Referenced by ReadyCheck(), SetWorkingFolder(), and slave_process().
|
private |
where should I go to perform work?
Definition at line 114 of file slave.hpp.
Referenced by MoveToWorkingFolder(), PurgeWorkingFolder(), and SetWorkingFolder().