Skip to content

Commit 63fac78

Browse files
launching scripts
1 parent 29634a4 commit 63fac78

5 files changed

Lines changed: 21 additions & 20 deletions

File tree

kratos.gid/exec/compiled.unix.bat

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ rm -f "$2/$1*.post.msh"
88
rm -f "$2/$1.info"
99
rm -f "$2/$1.err"
1010
rm -f "$2/$1.flavia.dat"
11+
rm -fr "$2/gid_output"
12+
rm -fr "$2/vtk_output"
1113

1214
# include .bashrc if it exists
1315
if [ -f "$HOME/.bashrc" ]; then
@@ -18,28 +20,18 @@ fi
1820
# and maintains OLD_LD_LIBRARY_PATH with previous settings
1921
# therefore, we use the OLD_LD_LIBRARY_PATH and prepend the path to the kratos libs
2022
if [ "$OLD_LD_LIBRARY_PATH" != "" ]; then
21-
export LD_LIBRARY_PATH="$3/exec/Kratos":"$3/exec/Kratos/libs":$OLD_LD_LIBRARY_PATH
23+
export LD_LIBRARY_PATH="$kratos_bin_path/libs":$OLD_LD_LIBRARY_PATH
2224
else
2325
# do not add the ':'
24-
export LD_LIBRARY_PATH="$3/exec/Kratos":"$3/exec/Kratos/libs"
26+
export LD_LIBRARY_PATH="$kratos_bin_path/libs"
2527
fi
2628

2729
# Prevents the PYTHONHOME error from happening and isolate possible python repacks present
2830
# in the system and interfeering with runkratos
29-
export PYTHONPATH="$3/exec/Kratos":$PYTHONPATH
31+
export PYTHONPATH=$kratos_bin_path:$PYTHONPATH
3032

33+
KERNEL_NAME="linux"
3134

32-
# if mac
33-
KERNEL=`uname -s`
34-
if [ $KERNEL = "Darwin" ]; then
35-
KERNEL_NAME="macosx"
36-
export DYLD_LIBRARY_PATH="$3/exec/Kratos":"$3/exec/Kratos/libs":$DYLD_LIBRARY_PATH
37-
export DYLD_FALLBACK_LIBRARY_PATH="$3/exec/Kratos":"$3/exec/Kratos/libs":$DYLD_FALLBACK_LIBRARY_PATH
38-
export PYTHONPATH="$3/exec/Kratos/Lib":"$3/exec/Kratos/Lib/lib-dynload/":$PYTHONPATH
39-
export PYTHONHOME="$3/exec/Kratos"
40-
else
41-
KERNEL_NAME="linux"
42-
fi
4335

4436
# Run Python using the script MainKratos.py
45-
"$run_kratos_exe" MainKratos.py > "$2/$1.info" 2> "$2/$1.err"
37+
$python_path/python3 MainKratos.py > "$2/$1.info" 2> "$2/$1.err"

kratos.gid/exec/compiled.win.bat

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,17 @@ REM ErrorFile: "%2\%1.err"
99

1010
DEL "%2\%1.info"
1111
DEL "%2\%1.err"
12+
DEL "%2\%1*.post.bin"
13+
DEL "%2\%1*.post.res"
14+
DEL "%2\%1*.post.msh"
15+
DEL "%2\%1.info"
16+
DEL "%2\%1.err"
17+
DEL "%2\%1.flavia.dat"
18+
DEL "%2\gid_output"
19+
DEL "%2\vtk_output"
1220

13-
set PATH=%kratos_bin_path%\\libs;%PATH%
21+
set PATH=%kratos_bin_path%\libs;%PATH%
1422
set PYTHONPATH=%kratos_bin_path%
1523

1624
REM Run Python using the script MainKratos.py
17-
python .\MainKratos.py > "%2\\%1.info" 2> "%2\\%1.err"
25+
%python_path%/python MainKratos.py > "%2\\%1.info" 2> "%2\\%1.err"

kratos.gid/exec/pip_gids_python.unix.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ rm -f "$2/$1.err"
1010
rm -f "$2/$1.flavia.dat"
1111

1212
# Run Python using the script MainKratos.py
13-
$kratos_python_exe MainKratos.py > "$2/$1.info" 2> "$2/$1.err"
13+
$python_path MainKratos.py > "$2/$1.info" 2> "$2/$1.err"

kratos.gid/exec/pip_gids_python.win.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ DEL "%2\%1*.post.res"
1515
DEL "%2\%1*.post.msh"
1616

1717
@REM Calculate!
18-
%kratos_python_exe% MainKratos.py > "%2\\%1.info" 2> "%2\\%1.err"
18+
%python_path% MainKratos.py > "%2\\%1.info" 2> "%2\\%1.err"

kratos.gid/scripts/Launch.tcl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,8 @@ proc Kratos::ExecuteLaunchByMode {launch_mode} {
300300
set ::env(python_path) $python_path
301301
}
302302
{Launch via pip on GiDs python} {
303-
W "local"
303+
set python_path [GiD_Python_GetPythonExe]
304+
set ::env(python_path) $python_path
304305
}
305306
default {}
306307
}

0 commit comments

Comments
 (0)