[FLASH-BUGS] Calling of "$FLASH/bin/setup.py" broken
Manuel Jung
manuel.jung at hs.uni-hamburg.de
Mon Apr 9 04:04:20 CDT 2018
Hello,
I recently discovered a difference in behavior whether one calls
"./setup" in the flash source directory directly or uses an absolute
path to call "bin/setup.py".
Here is a minimal working example:
>From the FLASH4.5 source directory call:
> ./setup Sedov -auto -objdir sedov_normal
> head -n1 sedov_normal/setup_call
/home/hslxrsrv3/stnv053/Downloads/flash/FLASH4.5/bin/setup.py Sedov
-auto -objdir sedov_normal
I often used this absolute call to setup my simulations in various
paths, which are not subdirectories from the FLASH source. So we call
> /home/hslxrsrv3/stnv053/Downloads/flash/FLASH4.5/bin/setup.py Sedov -auto -objdir sedov_absolute
And then we compare the units which are linked in the setup:
> diff sedov_normal/setup_units sedov_absolute/setup_units
9,12d8
< Grid/GridMain/paramesh/interpolation
< Grid/GridMain/paramesh/interpolation/Paramesh4
< Grid/GridMain/paramesh/interpolation/Paramesh4/prolong
< Grid/GridMain/paramesh/interpolation/prolong
21d16
< Grid/GridMain/paramesh/paramesh4/Paramesh4dev/flash_avoid_orrery
The "sedov_absolute" simulation setup is missing a few Paramesh
interpolation directories. While in general also the "setup_absolute"
setup runs fine, it sometimes crashes at refinement steps of the grid.
The "normal" method seems to work more reliably.
On a side note, i would be great if you could default to "python2"
instead of "python" in the header of the python files, which would
help in mixed python2/python3 environments. I will add a diff for this
at the end of the email.
Cheers,
Manuel
patch for python2/python3 compatibility:
diff --git a/bin/setup.py b/bin/setup.py
index bc7c076..10b7c18 100755
--- a/bin/setup.py
+++ b/bin/setup.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python2
import os, sys, string, re, time, shutil, UserDict, types, glob, socket, math
diff --git a/bin/setup_addcdepends.py b/bin/setup_addcdepends.py
index 56a4277..d4b328e 100755
--- a/bin/setup_addcdepends.py
+++ b/bin/setup_addcdepends.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python2
"""This program parses all the .c files in the current directory and
finds the header files
each file depends on. Having done that, it appends those dependencies
to Makefile.Depends."""
diff --git a/bin/setup_depends.py b/bin/setup_depends.py
index 789ae06..7855e15 100755
--- a/bin/setup_depends.py
+++ b/bin/setup_depends.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python2
"""This program parses all the .F90 files in the current directory
and finds the modules
each file depends on. Having done that, it generates a makefile
listing those dependencies"""
diff --git a/bin/setup_reorder.py b/bin/setup_reorder.py
index ccaa3fd..9465dd6 100755
--- a/bin/setup_reorder.py
+++ b/bin/setup_reorder.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python2
import sys, re, getopt, os
diff --git a/setup_alt b/setup_alt
index d3c0465..f2aba02 100755
--- a/setup_alt
+++ b/setup_alt
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python2
import os
import sys
sys.path = ['.', os.path.join(os.path.split(__file__)[0], 'tools')] + sys.path
--
Manuel Jung, Dr. rer. nat.
Hamburger Sternwarte
Universität Hamburg
Gojenbergsweg 112
21029 Hamburg
More information about the flash-bugs
mailing list