2010-10-26 20:32:20 +05:30
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
# Makes the postprocessing routines acessible from everywhere.
|
|
|
|
# you need a ~/bin directory in your home folder
|
|
|
|
# add the bin directory to your path by adding the following lines
|
|
|
|
# to your .bashrc file:
|
|
|
|
# PATH="$PATH:~/bin"
|
|
|
|
# export PATH
|
|
|
|
|
2011-01-26 20:47:03 +05:30
|
|
|
import os,sys,glob
|
2010-10-26 20:32:20 +05:30
|
|
|
|
2011-01-26 20:47:03 +05:30
|
|
|
bin_link = { \
|
2010-10-26 20:32:20 +05:30
|
|
|
'pre' : [
|
|
|
|
'marc_addUserOutput',
|
|
|
|
'mentat_pbcOnBoxMesh',
|
|
|
|
'mentat_patchFromReconstructedBoundaries',
|
|
|
|
'mentat_spectralBox',
|
2011-01-24 21:51:49 +05:30
|
|
|
'voronoi_randomSeeding',
|
|
|
|
'voronoi_tessellation',
|
2010-10-26 20:32:20 +05:30
|
|
|
],
|
|
|
|
'post' : [
|
|
|
|
'postResults',
|
|
|
|
'mentat_colorMap',
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2011-01-26 20:47:03 +05:30
|
|
|
compile = { \
|
|
|
|
'pre' : [
|
|
|
|
'voronoi_randomSeeding.f90',
|
|
|
|
'voronoi_tessellation.f90',
|
|
|
|
],
|
|
|
|
'post' : [
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2010-10-26 20:32:20 +05:30
|
|
|
homedir = os.getenv('HOME')
|
|
|
|
basedir = os.path.dirname(sys.argv[0])
|
2011-01-26 20:47:03 +05:30
|
|
|
for dir in bin_link:
|
|
|
|
for file in bin_link[dir]:
|
2010-10-26 20:32:20 +05:30
|
|
|
src = os.path.abspath(os.path.join(basedir,dir,file))
|
|
|
|
if (file == ''):
|
|
|
|
dst = os.path.abspath(os.path.join(homedir,'bin',dir))
|
|
|
|
else:
|
|
|
|
dst = os.path.abspath(os.path.join(homedir,'bin',file))
|
|
|
|
print src,'-->',dst
|
|
|
|
if os.path.lexists(dst):
|
|
|
|
os.remove(dst)
|
|
|
|
os.symlink(src,dst)
|
2011-01-26 20:47:03 +05:30
|
|
|
|
|
|
|
for dir in compile:
|
|
|
|
for file in compile[dir]:
|
|
|
|
src = os.path.abspath(os.path.join(basedir,dir,file))
|
|
|
|
if os.path.isfile(src):
|
|
|
|
print file
|
|
|
|
os.system('ifort -O3 -parallel -o%s %s'%(os.path.splitext(src)[0],src))
|
|
|
|
|
|
|
|
modules = glob.glob(os.path.abspath(os.path.join(basedir,'*.mod')))
|
|
|
|
for module in modules:
|
|
|
|
print module
|
|
|
|
os.remove(module)
|