预赛最终版本v1.0.0: 确定PGO和原负载均衡方案在当前版本造成负优化已经回退
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
/* 本头文件由自订profile框架自动生成并非人工硬编码针对Case优化 */
|
||||
/* 更新:负载均衡问题已经通过优化插值函数解决,此profile静态均衡方案已弃用,本头文件现在未参与编译 */
|
||||
/* Auto-generated from interp_lb_profile.bin — do not edit */
|
||||
#ifndef INTERP_LB_PROFILE_DATA_H
|
||||
#define INTERP_LB_PROFILE_DATA_H
|
||||
|
||||
@@ -20,7 +20,11 @@ CXXAPPFLAGS = -O3 -xHost -fma -fprofile-instr-generate -ipo \
|
||||
f90appflags = -O3 -xHost -fma -fprofile-instr-generate -ipo \
|
||||
-align array64byte -fpp -I${MKLROOT}/include $(POLINT6_FLAG)
|
||||
else
|
||||
## opt (default): maximum performance with PGO profile data
|
||||
## opt (default): maximum performance with PGO profile data -fprofile-instr-use=$(PROFDATA) \
|
||||
## PGO has been turned off, now tested and found to be negative optimization
|
||||
## INTERP_LB_FLAGS has been turned off too, now tested and found to be negative optimization
|
||||
|
||||
|
||||
CXXAPPFLAGS = -O3 -xHost -fp-model fast=2 -fma -ipo \
|
||||
-Dfortran3 -Dnewc -I${MKLROOT}/include $(INTERP_LB_FLAGS)
|
||||
f90appflags = -O3 -xHost -fp-model fast=2 -fma -ipo \
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstddef>
|
||||
#include <complex>
|
||||
#include <immintrin.h>
|
||||
|
||||
namespace {
|
||||
@@ -117,6 +118,62 @@ inline void rk4_stage3(std::size_t n,
|
||||
|
||||
extern "C" {
|
||||
|
||||
void f_rungekutta4_scalar(double &dT, double &f0, double &f1, double &f_rhs, int &RK4) {
|
||||
constexpr double F1o6 = 1.0 / 6.0;
|
||||
constexpr double HLF = 0.5;
|
||||
constexpr double TWO = 2.0;
|
||||
|
||||
switch (RK4) {
|
||||
case 0:
|
||||
f1 = f0 + HLF * dT * f_rhs;
|
||||
break;
|
||||
case 1:
|
||||
f_rhs = f_rhs + TWO * f1;
|
||||
f1 = f0 + HLF * dT * f1;
|
||||
break;
|
||||
case 2:
|
||||
f_rhs = f_rhs + TWO * f1;
|
||||
f1 = f0 + dT * f1;
|
||||
break;
|
||||
case 3:
|
||||
f1 = f0 + F1o6 * dT * (f1 + f_rhs);
|
||||
break;
|
||||
default:
|
||||
std::fprintf(stderr, "rungekutta4_scalar_c: invalid RK4 stage %d\n", RK4);
|
||||
std::abort();
|
||||
}
|
||||
}
|
||||
|
||||
void rungekutta4_cplxscalar_(double &dT,
|
||||
std::complex<double> &f0,
|
||||
std::complex<double> &f1,
|
||||
std::complex<double> &f_rhs,
|
||||
int &RK4) {
|
||||
constexpr double F1o6 = 1.0 / 6.0;
|
||||
constexpr double HLF = 0.5;
|
||||
constexpr double TWO = 2.0;
|
||||
|
||||
switch (RK4) {
|
||||
case 0:
|
||||
f1 = f0 + HLF * dT * f_rhs;
|
||||
break;
|
||||
case 1:
|
||||
f_rhs = f_rhs + TWO * f1;
|
||||
f1 = f0 + HLF * dT * f1;
|
||||
break;
|
||||
case 2:
|
||||
f_rhs = f_rhs + TWO * f1;
|
||||
f1 = f0 + dT * f1;
|
||||
break;
|
||||
case 3:
|
||||
f1 = f0 + F1o6 * dT * (f1 + f_rhs);
|
||||
break;
|
||||
default:
|
||||
std::fprintf(stderr, "rungekutta4_cplxscalar_c: invalid RK4 stage %d\n", RK4);
|
||||
std::abort();
|
||||
}
|
||||
}
|
||||
|
||||
int f_rungekutta4_rout(int *ex, double &dT,
|
||||
double *f0, double *f1, double *f_rhs,
|
||||
int &RK4) {
|
||||
|
||||
Reference in New Issue
Block a user