Skip to content

nexus rmg updates #4747

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Finalize RMG -> QMCPACK SD runs with twist averaging
  • Loading branch information
anbenali committed Sep 28, 2023
commit 5c1528588688d6759d2ae87e8c6ef371b487aa95
4 changes: 2 additions & 2 deletions nexus/lib/qmcpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
from developer import unavailable
from nexus_base import nexus_core
from copy import deepcopy
from rmg import Rmg
try:
import h5py
except:
Expand Down Expand Up @@ -174,7 +175,7 @@ def incorporate_result(self,result_name,result,sim):
input = self.input
system = self.system
if result_name=='orbitals':
if isinstance(sim,Pw2qmcpack):
if isinstance(sim,(Pw2qmcpack,Rmg)):

h5file = result.h5file

Expand Down Expand Up @@ -273,7 +274,6 @@ def incorporate_result(self,result_name,result,sim):
#end if
#end if
qs.wavefunction = newwfn

else:
self.error('incorporating orbitals from '+sim.__class__.__name__+' has not been implemented')
#end if
Expand Down
59 changes: 55 additions & 4 deletions nexus/lib/rmg.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
##################################################################


import os
from simulation import Simulation
from generic import obj
from rmg_input import RmgInput,generate_rmg_input
from rmg_analyzer import RmgAnalyzer
from execute import execute



Expand All @@ -15,24 +18,72 @@ class Rmg(Simulation):
generic_identifier = 'rmg'
application = 'rmg-cpu'
application_properties = set(['serial','mpi'])
application_results = set([''])
application_results = set(['orbitals','wavefunctions'])


def __init__(self,**sim_args):
sync_from_scf = sim_args.pop('sync_from_scf',True)
Simulation.__init__(self,**sim_args)
self.sync_from_scf = False
#calc = self.input.ontrol.get('calculation_mode',None)
if self.input.calculation_mode=='NSCF':
self.sync_from_scf = sync_from_scf
#end if
#end def __init__




def check_result(self,result_name,sim):
calculating_result = False
input =self.input
if result_name=='orbitals':
conv_requested = self.input.write_qmcpack_restart
calculating_result = conv_requested
if result_name=='wavefunctions' :
calculating_result = True
return calculating_result
#end def check_result


def get_result(self,result_name,sim):
result = None
self.error('Ability to get result '+result_name+' has not been implemented.')
result = obj()
input = self.input
outdir = 'Waves'
result.locdir = self.locdir
result.outdir = os.path.join(self.locdir,outdir)
if result_name=='orbitals':
h5file = 'wave.out.h5'
result.h5file = os.path.join(self.locdir,outdir,h5file)
if result_name=='wavefunctions':
result.location = os.path.join(self.locdir,outdir,'wave.out')
#self.error('Ability to get result '+result_name+' has not been implemented.')
return result
#end def get_result


def incorporate_result(self,result_name,result,sim):
self.error('ability to incorporate result '+result_name+' has not been implemented')
#self.error('ability to incorporate result '+result_name+' has not been implemented')
if result_name=='wavefunctions':
res_path = os.path.abspath(result.locdir)
loc_path = os.path.abspath(self.locdir)
if res_path==loc_path:
None # don't need to do anything if in same directory
elif self.sync_from_scf: # rsync output into nscf dir
outdir = os.path.join(self.locdir,'Waves')
#outdir = os.path.join(self.locdir,c.outdir)
command = 'rsync -av {0}/* {1}/'.format(result.outdir,outdir)
if not os.path.exists(outdir):
os.makedirs(outdir)
#end if
sync_record = os.path.join(outdir,'nexus_sync_record')
if not os.path.exists(sync_record):
execute(command)
f = open(sync_record,'w')
f.write('\n')
f.close()
#end if
#end if
#end def incorporate_result


Expand Down
Loading