- 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>
43 lines
729 B
C
43 lines
729 B
C
|
|
#include <iostream>
|
|
#include <iomanip>
|
|
#include <fstream>
|
|
#include <cstdlib>
|
|
#include <cstdio>
|
|
#include <string>
|
|
#include <cmath>
|
|
using namespace std;
|
|
|
|
#include <time.h>
|
|
#ifdef MPI_STUB
|
|
#include "mpi_stub.h"
|
|
#else
|
|
#include <mpi.h>
|
|
#endif
|
|
|
|
#include "var.h"
|
|
|
|
var::var(const char *namei, int sgfni,
|
|
const double SYM1, const double SYM2, const double SYM3) : sgfn(sgfni)
|
|
{
|
|
const char *p = namei;
|
|
int i = 0;
|
|
while (*(p++))
|
|
i++;
|
|
if (i > 20)
|
|
cout << "too long name for var: " << namei << endl;
|
|
sprintf(name, namei);
|
|
SoA[0] = SYM1;
|
|
SoA[1] = SYM2;
|
|
SoA[2] = SYM3;
|
|
|
|
propspeed = 1;
|
|
}
|
|
|
|
var::~var() {}
|
|
|
|
void var::setpropspeed(const double vl)
|
|
{
|
|
propspeed = vl;
|
|
}
|