Skip to content

Commit

Permalink
screen message updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Youngsung Kim committed Oct 1, 2022
1 parent 7eea1a0 commit 271a40f
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 18 deletions.
24 changes: 13 additions & 11 deletions fortlab/kernel/kernelgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,6 @@ def perform(self, args):
state_realpath = os.path.realpath(os.path.join(args.outdir, "state"))
kernel_realpath = os.path.realpath(os.path.join(args.outdir, "kernel"))

print("==== Generating state data files ====")

self.config["path"]["kernel_output"] = kernel_realpath
self.config["path"]["state_output"] = state_realpath

Expand Down Expand Up @@ -189,7 +187,7 @@ def perform(self, args):
(("0", "0"), ("0", "0"), ("1", "1"))
)

print("==== Generating kernel files ====")
print("==== Generating kernel files (%s) ====" % kernel_realpath)

plugins = (
("ext.gencore", gencore_plugindir),
Expand Down Expand Up @@ -278,6 +276,7 @@ def perform(self, args):
if klines is not None:
klines = remove_multiblanklines(klines)
kernel_files.append(filename)
print(filename)
with io.open(
os.path.join(kernel_realpath, filename), "w", encoding=enc
) as (fd):
Expand All @@ -293,24 +292,25 @@ def perform(self, args):
) as (fd):
fd.write(tounicode(slines))

with io.open(
os.path.join(
kernel_realpath, "%s.f90" % self.config["kernel_driver"]["name"]
),
"w",
encoding=enc,
) as (fd):
kdriver = "%s.f90" % self.config["kernel_driver"]["name"]
with io.open(os.path.join(kernel_realpath, kdriver), "w", encoding=enc,) as (fd):
set_indent("")
lines = driver.tostring()
if lines is not None:
lines = remove_multiblanklines(lines)
fd.write(tounicode(lines))

print(kdriver)

kernel_files.append(self.config["kernel"]["name"])
kernel_files.append(KGUTIL)
print(KGUTIL)

self.generate_kgen_utils(kernel_realpath, enc)
self.generate_kernel_makefile(kernel_realpath, enc)
kernel_files.append("Makefile")
print("Makefile")

self.generate_state_makefile(state_realpath, enc)
state_files.append("Makefile")

Expand All @@ -320,7 +320,7 @@ def perform(self, args):
if self.config["state_switch"]["clean"]:
run_shcmd(self.config["state_switch"]["clean"])

print("==== Generating state data files ====")
print("==== Generating state data files (%s) ====" % kernel_realpath)

out, err, retcode = run_shcmd("make", cwd=state_realpath)

Expand Down Expand Up @@ -886,6 +886,8 @@ def generate_state_makefile(self, statepath, enc):

def read_model(self, modeljson, config):

print("==== Collecting timing data ====")

if "etime" not in modeljson:
raise UserException("'etime' is not in model json file")

Expand Down
2 changes: 1 addition & 1 deletion fortlab/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class Fortlab(Project):
_name_ = "fortlab"
_version_ = "1.0.0"
_version_ = "1.0.1"
_description_ = "Fortran Kernel and Analysis Framework"
_long_description_ = "Tools for Analysis of Fortran Application and Source code"
_author_ = "Youngsung Kim"
Expand Down
2 changes: 0 additions & 2 deletions fortlab/resolver/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,6 @@ def perform(self, args):
else:
logger.warn('Stmt does not have "unknowns" attribute: %s'%str(cs_stmt))

print("==== Updating state information ====")

# update state info of callsite and its upper blocks
kganalyze.update_state_info(self.config["parentblock"]['stmt'], self.config)

Expand Down
15 changes: 13 additions & 2 deletions fortlab/scanner/compile/option.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,17 @@ def perform(self, args):

stracecmd = b'strace -f -q -s 100000 -e trace=execve -v -- /bin/sh -c "%s"'% str.encode(buildcmd)


try:

nprocessed = 0
flags = {}

process = subprocess.Popen(stracecmd, stdin=subprocess.PIPE, \
stdout=subprocess.PIPE, stderr=subprocess.PIPE, \
shell=True)


while True:

#line = process.stdout.readline()
Expand Down Expand Up @@ -127,12 +130,17 @@ def perform(self, args):
inq.put((src, incs))

elif "CMakeFortranCompilerId.F" not in src:
print("Info: %s is not saved in backup directory." % src)
print("[Info] %s is not saved in backup directory." % src)

if args.verbose:
print("Compiled: %s by %s" % (src, exepath))
print(str(options))

nprocessed += 1

if nprocessed % 100 == 0:
print("[Info] processed %d source files" % nprocessed)

#if src in flags:
# flags[src].append((exepath, incs, macros, openmp, options))
#else:
Expand All @@ -157,7 +165,7 @@ def perform(self, args):
#except Exception as err:
# raise
finally:
pass
print("[Info] processed total %d source files" % nprocessed)

#if args.cleancmd:
# cleancmd_output = subprocess.check_output(args.cleancmd["_"], shell=True)
Expand All @@ -178,6 +186,9 @@ def perform(self, args):

if args.savejson:
jsonfile = args.savejson["_"].strip()

print("[Output JOSN file] = %s" % jsonfile)

dirname = os.path.dirname(jsonfile)

if dirname and not os.path.exists(dirname):
Expand Down
2 changes: 0 additions & 2 deletions fortlab/scanner/timing/timingmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ def perform(self, args):

datadir = args.datadir["_"]

print("==== Collecting timing data ====")

# collect data
etimes = {} # mpirank:omptid:invoke=[(fileid, linenum, numvisits), ... ]
etimemin = 1.0E100
Expand Down

0 comments on commit 271a40f

Please sign in to comment.