sharc-md / sharc

The SHARC molecular dynamics (MD) program suite is an ab initio MD software package developed to study the excited-state dynamics of molecules.
https://www.sharc-md.org
GNU General Public License v3.0
69 stars 38 forks source link

OpenMolcas: WorkDir/OutputDir #11

Closed MaxParadiz closed 4 years ago

MaxParadiz commented 4 years ago

While attempting the test jobs with OpenMolcas/18.04, the MOLCAS calculations would abruptly stop. The issue was that script moves into the 'WorkDir' to run pymolcas, and the default is to set the submit directory as the output dir ('$CurrDir' or '$OutputDir'). At least in my compiled version of Molcas (18.04, python 3.6), this will cause Molcas to crash. It at the same time as python encounters a "shutil.SameFileError" when trying to copy the xmldump.

A simple fix for me was to change the 'MOLCAS_OUTPUT' environment variable. This can be done conveniently from within SHARC_MOLCAS.py:

def runMOLCAS(WORKDIR,MOLCAS,ncpu,strip=False):                                                                                                                          
    prevdir=os.getcwd()                                                                                                                                                  
    os.chdir(WORKDIR)                                                                                                                                                    
    os.environ['WorkDir']= WORKDIR                                          
######### Added this line ########################                                                                          
    os.environ['MOLCAS_OUTPUT']= WORKDIR+"/output"        
##############################################
    os.environ['MOLCAS_NPROCS']=str(ncpu)