- 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>
65 lines
1.6 KiB
C++
65 lines
1.6 KiB
C++
|
|
#ifndef CHECKPOINT_H
|
|
#define CHECKPOINT_H
|
|
|
|
#ifdef newc
|
|
#include <iostream>
|
|
#include <iomanip>
|
|
#include <strstream>
|
|
#include <fstream>
|
|
#include <string>
|
|
using namespace std;
|
|
#else
|
|
#include <iostream.h>
|
|
#include <iomanip.h>
|
|
#include <strstream>
|
|
#include <fstream.h>
|
|
#include <string.h>
|
|
#endif
|
|
#include <time.h>
|
|
#include <stdlib.h>
|
|
|
|
#ifdef MPI_STUB
|
|
#include "mpi_stub.h"
|
|
#else
|
|
#include <mpi.h>
|
|
#endif
|
|
|
|
#include "var.h"
|
|
#include "MyList.h"
|
|
#include "cgh.h"
|
|
#include "macrodef.h"
|
|
#include "ShellPatch.h"
|
|
|
|
class checkpoint
|
|
{
|
|
|
|
public:
|
|
bool checkedrun;
|
|
bool I_Print;
|
|
char *filename;
|
|
MyList<var> *CheckList;
|
|
string out_dir;
|
|
|
|
public:
|
|
checkpoint(bool checked, const char fname[], int myrank);
|
|
// checkpoint(bool checked, char fname[50], int myrank);
|
|
|
|
~checkpoint();
|
|
void addvariable(var *VV);
|
|
void addvariablelist(MyList<var> *VL);
|
|
|
|
void write_Black_Hole_position(int BH_num_input, int BH_num, double **Porg0, double **Porgbr, double *Mass);
|
|
void read_Black_Hole_position(int &BH_num_input, int &BH_num, double **&Porg0, double *&Pmom,
|
|
double *&Spin, double *&Mass, double **&Porgbr, double **&Porg,
|
|
double **&Porg1, double **&Porg_rhs);
|
|
void writecheck_cgh(double time, cgh *GH);
|
|
void readcheck_cgh(double &time, cgh *GH, int myrank, int nprocs, int Symmetry);
|
|
void writecheck_sh(double time, ShellPatch *SH);
|
|
void readcheck_sh(ShellPatch *SH, int myrank);
|
|
void write_bssn(double LastDump, double Last2dDump, double LastAnas);
|
|
void read_bssn(double &LastDump, double &Last2dDump, double &LastAnas);
|
|
};
|
|
|
|
#endif /* CHECKPOINT */
|