File: Allrun

package info (click to toggle)
openfoam 1812%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 220,284 kB
  • sloc: cpp: 1,038,902; sh: 14,536; ansic: 8,240; lex: 657; xml: 387; python: 300; awk: 212; makefile: 94; sed: 88; csh: 3
file content (105 lines) | stat: -rwxr-xr-x 3,322 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/bin/sh
cd ${0%/*} || exit 1                        # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions    # Tutorial run functions

if isTest $@
then
    # Reset the controlDict
    if [ -f system/controlDict.orig ]
    then
        echo "$0: restoring the controlDict from controlDict.orig"
        mv system/controlDict.orig system/controlDict
    fi
fi


runApplication blockMesh

application=$(getApplication)

#- Test writing collated format
runApplication decomposePar -fileHandler collated
runParallel $application -fileHandler collated
runApplication reconstructPar -latestTime -fileHandler collated

#- Test writing uncollated format
runApplication -s uncollated decomposePar -fileHandler uncollated -force
runParallel -s uncollated $application -fileHandler uncollated


#- Test uncollated+distributed running: copy to different roots
rm -rf machineA/fileHandler
mkdir -p machineA/fileHandler
(   cd machineA/fileHandler && \
    cp -r ../../processor[0-1] . && \
    cp -r ../../system . && \
    mkdir -p constant && cp ../../constant/* constant
)
#- Note: slave node does not need constant&system since these are global
rm -rf machineB/fileHandler
mkdir -p machineB/fileHandler
(   cd machineB/fileHandler && \
    cp -r ../../processor[2-3] .
)
#- Run with different roots
(   d=$PWD && \
    cd machineA/fileHandler && \
    runParallel -s multiRoot $application \
    -fileHandler masterUncollated -ioRanks '(0 2)' \
    -roots "(\"$d/machineA\" \"$d/machineB\" \"$d/machineB\")"
)

#- Restart from uncollated
runParallel -s collated $application -fileHandler collated
runApplication -s collated reconstructPar -latestTime -fileHandler collated

#- Convert the parallel format to uncollated
runParallel foamFormatConvert -fileHandler uncollated

#- Restart with multiple IO ranks
runParallel -s multiCollated \
    $application -fileHandler collated -ioRanks '(0 2)'

#- Reconstruct the multi-rank format. Delete the collated directory
#  since conflicts with the multi-collated directory
rm -rf processors4
runApplication -s multiCollated reconstructPar -latestTime \
    -fileHandler collated -ioRanks '(0 2)'

#- Convert the multi-rank format to uncollated
runParallel -s uncollated foamFormatConvert -fileHandler uncollated

#- Restart from multiCollated using collated
runParallel -s uncollated_from_multiCollated \
    $application -fileHandler uncollated



#- Test collated+distributed running: copy to different roots
#  Important: make sure to copy uniform since we're copying it

#- Delete all processor directories
runApplication -s collated decomposePar \
    -fileHandler collated -force -copyUniform

rm -rf machineA/fileHandler
mkdir -p machineA/fileHandler
(   cd machineA/fileHandler && \
    cp -r ../../processor* . && \
    cp -r ../../system . && \
    mkdir -p constant && cp ../../constant/* constant
)
#- Note: slave node does not need constant&system since these are global
rm -rf machineB/fileHandler
mkdir -p machineB/fileHandler

#- Run with different roots
(   d=$PWD && \
    cd machineA/fileHandler && \
    runParallel -s distributed_multiCollated $application \
    -fileHandler collated -ioRanks '(0 2)' \
    -roots "(\"$d/machineA\" \"$d/machineB\" \"$d/machineB\")"
)


#------------------------------------------------------------------------------