-
Notifications
You must be signed in to change notification settings - Fork 126
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
MAJOR code overhaul: ambient noise adjoint tomography and code improvements #181
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…d E weighted adjoint sources for adjoint simulations
…rnel save and export destinations which will be used by noise inversion workflow
…n) into noise inversion workflow
… and defined in one place during workflow
…it clearer about how directories and files are tagged
…ctly to the login node with a -l/--login argument for seisflows submit
…ween both functions
…lute whereas before paths were being forced to absolute
…ty is not complete yet
…ucntion so that noise inversion workflow can use it
…y structures of file naming, this is now done by the calling workflow. this change is necessary so that the noise inversion workflow can call the combine function to sum various horizontal kernels prior to the main combine call
… the actual event kernel
…on, line search seems to be working too
…all the internal function overrides are necessary made a preprocessing log statement more explanative
…rrect filenames due to incorrect indexing
…ccessfully with all three kernels ZZ RR and TT together
…ocedures including loggin and step count incrementing. fixed the weird chicken-egg behavior where step count could not be incremented before line search calculation by forcing passing line search to decremenet step count to get the final step count number
…aluate_gradient_from_kernels' as this only needed to be done once and there is a possibility that 'initialize_line_search' is run more than once changed check for zero-valued search direction to a check for zero valued gradient and stuck that in migration.evaluate_gradient_from_kernels as this should really be done prior to calculating P and is also an important check for Migration workflow, not just inversion BUGFIX: manual step length override was not being evaluated due to an incorrect boolean check, changed how this was dealt with FEATURE: added a print statement to the line search for debugging purposes
… value limit for alpha, but not w.r.t model parameters. fixed this by moving the step len safeguard check into optimize.calculate_step_length and calculating an actual max allowable alpha w.r.t model and search direction norms
…ing a timeout error
… it was first iteration
…tates so the rerun feature reran the incorrect job numbers. put in an additional sorting that takes care of hyphenated job numbers
…nst step_len_max which was always <1 because it is a percentage. since we put the step length max check in the optimization module and not line search, hard set backtrack initial step length to 1
…cause they did not conform to the expected format. added a sort flag to only perform sorting when recovering fro mjob failure
…equent iterations. now dealt with like gradients where they are renamed by the iteration number
…e time required is now equivalent to forward simulation
…indows had been collected for misfit calc (last considered trace and not the entire collection), which meant that sometimes misfit was saved for each event as the raw misfit, not the normalized misfit, this was causing the line search to fail to reduce the misfit because misfit values were huge w.r.t initial model
…r iteridx meaning line search restart utility did not work as expected
… branch overriding old devel styles
This was referenced Feb 23, 2024
This was referenced Mar 19, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The gist:
devel
branch of SeisFlows.Before I let this feature branch get so unruly that it cannot be easily merged back into devel, I am opting to PR it now, and to continue improving the devel branch through smaller feature PRs.
The changelog so far includes the following (also found in CHANGELOG.md). I've tried to highlight (boldface) the changes I think might be most interesting/useful/critical:
Major Changes
failed -> -1, pending -> 0), and full state file is created at workflow
setup, rather than one by one as each function completes
restarting failed line searches:
perform_line_search() -> evaluate_line_search_misfit() + update_line_search()
Green's functions
virtual sources are required for ambient noise adjoint tomography
information on azimuth + backazimuth required for RR/TT kernels
(parallelized)
sum_residuals
, which required Preprocess toknow too many things about the workflow. Now handled by Workflow.
tools
whichPreprocess can import
client
parameter to match Pyatoa > 0.3.0but instead explcitely reads data + metadata like Default preproc.
edit them directly
tasktime
now set in the top parent classSystem.run
rerun
function tells System to re-run failed jobs some number oftimes to deal with randomly failing tasks that usually work once you
run them again; added to TestFlow
array
: For debug purposes, allow running only specifictask IDs to e.g., re-run failed processes. Input style follows SLURM
array argument
job failure, but rather to wait until all jobs are finished. Tied into System
rerun
featureoutput of
sacct
for queue checking due to premature job exits withempty
sacct
returns (i.e., it takes a while for compute nodes tospin up and be visible in
sacct
)assumed directory structure
density
->update_density
handled by Workflow
seisflows submit --login
->seisflows submit --direct
for submittingyour workflow directly to the login/home node and not to a cluster node
seisflows configure
makes more clear which paths are default/notimportant, and which paths are required
seisflows setup
<->seisflows init
namespace change as the names makemore sense in this order.
init
starts a blank working directory,setup
runs module setup functions (like directory creation)
Minor Changes
adjoint simulation), so that it can be called by debugger
synthetic waveforms are saved
and removing scratch/system directory each iteration
to avoid heavy file overhead
graphics
utilities and adopted all of Pyatoa's PNG and PDFimage manipulation utilities for use in Pyaflowa preprocessing (adds PyPDF as
dependency)
pyproject.toml
first letter (e.g., I -> INFO, W -> WARN, D -> DEBU)
seisflows print tasks
to get source names and relevant task IDOptimize
: split up some internal functions for easier separation of tasksthat were previously all mashed together
Bugfixes
Inversion workflows ecause
xmeshfem3D
was not being called, and thereforenot updating database files.
causing incorrect misfit calculation and an inability for the inversion to reduce misfit
values to be negative. Now follows Tromp (2005) where we square the time shift
mpiexec
was being set inside System initiation, causing check statement tofail quietly
verbosity to each child process allowing for uniform logs for all jobs
seisflows swap
allow paths to be set relative or absolute, previously theywere forced to absolute
file extensions. Not critical because they were not used, and overwritten
seisflows setpar
was not properly setting FORTRAN double precision values.Added some better catches for
setpar
as it was quietly failing when fileswere nonexistent
step_count_max
was not being evaluated properlyseisflows configure
will no longer try to configure an already configuredfile
parallelized by concurrent futures. Previously these functions failed quietly
Misc.
import_seisflows
required all Workflows havemodules
as their first argument. Only Forward workflow requires.run by Optimize setup