From 299029e77f27ad4bfd8618d19fdecf70a81b895e Mon Sep 17 00:00:00 2001 From: trunk Date: Mon, 9 Sep 2024 20:06:52 +0200 Subject: [PATCH] Improve doc of parallelism, as well as output in log files --- doc/guide/abinit.md | 1 + doc/topics/_parallelism.md | 5 ++++- doc/tutorial/basepar.md | 2 +- src/44_abitypes_defs/m_dtfil.F90 | 13 +++++++++---- src/51_manage_mpi/m_wffile.F90 | 2 +- src/98_main/abinit.F90 | 3 +++ 6 files changed, 19 insertions(+), 7 deletions(-) diff --git a/doc/guide/abinit.md b/doc/guide/abinit.md index 89230dbe4a..94e64f0f74 100644 --- a/doc/guide/abinit.md +++ b/doc/guide/abinit.md @@ -1231,6 +1231,7 @@ information on such files: * [[prtgeo]] to print a file with a geometrical analysis (bond lengths and bond angles), that also contains an XMOL section * [[prt1dm]] to print a one-dimensional projection of potential and density, for the three axes. + ### 5.9 Control of output in the parallel case For massively parallel runs, one cannot afford to have some of the output diff --git a/doc/topics/_parallelism.md b/doc/topics/_parallelism.md index 2f9c3abcf5..5ce0afd950 100644 --- a/doc/topics/_parallelism.md +++ b/doc/topics/_parallelism.md @@ -21,8 +21,11 @@ export OMP_NUM_THREADS=4 mpirun -n 10 abinit run.abi > log 2> err ``` -In the latter, the standard output of the application is redirected to `log` while `err` collects the standard error. The command *mpirun* might possibly be replaced by *mpiexec* depending on your system. +In the latter, the standard output of the application is redirected to `log` while `err` collects the standard error. +Note that the control of output in the parallel case needs to be adapted, as for massively parallel runs, +one cannot afford to have some of the output files that are usually created, see +the [[help:abinit#control-of-output-in-the-parallel-cas|abinit help file]] for more explanation and how to change the default behavior (_LOG/_NOLOG files). * For ground-state calculations, the code has been parallelized (MPI-based parallelism) on the k-points, the spins, the spinor components, the bands, and the FFT grid and plane wave coefficients. diff --git a/doc/tutorial/basepar.md b/doc/tutorial/basepar.md index 1a7c725127..4bd601313a 100644 --- a/doc/tutorial/basepar.md +++ b/doc/tutorial/basepar.md @@ -213,7 +213,7 @@ to a local temporary disk space named `/scratch/user`, then you might add to the Note that determining ahead of time the precise resources you will need for your run will save you a lot of time if you are using a batch queue system. -Also, for parallel runs, note that the _log_ files **will not** be written exept the main log file. +Also, for parallel runs, note that the _log_ files **will not** be written except the main log file. You can change this behaviour by creating a file named `_LOG` to enforce the creation of all log files ```bash diff --git a/src/44_abitypes_defs/m_dtfil.F90 b/src/44_abitypes_defs/m_dtfil.F90 index d503885cea..744a3e6857 100644 --- a/src/44_abitypes_defs/m_dtfil.F90 +++ b/src/44_abitypes_defs/m_dtfil.F90 @@ -1509,7 +1509,8 @@ end subroutine isfile !! iofn1 !! !! FUNCTION -!! Begin by eventual redefinition of unit std_in and std_out +!! Define values of do_write_log and do_write_status parameters +!! Eventual redefinition of unit std_in and std_out !! Then, print greetings for interactive user. !! Next, read filenames from unit std_in, AND check that new !! output file does not already exist. @@ -1557,10 +1558,10 @@ subroutine iofn1(input_path, filnam, filstat, comm) real(dp),allocatable :: dprarr(:) !************************************************************************* - ! NOTE: In this routine it's very important to perform tests + ! NOTE: In this routine it is very important to perform tests ! on possible IO errors (err=10, iomsg) because we are initializing the IO stuff - ! It there's some problem with the hardware or some misconfiguration, - ! it's very likely that the code will crash here and we should try to give useful error messages. + ! If there is some problem with the hardware or some misconfiguration, + ! it is very likely that the code will crash here and we should try to give useful error messages. blank = ' '; tmpfil = '' @@ -1768,6 +1769,10 @@ subroutine iofn1(input_path, filnam, filstat, comm) if (open_file(fillog,msg,unit=std_out,status='unknown',action="write") /= 0) then ABI_ERROR(msg) end if +! Print greetings for interactive user + write(std_out,*,err=10,iomsg=errmsg)' ABINIT ',trim(abinit_version) + write(std_out,*,err=10,iomsg=errmsg)' ' + write(std_out,*,err=10,iomsg=errmsg)' I am not the master. Writing log in ',fillog else close(std_out, err=10, iomsg=errmsg) if (open_file(NULL_FILE,msg,unit=std_out,action="write") /= 0) then diff --git a/src/51_manage_mpi/m_wffile.F90 b/src/51_manage_mpi/m_wffile.F90 index 4e9c66bf90..e6ca7d4bd5 100644 --- a/src/51_manage_mpi/m_wffile.F90 +++ b/src/51_manage_mpi/m_wffile.F90 @@ -2641,7 +2641,7 @@ subroutine xderiveRead_int2d_displ(wff,xval,n1,n2,spaceComm,displace,ierr) depl_val(ipos)=ipos end do end do -!To save time, the location describe by array map must be in increasing order +!To save time, the location described by array map must be in increasing order nbval=0 do i1=0,totsize-1 if (depl_val(i1)/=-1) then diff --git a/src/98_main/abinit.F90 b/src/98_main/abinit.F90 index 63c260a298..6634d83219 100644 --- a/src/98_main/abinit.F90 +++ b/src/98_main/abinit.F90 @@ -254,6 +254,9 @@ program abinit call wrtout([std_out, ab_out], msg) end if + msg=' abinit : after writing the name of files ' + call wrtout(std_out,msg,'PERS') + ! Test if the netcdf library supports MPI-IO call nctk_test_mpiio()