Paramotopy
parallel parameter homotopy through bertini
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
slave.cpp
Go to the documentation of this file.
1 #include "slave.hpp"
2 
3 
4 
5 
7 //
8 // slave functions
9 //
11 
12 
13 
14 
15 
17  runinfo input_p_info,
18  timer & process_timer)
19 {
20 
21  this->paramotopy_settings = input_settings;
22  this->paramotopy_info = input_p_info;
23 
24 
25 
27 
29 
30  slave_process::ReceiveStart(process_timer);
31 
32  slave_process::ReceiveInput(process_timer);
33 
35 
37 
39 
40  slave_process::LoopSwitch(process_timer);
41 
43 
44 
45 
46 
47  return;
48 }//re:slave_main
49 
50 
51 
52 
53 
54 
56 
58  this->numfilesatatime = paramotopy_settings.settings["parallelism"]["numfilesatatime"].intvalue;
59  this->numfilesatatime_orig = paramotopy_settings.settings["parallelism"]["numfilesatatime"].intvalue;
60 
62 
63  this->standardstep2 = paramotopy_settings.settings["mode"]["standardstep2"].intvalue;
64 
65 }
66 
74 //
75 
76 
77 
78 void slave_process::SeedSwitch(timer & process_timer)
79 {
80 
81 }
82 
83 void slave_process::SeedBasic(timer & process_timer)
84 {
85 
86 }
87 
88 
89 
90 void slave_process::SeedSearch(timer & process_timer)
91 {
92 
93 }
94 
95 
96 
97 
98 
99 
100 
101 
109 //
110 
111 
112 
113 void slave_process::LoopSwitch(timer & process_timer)
114 {
115  switch (paramotopy_settings.settings["mode"]["main_mode"].intvalue) {
116  case 0:
117  slave_process::LoopBasic(process_timer);
118  break;
119 
120  case 1:
121  slave_process::LoopSearch(process_timer);
122  break;
123 
124 
125  default:
126  break;
127  }
128 }
129 
130 
131 
132 void slave_process::LoopBasic(timer & process_timer)
133 {
134 
135 
136 
139 
140 
141 
142 #ifdef timingstep2
143  process_timer.press_start("bertini");
144 #endif
146 #ifdef timingstep2
147  process_timer.add_time("bertini");
148 #endif
149 
150 
151 
152 
153 #ifdef timingstep2
154  process_timer.press_start("read");
155 #endif
157 #ifdef timingstep2
158  process_timer.add_time("read",6);
159 #endif
160 
161 
162 
163  double* datareceived = new double[numfilesatatime*(2*numparam+1)]; //for catching from the mpi
164 
165  MPI_Status status;
166 
167 
168  std::string target_file;
169 
171 
172  int* receive_buffer = new int[1];
173  while (1) {
174  /* Receive parameter points and line numbers from the master */
175 
176 
177 #ifdef timingstep2
178  process_timer.press_start("receive");
179 #endif
180  MPI_Recv(&receive_buffer[0], 1, MPI_INT, 0, MPI_ANY_TAG,
181  MPI_COMM_WORLD, &status);
182 #ifdef timingstep2
183  process_timer.add_time("receive");
184 #endif
185  int numtodo = receive_buffer[0];
186 
187  /* Check the tag of the received message. */
188  if (status.MPI_TAG == TERMINATE) {
189 #ifdef verbosestep2
190  std::cout << "worker" << myid << " received kill tag" << std::endl;
191 #endif
192 
193 #ifdef timingstep2
194  process_timer.press_start("write");
195 #endif
197 #ifdef timingstep2
198  process_timer.add_time("write");
199 #endif
200  break; //exits the while loop
201  }
202 
203 
204 
205  linenumber=-1;
206  if (numtodo>0) {
207 
208  #ifdef timingstep2
209  process_timer.press_start("receive");
210  #endif
211 
212  MPI_Recv(&datareceived[0], numtodo*(2*numparam+1), MPI_DOUBLE, 0, DATA_DOUBLE,
213  MPI_COMM_WORLD, &status);
214 
215  #ifdef timingstep2
216  process_timer.add_time("receive");
217  #endif
218 
219 
220 
221  for (int kk = 0; kk < numtodo; ++kk){
222 
223  linenumber = int(datareceived[kk*(2*numparam+1)+2*numparam]);
224 
225  double* current_params = new double[(2*numparam+1)];
226  for (int mm =0; mm< 2*numparam+1; mm++){
227  current_params[mm] = datareceived[kk*(2*numparam+1)+mm];
228  }
229 
230 
231 #ifdef timingstep2
232  process_timer.press_start("write");
233 #endif
234  slave_process::WriteNumDotOut(current_params);
235 #ifdef timingstep2
236  process_timer.add_time("write");
237 #endif
238 
239 
240  std::cout << "worker" << myid << " solving point " << linenumber << std::endl;
241  // Call Bertini
242 #ifdef timingstep2
243  process_timer.press_start("bertini");
244 #endif
245 
246 #ifndef nosolve
248 #endif
249 
250 #ifdef timingstep2
251  process_timer.add_time("bertini");
252 #endif
253 
254 
255 #ifndef nosolve
256  slavegatherer.SlaveCollectAndWriteData(current_params, paramotopy_settings, process_timer);
257 #endif
258 
259  }//re: for (int kk = 0; kk < int(status.MPI_TAG);++kk)
260  }//re: if numpointsthisiteration>0
261 
262 
263 #ifdef timingstep2
264  process_timer.press_start("send");
265 #endif
266  MPI_Send(&linenumber, 1, MPI_INT, 0, SLAVE_ITERATION_FINISHED, MPI_COMM_WORLD);
267 #ifdef timingstep2
268  process_timer.add_time("send");
269 #endif
270 
271  }//re: while (1)
272 
273 
274 }
275 
276 void slave_process::LoopSearch(timer & process_timer)
277 {
278 
279 
282 
283 
284 
285 #ifdef timingstep2
286  process_timer.press_start("bertini");
287 #endif
289 #ifdef timingstep2
290  process_timer.add_time("bertini");
291 #endif
292 
293 
294 
295 
296 #ifdef timingstep2
297  process_timer.press_start("read");
298 #endif
300 #ifdef timingstep2
301  process_timer.add_time("read",6);
302 #endif
303 
304 
305 
306  double* datareceived = new double[numfilesatatime*(2*numparam+1)]; //for catching from the mpi
307 
308  MPI_Status status;
309 
310 
311  std::string target_file;
312 
314 
315  double* current_params = new double[(2*numparam+1)];
316  int* receive_buffer = new int[1];
317 
318 
319  while (1) {
320  /* Receive parameter points and line numbers from the master */
321 
322 
323 #ifdef timingstep2
324  process_timer.press_start("receive");
325 #endif
326  MPI_Recv(&receive_buffer[0], 1, MPI_INT, 0, MPI_ANY_TAG,
327  MPI_COMM_WORLD, &status);
328 #ifdef timingstep2
329  process_timer.add_time("receive");
330 #endif
331  int numtodo = receive_buffer[0];
332 
333  /* Check the tag of the received message. */
334  if (status.MPI_TAG == TERMINATE) {
335 #ifdef verbosestep2
336  std::cout << "worker" << myid << " received kill tag" << std::endl;
337 #endif
338 
339 #ifdef timingstep2
340  process_timer.press_start("write");
341 #endif
342 #ifndef nosolve
344 #endif
345 #ifdef timingstep2
346  process_timer.add_time("write");
347 #endif
348  break; //exits the while loop
349  }
350 
351 
352 
353  int num_solns_this_iteration = 0;
354  int num_points_with_solns_this_iteration = 0;
355 
356  if (numtodo>0) {
357 
358 #ifdef timingstep2
359  process_timer.press_start("receive");
360 #endif
361 
362 
363  MPI_Recv(&datareceived[0], numtodo*(2*numparam+1), MPI_DOUBLE, 0, DATA_DOUBLE,
364  MPI_COMM_WORLD, &status);
365 
366 #ifdef timingstep2
367  process_timer.add_time("receive");
368 #endif
369 
370 
371 
372  for (int kk = 0; kk < numtodo; ++kk){
373 
374  linenumber = int(datareceived[kk*(2*numparam+1)+2*numparam]);
375 
376  for (int mm =0; mm< 2*numparam+1; mm++){
377  current_params[mm] = datareceived[kk*(2*numparam+1)+mm];
378  }
379 
380 
381 #ifdef timingstep2
382  process_timer.press_start("write");
383 #endif
384  slave_process::WriteNumDotOut(current_params);
385 #ifdef timingstep2
386  process_timer.add_time("write");
387 #endif
388 
389 
390 
391  // Call Bertini
392  std::cout << "worker" << myid << " solving point " << linenumber << std::endl;
393 #ifdef timingstep2
394  process_timer.press_start("bertini");
395 #endif
396 
397 #ifndef nosolve
399 #endif
400 
401 #ifdef timingstep2
402  process_timer.add_time("bertini");
403 #endif
404 
405 
406 #ifndef nosolve
407  slavegatherer.SlaveCollectAndWriteData(current_params, paramotopy_settings, process_timer);
408 
409  int num_solns_this_solve = slavegatherer.num_reals();
410 
411  //get the number of found solutions
412  if (num_solns_this_solve>0) {
413  num_points_with_solns_this_iteration ++;
414  num_solns_this_iteration += num_solns_this_solve;
415  }
416 #endif
417 
418  }//re: for (int kk = 0; kk < int(status.MPI_TAG);++kk)
419  }//re: if numpointsthisiteration>0
420 
421  int sendme=-1;
422  switch (paramotopy_settings.settings["mode"]["search_submode"].intvalue) {
423  case 0:
424  sendme = num_solns_this_iteration;
425  break;
426 
427  case 1:
428  sendme = num_points_with_solns_this_iteration;
429  break;
430 
431  default:
432  break;
433  }
434 
435 #ifdef timingstep2
436  process_timer.press_start("send");
437 #endif
438  MPI_Send(&sendme, 1, MPI_INT, 0, SLAVE_ITERATION_FINISHED, MPI_COMM_WORLD);
439 #ifdef timingstep2
440  process_timer.add_time("send");
441 #endif
442 
443  }//re: while (1)
444 
445 
446  delete[] receive_buffer;
447  delete[] current_params;
448 }
449 
450 
451 
452 
453 
461 //
462 
463 
464 
465 
466 void slave_process::CleanupSwitch(timer & process_timer)
467 {
468 
469 
470  int arbitraryinteger = 1;
471  MPI_Bcast(&arbitraryinteger, 1, MPI_INT, 0, MPI_COMM_WORLD); // could also be MPI_Barrier()
472 
473 
474 }
475 
476 
477 
478 void slave_process::CleanupBasic(timer & process_timer)
479 {
480 
481 }
482 
483 void slave_process::CleanupSearch(timer & process_timer)
484 {
485 
486 }
487 
488 
489 
490 
491 
492 
500 //
501 
502 
503 
504 void slave_process::ReceiveInput(timer & process_timer)
505 {
506 
507  if (this->have_input) {
508  delete[] input_file;
509  }
510 
511 
512  MPI_Status status;
513 
514 #ifdef timingstep2
515  process_timer.press_start("receive");
516 #endif
517  int input_length;
518  MPI_Recv(&input_length, 1, MPI_INT, 0, NUM_CHARACTERS, MPI_COMM_WORLD, &status);
519 
520 
521  input_file = new char[input_length];
522 
523 
524  MPI_Recv(&input_file[0], input_length, MPI_CHAR, 0, TEXT_FILE, MPI_COMM_WORLD, &status);
525 
526 #ifdef timingstep2
527  process_timer.add_time("receive");
528 #endif
529 
530  have_input = true;
531 
532 }
533 
534 void slave_process::ReceiveStart(timer & process_timer)
535 {
536 
537  MPI_Status status;
538 
539  int start_length;
540 
541  if (this->have_start) {
542  delete[] start_file;
543  }
544 
546  //
547  // get the start file from master
548  //
550 
551 
552 
553 #ifdef timingstep2
554  process_timer.press_start("receive");
555 #endif
556 
557  MPI_Recv(&start_length, 1, MPI_INT, 0, NUM_CHARACTERS, MPI_COMM_WORLD, &status);
558 
559 
560 #ifdef timingstep2
561  process_timer.add_time("receive");
562 #endif
563 
564 
565  start_file = new char[start_length];
566 
567 
568 #ifdef timingstep2
569  process_timer.press_start("receive");
570 #endif
571  MPI_Recv(&start_file[0], start_length, MPI_CHAR, 0, TEXT_FILE, MPI_COMM_WORLD, &status);
572 
573 #ifdef timingstep2
574  process_timer.add_time("receive");
575 #endif
576 
577 
578 
579  have_start = true;
580 }
581 
582 
583 
585 
586  if (!(this->have_start)) {
587  std::cerr << "slave" << myid << " did not have start file when attempting to write it." << std::endl;
588  MPI_Abort(MPI_COMM_WORLD,919);
589  }
590 
591  if (!(this->in_working_folder)) {
592  std::cerr << "slave" << myid << " was not in working folder before writing start." << std::endl;
593  MPI_Abort(MPI_COMM_WORLD,920);
594  }
595 
596 
597  std::ofstream fout;
598  fout.open("start");
599  if (!fout.is_open()) {
600  std::cerr << "failed to properly open " << "start" << " to open start file, worker " << myid << std::endl;
601  exit(719);
602  }
603  fout << start_file;
604  fout.close(); fout.clear();
605 }
606 
607 
608 
610 
611 
612  if (!(this->have_input)) {
613  std::cerr << "slave" << myid << " did not have input before attempting to write input" << std::endl;
614  MPI_Abort(MPI_COMM_WORLD,919);
615  }
616 
617  if (!(this->in_working_folder)) {
618  std::cerr << "slave" << myid << " was not in working folder before writing input" << std::endl;
619  MPI_Abort(MPI_COMM_WORLD,920);
620  }
621 
622 
623  std::ofstream fout;
624  fout.open("input");
625  if (!fout.is_open()) {
626  std::cerr << "failed to properly open " << "input" << " to open input file, worker " << myid << std::endl;
627  exit(720);
628  }
629  fout << input_file;
630  fout.close(); fout.clear();
631 
632 }
633 
634 
635 
636 
637 
638 
640 
641  //read in Num.out file
642  numdotout.clear();
643 
644  std::ifstream fin;
645  std::string copyme;
646 
647 
648  fin.open("num.out");
649 
650  while (!fin.eof()) {
651  getline(fin,copyme);
652  numdotout.push_back(copyme);
653  }
654  fin.close();
655  //end read num.out
656 
657 
658  //read in arr.out file
659  fin.open("arr.out");
660 
661  while (!fin.eof()) {
662  getline(fin,copyme);
663  arrdotout.push_back(copyme);
664  }
665  fin.close();
666  //end read arr.out
667 
668 
669  //read in deg.out file
670  fin.open("deg.out");
671 
672  while (!fin.eof()) {
673  getline(fin,copyme);
674  degdotout.push_back(copyme);
675  }
676  fin.close();
677  //end read deg.out
678 
679  //read in names.out file
680  fin.open("names.out");
681 
682  while (!fin.eof()) {
683  getline(fin,copyme);
684  namesdotout.push_back(copyme);
685  }
686  fin.close();
687  //end read names.out
688 
689  //read in names.out file
690  fin.open("config");
691 
692  while (!fin.eof()) {
693  getline(fin,copyme);
694  config.push_back(copyme);
695  }
696  fin.close();
697  //end read names.out
698 
699 
700  //read in names.out file
701  fin.open("func_input");
702 
703  while (!fin.eof()) {
704  getline(fin,copyme);
705  funcinput.push_back(copyme);
706  }
707  fin.close();
708  //end read names.out
709 
710  fin.open("preproc_data");
711 
712  while (!fin.eof()) {
713  getline(fin,copyme);
714  preproc_data.push_back(copyme);
715  }
716  fin.close();
717  // end read preproc_data
718 
719 
720 
721  this->have_dotout = true;
722 }
723 
724 
725 
727 
728  std::ofstream fout;
729 
730 
731  fout.open("arr.out");
732  for (int ii = 0; ii< int(arrdotout.size())-1; ii++) {
733  fout << arrdotout[ii] << "\n";
734  }
735  fout.close();
736 
737  fout.open("deg.out");
738  for (int ii = 0; ii< int(degdotout.size())-1; ii++) {
739  fout << degdotout[ii] << "\n";
740  }
741  fout.close();
742  fout.open("names.out");
743  for (int ii = 0; ii< int(namesdotout.size())-1; ii++) {
744  fout << namesdotout[ii] << "\n";
745  }
746  fout.close();
747 
748  fout.open("config");
749  for (int ii = 0; ii< int(config.size())-1; ii++) {
750  fout << config[ii] << "\n";
751  }
752  fout.close();
753 
754  fout.open("func_input");
755  for (int ii = 0; ii< int(funcinput.size())-1; ii++) {
756  fout << funcinput[ii] << "\n";
757  }
758  fout.close();
759 
760  fout.open("preproc_data");
761 
762  for (int ii = 0; ii < int(preproc_data.size())-1; ++ii){
763  fout << preproc_data[ii] << "\n";
764  }
765  fout.close();
766 
767 
768 }
769 
770 
771 
772 void slave_process::WriteNumDotOut(double current_params[]){
773 
774  //modified 2012.02.19 to make a single write call. db.
775 
776 
777  char *numer = NULL, *denom = NULL;
778  // char *passto_computeNumDenom = NULL;
779 
780 
781  std::string convertmetochar;
782  std::stringstream ss, writess;
783  std::ofstream fout;
784 
785  fout.open("num.out");
786 
787  if (!fout.is_open()) {
788  std::cerr << "failed to open num.out" << std::endl;
789  exit(741);
790  }
791  ss.precision(15);
792  fout.precision(15);
793 
794  //write the first two lines
795  writess << numdotout[0] << "\n" << numdotout[1] << "\n";
796 
797  if (standardstep2==1){
798 
799  //write the random values associated with this run:
800  for (int ii=0; ii<2*numparam; ++ii) {
801  writess << numdotout[ii+2] << "\n";
802 
803  }
804 
805  //write the parameter lines
806  for (int ii = 0; ii<numparam; ++ii) {
807  if (current_params[2*ii]==0) {
808  writess << "0/1 ;\n";
809  }
810  else {
811  ss << current_params[2*ii];
812  ss >> convertmetochar;
813  ss.clear();
814  ss.str("");
815 
816  //make a call from the bertini library
817  computeNumDenom(&numer, &denom, (char *) convertmetochar.c_str());
818 
819  writess << numer << "/" << denom << " ;\n";
820  }
821 
822 
823  if (current_params[2*ii+1]==0) {
824  writess << "0/1 ;\n";
825  }
826  else {
827  ss << current_params[2*ii+1];
828  ss >> convertmetochar;
829  ss.clear();
830  ss.str("");
831 
832  computeNumDenom(&numer, &denom, (char *) convertmetochar.c_str());
833  writess << numer << "/" << denom << " ;\n";
834  }
835 
836  }
837 
838  //put the remainder of the file on the buffer
839  for (int ii = (2+4*numparam); ii< int(numdotout.size())-1; ++ii) {
840  writess << numdotout[ii] << "\n";
841  }
842 
843 
844  } // end standard step2
845  else{ // begin nonstandard step2 ... doing a standard total degree
846  // bertini run with just parameters changed
847 
848  // Write the parameter values to be used in the SLP
849  for (int ii=0; ii < numparam; ++ii){
850  if (current_params[2*ii] == 0){
851  writess << "0/1 ; \n";
852  }
853  else{
854  ss << current_params[2*ii];
855  ss >> convertmetochar;
856  ss.clear();
857  ss.str("");
858 
859  //make a call from the bertini library
860  computeNumDenom(&numer, &denom, (char *) convertmetochar.c_str());
861 
862  writess << numer << "/" << denom << " ;\n";
863 
864  }
865 
866  if (current_params[2*ii+1]==0) {
867  writess << "0/1 ;\n";
868  }
869  else {
870  ss << current_params[2*ii+1];
871  ss >> convertmetochar;
872  ss.clear();
873  ss.str("");
874 
875  computeNumDenom(&numer, &denom, (char *) convertmetochar.c_str());
876  writess << numer << "/" << denom << " ;\n";
877  }
878  } // end write parameter values
879 
880  // this is for all the values that are constant
881  for (int ii = (2+2*numparam); ii< int(numdotout.size())-1; ++ii) {
882  writess << numdotout[ii] << "\n";
883  }
884 
885 
886  }
887 
888  fout << writess.str();
889  fout.close();
890 
891 
892 
893 
894 }
895 
896 
897 
898 
899 
901 
902 
903 
904 
905  boost::filesystem::path tmppath;
906 
907  if (paramotopy_settings.settings["files"]["customtmplocation"].intvalue==1){
908  tmppath = paramotopy_settings.settings["files"]["tempfilelocation"].pathvalue;
909  }
910  else {
911  tmppath = called_dir;
912  }
913 
914  tmppath /= "bfiles_";
915  tmppath += paramotopy_info.inputfilename;
916  tmppath /= "tmpstep2";
917 
918  this->tmpfolder = tmppath;
919 
920  tmppath /= "work";
921  std::stringstream converter;
922  converter << myid;
923  tmppath += converter.str();
924 
925  this->workingfolder = tmppath;
926 
927 }
928 
929 
930 
932  boost::filesystem::remove_all(workingfolder);
933 }
934 
935 
936 
938  boost::filesystem::create_directories(this->workingfolder);
939  safe_chdir(this->workingfolder.c_str());
940 
941  this->in_working_folder = true;
942 
943 }
944 
945 
946 
948  safe_chdir(called_dir.c_str()); //used to move back to the starting directory to write the timing files. now stay down there for loop, move here. no sense in moving, when each worker is just writing its own files.
949 
950  this->in_working_folder = false;
951 }
952 
953 
955 {
956 
957  bool its_all_good = true;
958  std::vector< std::string > reported_errors;
959 
960  if (!have_dotout) {
961  its_all_good = false;
962  reported_errors.push_back("num.out");
963  }
964 
965  if (!have_input) {
966  its_all_good = false;
967  reported_errors.push_back("no input");
968  }
969 
970  if (!have_start) {
971  its_all_good = false;
972  reported_errors.push_back("no start");
973  }
974 
975 
976  if (!in_working_folder) {
977  its_all_good = false;
978  reported_errors.push_back("not in working folder");
979  }
980 
981  if (filename.string().size()==0) {
982  reported_errors.push_back("no filename");
983  its_all_good = false;
984  }
985 
986  if (tmpfolder.string().size()==0) {
987  reported_errors.push_back("no tmpfolder");
988  its_all_good = false;
989  }
990 
991  if (numfilesatatime<=0) {
992  reported_errors.push_back("unset numfilesatatime");
993  its_all_good = false;
994  }
995 
996  if (numparam<=0) {
997  reported_errors.push_back("unset numparam");
998  its_all_good = false;
999  }
1000 
1001  if (standardstep2<0) {
1002  reported_errors.push_back("unset standardstep2");
1003  its_all_good = false;
1004  }
1005 
1006 
1007  if (!its_all_good){
1008  std::cerr << "slave " << myid << " reported its not all good, with bad flags:\n";
1009 
1010  for (int ii=0; ii<int(reported_errors.size()); ii++) {
1011  std::cerr << "slave " << myid << " flag" << ii << " " << reported_errors[ii] << std::endl;
1012  }
1013  std::cerr << "\n\nABORTING slave " << myid << std::endl;
1014  MPI_Abort(MPI_COMM_WORLD, 652);
1015  }
1016 }
1017 
int numfilesatatime_orig
the expected number of files per send
Definition: slave.hpp:110
char * input_file
the input file in a c-friendly format
Definition: slave.hpp:150
std::vector< std::string > numdotout
num.out file.
Definition: slave.hpp:139
unsigned int currentSeed
the current seed for random number generator.
Definition: slave.hpp:122
void LoopBasic(timer &process_timer)
Definition: slave.cpp:132
std::vector< std::string > config
config file.
Definition: slave.hpp:143
void PurgeWorkingFolder()
Definition: slave.cpp:931
void WriteStart()
Definition: slave.cpp:584
void CleanupSwitch(timer &process_timer)
Definition: slave.cpp:466
std::vector< std::string > funcinput
func_input file.
Definition: slave.hpp:144
void SeedSwitch(timer &process_timer)
Definition: slave.cpp:78
void MoveToWorkingFolder()
Definition: slave.cpp:937
void slave_main(ProgSettings input_settings, runinfo input_p_info, timer &process_timer)
Definition: slave.cpp:16
boost::filesystem::path called_dir
where was I instantiated?
Definition: slave.hpp:111
bool have_dotout
flag indicating whether we have read the .out files into memory.
Definition: slave.hpp:148
void LoopSearch(timer &process_timer)
Definition: slave.cpp:276
std::vector< std::string > degdotout
degout file.
Definition: slave.hpp:141
void ReceiveInput(timer &process_timer)
Definition: slave.cpp:504
void CleanupBasic(timer &process_timer)
Definition: slave.cpp:478
char * start_file
the start file in a c-friendly format
Definition: slave.hpp:153
boost::filesystem::path workingfolder
where should I go to perform work?
Definition: slave.hpp:114
int numparam
Definition: runinfo.hpp:64
void CleanupSearch(timer &process_timer)
Definition: slave.cpp:483
runinfo paramotopy_info
the parsed paramotopy input file.
Definition: slave.hpp:104
void SeedSearch(timer &process_timer)
Definition: slave.cpp:90
void parse_input_file_bertini(unsigned int &currentSeed, int &MPType)
Definition: step2_funcs.cpp:5
void LoopSwitch(timer &process_timer)
Definition: slave.cpp:113
bool SlaveCollectAndWriteData(double *current_params, ProgSettings &paramotopy_settings, timer &process_timer)
void ReadDotOut()
Definition: slave.cpp:639
void SetWorkingFolder()
Definition: slave.cpp:900
bool in_working_folder
boolean indicating whether i think i am in the correct location to perform work.
Definition: slave.hpp:156
void ReadyCheck()
Definition: slave.cpp:954
std::vector< std::string > preproc_data
preproc_data file.
Definition: slave.hpp:145
void SlaveSetup(ProgSettings &paramotopy_settings, runinfo &paramotopy_info, int myid, boost::filesystem::path called_dir)
int linenumber
what line is currently being run
Definition: slave.hpp:126
void SlaveSetup()
Definition: slave.cpp:55
void ReceiveStart(timer &process_timer)
Definition: slave.cpp:534
std::vector< std::string > namesdotout
names.out file.
Definition: slave.hpp:142
boost::filesystem::path inputfilename
Definition: runinfo.hpp:90
void WriteAllData()
boost::filesystem::path filename
the filename for the problem
Definition: slave.hpp:108
int numparam
the number of parameters in the problem.
Definition: slave.hpp:128
categorymap settings
void add_time(const std::string timer_name)
Definition: timing.cpp:12
int myid
my id withing my MPI communicator
Definition: slave.hpp:134
std::vector< std::string > arrdotout
arr.out file.
Definition: slave.hpp:140
boost::filesystem::path tmpfolder
the basis for workingfolder
Definition: slave.hpp:116
void WriteDotOut()
Definition: slave.cpp:726
A class that stores the general program settings of Paramotopy.
ProgSettings paramotopy_settings
the ProgSettings for this process
Definition: slave.hpp:105
void run_zero_dim_main(int MPType, unsigned int currentSeed)
Definition: step2_funcs.cpp:12
void safe_chdir(std::string desired_directory)
int MPType
MPType for current run.
Definition: slave.hpp:123
datagatherer slavegatherer
data member from datagatherer, which will gather bertini output files.
Definition: slave.hpp:120
void WriteInput()
Definition: slave.cpp:609
A class for the input file parser.
Definition: runinfo.hpp:41
void WriteNumDotOut(double current_params[])
Definition: slave.cpp:772
bool have_input
flag indicating whether we have received the INPUT file from master.
Definition: slave.hpp:149
int standardstep2
flag for total degree or coefficient parameter homotopy.
Definition: slave.hpp:136
int numfilesatatime
the expected number of files per send
Definition: slave.hpp:109
void SeedBasic(timer &process_timer)
Definition: slave.cpp:83
bool have_start
flag indicating whether we have received the START file from master.
Definition: slave.hpp:152
void press_start(const std::string timer_name)
Definition: timing.cpp:5
Capable of timing arbitrary categories of processes, using a map of timer_data's. ...
Definition: timing.hpp:71
void GoCalledDir()
Definition: slave.cpp:947