Skip to content

Commit 260d714

Browse files
authored
Merge pull request #194 from geodynamics/mergemaster
Sync changes from master to developer
2 parents a63d798 + 0c60d5d commit 260d714

File tree

9 files changed

+44
-31
lines changed

9 files changed

+44
-31
lines changed

configs/make.lassen

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# # Modules loaded
2+
# 1) StdEnv (S) 2) cuda/11.7.0 3) fftw/3.3.9 4) xl/2022.08.19 5) spectrum-mpi/rolling-release 6) lapack/3.8.0-gcc-4.9.3
3+
#
4+
etree=no
5+
SW4ROOT=/usr/apps/wpp
6+
FC=mpifort
7+
CXX=mpicxx
8+
#EXTRA_LINK_FLAGS = -L/usr/tce/packages/xl/xl-2019.02.07/xlf/16.1.1/lib -L/usr/tcetmp/packages/lapack/lapack-3.8.0-gcc-4.9.3/lib -llapack -lblas -lxlfmath -lxlf90 -lgfortran
9+
EXTRA_LINK_FLAGS = -L/usr/tce/packages/xl/xl-2022.08.19/xlf/16.1.1/lib -L$(LAPACK_DIR) -llapack -lblas -lxlfmath -lxlf90 -lgfortran

doc/SW4-Installation.pdf

-55 Bytes
Binary file not shown.

doc/SW4-Installation.tex

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ \subsubsection{How do I setup the {\tt make.inc} file?}
341341
the C++ compiler, Fortran compiler, or linker, on your system.
342342

343343
\subsection{Building \emph{SW4} with PROJ, HDF5, and ZFP support}
344-
The PROJ libraray enables the more advanced geographical mapping keywords in the {\tt grid} command and is also required by the {\tt rfile, sfile} and {\tt gmg} commands. To enable the {\tt sfile}, {\tt ssioutput}, and {\tt gmg} commands, you have to also install the {\tt HDF5} library. To use ZFP compression for the {\tt ssioutput} command, {\tt ZFP} and {\tt H5Z-ZFP} are required. See Section \ref{sec:proj} for installing these libraries.
344+
The PROJ library enables the more advanced geographical mapping keywords in the {\tt grid} command and is also required by the {\tt rfile, sfile} and {\tt gmg} commands. To enable the {\tt sfile}, {\tt ssioutput}, and {\tt gmg} commands, you have to also install the {\tt HDF5} library. To use ZFP compression for the {\tt ssioutput} command, {\tt ZFP} and {\tt H5Z-ZFP} are required. See Section \ref{sec:proj} for installing these libraries.
345345

346346
Once you have successfully installed the PROJ, and optionally the HDF5 and ZFP libraries, it should be easy to re-configure \emph{SW4} to use them. Simply edit your configuration file (\verb+make.inc+) by adding the following lines to the top of the file, setting the {\tt proj}, {\tt hdf5}, and {\tt zfp} keywords to
347347
{\tt yes} or {\tt no}, as appropriate.
@@ -366,7 +366,7 @@ \subsection{Building \emph{SW4} with PROJ, HDF5, and ZFP support}
366366
\verb+debug+ directories.
367367

368368
\subsection{Testing the \emph{SW4} installation}
369-
The \emph{SW4} source code distribution includes a python(3) script for running several tests and
369+
The \emph{SW4} source code distribution includes a Python (3) script for running several tests and
370370
checking the solutions against previously verified results. Note that the same set of tests can be
371371
performed when \emph{SW4} is built with CMake, see Section~\ref{cha:ctest-sw4}.
372372

@@ -438,7 +438,7 @@ \section{Installing \emph{SW4} with CMake}\label{cha:installing-cmake-sw4}
438438
The two dots after {\tt cmake [options]} are essential and instructs it to look in the parent
439439
directory for the {\tt CMakeLists.txt} file.
440440

441-
The \verb+cmake+ command searches for the necessary libraries and other dependencies, then creates
441+
The \verb+cmake+ command searches for the necessary libraries and other dependencies then creates
442442
makefiles that are appropriate for your system. You then run \verb+make+ to compiles and link
443443
\emph{SW4} using these makefiles. For details about the exact commands being used in compilation,
444444
run \texttt{make VERBOSE=1}. Once SW4 has been successfully built, you will see the
@@ -534,15 +534,15 @@ \subsection{CMake Options}
534534

535535
Sometimes CMake doesn't pick up the correct compiler. Say, for example that the C++ compiler on your
536536
system is called {\tt mpicxx} and the Fortran compiler is {\tt mpiifort}. You can tell {\tt cmake}
537-
to use those compilers by setting the following envoronment variables {\em before} running cmake
537+
to use those compilers by setting the following environment variables {\em before} running cmake
538538
(assuming a {\tt csh} shell),
539539
\begin{verbatim}
540540
> setenv CXX mpicxx
541541
> setenv FC mpiifort
542542
\end{verbatim}
543543

544544
\subsection{CTest}\label{cha:ctest-sw4}
545-
The \emph{SW4} CMake configuration includes several test cases that are used to verify the correctness
545+
The \emph{SW4} CMake configuration includes several test cases used to verify the correctness
546546
of the \emph{SW4} installation. Each test consists of two parts. First it runs a case using an input
547547
file in the \verb+pytest+ directory. Secondly, it checks that the results are within
548548
a reasonable error tolerance from previously recorded results.
@@ -563,7 +563,7 @@ \subsection{CTest}\label{cha:ctest-sw4}
563563
Start 24: Check_Result_pointsource/pointsource-sg-1
564564
24/24 Test #24: Check_Result_pointsource/pointsource-sg-1 ... Passed 0.03 sec
565565
566-
100\% tests passed, 0 tests failed out of 24
566+
100% tests passed, 0 tests failed out of 24
567567
568568
Total Test time (real) = 230.91 sec
569569
\end{verbatim}
@@ -626,9 +626,9 @@ \subsection{PROJ}
626626
> cd proj-x.x.x
627627
> mkdir build
628628
> cd build
629-
> cmake -DBUILD_APPS=OFF -DCMAKE_INSTALL_PREFIX=${SW4ROOT}
630-
-DSQLITE3_INCLUDE_DIR=${SW4ROOT}/include
631-
-DSQLITE3_LIBRARY=${SW4ROOT}/lib/libsqlite3.so ..
629+
> cmake -DBUILD_APPS=OFF -DCMAKE_INSTALL_PREFIX=${SW4ROOT} \
630+
-DSQLITE3_INCLUDE_DIR=${SW4ROOT}/include \
631+
-DSQLITE3_LIBRARY=${SW4ROOT}/lib/libsqlite3.so ..
632632
633633
# Note that the two -DSQLITE3 flags are needed if you compiled SQLite yourself.
634634
> make
@@ -643,13 +643,13 @@ \subsection{HDF5}
643643
> cd hdf5-1.xx.x
644644
> mkdir build
645645
> cd build
646-
> cmake -DHDF5_ENABLE_PARALLEL=ON -DCMAKE_INSTALL_PREFIX=${SW4ROOT}
646+
> cmake -DHDF5_ENABLE_PARALLEL=ON -DCMAKE_INSTALL_PREFIX=${SW4ROOT} ..
647647
> make
648648
> make install
649649
\end{verbatim}
650650

651651
\subsection{ZFP and H5Z-ZFP}
652-
We recommend to use use ZFP and H5Z-ZFP's latest stable release version.
652+
We recommend using ZFP and H5Z-ZFP's latest stable release version.
653653

654654
Installing ZFP can be done with the following steps:
655655
\begin{verbatim}

doc/SW4-UsersGuide.tex

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2519,14 +2519,14 @@ \section{Checkpoint and Restart the checkpoint command}\label{sec:checkpoint}
25192519
To use the HDF5 format and optionally with compression:
25202520
\begin{verbatim}
25212521
checkpoint cycleInterval=80000 restartpath=output file=HFCheck \
2522-
hdf5=yes zfp_accuracy=1e-5
2522+
hdf5=yes zfp-accuracy=1e-5
25232523
\end{verbatim}
25242524

25252525
To restart from a previously written checkpoint file, add the \verb+restartfile+ key word and the checkpoint file name to the \verb+checkpoint+ command:
25262526
\begin{verbatim}
25272527
checkpoint cycleInterval=80000 restartpath=output file=HFCheck \
25282528
restartfile=HFCheck.cycle=160000.sw4checkpoint \
2529-
hdf5=yes zfp_accuracy=1e-5
2529+
hdf5=yes zfp-accuracy=1e-5
25302530
\end{verbatim}
25312531

25322532
Note that when using the \verb+checkpoint+ command in combination with the \verb+rec+, \verb+rechdf5+, and \verb+ssioutput+ commands, it is advisable to align their write intervals, such that the latest time-series data are also written at the time writing a checkpoint file. For example, a user may set \verb+writeEvery=1000+ (default) in the \verb+rechdf5+ command, and set \verb+dumpInterval=400+ in the \verb+ssioutput+ command, and set \verb+cycleInterval=40000+, as 40000 is divisible by both 1000 and 4000.
@@ -4214,7 +4214,7 @@ \subsection{ssioutput [optional]}
42144214
The option {\bf file=...} has the
42154215
same meaning as the corresponding parameters in the image command.
42164216
The \verb+ssioutput+ command produces files with extension \verb+.ssi+.
4217-
To reduce the output size, we have enabled the support to utilize ZFP \url{https://github.com/LLNL/zfp} and SZ \url{https://github.com/szcompressor/SZ} lossy compression. They can reduce the output size without significant precision loss. We found setting \verb+zfp_accuracy=0.01+ can reduce the output size by a factor of 40. Note ZFP and H5Z-ZFP must be installed and linked with SW4 to use this option, see the Installation Guide for detailed installation instructions.
4217+
To reduce the output size, we have enabled the support to utilize ZFP \url{https://github.com/LLNL/zfp} and SZ \url{https://github.com/szcompressor/SZ} lossy compression. They can reduce the output size without significant precision loss. We found setting \verb+zfp-accuracy=0.01+ can reduce the output size by a factor of 40. Note ZFP and H5Z-ZFP must be installed and linked with SW4 to use this option, see the Installation Guide for detailed installation instructions.
42184218

42194219

42204220
The option {\bf dumpInterval=...} affects the maximum
@@ -4251,10 +4251,10 @@ \subsection{ssioutput [optional]}
42514251
ymin & starting $y$ location of requested SSI region & real & m & 0 \\ \hline
42524252
ymax & ending $y$ location of requested SSI region & real & m & $y_{max}$ \\ \hline
42534253
depth & approx depth of output over requested SSI region & real & m & 0 \\ \hline
4254-
zfp\_accuracy & use ZFP lossy compression accuracy mode & float & none & N/A \\ \hline
4255-
zfp\_precision & use ZFP lossy compression precision mode & float &none & N/A \\ \hline
4256-
zfp\_rate & use ZFP lossy compression rate mode & float &none & N/A \\ \hline
4257-
zfp\_reversible & use ZFP lossless compression mode & int & none & 0 \\ \hline
4254+
zfp-accuracy & use ZFP lossy compression accuracy mode & float & none & N/A \\ \hline
4255+
zfp-precision & use ZFP lossy compression precision mode & float &none & N/A \\ \hline
4256+
zfp-rate & use ZFP lossy compression rate mode & float &none & N/A \\ \hline
4257+
zfp-reversible & use ZFP lossless compression mode & int & none & 0 \\ \hline
42584258

42594259
\end{tabular}
42604260
\end{center}
@@ -4326,9 +4326,9 @@ \subsection{checkpoint [optional]}
43264326
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
43274327
\begin{flushleft}
43284328
\bf Syntax:\\ \tt
4329-
checkpoint cycleInterval=... file=... restartpath=... \\ zfp\_{accuracy/precision/rate/reversible}=...\\
4329+
checkpoint cycleInterval=... file=... restartpath=... \\ zfp-{accuracy/precision/rate/reversible}=...\\
43304330
checkpoint cycleInterval=... file=... restartpath=... restartfile=... \\
4331-
zfp\_{accuracy/precision/rate/reversible}=...\\
4331+
zfp-{accuracy/precision/rate/reversible}=...\\
43324332
\bf Required parameter:\\
43334333
\rm Time for output: (time, timeInterval, cycle, or cycleInterval).\\
43344334
\bf Notes:\\
@@ -4384,10 +4384,10 @@ \subsection{checkpoint [optional]}
43844384
restartfile & restart the code from this file & string & ``restart'' \\ \hline
43854385
restartpath & path to restart file & string & N/A \\ \hline
43864386
hdf5 & use HDF5 output format & string & ``no'' \\ \hline
4387-
zfp\_accuracy & use ZFP lossy compression accuracy mode & float & N/A \\ \hline
4388-
zfp\_precision & use ZFP lossy compression precision mode & float & N/A \\ \hline
4389-
zfp\_rate & use ZFP lossy compression rate mode & float & N/A \\ \hline
4390-
zfp\_reversible & use ZFP lossless compression mode & int & 0 \\ \hline
4387+
zfp-accuracy & use ZFP lossy compression accuracy mode & float & N/A \\ \hline
4388+
zfp-precision & use ZFP lossy compression precision mode & float & N/A \\ \hline
4389+
zfp-rate & use ZFP lossy compression rate mode & float & N/A \\ \hline
4390+
zfp-reversible & use ZFP lossless compression mode & int & 0 \\ \hline
43914391

43924392
\end{tabular}
43934393
\end{center}

doc/SW4_UsersGuide.pdf

5.12 MB
Binary file not shown.

pytest-sw4mopt/test_sw4mopt.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ def guess_mpi_cmd(mpi_tasks, omp_threads, cpu_allocation, verbose):
208208
elif 'ray' in node_name:
209209
if mpi_tasks<=0: mpi_tasks = 16
210210
mpirun_cmd="mpirun -gpu -np " + str(mpi_tasks)+" mpibind"
211+
elif 'lassen' in node_name:
212+
if mpi_tasks<=0: mpi_tasks = 16
213+
mpirun_cmd="lrun -T40 "
211214
elif 'sierra' in node_name:
212215
if mpi_tasks<=0: mpi_tasks = 16
213216
mpirun_cmd="lrun -T16 -p" + str(mpi_tasks)

pytest/test_sw4.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def guess_mpi_cmd(mpi_tasks, omp_threads, cpu_allocation, verbose):
160160
elif 'lassen' in node_name:
161161
os.environ["PSM2_DEVICES"] = ""
162162
if mpi_tasks<=0: mpi_tasks = 4
163-
mpirun_cmd="lrun -T4 -M -gpu"
163+
mpirun_cmd="lrun -T40 "
164164
# add more machine names here
165165
elif 'Linux' in sys_name:
166166
if omp_threads<=0: omp_threads=1;

src/AllDims.C

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,15 @@ AllDims::AllDims( int nprocs, int ibg, int ieg, int jbg, int jeg,
104104
ptrdiff_t fftw_alloc_local = fftw_mpi_local_size_3d( nig, njg, nkg, m_communicator, &ni, &ib );
105105
m_fftw_alloc_local = static_cast<size_t>(fftw_alloc_local);
106106
#else
107-
int ni, ib;
107+
ptrdiff_t ni, ib;
108108
#endif
109109

110-
std::vector<int> niloc(m_nproci), ibloc(m_nproci);
110+
std::vector<ptrdiff_t> niloc(m_nproci), ibloc(m_nproci);
111111
niloc[m_myid1d] = ni;
112112
ibloc[m_myid1d] = ib;
113113

114-
MPI_Allgather( &ni, 1, MPI_INT, &niloc[0], 1, MPI_INT, m_communicator );
115-
MPI_Allgather( &ib, 1, MPI_INT, &ibloc[0], 1, MPI_INT, m_communicator );
114+
MPI_Allgather( &ni, 1, MPI_AINT, &niloc[0], 1, MPI_AINT, m_communicator );
115+
MPI_Allgather( &ib, 1, MPI_AINT, &ibloc[0], 1, MPI_AINT, m_communicator );
116116

117117
m_ib.resize(m_nproci);
118118
m_ie.resize(m_nproci);

src/parseInputFile.C

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5775,16 +5775,17 @@ void EW::processSource(char* buffer, vector<vector<Source*> > & a_GlobalUniqueSo
57755775
{
57765776
tDep = iDiscrete6moments;
57775777
fname = basename + ".xx";
5778-
npar = 6*(npts+1);
57795778
}
57805779
else
57815780
{
57825781
tDep = iDiscrete3forces;
57835782
fname = basename + ".x";
5784-
npar = 3*(npts+1);
57855783
}
57865784
bool byteswap;
57875785
readSACheader( fname.c_str(), dt, t0, latsac, lonsac, cmpazsac, cmpincsac, utcsac, npts, byteswap );
5786+
npar = 3*(npts+1);
5787+
if( isMomentType ) npar = 6*(npts+1);
5788+
57885789
if( !useB )
57895790
t0 = 0;
57905791

0 commit comments

Comments
 (0)