Skip to content

Commit

Permalink
Add 'parsetiming' command (#1046)
Browse files Browse the repository at this point in the history
* Start parsetiming command

* Start storing run data in a separate class

* Extract total time

* Get threads

* Store results in an array

* Sort by total time

* Fix # threads detection. Add total cores calc. Better error checking

* Add sort by time/cores option

* Add data sets and data file. Add shorthand names for each run

* Allow skipping over non-cpptraj-output files

* Extract detailed traj read and action process timings.

* Start TICA

* Set up frame from mask with coordinate info

* Add mask set up and initial loop

* Enable command

* Start TICA test

* Add Squared function

* Calc vector quantities

* Finish initial covar calc

* Add mass

* Make TICA hidden until its ready for prime time

* Add directory name

* Add reverse option

* Add sort by file name

* Better error detection

* Option to include bad runs

* Explicitly state testing FFTW from MKL

* Test groupby output

* Add groupout keyword

* Add printout of speedup, ideal speedup, and efficiency within groups

* Add 'grouptype' option; cannot use groupby since that is already a dat
output file keyword

* Add type trajproc

* Change gpu name to have G prefix

* Add grouptype kind

* For hybrid mpi openmp runs, append number of threads per process

* Write total cores instead of ideal speedup

* Make largest time out of all run times the reference

* Clean up help

* Clean up output. Add showdetails keyword.

* Add parsetiming test

* Enable test

* Add output for parsetiming test

* Protect against empty dir name

* Add set name. Update for fixed empty dir names.

* Add entry for parsedata

* Unhide

* 6.20.3. Revision bump for new parsetiming command.

* Fix test for OS that do not support file globbing

* Try to use pip instead of conda to build pytraj

* Try python 3.10, remove curl

* Enclose in quotes to prevent 3.10 to 3.1

* Try reverting to python 3.8

* Try python -m pytest

* Add some simpler python and pytraj tests

* Try conda-forge

---------

Co-authored-by: Daniel R. Roe <[email protected]>
  • Loading branch information
drroe and Daniel R. Roe authored Aug 18, 2023
1 parent 0072a35 commit e520de5
Show file tree
Hide file tree
Showing 24 changed files with 1,499 additions and 12 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/merge-gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,18 +141,19 @@ jobs:
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: '3.8'
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Install conda packages
run: |
conda install setuptools cython numpy pytest mock curl
conda env update --file devtools/ci/environment.yml --name base
- name: Install cpptraj
run: |
export PATH=$HOME/bin:${PATH}
export LD_LIBRARY_PATH=$HOME/lib:${LD_LIBRARY_PATH}
export MAKE_COMMAND="make -j2"
./configure --buildlibs -openmp -shared gnu
source cpptraj.sh
make -j2 libcpptraj
Expand Down
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@ EOF
fi
elif [ "$MKL_FFTW" = 'yes' ] ; then
# Using FFTW from MKL
TestProgram " Checking FFTW3" "$CXX" "$CXXFLAGS ${LIB_INCL[$LBLAS]}" testp.cpp "${LIB_FLAG[$LBLAS]}"
TestProgram " Checking MKL FFTW3" "$CXX" "$CXXFLAGS ${LIB_INCL[$LBLAS]}" testp.cpp "${LIB_FLAG[$LBLAS]}"
else
TestProgram silent " Checking FFTW3" "$CXX" "$CXXFLAGS ${LIB_INCL[$LFFTW3]}" testp.cpp "${LIB_FLAG[$LFFTW3]}"
if [ $? -ne 0 ] ; then
Expand Down
9 changes: 5 additions & 4 deletions devtools/ci/environment.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
channels:
- defaults
- conda-forge
dependencies:
- python=3.8
- pyflakes
- numpy
- mock
- pytest
- cython
- setuptools
- curl
- pytest
- mock
- curl
191 changes: 190 additions & 1 deletion doc/cpptraj.lyx
Original file line number Diff line number Diff line change
Expand Up @@ -8341,7 +8341,7 @@ The following general commands are available:
\begin_layout Standard
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="34" columns="2">
<lyxtabular version="3" rows="35" columns="2">
<features tabularvalignment="middle">
<column alignment="center" valignment="top">
<column alignment="center" valignment="top">
Expand Down Expand Up @@ -8734,6 +8734,26 @@ parallelanalysis
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
parsedata
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Parse timing data from CPPTRAJ output.
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
precision
\end_layout
Expand Down Expand Up @@ -11455,6 +11475,175 @@ noprefix "false"
.
\end_layout

\begin_layout Subsection
parsedata
\end_layout

\begin_layout LyX-Code
parsetiming <filename args> ...
[out <file>] [name <setname>]
\end_layout

\begin_layout LyX-Code
[sortby {time|cores|filename}] [includebad] [showdetails]
\end_layout

\begin_layout LyX-Code
[type {trajproc|trajread|actframe}] [reverse]
\end_layout

\begin_layout LyX-Code
[groupout <file> [grouptype {prefix|name|kind}]]
\end_layout

\begin_deeper
\begin_layout Description
<filename
\begin_inset space ~
\end_inset

args> Files containing CPPTRAJ output to get timing data from.
\end_layout

\begin_layout Description
[out
\begin_inset space ~
\end_inset

<file>] Write total sorted timing sets to <file>.
\end_layout

\begin_layout Description
[name
\begin_inset space ~
\end_inset

<setname>] Set name for timing data sets.
\end_layout

\begin_layout Description
[sortby
\begin_inset space ~
\end_inset

{time|cores|filename}] Sort timing data sets by either time, number of cores
(MPI processes * OpenMP threads), or file name.
\end_layout

\begin_layout Description
[includebad] If specified, include run output for which timing data cannot
be extracted (e.g.
an incomplete/failed run).
\end_layout

\begin_layout Description
[showdetails] If specified, details about each run will be printed to STDOUT.
\end_layout

\begin_layout Description
[type
\begin_inset space ~
\end_inset

{trajproc|trajread|actframe} If specified, report time other than the total
time (which is the default):
\end_layout

\begin_deeper
\begin_layout Description
trajproc Total trajectory processing time (trajectory I/O plus action frame
time).
\end_layout

\begin_layout Description
trajread Trajectory read time (requires compiling with '-timer' configure
option/-DTIMER compiler define).
\end_layout

\begin_layout Description
actframe Action frame time (requires compiling with '-timer' configure option/-D
TIMER compiler define).
\end_layout

\end_deeper
\begin_layout Description
[reverse] Instead of longest time to shortest time, sort shortest time to
longest time.
\end_layout

\begin_layout Description
[groupout
\begin_inset space ~
\end_inset

<file>] Group run output by a property and write to a file.
Additional details will be written like speedup and efficiency (relative
to the slowest run).
\end_layout

\begin_deeper
\begin_layout Description
[grouptype
\begin_inset space ~
\end_inset

{prefix|name|kind}] Property to group runs by in group output file.
\end_layout

\begin_deeper
\begin_layout Description
prefix Group by directory prefix.
\end_layout

\begin_layout Description
name Group by run type name (see
\emph on
<setname>[name]
\emph default
below).
\end_layout

\begin_layout Description
kind Group by run type name; OpenMP runs are separated by number of OpenMP
threads.
\end_layout

\end_deeper
\end_deeper
\begin_layout Standard
DataSets Created:
\end_layout

\begin_layout Description
<setname> Set containing sorted run times.
\end_layout

\begin_layout Description
<setname>[name] Set containing shortedhand run names.
Consists of a prefix (S for serial, O for OpenMP, M for MPI, H for hybrid
MPI/OpenMP) followed by numbers indicating number of MPI processes 'x'
OpenMP threads; e.g., H16x4 means a hybrid run consisting of 16 MPI processes
and 4 OpenMP threads per process.
If CUDA is active, the name will be wrapped in 'G()', e.g.
G(H16x4).
\end_layout

\begin_layout Description
<setname>[dir] Set containing output directory prefixes.
If no directory prefix, just contains output file name.
\end_layout

\end_deeper
\begin_layout Standard
The
\series bold
\emph on
parsedata
\series default
\emph default
command can be used to extract timing data from CPPTRAJ output.
\end_layout

\begin_layout Subsection
precision
\end_layout
Expand Down
Loading

0 comments on commit e520de5

Please sign in to comment.