Files
AMSS-NCKU/AMSS_NCKU_source/scalar_class.h
CGH0S7 caf192b2e4 Remove MPI dependency, replace with single-process stub for non-MPI builds
- 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>
2026-02-10 22:51:11 +08:00

80 lines
1.8 KiB
C++

#ifndef SCALAR_CLASS_H
#define SCALAR_CLASS_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
#include "cgh.h"
#include "ShellPatch.h"
#include "misc.h"
#include "var.h"
#include "MyList.h"
#include "monitor.h"
class scalar_class
{
protected:
int myrank;
cgh *GH;
ShellPatch *SH;
double PhysTime;
int checkrun;
char checkfilename[50];
int Steps;
double StartTime, TotalTime;
double AnasTime, DumpTime, CheckTime;
double LastAnas;
double Courant;
double numepss, numepsb;
int Symmetry;
int trfls, a_lev;
double dT;
var *Sphio, *Spio;
var *Sphi0, *Spi0;
var *Sphi, *Spi;
var *Sphi1, *Spi1;
var *Sphi_rhs, *Spi_rhs;
MyList<var> *StateList, *SynchList_pre, *SynchList_cor, *RHSList;
MyList<var> *OldStateList, *DumpList, *CheckList;
monitor *ErrorMonitor;
public:
scalar_class(double Couranti, double StartTimei, double TotalTimei, double DumpTimei, double CheckTimei, double AnasTimei,
int Symmetryi, int checkruni, char *checkfilenamei, double numepssi, double numepsbi,
int a_levi);
~scalar_class();
void Setup_Initial_Data();
void Evolve(int Steps);
void RecursiveStep(int lev);
void Step(int lev, int YN);
void RestrictProlong(int lev, int YN, bool BB);
void ProlongRestrict(int lev, int YN, bool BB);
};
#endif /* SCALAR_CLASS_H */