- 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>
39 lines
740 B
C++
39 lines
740 B
C++
|
|
#ifndef BLOCK_H
|
|
#define BLOCK_H
|
|
|
|
#ifdef MPI_STUB
|
|
#include "mpi_stub.h"
|
|
#else
|
|
#include <mpi.h>
|
|
#endif
|
|
#include "macrodef.h" //need dim here; Vertex or Cell
|
|
#include "var.h"
|
|
#include "MyList.h"
|
|
class Block
|
|
{
|
|
|
|
public:
|
|
int shape[dim];
|
|
double bbox[2 * dim];
|
|
double *X[dim];
|
|
int rank; // where the real data locate in
|
|
int lev, cgpu;
|
|
int ingfs, fngfs;
|
|
int *(*igfs);
|
|
double *(*fgfs);
|
|
|
|
public:
|
|
Block() {};
|
|
Block(int DIM, int *shapei, double *bboxi, int ranki, int ingfsi, int fngfs, int levi, const int cgpui = 0);
|
|
|
|
~Block();
|
|
|
|
void checkBlock();
|
|
|
|
double getdX(int dir);
|
|
void swapList(MyList<var> *VarList1, MyList<var> *VarList2, int myrank);
|
|
};
|
|
|
|
#endif /* BLOCK_H */
|