- 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>
50 lines
879 B
C++
50 lines
879 B
C++
|
|
#ifndef MONITOR_H
|
|
#define MONITOR_H
|
|
|
|
#ifdef newc
|
|
#include <iostream>
|
|
#include <iomanip>
|
|
#include <strstream>
|
|
#include <fstream>
|
|
#include <string>
|
|
#include <cstdlib>
|
|
#include <cstdio>
|
|
using namespace std;
|
|
#else
|
|
#include <iostream.h>
|
|
#include <iomanip.h>
|
|
#include <strstream>
|
|
#include <fstream.h>
|
|
#include <string.h>
|
|
#endif
|
|
#include <time.h>
|
|
|
|
#ifdef MPI_STUB
|
|
#include "mpi_stub.h"
|
|
#else
|
|
#include <mpi.h>
|
|
#endif
|
|
|
|
class monitor
|
|
{
|
|
|
|
public:
|
|
string out_dir;
|
|
ofstream outfile;
|
|
|
|
bool I_Print;
|
|
|
|
public:
|
|
monitor(const char fname[], int myrank, string head);
|
|
monitor(const char fname[], int myrank, const int out_rank, string head);
|
|
|
|
~monitor();
|
|
|
|
void writefile(double time, int NN, double *DDAT);
|
|
void writefile(double time, int NN, double *DDAT1, double *DDAT2);
|
|
void print_message(string head);
|
|
};
|
|
|
|
#endif /* MONITOR */
|