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

Improving the accounts usage command mention on midway2 and midway3 #214

Merged
merged 5 commits into from
Sep 3, 2024

Conversation

ndtrung81
Copy link
Collaborator

The PR improves the description of the accounts usage command and their diffs on midway2 vs midway3.

@ndtrung81
Copy link
Collaborator Author

Currently the command rcchelp usage -account [pi-cnetid] -byjob and the corresponding accounts usage command don't function on midway3, because the cached yaml file fetched from the database does not have the job info. However, users can still get the jobs on midway3 partitions (caslake and gpu) by running these commands on midway2.

@ndtrung81
Copy link
Collaborator Author

@aolykhin this PR has relevant info mentioned in the issue you raised earlier #130 regarding byjob info

Copy link
Collaborator

@od101 od101 left a comment

Choose a reason for hiding this comment

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

thank you, @ndtrung81 .
left minor comments, suggestions, etc.
thank you!

@@ -26,23 +26,73 @@ accounts balance
```

## How do I review the usage of my allocation?
The `accounts` tool provides several options for summarizing allocation usage. To obtain a summary, execute the command:
The `accounts` tool provides several options for summarizing the usage of the allocations to which your RCC account is accessible. To obtain a summary, execute the command `accounts usage` with the account name(s):

Copy link
Collaborator

Choose a reason for hiding this comment

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

"... RCC account is accessible." => "... RCC account has access to."?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just in case, users can also log into MyRCC profile and see all the service unites of the accounts they are a member of in a user-friendly web interface.

accounts usage
accounts usage --account [pi-cnetid]
accounts usage --accounts [pi-cnetid1],[pi-cnetid2]
```
Copy link
Collaborator

Choose a reason for hiding this comment

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

all work as shown.

something related:

  • help shows "-account -a ACCOUNT[,...]", i.e., the option "account" with single dash, i.e., "-", and doesn't show any option of "accounts".
  • "-a" as shown in help doesn't work.
  • the example of "accounts" above will work just fine with "account", and otherwise too.

Copy link
Collaborator

Choose a reason for hiding this comment

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

accounts usage --accounts pi-1, pi-2 for me, only returns the first account (pi-1), second one doesn't show up.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Here it looks to me on midway2

[ndtrung@midway2-login1 ~]$ accounts usage --accounts pi-depablo,pi-gagalli
Account Usage: Thu Aug 29 15:32:56 2024
Accounts:   pi-depablo,pi-gagalli

+------------+-------------+
| Account    | Charge (SU) |
+------------+-------------+
| pi-depablo |  2781855.77 |
| pi-gagalli |  1337831.94 |
+------------+-------------+

```
accounts usage
accounts usage --account [pi-cnetid] --byuser
```
Copy link
Collaborator

Choose a reason for hiding this comment

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

works as expected. "-byuser" works too.

Copy link
Collaborator

Choose a reason for hiding this comment

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

... often your PI's CNetID. Execute groups command to find it, if you are not sure.

=== "Midway3, Beagle3"
```
rcchelp usage
rcchelp usage -account [pi-cnetid] -byuser
Copy link
Collaborator

Choose a reason for hiding this comment

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

last example needs to be:
rcchelp usage -a [pi-cnetid] -byuser

Copy link
Collaborator

Choose a reason for hiding this comment

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

All good.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, I fixed that error, thanks @od101


To view usage per job, utilize the following command:
To view the resource usage per job, you need to run on Midway2 before using either `accounts`:

Copy link
Collaborator

Choose a reason for hiding this comment

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

"run on Midway2" => "run on Midway2/DaLI"?

```
accounts usage --byjob
accounts usage --account [pi-cnetid] --byjob
```
Copy link
Collaborator

@od101 od101 Aug 23, 2024

Choose a reason for hiding this comment

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

works fine.

something related: help shows single dash for "byjob", but it works fine with both single/double. same for "account" option.

```
=== "Midway2, DaLI"
```
rcchelp usage
Copy link
Collaborator

Choose a reason for hiding this comment

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

byjob missing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed this


both of which include the jobs on both Midway2 and Midway3 partitions (e.g. `caslake` and `gpu`).

The output is a table that lists the job IDs, partitions, number of CPU cores and SU consumptions. To further check the resource consumption of a job on Midway3, you need to log in to Midway3 and run `sacct -j` or `scontrol show job` with the job ID.

Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe to note that sacct will work during and after the execution. but, scontrol will work only during, and not after.

Copy link
Collaborator

@pedramesfahani pedramesfahani left a comment

Choose a reason for hiding this comment

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

Thank you @ndtrung81 for the updates.

@@ -26,23 +26,73 @@ accounts balance
```

## How do I review the usage of my allocation?
The `accounts` tool provides several options for summarizing allocation usage. To obtain a summary, execute the command:
The `accounts` tool provides several options for summarizing the usage of the allocations to which your RCC account is accessible. To obtain a summary, execute the command `accounts usage` with the account name(s):

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just in case, users can also log into MyRCC profile and see all the service unites of the accounts they are a member of in a user-friendly web interface.

accounts usage
accounts usage --account [pi-cnetid]
accounts usage --accounts [pi-cnetid1],[pi-cnetid2]
```
Copy link
Collaborator

Choose a reason for hiding this comment

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

accounts usage --accounts pi-1, pi-2 for me, only returns the first account (pi-1), second one doesn't show up.

```
accounts usage
accounts usage --account [pi-cnetid] --byuser
```
Copy link
Collaborator

Choose a reason for hiding this comment

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

... often your PI's CNetID. Execute groups command to find it, if you are not sure.

=== "Midway3, Beagle3"
```
rcchelp usage
rcchelp usage -account [pi-cnetid] -byuser
Copy link
Collaborator

Choose a reason for hiding this comment

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

All good.

rcchelp usage -account [pi-cnetid] -byjob
```

both of which include the jobs on both Midway2 and Midway3 partitions (e.g. `caslake` and `gpu`).
Copy link
Collaborator

Choose a reason for hiding this comment

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

To a bit make the sentence be more clear and easier to follow:
Note! This command, although it is executed on Midway2 ecosystem, provides the necessary information about both Midway2 and Midway3 ecosystems.

@@ -862,7 +862,7 @@ module load python

for idx in {0..31}
do
taskset -c $i python script.py input-$idx.txt > output-$idx.txt &
taskset -c $idx python script.py input-$idx.txt > output-$idx.txt &
done
wait
```
Copy link
Collaborator

Choose a reason for hiding this comment

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

This script is a Bash loop that runs 32 instances of a Python script (script.py) in parallel, each bound to a specific CPU core.

Breakdown:

  1. Loop (for idx in {0..31}): This loop iterates 32 times, with idx taking values from 0 to 31.

  2. taskset -c $idx: This command binds the execution of the following command (python script.py ...) to a specific CPU core, where $idx specifies the core number.

  3. python script.py input-$idx.txt > output-$idx.txt &: This runs the Python script with a specific input file (input-$idx.txt) and writes the output to a corresponding output file (output-$idx.txt). The & at the end puts each command in the background, allowing them to run in parallel.

  4. wait: This command makes the script wait until all background processes have finished before it exits.

Summary:
The script parallelizes the execution of script.py across 32 CPU cores, each processing a different input file and saving the results in corresponding output files.

@ndtrung81
Copy link
Collaborator Author

thanks very much @od101 and @pedramesfahani for the careful reviews. I made the corrections and incorporated your edits.

@ndtrung81 ndtrung81 merged commit 23eeaa0 into main Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants