-
Notifications
You must be signed in to change notification settings - Fork 668
Fb matrix divider #328
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
Merged
Merged
Fb matrix divider #328
Changes from 16 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
98c5702
Added boundary checks to the SMC grid input files for ww3_grid,
UKMO-lsampson 71b9ba9
Fb 360 calendar (#8)
ukmo-juan-castillo 6c42d17
RTD support for ww3_boun[dc] (#10)
ukmo-ccbunney 5c361aa
Fb coupling time (#9)
ukmo-juan-castillo cc34122
Merge remote-tracking branch 'upstream/staging' into develop
33a7af3
bug fix for ukmet development
68c3c96
Merge remote-tracking branch 'upstream/develop' into develop
663d983
Merge remote-tracking branch 'upstream/develop' into develop
d4887f5
Merge remote-tracking branch 'upstream/develop' into develop
dc0cea9
Merge remote-tracking branch 'upstream/develop' into develop
832a6ea
add the matrix subsetter
115ceb1
clean-up
4427883
clean up
8b498e8
add another script which separate serial and parallel jobs and divide…
e1cb650
modify the script to remove ../model? after test completion.
88ee4f0
bug fixes and adding ww3_tp2.17 to list_heavy
3c74387
add if statement to remove matrix? and model?
073e47d
Update matrix_divider_p.sh
aliabdolali b07cfbb
Merge remote-tracking branch 'upstream/develop' into fb_matrix_divider
cf02516
Merge remote-tracking branch 'upstream/develop' into fb_matrix_divider
6578878
Merge remote-tracking branch 'upstream/develop' into fb_matrix_divider
799a8c4
Merge remote-tracking branch 'upstream/develop' into fb_matrix_divider
5c5bbff
put if check for ../model? inside matrix? loop
62b756b
fix the bug for sed for model?
8d7107a
final fix for extra model? removal
2e5216e
add 2.21 to the list_heavy
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| #!/bin/bash | ||
| # --------------------------------------------------------------------------- # | ||
| # matrix_divider simply divides the main matrix into subsets with a given # | ||
| # number of test (i.e. maxlist=100) # | ||
| # # | ||
| # Remarks: # | ||
| # - Once the matrix is generated, this script can be execute. The user should # | ||
| # define the maxlist and this script divide the matrix into matrix? and # | ||
| # submit the job using sbatch. # | ||
| # # | ||
| # Ali Abdolali # | ||
| # August 2018 # | ||
| # March 2021 # | ||
| # # | ||
| # Copyright 2013 National Weather Service (NWS), # | ||
| # National Oceanic and Atmospheric Administration. All rights # | ||
| # reserved. WAVEWATCH III is a trademark of the NWS. # | ||
| # No unauthorized use without permission. # | ||
| # # | ||
| # --------------------------------------------------------------------------- # | ||
| # --------------------------------------------------------------------------- # | ||
| # 1. clean up and definitions # | ||
| # --------------------------------------------------------------------------- # | ||
| rm -r ../model? | ||
| rm -r ../model?? | ||
| #Put the job requirement/spec in "before" | ||
| sed -e "/run_test/,\$d" matrix > before | ||
| #Put the list of tests in "list" | ||
| command egrep 'run_test|ww3_tp2.14' matrix | cat >> list | ||
| #Count the number of lines in "list" | ||
| listn=$(wc -l < list) | ||
| count=0 | ||
| countT=0 | ||
| # Define the number of test in each subset "maxlist" | ||
| maxlist=100 | ||
| matrixno=1 | ||
| # --------------------------------------------------------------------------- # | ||
| # 2. Divide and dump in subsets # | ||
| # --------------------------------------------------------------------------- # | ||
| while read line | ||
| do | ||
| if [[ count -eq 0 ]] | ||
| then | ||
| cat before >> matrix$matrixno | ||
| fi | ||
| if [[ count -le maxlist ]] | ||
| then | ||
| echo $line >> matrix$matrixno | ||
| (( count = count + 1 )) | ||
| (( countT = countT + 1 )) | ||
| # echo $count | ||
| # echo $countT | ||
| else | ||
| count=0 | ||
| (( matrixno = matrixno + 1 )) | ||
| fi | ||
| done < list | ||
|
|
||
| for i in `seq 1 1 "$((matrixno))"`; do | ||
| #Replace matrix.out > matrix?.out, model > model? | ||
| cp -r ../model ../model$i | ||
| sed -i 's/'matrix.out'/'matrix${i}.out'/gI' matrix$i | ||
| sed -i 's/'model'/'model${i}'/gI' matrix$i | ||
| echo " echo ' '" >> matrix$i | ||
| echo " echo ' **************************************************************'" >> matrix$i | ||
| echo " echo ' * end of WAVEWATCH III matrix$i of regression tests *'" >> matrix$i | ||
| echo " echo ' **************************************************************'" >> matrix$i | ||
| echo " echo ' '" >> matrix$i | ||
| done | ||
|
|
||
| rm before | ||
| rm list | ||
|
|
||
| echo "file matrix is divided into $i subsets ...." | ||
|
|
||
| # --------------------------------------------------------------------------- # | ||
| # End to matrix_divider # | ||
| # --------------------------------------------------------------------------- # |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,118 @@ | ||
| #!/bin/bash | ||
| # --------------------------------------------------------------------------- # | ||
| # matrix_divider simply divides the main matrix into subsets with a given # | ||
| # number of test (i.e. maxlist1 for mpi tests and maxlist2 for serial tests) # | ||
| # # | ||
| # Remarks: # | ||
| # - Once the matrix is generated, this script can be execute. The user should # | ||
| # define the maxlist and this script divide the matrix into matrix? and # | ||
| # submit the job using sbatch. # | ||
| # # | ||
| # Ali Abdolali # | ||
| # August 2018 # | ||
| # March 2021 # | ||
| # # | ||
| # Copyright 2013 National Weather Service (NWS), # | ||
| # National Oceanic and Atmospheric Administration. All rights # | ||
| # reserved. WAVEWATCH III is a trademark of the NWS. # | ||
| # No unauthorized use without permission. # | ||
| # # | ||
| # --------------------------------------------------------------------------- # | ||
| # --------------------------------------------------------------------------- # | ||
| # 1. clean up and definitions # | ||
| # --------------------------------------------------------------------------- # | ||
| rm -r ../model? | ||
| rm -r ../model?? | ||
| cp matrix matrix.tmp | ||
|
|
||
| maxlist1=47 | ||
| maxlist2=91 | ||
|
|
||
| #Put the job requirement/spec in "before" | ||
| sed -e "/run_test/,\$d" matrix.tmp > before | ||
| #Put the list of tests in "list" | ||
| command egrep 'ww3_tp2.14|ww3_tp2.17' matrix.tmp | cat >> list_heavy | ||
| awk '!/ww3_tp2.14/' matrix.tmp > tmpfile && mv tmpfile matrix.tmp | ||
| awk '!/ww3_tp2.17/' matrix.tmp > tmpfile && mv tmpfile matrix.tmp | ||
| command egrep 'mpirun|mpiexec|MPI_LAUNCH' matrix.tmp | cat >> list_mpi | ||
| awk '!/mpirun|mpiexec|MPI_LAUNCH/' matrix.tmp > tmpfile && mv tmpfile matrix.tmp | ||
| split -dl $maxlist1 list_mpi list_mpi_ | ||
| rm list_mpi | ||
| matrixno1=$(ls list_mpi_* | wc -l) | ||
| echo "Total nummber of matrix with parallel tests = $(($matrixno1 + 1)); each includes $maxlist1 tests" | ||
| command egrep 'run_test' matrix.tmp | cat >> list_serial | ||
| split -dl $maxlist2 list_serial list_serial_ | ||
| rm list_serial | ||
| matrixno2=$(ls list_serial_* | wc -l) | ||
| echo "Total nummber of matrix with serial test = $matrixno2; each includes $maxlist2 tests" | ||
| rm matrix.tmp | ||
|
|
||
| # --------------------------------------------------------------------------- # | ||
| # 2. Divide and dump in subsets # | ||
| # --------------------------------------------------------------------------- # | ||
| # parallel jobs | ||
| count=0 | ||
| for i in `seq -f '%02g' 0 "$((matrixno1 - 1))"`; do | ||
| #echo $i | ||
| #Replace matrix.out > matrix?.out, model > model? | ||
| (( count = count + 1 )) | ||
| cat before >> matrix$count | ||
| cat list_mpi_$i >> matrix$count | ||
| cp -r ../model ../model$count | ||
| sed -i 's/'matrix.out'/'matrix${count}.out'/gI' matrix$count | ||
| sed -i 's/'model'/'model${count}'/gI' matrix$count | ||
| echo " echo ' '" >> matrix$count | ||
| echo " echo ' **************************************************************'" >> matrix$count | ||
| echo " echo ' * end of WAVEWATCH III matrix$count of regression tests *'" >> matrix$count | ||
| echo " echo ' **************************************************************'" >> matrix$count | ||
| echo " echo ' '" >> matrix$count | ||
| echo "rm -r ../model$count" >> matrix$count | ||
| echo " matrix$count prepared" | ||
| done | ||
|
|
||
| #serial jobs | ||
| for i in `seq -f '%02g' 0 "$((matrixno2 - 1))"`; do | ||
| #echo $i | ||
| #Replace matrix.out > matrix?.out, model > model? | ||
| (( count = count + 1 )) | ||
| cat before >> matrix$count | ||
| cat list_serial_$i >> matrix$count | ||
| cp -r ../model ../model$count | ||
| sed -i 's/'matrix.out'/'matrix${count}.out'/gI' matrix$count | ||
| sed -i 's/'model'/'model${count}'/gI' matrix$count | ||
| echo " echo ' '" >> matrix$count | ||
| echo " echo ' **************************************************************'" >> matrix$count | ||
| echo " echo ' * end of WAVEWATCH III matrix$count of regression tests *'" >> matrix$count | ||
| echo " echo ' **************************************************************'" >> matrix$count | ||
| echo " echo ' '" >> matrix$count | ||
| echo "rm -r ../model$count" >> matrix$count | ||
| echo " matrix$count prepared" | ||
| done | ||
|
|
||
| #ww3_tp2.14 is separated, as it has dependency. | ||
| #ww3_tp2.17 is separated, as it takes a long time to finish | ||
| (( count = count + 1 )) | ||
| cat before >> matrix$count | ||
| cat list_heavy >> matrix$count | ||
| cp -r ../model ../model$count | ||
| sed -i 's/'matrix.out'/'matrix${count}.out'/gI' matrix$count | ||
| sed -i 's/'model'/'model${count}'/gI' matrix$count | ||
| echo " echo ' '" >> matrix$count | ||
| echo " echo ' **************************************************************'" >> matrix$count | ||
| echo " echo ' * end of WAVEWATCH III matrix$count of regression tests *'" >> matrix$count | ||
| echo " echo ' **************************************************************'" >> matrix$count | ||
| echo " echo ' '" >> matrix$count | ||
| echo "rm -r ../model$count" >> matrix$count | ||
| echo " matrix$count prepared" | ||
|
|
||
|
|
||
|
|
||
| rm before | ||
| rm list* | ||
|
|
||
| echo "file matrix is divided into $count subsets ...." | ||
|
|
||
| # --------------------------------------------------------------------------- # | ||
| # End to matrix_divider # | ||
| # --------------------------------------------------------------------------- # | ||
|
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.