MCPcopy Create free account
hub / github.com/AMReX-Codes/amrex / EndParallel

Function EndParallel

Src/Base/AMReX_ParallelDescriptor.cpp:417–454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

415}
416
417void
418EndParallel ()
419{
420 --num_startparallel_called;
421 if (num_startparallel_called == 0) {
422 BL_MPI_REQUIRE( MPI_Type_free(&mpi_type_realvect) );
423 BL_MPI_REQUIRE( MPI_Type_free(&mpi_type_intvect) );
424 BL_MPI_REQUIRE( MPI_Type_free(&mpi_type_indextype) );
425 BL_MPI_REQUIRE( MPI_Type_free(&mpi_type_box) );
426 BL_MPI_REQUIRE( MPI_Type_free(&mpi_type_lull_t) );
427 for (auto *t : m_mpi_types) {
428 BL_MPI_REQUIRE( MPI_Type_free(t) );
429 *t = MPI_DATATYPE_NULL;
430 }
431 for (auto *op : m_mpi_ops) {
432 BL_MPI_REQUIRE( MPI_Op_free(op) );
433 *op = MPI_OP_NULL;
434 }
435 mpi_type_realvect = MPI_DATATYPE_NULL;
436 mpi_type_intvect = MPI_DATATYPE_NULL;
437 mpi_type_indextype = MPI_DATATYPE_NULL;
438 mpi_type_box = MPI_DATATYPE_NULL;
439 mpi_type_lull_t = MPI_DATATYPE_NULL;
440 m_mpi_types.clear();
441 m_mpi_ops.clear();
442 }
443
444 if (!call_mpi_finalize) {
445 BL_MPI_REQUIRE( MPI_Comm_free(&m_comm) );
446 }
447 m_comm = MPI_COMM_NULL;
448
449 ParallelContext::pop();
450
451 if (call_mpi_finalize) {
452 MPI_Finalize();
453 }
454}
455
456double
457second () noexcept

Callers 2

DispatchMethod · 0.85
FinalizeMethod · 0.85

Calls 2

popFunction · 0.85
clearMethod · 0.45

Tested by

no test coverage detected