Skip to content
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

Changed swarm output directory to be the current swarm id #12

Merged
merged 3 commits into from
Apr 15, 2024

Conversation

wjs20
Copy link
Contributor

@wjs20 wjs20 commented Mar 10, 2024

The way that lightdock-rust currently reads and writes files is a little confusing. Because swarms writes to the current directory by default, you either have to copy the structure files into every swarm directory, which seems inefficient, or you have to cd into every directory and refer to the structure and settings files using dotted relative paths. The change means that instead of doing this:

cd swarm_0
cp ../lightdock_1czy_protein.pdb ../lightdock_1czy_peptide.pdb .
cp ../rec_nm.npy ../lig_nm.npy .
cp -R ../../../data .
time ../../../target/release/lightdock-rust ../setup.json ../init/initial_positions_0.dat 100 dfire

You can just do this:

/target/release/lightdock-rust setup.json init/initial_positions_0.dat 100 dfire

You can also run this in parallel, because each process will be writing to a different directory and the file names will not clobber each other. It does this by extracting the swarm id from the initial_positions_number.dat filename, and using this as the directory name to write the gso_number.out files.

Let me know what you think.

@wjs20 wjs20 force-pushed the change-swarm-output-directory branch from 75afe5a to edb6c37 Compare March 11, 2024 09:34
@wjs20
Copy link
Contributor Author

wjs20 commented Mar 11, 2024

My initial implementation didn't work with nested paths (e.g. init/initial_positions_0.dat) I have fixed this in edb6c37

@brianjimenez
Copy link
Member

Thank you @wjs20 for your contribution, did you have a look at 0.3.0 branch? That is the most updated code (still not merged into main though) and something similar was implemented (no need to copy structures or data anymore). Please, could you rebase your contribution into 0.3.0? Thanks in advance for your time and contributed code!

@brianjimenez brianjimenez self-assigned this Apr 2, 2024
@brianjimenez brianjimenez added the enhancement New feature or request label Apr 2, 2024
@brianjimenez brianjimenez self-requested a review April 2, 2024 16:23
@brianjimenez brianjimenez merged commit 319b4c0 into lightdock:master Apr 15, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants