Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
333 changes: 154 additions & 179 deletions nexus/nexus/__init__.py

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions nexus/nexus/examples/qmcpack/rsqmc_misc/c20/c20.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /usr/bin/env python3

from nexus import settings,job,run_project
from nexus import settings,job,run_project,NEXUS_CONFIG
from nexus import read_structure
from nexus import generate_physical_system
from nexus import generate_pwscf
Expand Down Expand Up @@ -153,7 +153,7 @@


# print out the total energy
performed_runs = not settings.generate_only and not settings.status_only
performed_runs = not NEXUS_CONFIG.generate_only and not NEXUS_CONFIG.status_only
if performed_runs:
# get the qmcpack analyzer object
# it contains all of the statistically analyzed data from the run
Expand Down
4 changes: 2 additions & 2 deletions nexus/nexus/examples/qmcpack/rsqmc_misc/graphene/graphene.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /usr/bin/env python3

from nexus import settings,job,run_project
from nexus import settings,job,run_project,NEXUS_CONFIG
from nexus import generate_physical_system
from nexus import generate_pwscf
from nexus import generate_pw2qmcpack
Expand Down Expand Up @@ -203,7 +203,7 @@


# print out the total energy
performed_runs = not settings.generate_only and not settings.status_only
performed_runs = not NEXUS_CONFIG.generate_only and not NEXUS_CONFIG.status_only
if performed_runs:
# get the qmcpack analyzer object
# it contains all of the statistically analyzed data from the run
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /usr/bin/env python3

from nexus import settings
from nexus import settings, NEXUS_CONFIG
from nexus import generate_physical_system
from nexus import generate_pwscf,job
from nexus import run_project
Expand Down Expand Up @@ -64,7 +64,7 @@


# analyze the results
performed_runs = not settings.generate_only and not settings.status_only
performed_runs = not NEXUS_CONFIG.generate_only and not NEXUS_CONFIG.status_only
if performed_runs:
print()
print('Relaxation results:')
Expand Down
4 changes: 2 additions & 2 deletions nexus/nexus/gamess_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import numpy as np
from .periodic_table import Elements
from .developer import DevBase, obj, warn, FileFormatError
from .nexus_base import nexus_noncore
from .nexus_base import NEXUS_CONFIG
from .pseudoset import pp_elem_label, PseudoSet
from .simulation import SimulationInput
from .utilities import path_string
Expand Down Expand Up @@ -1253,7 +1253,7 @@ def generate_any_gamess_input(**kwargs):
#end if
if pskw.pseudos is None:
if pskw.bases is not None:
bss = nexus_noncore.basissets.bases_by_atom(*pskw.bases)
bss = NEXUS_CONFIG.basissets.bases_by_atom(*pskw.bases)
else:
bss = obj()
if 'coord' not in gi.contrl:
Expand Down
22 changes: 11 additions & 11 deletions nexus/nexus/machines.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
from subprocess import Popen, CalledProcessError
import numpy as np
from .developer import DevBase, obj, warn, NexusError
from .nexus_base import NexusCore, nexus_core
from .nexus_base import NexusCore, NEXUS_CONFIG
from .execute import execute
from .utilities import path_string
import importlib.util
Expand Down Expand Up @@ -637,7 +637,7 @@ def initialize(self,sim):
#end if
if self.subdir is None:
if machine.local_directory is not None:
self.subdir = os.path.join(machine.local_directory,nexus_core.runs,sim.path)
self.subdir = os.path.join(machine.local_directory,NEXUS_CONFIG.runs,sim.path)
self.abs_subdir = self.subdir
else:
self.subdir = self.directory
Expand Down Expand Up @@ -759,7 +759,7 @@ def serial_only(self):

# remove?
def determine_end_status(self,status):
if not nexus_core.generate_only:
if not NEXUS_CONFIG.generate_only:
self.successful = False # not really implemented yet
#end if
#end def determine_end_status
Expand Down Expand Up @@ -1312,7 +1312,7 @@ def query_queue(self):
self.validate()
done = []
for pid,process in self.processes.items():
if nexus_core.generate_only or not nexus_core.monitor:
if NEXUS_CONFIG.generate_only or not NEXUS_CONFIG.monitor:
qpid,status = pid,0
else:
qpid,status = os.waitpid(pid,os.WNOHANG)
Expand All @@ -1326,7 +1326,7 @@ def query_queue(self):
self.running.remove(iid)
self.finished.add(iid)
done.append(pid)
if not nexus_core.generate_only:
if not NEXUS_CONFIG.generate_only:
job.out.close()
job.err.close()
#end if
Expand Down Expand Up @@ -1369,7 +1369,7 @@ def submit_jobs(self):
job_req = job_req[order]

for job in job_req:
if job.cores>self.cores and not nexus_core.generate_only:
if job.cores>self.cores and not NEXUS_CONFIG.generate_only:
msg = (
'job '+str(job.internal_id)+' is too large to run on this machine\n'
'cores requested: '+str(job.cores)+'\n'
Expand Down Expand Up @@ -1443,11 +1443,11 @@ def submit_job(self,job):
job.status = job.states.running
process = obj()
process.job = job
if nexus_core.generate_only:
if NEXUS_CONFIG.generate_only:
self.log(pad+'Would have executed: '+command)
job.system_id = job.internal_id
else:
if nexus_core.monitor:
if NEXUS_CONFIG.monitor:
self.log(pad+'Executing: '+command)
job.out = open(job.outfile,'w')
job.err = open(job.errfile,'w')
Expand Down Expand Up @@ -1747,7 +1747,7 @@ def requeue_job(self,job):
#end if
self.process_job(job)
self.jobs[jid] = job
if not nexus_core.dynamic:
if not NEXUS_CONFIG.dynamic:
self.running.add(jid)
process = obj(job=job)
self.processes[pid] = process
Expand Down Expand Up @@ -2087,7 +2087,7 @@ def query_queue(self,out=None):
#end if
done = []
for pid,process in self.processes.items():
if pid not in self.system_queue or self.system_queue[pid]=='complete' or nexus_core.generate_only:
if pid not in self.system_queue or self.system_queue[pid]=='complete' or NEXUS_CONFIG.generate_only:
job = process.job
job.status = job.states.finished
job.finished = True
Expand Down Expand Up @@ -2138,7 +2138,7 @@ def submit_job(self,job):
raise FileNotFoundError(msg)
#end if
command = self.sub_command(job)
if nexus_core.generate_only:
if NEXUS_CONFIG.generate_only:
self.log(pad+'Would have executed: '+command)
job.status = job.states.running
process = obj()
Expand Down
Loading
Loading