aboutsummaryrefslogtreecommitdiff
path: root/Source/Python/WarpXWrappers.h
diff options
context:
space:
mode:
authorGravatar KZhu-ME <86268612+KZhu-ME@users.noreply.github.com> 2021-07-09 20:13:56 -0700
committerGravatar GitHub <noreply@github.com> 2021-07-09 20:13:56 -0700
commitf462adc324cf466b60d62bc8c06c035221b75861 (patch)
tree3b100b97e40559ee9d809698e7a348b1c033220c /Source/Python/WarpXWrappers.h
parentb28004a648e5b729f8ef52c89d8df7a9423e368c (diff)
downloadWarpX-f462adc324cf466b60d62bc8c06c035221b75861.tar.gz
WarpX-f462adc324cf466b60d62bc8c06c035221b75861.tar.zst
WarpX-f462adc324cf466b60d62bc8c06c035221b75861.zip
Feature pass MPI comm from Python script to AMReX during initialization (#2034)
* Added functionality to pass mpi comm from python script to amrex during initialization * Fixed missing _ in MPI._sizeof() * Added functions to get the current processor's rank and total number of processors * Renamed MPI_Comm to _MPI_Comm_type and defined _MPI_Comm_type in except statement * Updated comment to explain why mpi4py needs to be imported before loading libwarpx * Removed ifdef flags that prevent amrex_init_with_inited_mpi from being declared when MPI is off * Changed amrex_init_with_inited_mpi to be declared even when not using mpi, but will be defined to be functionally the same as amrex_init * Defined MPI = None to signify whether MPI is used, to add another check when initializing amrex * Changed ifdef blocks in WarpXWrappers.cpp/h to fix compile errors. Added ifdef block to conditionally declare amrex_init_with_inited_mpi in WarpXWrappers.h to prevent compile error when not using MPI. Removed ifdef block to declare/define same function in WarpXWrappers.cpp since function needs to be declared even when MPI is not used, but will never be called in that case. * Changed BL_USE_MPI to AMREX_USE_MPI and removed incorrect MPI=None statement * Changed BL_USE_MPI to AMREX_USE_MPI * Added test to verify correct passing of MPI communicator to amrex * Added ability to pass mpi_comm to sim.step * Change test to check for differeing outputs when passed different inputs * Removed obsolete comments refactored program to use more shared code * Refactored comments * Updated description to match test * Removed unecessary imports and updated comments
Diffstat (limited to '')
-rw-r--r--Source/Python/WarpXWrappers.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/Python/WarpXWrappers.h b/Source/Python/WarpXWrappers.h
index a720f0f59..30fa81968 100644
--- a/Source/Python/WarpXWrappers.h
+++ b/Source/Python/WarpXWrappers.h
@@ -11,7 +11,7 @@
#include <AMReX_Config.H>
#include <AMReX_REAL.H>
-#ifdef BL_USE_MPI
+#ifdef AMREX_USE_MPI
# include <mpi.h>
#endif
@@ -34,7 +34,7 @@ extern "C" {
void amrex_init (int argc, char* argv[]);
-#ifdef BL_USE_MPI
+#ifdef AMREX_USE_MPI
void amrex_init_with_inited_mpi (int argc, char* argv[], MPI_Comm mpicomm);
#endif
@@ -113,6 +113,10 @@ extern "C" {
int warpx_finestLevel ();
+ int warpx_getMyProc ();
+ int warpx_getNProcs ();
+
+
void mypc_Redistribute ();
#ifdef __cplusplus