- Add mpi_stub.h providing all MPI types/constants/functions as no-ops (nprocs=1, myrank=0) with memcpy-based Allreduce and clock_gettime Wtime - Replace #include <mpi.h> with conditional #ifdef MPI_STUB in 31 files (19 headers + 12 source files) preserving ability to build with real MPI - Change makefile.inc: CLINKER mpiicpx->icpx, add -DMPI_STUB to CXXAPPFLAGS - Update makefile_and_run.py: run ./ABE directly instead of mpirun -np N - Set MPI_processes=1 in AMSS_NCKU_Input.py Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
58 lines
1.3 KiB
C++
58 lines
1.3 KiB
C++
|
|
#ifndef Ansorg_H
|
|
#define Ansorg_H
|
|
|
|
#ifdef newc
|
|
#include <iostream>
|
|
#include <iomanip>
|
|
#include <fstream>
|
|
#include <cstdlib>
|
|
#include <string>
|
|
#include <cmath>
|
|
using namespace std;
|
|
#else
|
|
#include <iostream.h>
|
|
#include <iomanip.h>
|
|
#include <fstream.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <math.h>
|
|
#endif
|
|
|
|
#ifdef MPI_STUB
|
|
#include "mpi_stub.h"
|
|
#else
|
|
#include <mpi.h>
|
|
#endif
|
|
|
|
#define PI M_PI
|
|
|
|
class Ansorg
|
|
{
|
|
protected:
|
|
int n1, n2, n3, ntotal;
|
|
int order;
|
|
double *coordA, *coordB, *coordphi;
|
|
int ps_rxx, ps_rxy, ps_ryx, ps_ryy;
|
|
double ps_b, ps_dx;
|
|
double PIh;
|
|
double *pu_ps;
|
|
int myrank;
|
|
|
|
public:
|
|
Ansorg(char *filename, int orderi);
|
|
~Ansorg();
|
|
double ps_u_at_xyz(double x, double y, double z);
|
|
void set_ABp();
|
|
void xyz_to_ABp(double x, double y, double z,
|
|
double *A, double *B, double *phi);
|
|
double interpolate_tri_bar(double x, double y, double z,
|
|
int n1, int n2, int n3,
|
|
double *x1, double *x2, double *x3, double *yp);
|
|
int find_point_bisection(double x, int n, double *xp, int o);
|
|
void barycentric_omega(int n, int s, double *x, double *omega);
|
|
double barycentric(double x0, int n, int s, double *x, double *y,
|
|
double *omega);
|
|
};
|
|
#endif /* Ansorg_H */
|