42 static bool executed =
false;
51 int required = MPI_THREAD_FUNNELED;
53 nrn_assert(MPI_Init_thread(pargc, pargv, required, &provided) == MPI_SUCCESS);
57 nrn_assert(MPI_Init(pargc, pargv) == MPI_SUCCESS);
98 static int change_cnt{0};
99 int nrn_subworld_change_cnt, nrn_subworld_index, nrn_subworld_rank, nrn_mpi_numprocs_subworld,
100 nrn_mpi_numprocs_world;
104 (*nrn2core_subworld_info_)(nrn_subworld_change_cnt,
107 nrn_mpi_numprocs_subworld,
108 nrn_mpi_numprocs_world);
109 if (nrn_subworld_change_cnt == change_cnt) {
112 change_cnt = nrn_subworld_change_cnt;
120 nrn_assert(world_size == nrn_mpi_numprocs_world);
128 int subworld_rank{-1};
130 nrn_assert(nrn_subworld_rank == subworld_rank);
132 int subworld_size{-1};
134 nrn_assert(subworld_size == nrn_mpi_numprocs_subworld);
141 MPI_Query_thread(&th);
142 if (th < MPI_THREAD_FUNNELED) {
144 "\n Current MPI library doesn't support MPI_THREAD_FUNNELED,\
145 \n Run without enabling multi-threading!");
151 MPI_Initialized(&flag);
156 MPI_Abort(MPI_COMM_WORLD, errcode);
175 MPI_COMM_WORLD, MPI_COMM_TYPE_SHARED,
nrnmpi_myid_, MPI_INFO_NULL, &local_comm);
176 MPI_Comm_rank(local_comm, &local_rank);
177 MPI_Comm_free(&local_comm);
193 MPI_COMM_WORLD, MPI_COMM_TYPE_SHARED,
nrnmpi_myid_, MPI_INFO_NULL, &local_comm);
194 MPI_Comm_size(local_comm, &local_size);
195 MPI_Comm_free(&local_comm);
218 unsigned long offset = 0;
219 MPI_Exscan(&length, &offset, 1, MPI_UNSIGNED_LONG, MPI_SUM,
nrnmpi_comm);
221 int op_status = MPI_File_open(
222 nrnmpi_comm, filename.c_str(), MPI_MODE_CREATE | MPI_MODE_WRONLY, MPI_INFO_NULL, &fh);
224 std::cerr <<
"Error while opening output file " << filename << std::endl;
228 op_status = MPI_File_write_at_all(fh, offset, buffer, length, MPI_BYTE, &
status);
230 std::cerr <<
"Error while writing output " << std::endl;
THIS FILE IS AUTO GENERATED DONT MODIFY IT.
nrnmpi_init_ret_t nrnmpi_init_impl(int *pargc, char ***pargv, bool is_quiet)
MPI_Comm nrnmpi_world_comm
static bool nrnmpi_under_nrncontrol_
void nrnmpi_finalize_impl(void)
void(* nrn2core_subworld_info_)(int &, int &, int &, int &, int &)
void nrnmpi_abort_impl(int errcode)
void nrnmpi_write_file_impl(const std::string &filename, const char *buffer, size_t length)
Write given buffer to a new file using MPI collective I/O.
void nrnmpi_spike_initialize()
static void nrn_fatal_error(const char *msg)
double nrnmpi_wtime_impl()
int nrnmpi_local_size_impl()
Return number of ranks running on single shared memory node.
int nrnmpi_local_rank_impl()
Return local mpi rank within a shared memory node.
bool nrnmpi_initialized_impl()
void nrnmpi_check_threading_support_impl()
#define nrn_assert(x)
assert()-like macro, independent of NDEBUG status