Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

Commit 52162a99 authored by POLCHER Jan's avatar POLCHER Jan 🚴🏾
Browse files

A tool to manage module path and F90 compilation.

parent 8775c8e5
import sys
import os
import inspect
def localdir(follow_symlinks=True):
if getattr(sys, 'frozen', False): # py2exe, PyInstaller, cx_Freeze
path = os.path.abspath(sys.executable)
else:
path = inspect.getabsfile(localdir)
if follow_symlinks:
path = os.path.realpath(path)
return os.path.dirname(path)
def adddirtopath(dir) :
sys.path.append(localdir()+'/'+dir)
return
def compile90(dir) :
adddirtopath(dir)
if MPI == sys.modules['mpi4py'].MPI :
if MPI.COMM_WORLD.Get_rank() == 0 :
err=os.system("cd "+localdir()+"/F90subroutines ; make all")
if err != 0 :
print("Compilation error in the FORTRAN interface")
sys.exit()
else :
print("Not compiling on other cores")
MPI.COMM_WORLD.Barrier()
else :
err=os.system("cd "+localdir()+"/F90subroutines ; make all")
if err != 0 :
print("Compilation error in the FORTRAN interface")
sys.exit()
return
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment