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

Feat append arglist to srun #8

Closed
wants to merge 26 commits into from
Closed

Conversation

fordmcdonald
Copy link
Member

No description provided.

@fordmcdonald fordmcdonald self-assigned this Mar 7, 2023
@fordmcdonald fordmcdonald added the enhancement New feature or request label Mar 7, 2023
@fordmcdonald
Copy link
Member Author

fordmcdonald commented Mar 7, 2023

I worked under multiple branches for the attached issues, but I forgot to create a pull request for the default config commit. This PR covers the following features:

  • Added a default configuration file. The user can provide a custom config via --config <config.toml>, which will be merged with the default config for any missing attributes.
  • Appends an arglist of strings that reflects the parameters provided in the config. The function compileArgumentList(dict) handles the various formats and positional args that xnat2bids requires.
  • The default config has been updated with an exhaustive list of xnat2bids parameters. I have made a separate issue to build out handling all possible slurm arguments.

@fordmcdonald fordmcdonald marked this pull request as ready for review March 7, 2023 20:00
@fordmcdonald fordmcdonald requested a review from mirestrepo March 7, 2023 20:00
Copy link
Contributor

@mirestrepo mirestrepo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I added few comments ut this is pretty close!

run_xnat2bids.py Outdated Show resolved Hide resolved
run_xnat2bids.py Outdated Show resolved Hide resolved
x2b_default_config.toml Outdated Show resolved Hide resolved
x2b_default_config.toml Outdated Show resolved Hide resolved

[xnat2bids-args]
session = "XNAT_E00114"
bids_root = "/gpfs/data/bnc/shared/bids-export/"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the defaults should match the defaults in our docs

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is /gpfs/data/bnc/shared/bids-export/ our default? Maybe we should also make it in the $USER home so we don't have to manage cleaning up of bcc's folder

Copy link
Contributor

@mirestrepo mirestrepo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So close!

run_xnat2bids.py Outdated Show resolved Hide resolved
run_xnat2bids.py Outdated Show resolved Hide resolved
tests/test_xnat2bids.py Show resolved Hide resolved
@@ -0,0 +1,22 @@
[slurm-args]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commit the values that we have good defaults for

x2b_example_user_config.toml Show resolved Hide resolved
run_xnat2bids.py Outdated Show resolved Hide resolved
@fordmcdonald fordmcdonald requested a review from mirestrepo March 8, 2023 22:03
Copy link
Contributor

@mirestrepo mirestrepo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry I keep suggesting stuff. Getting there! Love the changes you made to the compilation of args, volume bindings and logging

x2b_default_config.toml Outdated Show resolved Hide resolved

[xnat2bids-args]
session = "XNAT_E00114"
bids_root = "/gpfs/data/bnc/shared/bids-export/"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is /gpfs/data/bnc/shared/bids-export/ our default? Maybe we should also make it in the $USER home so we don't have to manage cleaning up of bcc's folder

x2b_default_config.toml Outdated Show resolved Hide resolved
x2b_example_user_config.toml Show resolved Hide resolved
run_xnat2bids.py Outdated Show resolved Hide resolved
run_xnat2bids.py Outdated Show resolved Hide resolved
run_xnat2bids.py Outdated Show resolved Hide resolved
run_xnat2bids.py Outdated Show resolved Hide resolved
@fordmcdonald fordmcdonald requested a review from mirestrepo March 21, 2023 20:05
@mirestrepo mirestrepo added this to the April BNC Workshop milestone Mar 22, 2023
Copy link
Contributor

@mirestrepo mirestrepo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even closer. Tiny changes left. I'm changing my mind here, but maybe the default config should have good defaults for any example, in that case, the session is probably best not part of the default

bids_root_dir=""
host="https://xnat.bnc.brown.edu"
session-suffix=-1
bidsmap-file="/gpfs/data/bnc/shared/scripts/fmcdona4/bidsmap.json"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see this file in Oscar. That location has a txt but it's not the bidsmap format. Also I don't think we are using a bidsmap file for demodat

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, bidsmap-file is just dummy data, testing that bidsmap filepaths are being correctly adding to bindings. In test_xnat2bids.py, I'm only asserting that the filepath has been added to bindings after making a call to compileArgumentList.

nodes = 1
cpus-per-task = 2
job-name = "xnat2bids"
output = "/gpfs/data/bnc/scratch/logs/%J.txt"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
output = "/gpfs/data/bnc/scratch/logs/%J.txt"
output = "/gpfs/scratch/%u/logs/xnat2bids_test%J.log"

run_xnat2bids.py Outdated Show resolved Hide resolved
run_xnat2bids.py Outdated Show resolved Hide resolved
tests/x2b_test_config.toml Outdated Show resolved Hide resolved
mem = 16000
nodes = 1
cpus-per-task = 2
job-name = "xnat2bids"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
job-name = "xnat2bids"
job-name = "xnat2bids"
output = "/gpfs/scratch/%u/logs/xnat2bids%J.log"

Copy link
Member Author

@fordmcdonald fordmcdonald Apr 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In PR #11, I'm not specifying an output parameter in slurm-args, so that I can add the session # to the logging statements.

        if not ('output' in arg_dict['slurm-args']):
            output = f"/users/{user}/logs/%x-{session}-%J.txt"
            arg = f"--output {output}"
            slurm_param_list.append(arg) 

But I like the idea of using %u, and letting slurm define user here. Should logs go to scratch/user/logs vs. /users/user/logs ?

x2b_example_user_config.toml Outdated Show resolved Hide resolved
x2b_default_config.toml Outdated Show resolved Hide resolved
x2b_default_config.toml Outdated Show resolved Hide resolved
@fordmcdonald fordmcdonald deleted the feat-append-arglist-to-srun branch April 13, 2023 18:59
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.

Add default config for xnat2bids script Append xnat2bids parameter tags to arglist
2 participants