Skip to content

Commit 5cf714e

Browse files
committed
SCRIPTS: Support change set selection in decomp script
1 parent 1901175 commit 5cf714e

File tree

2 files changed

+64
-25
lines changed

2 files changed

+64
-25
lines changed

Diff for: packages/seacas/scripts/decomp

+31-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright(C) 1999-2020, 2023 National Technology & Engineering Solutions
2+
# Copyright(C) 1999-2020, 2023, 2025 National Technology & Engineering Solutions
33
# of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
44
# NTESS, the U.S. Government retains certain rights in this software.
55
#
@@ -46,6 +46,7 @@ Decomposition methods: Default is -l rib. [0..3] = speed ranking 0=fastest.
4646
For example "--multikl" is the same as "-l multikl"
4747
4848
Other options:
49+
--change_set <#> Read from the specified (1-based) change set index.
4950
--help Print this message (-h)
5051
--launch <cmd> Prefix nem_slice call with this command to run it.
5152
The cmd argument must be quoted if it contains options
@@ -102,6 +103,7 @@ Decomposition methods: Default is -l rib. [0..3] = speed ranking 0=fastest.
102103
-l zpinch [-] special decomposition method; not useful for general use.
103104
104105
Other options:
106+
-C <#> Read from the specified (1-based) change set index.
105107
-N Nodal Decomposition
106108
-E Elemental Decomposition (default)
107109
-n options Specify nem_slice options
@@ -157,6 +159,7 @@ function execute_loadbalance {
157159
LAUNCH=$7
158160
decomp_type=$8
159161
weighting=$9
162+
change_set_index=$10
160163

161164
nemesis=$basename.$suffix_mesh.nem
162165
genesis=$basename.$suffix_mesh
@@ -174,6 +177,11 @@ function execute_loadbalance {
174177
return -1
175178
fi
176179

180+
change_set=""
181+
if [ "$change_set_index" != "0" ]
182+
then
183+
change_set="-C $change_set_index"
184+
fi
177185
date=$(date '+%m/%d/%y')
178186
time=$(date '+%H:%M:%S')
179187
prob_dir=$(pwd | sed "s/.*\///g")
@@ -182,16 +190,16 @@ function execute_loadbalance {
182190
then
183191
echo ${txtblu}
184192
echo "Executing:"
185-
echo " $LAUNCH $NEM_SLICE $decomp_type $spheres $do_viz $decomp_method $weighting $nem_slice_flag -o $nemesis -m mesh=$processors -a $input $genesis"
193+
echo " $LAUNCH $NEM_SLICE $decomp_type $spheres $do_viz $decomp_method $weighting $nem_slice_flag $change_set -o $nemesis -m mesh=$processors -a $input $genesis"
186194
echo ${txtrst}
187-
(${NOOP:+echo }$LAUNCH $NEM_SLICE $decomp_type $spheres $do_viz $decomp_method $weighting $nem_slice_flag -o $nemesis -m mesh=$processors -a $input $genesis)
195+
(${NOOP:+echo }$LAUNCH $NEM_SLICE $decomp_type $spheres $do_viz $decomp_method $weighting $nem_slice_flag $change_set -o $nemesis -m mesh=$processors -a $input $genesis)
188196
load_rc=$?
189197
else
190198
echo ${txtblu}
191199
echo "Executing:"
192-
echo " $LAUNCH $NEM_SLICE $decomp_type $spheres $do_viz $decomp_method $weighting $nem_slice_flag -o $nemesis -m mesh=$processors $genesis"
200+
echo " $LAUNCH $NEM_SLICE $decomp_type $spheres $do_viz $decomp_method $weighting $nem_slice_flag $change_set -o $nemesis -m mesh=$processors $genesis"
193201
echo ${txtrst}
194-
(${NOOP:+echo }$LAUNCH $NEM_SLICE $decomp_type $spheres $do_viz $decomp_method $weighting $nem_slice_flag -o $nemesis -m mesh=$processors $genesis)
202+
(${NOOP:+echo }$LAUNCH $NEM_SLICE $decomp_type $spheres $do_viz $decomp_method $weighting $nem_slice_flag $change_set -o $nemesis -m mesh=$processors $genesis)
195203
load_rc=$?
196204
fi
197205
return $load_rc
@@ -204,7 +212,8 @@ function execute_spread {
204212
rootdir=$2
205213
subdir=$3
206214
numproc=$4
207-
NEM_SPREAD=$5
215+
change_set_index=$5
216+
NEM_SPREAD=$6
208217

209218
nemesis=$basename.$suffix_mesh.nem
210219
genesis=$basename.$suffix_mesh
@@ -233,6 +242,12 @@ function execute_spread {
233242
fi
234243
fi
235244

245+
change_set=""
246+
if [ "$change_set_index" != "0" ]
247+
then
248+
change_set="-C $change_set_index"
249+
fi
250+
236251
if [ -e $pexsh ]
237252
then
238253
/bin/rm -rf $pexsh
@@ -255,9 +270,9 @@ function execute_spread {
255270

256271
echo ${txtblu}
257272
echo "Executing:"
258-
echo " $NEM_SPREAD $use64 $pexsh"
273+
echo " $NEM_SPREAD $use64 $change_set $pexsh"
259274
echo ${txtrst}
260-
${NOOP:+echo }$NEM_SPREAD $use64 $pexsh
275+
${NOOP:+echo }$NEM_SPREAD $use64 $change_set $pexsh
261276
}
262277

263278
########################################################################
@@ -302,6 +317,7 @@ spheres="-S"
302317
do_viz=""
303318
curdir=$(pwd)
304319
use64=""
320+
change_set_index='0'
305321

306322
ACCESSBIN=$(dirname "$0")
307323
ACCESSBIN=$(cd "${ACCESSBIN}" && pwd)
@@ -326,14 +342,15 @@ fi
326342
########################################################################
327343
# decomp options:
328344
if [ $OLDGETOPT -eq 1 ] ; then
329-
TEMP=$(getopt Hh6ENn:i:o:p:j:r:R:S:X:sl:vVd: "$@")
345+
TEMP=$(getopt Hh6C:ENn:i:o:p:j:r:R:S:X:sl:vVd: "$@")
330346
else
331-
TEMP=$(getopt -o Hh6ENn:i:o:p:j:r:R:S:X:sl:vVd:w: -a \
347+
TEMP=$(getopt -o Hh6C:ENn:i:o:p:j:r:R:S:X:sl:vVd:w: -a \
332348
--long input: \
333349
--long launch: \
334350
--long nolaunch \
335351
--long noop \
336352
--long help \
353+
--long change_set: \
337354
--long nem_slice_flag \
338355
--long 64 \
339356
--long processors: \
@@ -378,6 +395,8 @@ while true ; do
378395
do_viz="-y" ; shift ;;
379396
(-d|--debug)
380397
debug_level="$2" ; shift 2 ;;
398+
(-C|--change_set)
399+
change_set_index="$2" ; shift 2 ;;
381400
(-n|--nem_slice_flag)
382401
nem_slice_flag="$2" ; shift 2 ;;
383402
(-N|--nodal)
@@ -539,7 +558,7 @@ then
539558
fi
540559

541560
########################################################################
542-
execute_loadbalance "$basename" "$processors" "$decomp_method" "$nem_slice_flag" "$NEM_SLICE" "$input" "$LAUNCH" "$decomp_type" "$weighting"
561+
execute_loadbalance "$basename" "$processors" "$decomp_method" "$nem_slice_flag" "$NEM_SLICE" "$input" "$LAUNCH" "$decomp_type" "$weighting" "$change_set_index"
543562
if [ $? -ne 0 ]
544563
then
545564
echo ${txtred}
@@ -555,7 +574,7 @@ else
555574
fi
556575

557576
########################################################################
558-
execute_spread "$basename" "$rootdir" "$subdir" "$processors" "$NEM_SPREAD"
577+
execute_spread "$basename" "$rootdir" "$subdir" "$processors" "$change_set_index" "$NEM_SPREAD"
559578
if [ $? -ne 0 ]
560579
then
561580
echo ${txtred}

Diff for: packages/seacas/scripts/decomp.in

+33-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright(C) 1999-2020, 2023 National Technology & Engineering Solutions
2+
# Copyright(C) 1999-2020, 2023, 2025 National Technology & Engineering Solutions
33
# of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
44
# NTESS, the U.S. Government retains certain rights in this software.
55
#
@@ -46,6 +46,7 @@ Decomposition methods: Default is @DECOMP_DEFAULT@. [0..3] = speed ranking 0=fas
4646
For example "--multikl" is the same as "-l multikl"
4747
4848
Other options:
49+
--change_set <#> Read from the specified (1-based) change set index.
4950
--help Print this message (-h)
5051
--noop Only echo the nem_slice and nem_spread commands.
5152
--nodal Nodal Decomposition (-N)
@@ -98,6 +99,7 @@ Decomposition methods: Default is @DECOMP_DEFAULT@. [0..3] = speed ranking 0=fas
9899
-l zpinch [-] special decomposition method; not useful for general use.
99100
100101
Other options:
102+
-C <#> Read from the specified (1-based) change set index.
101103
-N Nodal Decomposition
102104
-E Elemental Decomposition (default)
103105
-n options Specify nem_slice options
@@ -152,7 +154,8 @@ function execute_loadbalance {
152154
input=$6
153155
decomp_type=$7
154156
weighting=$8
155-
157+
change_set_index=$9
158+
156159
nemesis=$basename.$suffix_mesh.nem
157160
genesis=$basename.$suffix_mesh
158161

@@ -169,20 +172,26 @@ function execute_loadbalance {
169172
return -1
170173
fi
171174

175+
change_set=""
176+
if [ "$change_set_index" != "0" ]
177+
then
178+
change_set="-C $change_set_index"
179+
fi
180+
172181
if [ -n "$input" ] && [ -e "$input" ]
173182
then
174183
echo ${txtblu}
175184
echo "Executing:"
176-
echo " $NEM_SLICE $decomp_type $spheres $do_viz $decomp_method $weighting $nem_slice_flag -o $nemesis -m mesh=$processors -a $input $genesis"
185+
echo " $NEM_SLICE $decomp_type $spheres $do_viz $decomp_method $weighting $nem_slice_flag $change_set -o $nemesis -m mesh=$processors -a $input $genesis"
177186
echo ${txtrst}
178-
(${NOOP:+echo }$NEM_SLICE $decomp_type $spheres $do_viz $decomp_method $weighting $nem_slice_flag -o $nemesis -m mesh=$processors -a $input $genesis)
187+
(${NOOP:+echo }$NEM_SLICE $decomp_type $spheres $do_viz $decomp_method $weighting $nem_slice_flag $change_set -o $nemesis -m mesh=$processors -a $input $genesis)
179188
load_rc=$?
180189
else
181190
echo ${txtblu}
182191
echo "Executing:"
183-
echo " $NEM_SLICE $decomp_type $spheres $do_viz $decomp_method $weighting $nem_slice_flag -o $nemesis -m mesh=$processors $genesis"
192+
echo " $NEM_SLICE $decomp_type $spheres $do_viz $decomp_method $weighting $nem_slice_flag $change_set -o $nemesis -m mesh=$processors $genesis"
184193
echo ${txtrst}
185-
(${NOOP:+echo }$NEM_SLICE $decomp_type $spheres $do_viz $decomp_method $weighting $nem_slice_flag -o $nemesis -m mesh=$processors $genesis)
194+
(${NOOP:+echo }$NEM_SLICE $decomp_type $spheres $do_viz $decomp_method $weighting $nem_slice_flag $change_set -o $nemesis -m mesh=$processors $genesis)
186195
load_rc=$?
187196
fi
188197
return $load_rc
@@ -195,7 +204,8 @@ function execute_spread {
195204
rootdir=$2
196205
subdir=$3
197206
numproc=$4
198-
NEM_SPREAD=$5
207+
change_set_index=$5
208+
NEM_SPREAD=$6
199209

200210
nemesis=$basename.$suffix_mesh.nem
201211
genesis=$basename.$suffix_mesh
@@ -224,6 +234,12 @@ function execute_spread {
224234
fi
225235
fi
226236

237+
change_set=""
238+
if [ "$change_set_index" != "0" ]
239+
then
240+
change_set="-C $change_set_index"
241+
fi
242+
227243
if [ -e $pexsh ]
228244
then
229245
/bin/rm -rf $pexsh
@@ -246,9 +262,9 @@ function execute_spread {
246262

247263
echo ${txtblu}
248264
echo "Executing:"
249-
echo " $NEM_SPREAD $use64 $pexsh"
265+
echo " $NEM_SPREAD $use64 $change_set $pexsh"
250266
echo ${txtrst}
251-
${NOOP:+echo }$NEM_SPREAD $use64 $pexsh
267+
${NOOP:+echo }$NEM_SPREAD $use64 $change_set $pexsh
252268
}
253269

254270
########################################################################
@@ -292,6 +308,7 @@ suffix_spread=''
292308
spheres="-S"
293309
do_viz=""
294310
use64=""
311+
change_set_index='0'
295312

296313
NOOP=
297314

@@ -345,12 +362,13 @@ fi
345362
########################################################################
346363
# decomp options:
347364
if [ $OLDGETOPT -eq 1 ] ; then
348-
TEMP=$(getopt Hh6ENn:i:o:p:j:r:R:S:X:sl:vVd: "$@")
365+
TEMP=$(getopt Hh6C:ENn:i:o:p:j:r:R:S:X:sl:vVd: "$@")
349366
else
350-
TEMP=$(getopt -o Hh6ENn:i:o:p:j:r:R:S:X:sl:vVd:w: -a \
367+
TEMP=$(getopt -o Hh6C:ENn:i:o:p:j:r:R:S:X:sl:vVd:w: -a \
351368
--long input: \
352369
--long noop \
353370
--long help \
371+
--long change_set: \
354372
--long nem_slice_flag \
355373
--long 64 \
356374
--long processors: \
@@ -393,6 +411,8 @@ while true ; do
393411
do_viz="-y" ; shift ;;
394412
(-d|--debug)
395413
debug_level="$2" ; shift 2 ;;
414+
(-C|--change_set)
415+
change_set_index="$2" ; shift 2 ;;
396416
(-n|--nem_slice_flag)
397417
nem_slice_flag="$2" ; shift 2 ;;
398418
(-N|--nodal)
@@ -509,7 +529,7 @@ then
509529
fi
510530

511531
########################################################################
512-
execute_loadbalance "$basename" "$processors" "$decomp_method" "$nem_slice_flag" "$NEM_SLICE" "$input" "$decomp_type" "$weighting"
532+
execute_loadbalance "$basename" "$processors" "$decomp_method" "$nem_slice_flag" "$NEM_SLICE" "$input" "$decomp_type" "$weighting" "$change_set_index"
513533
if [ $? -ne 0 ]
514534
then
515535
echo ${txtred}
@@ -525,7 +545,7 @@ else
525545
fi
526546

527547
########################################################################
528-
execute_spread "$basename" "$rootdir" "$subdir" "$processors" "$NEM_SPREAD"
548+
execute_spread "$basename" "$rootdir" "$subdir" "$processors" "$change_set_index" "$NEM_SPREAD"
529549
if [ $? -ne 0 ]
530550
then
531551
echo ${txtred}

0 commit comments

Comments
 (0)