From cbe5bfc005a72f65a92e89239d469244354d254f Mon Sep 17 00:00:00 2001 From: Frederic Perez Date: Fri, 1 Dec 2023 12:12:50 +0100 Subject: [PATCH 1/5] Probes may be opened even when file is not complete --- happi/_Diagnostics/Probe.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/happi/_Diagnostics/Probe.py b/happi/_Diagnostics/Probe.py index be03c1833..1fd4958eb 100755 --- a/happi/_Diagnostics/Probe.py +++ b/happi/_Diagnostics/Probe.py @@ -53,8 +53,9 @@ def _init(self, requestedProbe=None, field=None, timesteps=None, subset=None, av self._dataForTime = {} for file in self._h5probe: for key, val in file.items(): - try : self._dataForTime[int(key)] = val - except Exception as e: break + if val: + try : self._dataForTime[int(key)] = val + except Exception as e: break self._alltimesteps = self._np.double(sorted(self._dataForTime.keys())) if self._alltimesteps.size == 0: raise Exception("No timesteps found") From 1fbf78b55a123108baa86639692d20299e56e97d Mon Sep 17 00:00:00 2001 From: Francesco Massimo Date: Fri, 1 Dec 2023 21:54:50 +0100 Subject: [PATCH 2/5] add some publications --- doc/Sphinx/Overview/material.rst | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/doc/Sphinx/Overview/material.rst b/doc/Sphinx/Overview/material.rst index 6b048f64c..a2b2263cd 100644 --- a/doc/Sphinx/Overview/material.rst +++ b/doc/Sphinx/Overview/material.rst @@ -47,6 +47,37 @@ As of November 2021, 90 papers have been published covering a broad range of top There is now a utility to add new entries to this list. Use the python script doc/doi2publications.py to generate entries from a DOI number, and paste them here + +.. [Vallieres2023] + + S. Vallières, J. Powell, T. Connell, M. Evans, M. Lytova, F. Fillion-Gourdeau, S. Fourmaux, S. Payeur, P. Lassonde, S. MacLean, and F. Légaré, + `High Dose-Rate MeV Electron Beam from a Tightly-Focused Femtosecond IR Laser in Ambient Air`, + `Laser and Photonics Review 23000782300078 (2023) `_ + +.. [Starodubtseva2023] + + E. Starodubtseva, I. Tsymbalov, D. Gorlova, K. Ivanov, and A. Savel'ev, + `Low energy electron injection for direct laser acceleration`, + `Phys. Plasmas 30, 083105 (2023) `_ + +.. [Maffini2023] + + A. Maffini, F. Mirani, M. Galbiati, K. Ambrogioni, F. Gatti, M. S. G. De Magistris, D. Vavassori, D. Orecchia, D. Dellasega, V. Russo, M. Zavelani-Rossi and M. Passoni, + `Towards compact laser-driven accelerators: exploring the potential of advanced double-layer targets`, + `EPJ Techniques and Instrumentation 10, 15 (2023) `_ + +.. [Guskov2023] + + S. Yu. Gus'kov, Ph. Korneev, and M. Murakami, + `Laser-driven electrodynamic implosion of fast ions in a thin shell`, + `Matter Radiat. Extremes 8, 056602 (2023) `_ + +.. [RezaeiPandari2023] + + M. Rezaei-Pandari, M. Mirzaie, C. I. Hojbota, T. G. Pak, S. B. Kim, G. W. Lee, R. Massudi, A. R. Niknam, S. K. Lee, K.-Y. Kim, and C. H. Nam, + `Laser Wakefield Electron Acceleration with Polarization-Dependent Ionization Injection`, + `Physical Review Applied 20, 034026 (2023) `_ + .. [Jonnerby2023] J. Jonnerby, A. von Boetticher, J. Holloway, L. Corner, A. Picksley, A. J. Ross, R. J. Shalloo , C. Thornton, N. Bourgeois, R. Walczak, and S. M. Hooker, From a4ed01f0663689f1247ae77c7d40a43e552cc94b Mon Sep 17 00:00:00 2001 From: Frederic Perez Date: Tue, 5 Dec 2023 12:02:56 +0100 Subject: [PATCH 3/5] simplify dump_minutes --- src/Checkpoint/Checkpoint.cpp | 48 +++++++++++++---------------------- src/Checkpoint/Checkpoint.h | 15 +---------- 2 files changed, 18 insertions(+), 45 deletions(-) diff --git a/src/Checkpoint/Checkpoint.cpp b/src/Checkpoint/Checkpoint.cpp index 76000b624..1ab5aa605 100755 --- a/src/Checkpoint/Checkpoint.cpp +++ b/src/Checkpoint/Checkpoint.cpp @@ -35,6 +35,7 @@ #include "LaserEnvelope.h" #include "BinaryProcesses.h" #include "CollisionalNuclearReaction.h" +#include using namespace std; @@ -49,11 +50,9 @@ Checkpoint::Checkpoint( Params ¶ms, SmileiMPI *smpi ) : dump_minutes( 0.0 ), exit_after_dump( true ), time_reference( MPI_Wtime() ), - time_dump_step( 0 ), keep_n_dumps( 2 ), keep_n_dumps_max( 10000 ), dump_deflate( 0 ), - dump_request( smpi->getSize() ), file_grouping( 0 ) { @@ -66,7 +65,7 @@ Checkpoint::Checkpoint( Params ¶ms, SmileiMPI *smpi ) : PyTools::extract( "dump_minutes", dump_minutes, "Checkpoints" ); if( dump_minutes > 0 ) { - MESSAGE( 1, "Code will stop after " << dump_minutes << " minutes" ); + MESSAGE( 1, "Code will dump after " << dump_minutes << " minutes" ); } PyTools::extract( "keep_n_dumps", keep_n_dumps, "Checkpoints" ); @@ -186,40 +185,27 @@ Checkpoint::~Checkpoint() {} void Checkpoint::dump( VectorPatch &vecPatches, Region ®ion, unsigned int itime, SmileiMPI *smpi, SimWindow *simWindow, Params ¶ms ) { - - // check for excedeed time - if( dump_minutes != 0.0 ) { - int tagUB = smpi->getTagUB(); + bool dump_now = false; + + // Find out whether we should make a checkpoint due to dump_minutes + if( dump_minutes != 0. ) { // master checks whenever we passed the time limit - if( smpi->isMaster() && time_dump_step==0 ) { - double elapsed_time = ( MPI_Wtime() - time_reference )/60.; - if( elapsed_time > dump_minutes ) { - time_dump_step = itime+1; // we will dump at next timestep (in case non-master already passed) - MESSAGE( "Reached time limit : " << elapsed_time << " minutes. Dump timestep : " << time_dump_step ); - // master does a non-blocking send - for( unsigned int dest=0; dest < ( unsigned int ) smpi->getSize(); dest++ ) { - MPI_Isend( &time_dump_step, 1, MPI_UNSIGNED, dest, tagUB, smpi->world(), &dump_request[dest] ); - } - } - } else { // non master nodes receive the time_dump_step (non-blocking) - int todump=0; - MPI_Iprobe( 0, tagUB, MPI_COMM_WORLD, &todump, &dump_status_prob ); - if( todump ) { - MPI_Recv( &time_dump_step, 1, MPI_UNSIGNED, 0, tagUB, smpi->world(), &dump_status_recv ); - } + if( smpi->isMaster() && MPI_Wtime() - time_reference > dump_minutes * 60. ) { + dump_now = true; } - smpi->barrier(); + // Broadcast the result + MPI_Bcast( &dump_now, 1, MPI_CXX_BOOL, 0, smpi->world() ); } - - if( signal_received!=0 || - ( dump_step != 0 && ( ( itime-this_run_start_step ) % dump_step == 0 ) ) || - ( time_dump_step!=0 && itime==time_dump_step ) ) { + + // Dump if at requested timestep + dump_now = dump_now || ( dump_step != 0 && ( ( itime-this_run_start_step ) % dump_step == 0 ) ); + + if( signal_received != 0 || dump_now ) { dumpAll( vecPatches, region, itime, smpi, simWindow, params ); if( exit_after_dump || ( ( signal_received!=0 ) && ( signal_received != SIGUSR2 ) ) ) { - exit_asap=true; + exit_asap = true; } - signal_received=0; - time_dump_step=0; + signal_received = 0; time_reference = MPI_Wtime(); } } diff --git a/src/Checkpoint/Checkpoint.h b/src/Checkpoint/Checkpoint.h index 7dec58d26..7bcd784a1 100755 --- a/src/Checkpoint/Checkpoint.h +++ b/src/Checkpoint/Checkpoint.h @@ -63,9 +63,6 @@ class Checkpoint //! incremental number of times we've done a dump unsigned int dump_number; - //! incremental number of times we've done a dump_minutes - unsigned int dump_minutes_times; - //! this static variable is defined (in the .cpp) as false but becomes true when //! the signal SIGUSR1 is captured by the signal_callback_handler fnction static int signal_received; @@ -113,19 +110,13 @@ class Checkpoint void dumpMovingWindow( H5Write &f, SimWindow *simWindow ); void restartMovingWindow( H5Read &f, SimWindow *simWindow ); - //! function that returns elapsed time from creator (uses private var time_reference) - //double time_seconds(); - //! to dump and stop a simulation you might just check if a file named stop has been created this variable //! is true if since last time a file named stop appeared bool stop_file_seen_since_last_check; - //! time of the constructor + //! Last dump time double time_reference; - //! step at which perform a dump in case time_dump returns true - unsigned int time_dump_step; - //! keep the last keep_n_dumps dump files unsigned int keep_n_dumps; const unsigned int keep_n_dumps_max; @@ -136,10 +127,6 @@ class Checkpoint //! int deflate dump value int dump_deflate; - std::vector dump_request; - MPI_Status dump_status_prob; - MPI_Status dump_status_recv; - //! group checkpoint files in subdirs of file_grouping files unsigned int file_grouping; From 9f21b5a3a3fba5ed01295af016325a09d13c986a Mon Sep 17 00:00:00 2001 From: Francesco Massimo Date: Wed, 6 Dec 2023 11:27:00 +0100 Subject: [PATCH 4/5] add publications --- doc/Sphinx/Overview/material.rst | 44 ++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/doc/Sphinx/Overview/material.rst b/doc/Sphinx/Overview/material.rst index a2b2263cd..aa7c9f06f 100644 --- a/doc/Sphinx/Overview/material.rst +++ b/doc/Sphinx/Overview/material.rst @@ -48,6 +48,18 @@ As of November 2021, 90 papers have been published covering a broad range of top Use the python script doc/doi2publications.py to generate entries from a DOI number, and paste them here +.. [Guo2023] + + A. Guo, Q. Lu, S. Lu, S. Wang and R. Wang, + `Properties of Electron-scale Magnetic Reconnection at a Quasi-perpendicular Shock`, + `The Astrophysical Journal 955, 1 (2023) `_ + +.. [Si2023] + + M. Si, Y. Huang, M. Ruan, B. Shen, Z. Xu, T. Yu, X. Wang and Y. Chen, + `Relativistic-guided stable mode of few-cycle 20 micron level infrared radiation`, + `Optics Express 31, 24, 40202-40209 (2023) `_ + .. [Vallieres2023] S. Vallières, J. Powell, T. Connell, M. Evans, M. Lytova, F. Fillion-Gourdeau, S. Fourmaux, S. Payeur, P. Lassonde, S. MacLean, and F. Légaré, @@ -204,6 +216,25 @@ As of November 2021, 90 papers have been published covering a broad range of top `Electron acceleration by laser plasma wedge interaction`, `Phys. Rev. Research 5, 013115 (2023) `_ +.. [Bukharskii2022] + + N. Bukharskii, Iu. Kochetkov and Ph. Korneev, + `Terahertz annular antenna driven with a short intense laser pulse`, + `Applied Physics Letters 120, 014102 (2022) `_ + + +.. [Jirka2022] + + M. Jirka, P. Sasorov and S. V. Bulanov, + `New and old physics in the interaction of a radiating electron with the extreme electromagnetic field`, + `Physical Review D 105, 113004 (2022) `_ + +.. [Geng2022] + + X. Geng, L. Ji and B. Shen, + `Quasimonochromatic Bright Gamma-ray Generation from Synchronized Compton Scattering via Azimuthal Spatial-Temporal Coupling`, + `Physical Review Applied 17, 024055 (2022) `_ + .. [Yan2022] X. Yan, Y. Wu, X. Geng, H. Zhang, B. Shen and L. Ji, @@ -337,8 +368,6 @@ As of November 2021, 90 papers have been published covering a broad range of top `Stimulated-Raman-scattering amplification of attosecond XUV pulses with pulse-train pumps and application to local in-depth plasma-density measurement`, `Phys. Rev. E 106, 045208 (2022) `_ - - .. [Krafft2022b] C. Krafft and P. Savoini, @@ -400,7 +429,18 @@ As of November 2021, 90 papers have been published covering a broad range of top `In International Conference on High Performance Computing in Asia-Pacific Region Workshops (HPCAsia 2022 Workshop). Association for Computing Machinery, New York, NY, USA, 40–48. (2022) `_ +.. [Tiwary2021] + S. Tiwary and N. Kumar, + `Particle jets in colliding two ultraintense laser pulses of varying frequencies`, + `Physical Review Research 3, 043190 (2021) `_ + +.. [Spiers2021] + + B. T. Spiers, R. Aboushelbaya, Q. Feng, M. W. Mayr, I. Ouatu, R. W. Paddock, R. Timmis, R. H.-W. Wang and P. A. Norreys, + `Methods for extremely sparse-angle proton tomography`, + `Physical Review E 104, 045201 (2021) `_ + .. [Tomassini2021] Paolo Tomassini, Francesco Massimo, Luca Labate and Leonida A. Gizzi, From 02a7520d5168f89e013a095f85f325507520254b Mon Sep 17 00:00:00 2001 From: Frederic Perez Date: Wed, 6 Dec 2023 14:32:43 +0100 Subject: [PATCH 5/5] dump_minutes --- doc/Sphinx/Overview/releases.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/Sphinx/Overview/releases.rst b/doc/Sphinx/Overview/releases.rst index 2bd1c6503..98e30cde6 100755 --- a/doc/Sphinx/Overview/releases.rst +++ b/doc/Sphinx/Overview/releases.rst @@ -29,6 +29,10 @@ Changes made in the repository (not released) * Changed coordinate reference for 2D probe in 3D or AM geometry (zero is the box origin projected orthogonally on the probe plane). +* Bug fixes: + + * ``dump_minutes`` often failed to write some checkpoint files. + ---- Projects