Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mpi nightly build trials #917

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyphare/pyphare/pharein/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ def check_diag_options(**kwargs):
diag_options["options"]["dir"], "diagnostics"
)
valid_modes = ["overwrite"]
if "mode" in diag_options["options"]:
if "options" in diag_options and "mode" in diag_options["options"]:
mode = diag_options["options"]["mode"]
if mode not in valid_modes:
raise ValueError(
Expand Down
7 changes: 4 additions & 3 deletions tests/functional/harris/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ if(NOT ${PHARE_PROJECT_DIR} STREQUAL ${CMAKE_BINARY_DIR})
endif()

if(HighFive AND testMPI)

## These test use dump diagnostics so require HighFive!
# exec level 11
# mpirun -n 10

if(testMPI)
phare_mpi_python3_exec(11 10 harris_2d harris_2d.py ${CMAKE_CURRENT_BINARY_DIR})
phare_mpi_python3_exec(11 10 harris_2d harris_2d_lb.py ${CMAKE_CURRENT_BINARY_DIR})
endif(testMPI)

endif()
9 changes: 0 additions & 9 deletions tests/functional/harris/harris_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@

def config():
sim = ph.Simulation(
smallest_patch_size=15,
largest_patch_size=25,
time_step_nbr=time_step_nbr,
time_step=time_step,
# boundary_types="periodic",
Expand Down Expand Up @@ -155,13 +153,6 @@ def vthz(x, y):

def main():
Simulator(config()).run()
try:
from tools.python3 import plotting as m_plotting

m_plotting.plot_run_timer_data(diag_outputs, cpp.mpi_rank())
except ImportError:
print("Phlop not found - install with: `pip install phlop`")
cpp.mpi_barrier()


if __name__ == "__main__":
Expand Down
15 changes: 12 additions & 3 deletions tests/functional/harris/harris_2d_lb.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
from pyphare.pharesee.run import Run
from pyphare.simulator.simulator import Simulator, startMPI


from tests.simulator import SimulatorTest
from tools.python3 import plotting as m_plotting

mpl.use("Agg")

SCOPE_TIMING = os.getenv("PHARE_SCOPE_TIMING", "True").lower() in ("true", "1", "t")
SCOPE_TIMING = os.getenv("PHARE_SCOPE_TIMING", "False").lower() in ("true", "1", "t")
LOAD_BALANCE = os.getenv("LOAD_BALANCE", "True").lower() in ("true", "1", "t")

cpp = cpp_lib()
Expand Down Expand Up @@ -184,6 +184,15 @@ def plot(diag_dir):
)


def plot_runtimer(diag_dir, rank):
try:
from tools.python3 import plotting as m_plotting

m_plotting.plot_run_timer_data(diag_dir, cpp.mpi_rank())
except ImportError:
print("phlop not found - or phare src dir not in pythonpath")


class HarrisTest(SimulatorTest):
def __init__(self, *args, **kwargs):
super(HarrisTest, self).__init__(*args, **kwargs)
Expand All @@ -202,7 +211,7 @@ def test_run(self):
if cpp.mpi_rank() == 0:
plot(diag_dir)
if SCOPE_TIMING:
m_plotting.plot_run_timer_data(diag_dir, cpp.mpi_rank())
plot_runtimer(diag_dir, cpp.mpi_rank())
cpp.mpi_barrier()
return self

Expand Down
7 changes: 5 additions & 2 deletions tests/simulator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ if(HighFive)

# doesn't make sense in serial
phare_mpi_python3_exec(9 3 load_balancing test_load_balancing.py ${CMAKE_CURRENT_BINARY_DIR})
endif(testMPI)

phare_python3_exec(11, test_diagnostic_timestamps test_diagnostic_timestamps.py ${CMAKE_CURRENT_BINARY_DIR})
else()
phare_python3_exec(11 test_diagnostic_timestamps test_diagnostic_timestamps.py ${CMAKE_CURRENT_BINARY_DIR})

endif(testMPI)

endif()

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.py ${CMAKE_CURRENT_BINARY_DIR}/config.py @ONLY)
Expand Down
9 changes: 7 additions & 2 deletions tests/simulator/refinement/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ endif()
if(HighFive)
## These test use dump diagnostics so require HighFive!
if(testMPI)
phare_mpi_python3_exec(9 2 simple_2d_refinement test_2d_2_core.py ${CMAKE_CURRENT_BINARY_DIR})
phare_mpi_python3_exec(11 10 complex_2d_refinement test_2d_10_core.py ${CMAKE_CURRENT_BINARY_DIR})

# disabled due to https://github.com/PHAREHUB/PHARE/issues/853
# phare_mpi_python3_exec(11 10 complex_2d_refinement test_2d_10_core.py ${CMAKE_CURRENT_BINARY_DIR})

endif(testMPI)

phare_python3_exec(9 simple_2d_refinement test_2d_2_core.py ${CMAKE_CURRENT_BINARY_DIR})

endif()
Loading