Paramotopy
parallel parameter homotopy through bertini
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
slave_process Class Reference

slave process for basic searches and brute-force runs. More...

#include <slave.hpp>

Collaboration diagram for slave_process:
[legend]

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...
 

Detailed Description

slave process for basic searches and brute-force runs.

process for running Bertini to solve a problem.

Definition at line 47 of file slave.hpp.

Constructor & Destructor Documentation

slave_process::slave_process ( )
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.

Here is the call graph for this function:

Member Function Documentation

void slave_process::CleanupBasic ( timer process_timer)
private

basic mode cleanup function.

Parameters
process_timercurrent timer

Definition at line 478 of file slave.cpp.

void slave_process::CleanupSearch ( timer process_timer)
private

search mode cleanup function.

Parameters
process_timercurrent timer

Definition at line 483 of file slave.cpp.

void slave_process::CleanupSwitch ( timer process_timer)
private

cleanup switch

Parameters
process_timercurrent timer

Definition at line 466 of file slave.cpp.

void slave_process::GoCalledDir ( )
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().

Here is the call graph for this function:

Here is the caller graph for this function:

void slave_process::LoopBasic ( timer process_timer)
private

basic mode run loop

Parameters
process_timercurrent 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().

Here is the call graph for this function:

Here is the caller graph for this function:

void slave_process::LoopSearch ( timer process_timer)
private

search mode loop

Parameters
process_timercurrent 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().

Here is the call graph for this function:

Here is the caller graph for this function:

void slave_process::LoopSwitch ( timer process_timer)
private

main loop switch

Parameters
process_timercurrent timer

Definition at line 113 of file slave.cpp.

References LoopBasic(), LoopSearch(), paramotopy_settings, and ProgSettings::settings.

Referenced by slave_main().

Here is the call graph for this function:

Here is the caller graph for this function:

void slave_process::MoveToWorkingFolder ( )
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().

Here is the call graph for this function:

Here is the caller graph for this function:

void slave_process::PurgeWorkingFolder ( )
private

clears the working_folder.

Definition at line 931 of file slave.cpp.

References workingfolder.

Referenced by slave_main().

Here is the caller graph for this function:

void slave_process::ReadDotOut ( )
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().

Here is the caller graph for this function:

void slave_process::ReadyCheck ( )
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().

Here is the caller graph for this function:

void slave_process::ReceiveInput ( timer process_timer)
private

receives the input file to all workers in the communicator

Parameters
process_timercurrent 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().

Here is the call graph for this function:

Here is the caller graph for this function:

void slave_process::ReceiveStart ( timer process_timer)
private

receives the start file to all workers in the communicator

Parameters
process_timercurrent 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().

Here is the call graph for this function:

Here is the caller graph for this function:

void slave_process::SeedBasic ( timer process_timer)
private

basic seeding function

Parameters
process_timercurrent timer

Definition at line 83 of file slave.cpp.

void slave_process::SeedSearch ( timer process_timer)
private

search mode seeding function

Parameters
process_timercurrent timer

Definition at line 90 of file slave.cpp.

void slave_process::SeedSwitch ( timer process_timer)
private

switch for choosing seed process

Parameters
process_timercurrent timer

Definition at line 78 of file slave.cpp.

void slave_process::SetWorkingFolder ( )
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().

Here is the caller graph for this function:

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.

Parameters
input_settingscurrent input settings.
input_p_infocurrent parser run info.
process_timerMUTABLE 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().

Here is the call graph for this function:

Here is the caller graph for this function:

void slave_process::SlaveSetup ( )
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().

Here is the caller graph for this function:

void slave_process::WriteDotOut ( )
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.

void slave_process::WriteInput ( )
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().

Here is the caller graph for this function:

void slave_process::WriteNumDotOut ( double  current_params[])
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().

Here is the call graph for this function:

Here is the caller graph for this function:

void slave_process::WriteStart ( )
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().

Here is the caller graph for this function:

Member Data Documentation

std::vector<std::string> slave_process::arrdotout
private

arr.out file.

Definition at line 140 of file slave.hpp.

Referenced by ReadDotOut(), and WriteDotOut().

boost::filesystem::path slave_process::called_dir
private

where was I instantiated?

Definition at line 111 of file slave.hpp.

Referenced by GoCalledDir(), SetWorkingFolder(), slave_main(), and slave_process().

std::vector<std::string> slave_process::config
private

config file.

Definition at line 143 of file slave.hpp.

Referenced by ReadDotOut(), and WriteDotOut().

unsigned int slave_process::currentSeed
private

the current seed for random number generator.

Definition at line 122 of file slave.hpp.

Referenced by LoopBasic(), and LoopSearch().

std::vector<std::string> slave_process::degdotout
private

degout file.

Definition at line 141 of file slave.hpp.

Referenced by ReadDotOut(), and WriteDotOut().

boost::filesystem::path slave_process::filename
private

the filename for the problem

Definition at line 108 of file slave.hpp.

Referenced by ReadyCheck(), slave_process(), and SlaveSetup().

std::vector<std::string> slave_process::funcinput
private

func_input file.

Definition at line 144 of file slave.hpp.

Referenced by ReadDotOut(), and WriteDotOut().

bool slave_process::have_dotout
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().

bool slave_process::have_input
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().

bool slave_process::have_start
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().

boost::filesystem::path slave_process::homedir
private

where is /Users/ofloveandhate?

Definition at line 112 of file slave.hpp.

Referenced by slave_process().

bool slave_process::in_working_folder
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().

char* slave_process::input_file
private

the input file in a c-friendly format

Definition at line 150 of file slave.hpp.

Referenced by ReceiveInput(), and WriteInput().

int slave_process::linenumber
private

what line is currently being run

Definition at line 126 of file slave.hpp.

Referenced by LoopBasic(), and LoopSearch().

int slave_process::MPType
private

MPType for current run.

Definition at line 123 of file slave.hpp.

Referenced by LoopBasic(), and LoopSearch().

int slave_process::myid
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().

std::vector<std::string> slave_process::namesdotout
private

names.out file.

Definition at line 142 of file slave.hpp.

Referenced by ReadDotOut(), and WriteDotOut().

std::vector<std::string> slave_process::numdotout
private

num.out file.

Definition at line 139 of file slave.hpp.

Referenced by ReadDotOut(), and WriteNumDotOut().

int slave_process::numfilesatatime
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().

int slave_process::numfilesatatime_orig
private

the expected number of files per send

Definition at line 110 of file slave.hpp.

Referenced by SlaveSetup().

int slave_process::numparam
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().

int slave_process::numprocs
private

the number of processors in my MPI communicator.

Definition at line 131 of file slave.hpp.

Referenced by slave_process().

runinfo slave_process::paramotopy_info
private

the parsed paramotopy input file.

Definition at line 104 of file slave.hpp.

Referenced by SetWorkingFolder(), slave_main(), and SlaveSetup().

ProgSettings slave_process::paramotopy_settings
private

the ProgSettings for this process

Definition at line 105 of file slave.hpp.

Referenced by LoopBasic(), LoopSearch(), LoopSwitch(), SetWorkingFolder(), slave_main(), and SlaveSetup().

std::vector<std::string> slave_process::preproc_data
private

preproc_data file.

Definition at line 145 of file slave.hpp.

Referenced by ReadDotOut(), and WriteDotOut().

datagatherer slave_process::slavegatherer
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().

int slave_process::standardstep2
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().

char* slave_process::start_file
private

the start file in a c-friendly format

Definition at line 153 of file slave.hpp.

Referenced by ReceiveStart(), and WriteStart().

boost::filesystem::path slave_process::tmpfolder
private

the basis for workingfolder

Definition at line 116 of file slave.hpp.

Referenced by ReadyCheck(), SetWorkingFolder(), and slave_process().

boost::filesystem::path slave_process::workingfolder
private

where should I go to perform work?

Definition at line 114 of file slave.hpp.

Referenced by MoveToWorkingFolder(), PurgeWorkingFolder(), and SetWorkingFolder().


The documentation for this class was generated from the following files: