Loading src/trapping/cfrfme.cpp +330 −307 Original line number Original line Diff line number Diff line Loading @@ -57,6 +57,10 @@ #include "../include/tra_subs.h" #include "../include/tra_subs.h" #endif #endif #ifndef INCLUDE_ERRORS_H_ #include "../include/errors.h" #endif #ifdef USE_NVTX #ifdef USE_NVTX #include <nvtx3/nvToolsExt.h> #include <nvtx3/nvToolsExt.h> #endif #endif Loading Loading @@ -146,15 +150,23 @@ void frfme(string data_file, string output_path) { str_target = m.suffix().str(); str_target = m.suffix().str(); regex_search(str_target, m, re); regex_search(str_target, m, re); int jlml = stoi(m.str()); int jlml = stoi(m.str()); int lmode = 0, lm = 0, nks = 0; // Input parameters int lmode, lm; double vk = 0.0, exri = 0.0, an = 0.0, ff = 0.0, tra = 0.0; double vk = 0.0, exri = 0.0, an = 0.0, ff = 0.0, tra = 0.0; double exdc = 0.0, wp = 0.0, xip = 0.0, xi = 0.0; double exdc = 0.0, wp = 0.0, xip = 0.0, xi = 0.0; int idfc = 0, nxi = 0; int idfc = 0, nxi = 0; double apfafa = 0.0, pmf = 0.0, spd = 0.0, rir = 0.0, ftcn = 0.0, fshmx = 0.0; double apfafa = 0.0, pmf = 0.0, spd = 0.0, rir = 0.0, ftcn = 0.0, fshmx = 0.0; double vxyzmx = 0.0, delxyz = 0.0, vknmx = 0.0, delk = 0.0, delks = 0.0; double vxyzmx = 0.0, delxyz = 0.0, vknmx = 0.0, delk = 0.0, delks = 0.0, vkm = 0.0; double frsh = 0.0, exril = 0.0; double frsh = 0.0, exril = 1.0, spdfr = 1.0, exdcl = 1.0, wlenfr= 1.0, wn = 0.0; double *vkv = NULL; int nksh = 0, nrsh = 0, nxsh = 0, nysh = 0, nzsh = 0; // Calculation parameters, computed from input data int nlmmt = 0, nrvc = 0; int nlmmt = 0, nrvc = 0; int nkshpo = 0, nks = 0, nkv = 0; int nxshpo = 0, nxs = 0, nxv = 0; int nyshpo = 0, nys = 0, nyv = 0; int nzshpo = 0, nzs = 0, nzv = 0; double *vkv = NULL; double *_xv = NULL, *_yv = NULL, *_zv = NULL; // Vector size variables // Vector size variables int wsum_size; int wsum_size; // End of vector size variables // End of vector size variables Loading @@ -162,16 +174,18 @@ void frfme(string data_file, string output_path) { #ifdef USE_NVTX #ifdef USE_NVTX nvtxRangePush("frfme() with jlmf != 1"); nvtxRangePush("frfme() with jlmf != 1"); #endif #endif int nxv, nyv, nzv; if (tfrfme == NULL) tfrfme = TFRFME::from_binary(tfrfme_name, "HDF5"); if (tfrfme == NULL) tfrfme = TFRFME::from_binary(tfrfme_name, "HDF5"); if (tfrfme != NULL) { if (tfrfme != NULL) { lmode = tfrfme->lmode; lmode = tfrfme->lmode; lm = tfrfme->lm; lm = tfrfme->lm; const int nkv = tfrfme->nkv; nkv = tfrfme->nkv; nks = nkv - 1; nks = nkv - 1; nxv = tfrfme->nxv; nxv = tfrfme->nxv; nyv = tfrfme->nyv; nyv = tfrfme->nyv; nzv = tfrfme->nzv; nzv = tfrfme->nzv; _xv = tfrfme->get_x(); _yv = tfrfme->get_y(); _zv = tfrfme->get_z(); vk = tfrfme->vk; vk = tfrfme->vk; exri = tfrfme->exri; exri = tfrfme->exri; an = tfrfme->an; an = tfrfme->an; Loading Loading @@ -215,7 +229,6 @@ void frfme(string data_file, string output_path) { #ifdef USE_NVTX #ifdef USE_NVTX nvtxRangePush("Setup operations"); nvtxRangePush("Setup operations"); #endif #endif int nksh, nrsh, nxsh, nysh, nzsh; str_target = file_lines[last_read_line++]; str_target = file_lines[last_read_line++]; for (int cli = 0; cli < 7; cli++) { for (int cli = 0; cli < 7; cli++) { regex_search(str_target, m, re); regex_search(str_target, m, re); Loading @@ -230,7 +243,7 @@ void frfme(string data_file, string output_path) { } } re = regex("-?[0-9]\\.[0-9]+([dDeE][-+]?[0-9]+)?"); re = regex("-?[0-9]\\.[0-9]+([dDeE][-+]?[0-9]+)?"); regex_search(str_target, m, re); regex_search(str_target, m, re); double wlenfr = stod(m.str()); wlenfr = stod(m.str()); str_target = file_lines[last_read_line++]; str_target = file_lines[last_read_line++]; for (int cli = 0; cli < 3; cli++) { for (int cli = 0; cli < 3; cli++) { regex_search(str_target, m, re); regex_search(str_target, m, re); Loading @@ -239,7 +252,6 @@ void frfme(string data_file, string output_path) { else if (cli == 2) tra = stod(m.str()); else if (cli == 2) tra = stod(m.str()); str_target = m.suffix().str(); str_target = m.suffix().str(); } } double spdfr, exdcl; str_target = file_lines[last_read_line++]; str_target = file_lines[last_read_line++]; for (int cli = 0; cli < 3; cli++) { for (int cli = 0; cli < 3; cli++) { regex_search(str_target, m, re); regex_search(str_target, m, re); Loading @@ -262,6 +274,9 @@ void frfme(string data_file, string output_path) { else if (more == 'e' || more == 'E') { else if (more == 'e' || more == 'E') { more = 'E'; more = 'E'; sprintf(namef, "c_TEDF"); sprintf(namef, "c_TEDF"); } else { throw(UnrecognizedConfigurationException("ERROR: only 'm', 'M', 'e', or 'E' accepted as modes!\n")); } } } str_target = m.suffix().str(); str_target = m.suffix().str(); re = regex("[0-9]+"); re = regex("[0-9]+"); Loading @@ -282,10 +297,12 @@ void frfme(string data_file, string output_path) { } } } } ScattererConfiguration *tedf = ScattererConfiguration::from_binary(tedf_name, "HDF5"); ScattererConfiguration *tedf = ScattererConfiguration::from_binary(tedf_name, "HDF5"); if (tedf != NULL) { #ifdef USE_NVTX #ifdef USE_NVTX nvtxRangePush("TEDF data import"); nvtxRangePush("TEDF data import"); #endif #endif if (tedf == NULL) { throw(OpenConfigurationFileException("ERROR: could not open " + tedf_name + "hd5!\n")); } int iduml, idum; int iduml, idum; iduml = tedf->number_of_spheres; iduml = tedf->number_of_spheres; idum = tedf->get_iog(iduml - 1); idum = tedf->get_iog(iduml - 1); Loading Loading @@ -313,7 +330,7 @@ void frfme(string data_file, string output_path) { nvtxRangePop(); nvtxRangePop(); #endif #endif delete tedf; delete tedf; double wn = wp / 3.0e8; wn = wp / 3.0e8; vk = xi * wn; vk = xi * wn; exri = sqrt(exdc); exri = sqrt(exdc); frsh = 0.0; frsh = 0.0; Loading @@ -337,7 +354,7 @@ void frfme(string data_file, string output_path) { #endif #endif nlmmt = lm * (lm + 2) * 2; nlmmt = lm * (lm + 2) * 2; nks = nksh * 2; nks = nksh * 2; const int nkv = nks + 1; nkv = nks + 1; // Array initialization // Array initialization long swap1_size, swap2_size, tfrfme_size; long swap1_size, swap2_size, tfrfme_size; double size_mb; double size_mb; Loading @@ -354,22 +371,22 @@ void frfme(string data_file, string output_path) { tt2 = new Swap2(nkv); tt2 = new Swap2(nkv); vkv = tt2->get_vector(); vkv = tt2->get_vector(); // End of array initialization // End of array initialization double vkm = vk * exri; vkm = vk * exri; vknmx = vk * an; vknmx = vk * an; delk = vknmx / nksh; delk = vknmx / nksh; delks = delk / vkm; delks = delk / vkm; delks = delks * delks; delks = delks * delks; vxyzmx = acos(0.0) * 4.0 / vkm * wlenfr; vxyzmx = acos(0.0) * 4.0 / vkm * wlenfr; delxyz = vxyzmx / nrsh; delxyz = vxyzmx / nrsh; int nxs = nxsh * 2; nxs = nxsh * 2; int nxv = nxs + 1; nxv = nxs + 1; int nxshpo = nxsh + 1; nxshpo = nxsh + 1; int nys = nysh * 2; nys = nysh * 2; int nyv = nys + 1; nyv = nys + 1; int nyshpo = nysh + 1; nyshpo = nysh + 1; int nzs = nzsh * 2; nzs = nzsh * 2; int nzv = nzs + 1; nzv = nzs + 1; int nzshpo = nzsh + 1; nzshpo = nzsh + 1; tfrfme_size = TFRFME::get_size(lm, nkv, nxv, nyv, nzv); tfrfme_size = TFRFME::get_size(lm, nkv, nxv, nyv, nzv); size_mb = 1.0 * tfrfme_size / 1024.0 / 1024.0; size_mb = 1.0 * tfrfme_size / 1024.0 / 1024.0; sprintf(buffer, "TFRFME: %.2lg MB\n", size_mb); sprintf(buffer, "TFRFME: %.2lg MB\n", size_mb); Loading @@ -387,9 +404,11 @@ void frfme(string data_file, string output_path) { logger.log(message); logger.log(message); tfrfme = new TFRFME(lmode, lm, nkv, nxv, nyv, nzv); tfrfme = new TFRFME(lmode, lm, nkv, nxv, nyv, nzv); double *_xv = tfrfme->get_x(); if (tfrfme == NULL) double *_yv = tfrfme->get_y(); throw(ObjectAllocationException("ERROR: could not initialize TFRFME structure!\n")); double *_zv = tfrfme->get_z(); _xv = tfrfme->get_x(); _yv = tfrfme->get_y(); _zv = tfrfme->get_z(); #ifdef USE_NVTX #ifdef USE_NVTX nvtxRangePop(); nvtxRangePop(); #endif #endif Loading @@ -408,8 +427,8 @@ void frfme(string data_file, string output_path) { _zv[i27] = _zv[i27 - 1] + delxyz; _zv[i27] = _zv[i27 - 1] + delxyz; _zv[nzv - i27 - 1] = -_zv[i27]; _zv[nzv - i27 - 1] = -_zv[i27]; } // i27 loop } // i27 loop int nrvc = nxv * nyv * nzv; nrvc = nxv * nyv * nzv; int nkshpo = nksh + 1; nkshpo = nksh + 1; for (int i28 = nkshpo; i28 <= nks; i28++) { for (int i28 = nkshpo; i28 <= nks; i28++) { vkv[i28] = vkv[i28 - 1] + delk; vkv[i28] = vkv[i28 - 1] + delk; vkv[nkv - i28 - 1] = -vkv[i28]; vkv[nkv - i28 - 1] = -vkv[i28]; Loading @@ -417,7 +436,6 @@ void frfme(string data_file, string output_path) { #ifdef USE_NVTX #ifdef USE_NVTX nvtxRangePop(); nvtxRangePop(); #endif #endif if (tfrfme != NULL) { #ifdef USE_NVTX #ifdef USE_NVTX nvtxRangePush("TFRFME initialization"); nvtxRangePush("TFRFME initialization"); #endif #endif Loading Loading @@ -455,6 +473,8 @@ void frfme(string data_file, string output_path) { #ifdef USE_NVTX #ifdef USE_NVTX nvtxRangePop(); nvtxRangePop(); #endif #endif } // jlmf = 1 configuration mode // label 45 #ifdef USE_NVTX #ifdef USE_NVTX nvtxRangePush("j80 loop"); nvtxRangePush("j80 loop"); #endif #endif Loading Loading @@ -498,6 +518,7 @@ void frfme(string data_file, string output_path) { logger.log(message); logger.log(message); free(global_vec_w); free(global_vec_w); #else #else // This code block is compiled if USE_TARGET_OFFLOAD is not defined #pragma omp parallel for #pragma omp parallel for for (int j80 = jlmf - 1; j80 < jlml; j80++) { for (int j80 = jlmf - 1; j80 < jlml; j80++) { dcomplex *vec_w = global_vec_w + nkvs * (j80 - jlmf + 1); dcomplex *vec_w = global_vec_w + nkvs * (j80 - jlmf + 1); Loading Loading @@ -576,25 +597,8 @@ void frfme(string data_file, string output_path) { fclose(output); fclose(output); #ifdef USE_NVTX #ifdef USE_NVTX nvtxRangePop(); nvtxRangePop(); #endif } else { // Should never happen. message = "ERROR: could not open TFRFME file for output.\n"; logger.err(message); } } else { message = "ERROR: could not open TEDF file.\n"; logger.err(message); } } else { // label 98 string output_name = output_path + "/c_OFRFME"; FILE *output = fopen(output_name.c_str(), "w"); fprintf(output, " WRONG INPUT TAPE\n"); fclose(output); } #ifdef USE_NVTX nvtxRangePop(); nvtxRangePop(); #endif #endif } // label 45 // label 45 #ifdef USE_NVTX #ifdef USE_NVTX nvtxRangePush("frfme() memory clean"); nvtxRangePush("frfme() memory clean"); Loading @@ -620,6 +624,25 @@ void frfme(string data_file, string output_path) { nvtxRangePop(); nvtxRangePop(); #endif #endif } } // STALE CODE BLOCK // else { // Should never happen. // message = "ERROR: could not open TFRFME file for output.\n"; // logger.err(message); // } // } else { // message = "ERROR: could not open TEDF file.\n"; // logger.err(message); // } // } else { // label 98 // string output_name = output_path + "/c_OFRFME"; // FILE *output = fopen(output_name.c_str(), "w"); // fprintf(output, " WRONG INPUT TAPE\n"); // fclose(output); // } // #ifdef USE_NVTX // nvtxRangePop(); // #endif // } #ifdef USE_TARGET_OFFLOAD #ifdef USE_TARGET_OFFLOAD void offload_loop( void offload_loop( Loading Loading
src/trapping/cfrfme.cpp +330 −307 Original line number Original line Diff line number Diff line Loading @@ -57,6 +57,10 @@ #include "../include/tra_subs.h" #include "../include/tra_subs.h" #endif #endif #ifndef INCLUDE_ERRORS_H_ #include "../include/errors.h" #endif #ifdef USE_NVTX #ifdef USE_NVTX #include <nvtx3/nvToolsExt.h> #include <nvtx3/nvToolsExt.h> #endif #endif Loading Loading @@ -146,15 +150,23 @@ void frfme(string data_file, string output_path) { str_target = m.suffix().str(); str_target = m.suffix().str(); regex_search(str_target, m, re); regex_search(str_target, m, re); int jlml = stoi(m.str()); int jlml = stoi(m.str()); int lmode = 0, lm = 0, nks = 0; // Input parameters int lmode, lm; double vk = 0.0, exri = 0.0, an = 0.0, ff = 0.0, tra = 0.0; double vk = 0.0, exri = 0.0, an = 0.0, ff = 0.0, tra = 0.0; double exdc = 0.0, wp = 0.0, xip = 0.0, xi = 0.0; double exdc = 0.0, wp = 0.0, xip = 0.0, xi = 0.0; int idfc = 0, nxi = 0; int idfc = 0, nxi = 0; double apfafa = 0.0, pmf = 0.0, spd = 0.0, rir = 0.0, ftcn = 0.0, fshmx = 0.0; double apfafa = 0.0, pmf = 0.0, spd = 0.0, rir = 0.0, ftcn = 0.0, fshmx = 0.0; double vxyzmx = 0.0, delxyz = 0.0, vknmx = 0.0, delk = 0.0, delks = 0.0; double vxyzmx = 0.0, delxyz = 0.0, vknmx = 0.0, delk = 0.0, delks = 0.0, vkm = 0.0; double frsh = 0.0, exril = 0.0; double frsh = 0.0, exril = 1.0, spdfr = 1.0, exdcl = 1.0, wlenfr= 1.0, wn = 0.0; double *vkv = NULL; int nksh = 0, nrsh = 0, nxsh = 0, nysh = 0, nzsh = 0; // Calculation parameters, computed from input data int nlmmt = 0, nrvc = 0; int nlmmt = 0, nrvc = 0; int nkshpo = 0, nks = 0, nkv = 0; int nxshpo = 0, nxs = 0, nxv = 0; int nyshpo = 0, nys = 0, nyv = 0; int nzshpo = 0, nzs = 0, nzv = 0; double *vkv = NULL; double *_xv = NULL, *_yv = NULL, *_zv = NULL; // Vector size variables // Vector size variables int wsum_size; int wsum_size; // End of vector size variables // End of vector size variables Loading @@ -162,16 +174,18 @@ void frfme(string data_file, string output_path) { #ifdef USE_NVTX #ifdef USE_NVTX nvtxRangePush("frfme() with jlmf != 1"); nvtxRangePush("frfme() with jlmf != 1"); #endif #endif int nxv, nyv, nzv; if (tfrfme == NULL) tfrfme = TFRFME::from_binary(tfrfme_name, "HDF5"); if (tfrfme == NULL) tfrfme = TFRFME::from_binary(tfrfme_name, "HDF5"); if (tfrfme != NULL) { if (tfrfme != NULL) { lmode = tfrfme->lmode; lmode = tfrfme->lmode; lm = tfrfme->lm; lm = tfrfme->lm; const int nkv = tfrfme->nkv; nkv = tfrfme->nkv; nks = nkv - 1; nks = nkv - 1; nxv = tfrfme->nxv; nxv = tfrfme->nxv; nyv = tfrfme->nyv; nyv = tfrfme->nyv; nzv = tfrfme->nzv; nzv = tfrfme->nzv; _xv = tfrfme->get_x(); _yv = tfrfme->get_y(); _zv = tfrfme->get_z(); vk = tfrfme->vk; vk = tfrfme->vk; exri = tfrfme->exri; exri = tfrfme->exri; an = tfrfme->an; an = tfrfme->an; Loading Loading @@ -215,7 +229,6 @@ void frfme(string data_file, string output_path) { #ifdef USE_NVTX #ifdef USE_NVTX nvtxRangePush("Setup operations"); nvtxRangePush("Setup operations"); #endif #endif int nksh, nrsh, nxsh, nysh, nzsh; str_target = file_lines[last_read_line++]; str_target = file_lines[last_read_line++]; for (int cli = 0; cli < 7; cli++) { for (int cli = 0; cli < 7; cli++) { regex_search(str_target, m, re); regex_search(str_target, m, re); Loading @@ -230,7 +243,7 @@ void frfme(string data_file, string output_path) { } } re = regex("-?[0-9]\\.[0-9]+([dDeE][-+]?[0-9]+)?"); re = regex("-?[0-9]\\.[0-9]+([dDeE][-+]?[0-9]+)?"); regex_search(str_target, m, re); regex_search(str_target, m, re); double wlenfr = stod(m.str()); wlenfr = stod(m.str()); str_target = file_lines[last_read_line++]; str_target = file_lines[last_read_line++]; for (int cli = 0; cli < 3; cli++) { for (int cli = 0; cli < 3; cli++) { regex_search(str_target, m, re); regex_search(str_target, m, re); Loading @@ -239,7 +252,6 @@ void frfme(string data_file, string output_path) { else if (cli == 2) tra = stod(m.str()); else if (cli == 2) tra = stod(m.str()); str_target = m.suffix().str(); str_target = m.suffix().str(); } } double spdfr, exdcl; str_target = file_lines[last_read_line++]; str_target = file_lines[last_read_line++]; for (int cli = 0; cli < 3; cli++) { for (int cli = 0; cli < 3; cli++) { regex_search(str_target, m, re); regex_search(str_target, m, re); Loading @@ -262,6 +274,9 @@ void frfme(string data_file, string output_path) { else if (more == 'e' || more == 'E') { else if (more == 'e' || more == 'E') { more = 'E'; more = 'E'; sprintf(namef, "c_TEDF"); sprintf(namef, "c_TEDF"); } else { throw(UnrecognizedConfigurationException("ERROR: only 'm', 'M', 'e', or 'E' accepted as modes!\n")); } } } str_target = m.suffix().str(); str_target = m.suffix().str(); re = regex("[0-9]+"); re = regex("[0-9]+"); Loading @@ -282,10 +297,12 @@ void frfme(string data_file, string output_path) { } } } } ScattererConfiguration *tedf = ScattererConfiguration::from_binary(tedf_name, "HDF5"); ScattererConfiguration *tedf = ScattererConfiguration::from_binary(tedf_name, "HDF5"); if (tedf != NULL) { #ifdef USE_NVTX #ifdef USE_NVTX nvtxRangePush("TEDF data import"); nvtxRangePush("TEDF data import"); #endif #endif if (tedf == NULL) { throw(OpenConfigurationFileException("ERROR: could not open " + tedf_name + "hd5!\n")); } int iduml, idum; int iduml, idum; iduml = tedf->number_of_spheres; iduml = tedf->number_of_spheres; idum = tedf->get_iog(iduml - 1); idum = tedf->get_iog(iduml - 1); Loading Loading @@ -313,7 +330,7 @@ void frfme(string data_file, string output_path) { nvtxRangePop(); nvtxRangePop(); #endif #endif delete tedf; delete tedf; double wn = wp / 3.0e8; wn = wp / 3.0e8; vk = xi * wn; vk = xi * wn; exri = sqrt(exdc); exri = sqrt(exdc); frsh = 0.0; frsh = 0.0; Loading @@ -337,7 +354,7 @@ void frfme(string data_file, string output_path) { #endif #endif nlmmt = lm * (lm + 2) * 2; nlmmt = lm * (lm + 2) * 2; nks = nksh * 2; nks = nksh * 2; const int nkv = nks + 1; nkv = nks + 1; // Array initialization // Array initialization long swap1_size, swap2_size, tfrfme_size; long swap1_size, swap2_size, tfrfme_size; double size_mb; double size_mb; Loading @@ -354,22 +371,22 @@ void frfme(string data_file, string output_path) { tt2 = new Swap2(nkv); tt2 = new Swap2(nkv); vkv = tt2->get_vector(); vkv = tt2->get_vector(); // End of array initialization // End of array initialization double vkm = vk * exri; vkm = vk * exri; vknmx = vk * an; vknmx = vk * an; delk = vknmx / nksh; delk = vknmx / nksh; delks = delk / vkm; delks = delk / vkm; delks = delks * delks; delks = delks * delks; vxyzmx = acos(0.0) * 4.0 / vkm * wlenfr; vxyzmx = acos(0.0) * 4.0 / vkm * wlenfr; delxyz = vxyzmx / nrsh; delxyz = vxyzmx / nrsh; int nxs = nxsh * 2; nxs = nxsh * 2; int nxv = nxs + 1; nxv = nxs + 1; int nxshpo = nxsh + 1; nxshpo = nxsh + 1; int nys = nysh * 2; nys = nysh * 2; int nyv = nys + 1; nyv = nys + 1; int nyshpo = nysh + 1; nyshpo = nysh + 1; int nzs = nzsh * 2; nzs = nzsh * 2; int nzv = nzs + 1; nzv = nzs + 1; int nzshpo = nzsh + 1; nzshpo = nzsh + 1; tfrfme_size = TFRFME::get_size(lm, nkv, nxv, nyv, nzv); tfrfme_size = TFRFME::get_size(lm, nkv, nxv, nyv, nzv); size_mb = 1.0 * tfrfme_size / 1024.0 / 1024.0; size_mb = 1.0 * tfrfme_size / 1024.0 / 1024.0; sprintf(buffer, "TFRFME: %.2lg MB\n", size_mb); sprintf(buffer, "TFRFME: %.2lg MB\n", size_mb); Loading @@ -387,9 +404,11 @@ void frfme(string data_file, string output_path) { logger.log(message); logger.log(message); tfrfme = new TFRFME(lmode, lm, nkv, nxv, nyv, nzv); tfrfme = new TFRFME(lmode, lm, nkv, nxv, nyv, nzv); double *_xv = tfrfme->get_x(); if (tfrfme == NULL) double *_yv = tfrfme->get_y(); throw(ObjectAllocationException("ERROR: could not initialize TFRFME structure!\n")); double *_zv = tfrfme->get_z(); _xv = tfrfme->get_x(); _yv = tfrfme->get_y(); _zv = tfrfme->get_z(); #ifdef USE_NVTX #ifdef USE_NVTX nvtxRangePop(); nvtxRangePop(); #endif #endif Loading @@ -408,8 +427,8 @@ void frfme(string data_file, string output_path) { _zv[i27] = _zv[i27 - 1] + delxyz; _zv[i27] = _zv[i27 - 1] + delxyz; _zv[nzv - i27 - 1] = -_zv[i27]; _zv[nzv - i27 - 1] = -_zv[i27]; } // i27 loop } // i27 loop int nrvc = nxv * nyv * nzv; nrvc = nxv * nyv * nzv; int nkshpo = nksh + 1; nkshpo = nksh + 1; for (int i28 = nkshpo; i28 <= nks; i28++) { for (int i28 = nkshpo; i28 <= nks; i28++) { vkv[i28] = vkv[i28 - 1] + delk; vkv[i28] = vkv[i28 - 1] + delk; vkv[nkv - i28 - 1] = -vkv[i28]; vkv[nkv - i28 - 1] = -vkv[i28]; Loading @@ -417,7 +436,6 @@ void frfme(string data_file, string output_path) { #ifdef USE_NVTX #ifdef USE_NVTX nvtxRangePop(); nvtxRangePop(); #endif #endif if (tfrfme != NULL) { #ifdef USE_NVTX #ifdef USE_NVTX nvtxRangePush("TFRFME initialization"); nvtxRangePush("TFRFME initialization"); #endif #endif Loading Loading @@ -455,6 +473,8 @@ void frfme(string data_file, string output_path) { #ifdef USE_NVTX #ifdef USE_NVTX nvtxRangePop(); nvtxRangePop(); #endif #endif } // jlmf = 1 configuration mode // label 45 #ifdef USE_NVTX #ifdef USE_NVTX nvtxRangePush("j80 loop"); nvtxRangePush("j80 loop"); #endif #endif Loading Loading @@ -498,6 +518,7 @@ void frfme(string data_file, string output_path) { logger.log(message); logger.log(message); free(global_vec_w); free(global_vec_w); #else #else // This code block is compiled if USE_TARGET_OFFLOAD is not defined #pragma omp parallel for #pragma omp parallel for for (int j80 = jlmf - 1; j80 < jlml; j80++) { for (int j80 = jlmf - 1; j80 < jlml; j80++) { dcomplex *vec_w = global_vec_w + nkvs * (j80 - jlmf + 1); dcomplex *vec_w = global_vec_w + nkvs * (j80 - jlmf + 1); Loading Loading @@ -576,25 +597,8 @@ void frfme(string data_file, string output_path) { fclose(output); fclose(output); #ifdef USE_NVTX #ifdef USE_NVTX nvtxRangePop(); nvtxRangePop(); #endif } else { // Should never happen. message = "ERROR: could not open TFRFME file for output.\n"; logger.err(message); } } else { message = "ERROR: could not open TEDF file.\n"; logger.err(message); } } else { // label 98 string output_name = output_path + "/c_OFRFME"; FILE *output = fopen(output_name.c_str(), "w"); fprintf(output, " WRONG INPUT TAPE\n"); fclose(output); } #ifdef USE_NVTX nvtxRangePop(); nvtxRangePop(); #endif #endif } // label 45 // label 45 #ifdef USE_NVTX #ifdef USE_NVTX nvtxRangePush("frfme() memory clean"); nvtxRangePush("frfme() memory clean"); Loading @@ -620,6 +624,25 @@ void frfme(string data_file, string output_path) { nvtxRangePop(); nvtxRangePop(); #endif #endif } } // STALE CODE BLOCK // else { // Should never happen. // message = "ERROR: could not open TFRFME file for output.\n"; // logger.err(message); // } // } else { // message = "ERROR: could not open TEDF file.\n"; // logger.err(message); // } // } else { // label 98 // string output_name = output_path + "/c_OFRFME"; // FILE *output = fopen(output_name.c_str(), "w"); // fprintf(output, " WRONG INPUT TAPE\n"); // fclose(output); // } // #ifdef USE_NVTX // nvtxRangePop(); // #endif // } #ifdef USE_TARGET_OFFLOAD #ifdef USE_TARGET_OFFLOAD void offload_loop( void offload_loop( Loading