You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Heis_DSF_par_Wrapup.cc 2.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /**********************************************************
  2. This software is part of J.-S. Caux's C++ library.
  3. Copyright (c) J.-S. Caux.
  4. -----------------------------------------------------------
  5. File: Heis_DSF_par_Prepare.cc
  6. Purpose: Parallel version of ABACUS using MPICH.
  7. ***********************************************************/
  8. #include "ABACUS.h"
  9. using namespace std;
  10. using namespace ABACUS;
  11. int main(int argc, char *argv[])
  12. {
  13. char whichDSF;
  14. DP Delta;
  15. int N, M, iKmin, iKmax, paralevel, nr_processors_at_newlevel;
  16. DP target_sumrule = 1.0e+6; // effectively deactivated here
  17. bool refine = true; // always true for parallel mode
  18. if (argc < 9) { // provide some info
  19. cout << endl << "Welcome to ABACUS\t(copyright J.-S. Caux)." << endl;
  20. cout << endl << "Usage of Heis_DSF_par_Wrapup executable: " << endl;
  21. cout << endl << "This function wraps up an ABACUSG parallel mode run." << endl;
  22. cout << endl << "Provide the following arguments:" << endl << endl;
  23. cout << "char whichDSF \t\t Which structure factor should be calculated ? Options are: "
  24. "m for S- S+, z for Sz Sz, p for S+ S-." << endl;
  25. cout << "DP Delta \t\t Value of the anisotropy: use positive real values only" << endl;
  26. cout << "int N \t\t\t Length (number of sites) of the system: use positive even integer values only" << endl;
  27. cout << "int M \t\t\t Number of down spins: use positive integer values between 1 and N/2" << endl;
  28. cout << "int iKmin" << endl << "int iKmax \t\t Min and max momentum integers to scan over: "
  29. "recommended values: 0 and N" << endl;
  30. cout << "int paralevel" << endl;
  31. cout << "rank[i], nr_processors[i] \t rank and nr_processors of each earlier paralevels." << endl;
  32. cout << "int nr_processors_at_new_level \t for this latest parallelization level." << endl;
  33. return(0);
  34. }
  35. else { // correct nr of arguments
  36. int n = 1;
  37. whichDSF = *argv[n++];
  38. Delta = atof(argv[n++]);
  39. N = atoi(argv[n++]);
  40. M = atoi(argv[n++]);
  41. iKmin = atoi(argv[n++]);
  42. iKmax = atoi(argv[n++]);
  43. paralevel = atoi(argv[n++]); // paralevel == 1 means that we have one layer of parallelization, so no previous rank and nr_processors to specify
  44. if (argc != 9 + 2*(paralevel - 1)) ABACUSerror("Wrong nr of arguments in Heis_DSF_par_Wrapup.");
  45. Vect<int> rank_lower_paralevels(paralevel - 1);
  46. Vect<int> nr_processors_lower_paralevels(paralevel - 1);
  47. for (int i = 0; i < paralevel - 1; ++i) {
  48. rank_lower_paralevels[i] = atoi(argv[n++]);
  49. nr_processors_lower_paralevels[i] = atoi(argv[n++]);
  50. }
  51. nr_processors_at_newlevel = atoi(argv[n++]);
  52. string defaultScanStatename = "";
  53. // Split up thread list into chunks, one per processor
  54. Wrapup_Parallel_Scan_Heis (whichDSF, Delta, N, M, iKmin, iKmax, paralevel, rank_lower_paralevels,
  55. nr_processors_lower_paralevels, nr_processors_at_newlevel);
  56. }
  57. return(0);
  58. }