Пример #1
0
 def __init__(self, new=False):
     """
     description will contain the description of the cluster and code version and compilation
     data will contain the actual data
     """
     self.description = get_description(self.code)
     if new:
         if not self.description.read_from_file():
             print('desctipion found, create it from template please:')
             if not self.description.create_interactively_from_template():
                 raise RuntimeError
     try:
         self.col = get_collection(collection=self.code+"-"+self.version)
     except pymongo.errors.OperationFailure:
         print("pymongo operation failure, no DB support")
     self.data = {}
     self.ncpus = []
     self.gh = []
     self.systems = []
     self.data = {}
Пример #2
0
 def __init__(self, new=False):
     """
     description will contain the description of the cluster and code version and compilation
     data will contain the actual data
     """
     self.description = get_description(self.code)
     if new:
         if not self.description.read_from_file():
             print('desctipion found, create it from template please:')
             if not self.description.create_interactively_from_template():
                 raise RuntimeError
     try:
         self.col = get_collection(collection=self.code + "-" +
                                   self.version)
     except pymongo.errors.OperationFailure:
         print("pymongo operation failure, no DB support")
     self.data = {}
     self.ncpus = []
     self.gh = []
     self.systems = []
     self.data = {}
Пример #3
0
 def get_from_db(self, dh=None):
     if dh == None:
         """
         no description hash specified: create a list of all gh available and let the user pick one
         """
         data_sets = self.col.find()
         i = 0
         hash_list = []
         for data_set in data_sets:
             print("set %s:" % i)
             hash_list.append(data_set['desc_hash'])
             desc = get_description(self.code)
             desc.from_db_entry(data_set)
             print(desc)
             i += 1
         dh = hash_list[int(raw_input('Which set should be imported?\n'))]
     print(dh)
     entry = self.col.find({'desc_hash': dh})[0]
     #pprint.pprint(entry)
     self.data = entry['data']
     self.description.from_db_entry(entry)
     print(self.description)
Пример #4
0
 def get_from_db(self, dh=None):
     if dh == None:
         """
         no description hash specified: create a list of all gh available and let the user pick one
         """
         data_sets = self.col.find()
         i = 0
         hash_list = []
         for data_set in data_sets:
             print("set %s:" % i)
             hash_list.append(data_set['desc_hash'])
             desc = get_description(self.code)
             desc.from_db_entry(data_set)
             print(desc)
             i += 1
         dh = hash_list[int(raw_input('Which set should be imported?\n'))]
     print(dh)
     entry = self.col.find({'desc_hash': dh})[0]
     #pprint.pprint(entry)
     self.data = entry['data']
     self.description.from_db_entry(entry)
     print(self.description)
Пример #5
0
from __future__ import print_function, division

__author__ = 'setten'
__version__ = "0.1"
__maintainer__ = "Michiel van Setten"
__email__ = "*****@*****.**"
__date__ = "Sept 2014"
"""
Script to setup a set of benchmark calculations
"""

from PyBench.core.descriptions import get_description
from PyBench.core.benchmarks import get_benchmark
import os

if __name__ == "__main__":
    code = 'vasp'
    desc = get_description(code=code)
    if not os.path.isfile('description'):
        desc.print_template()
    bench = get_benchmark('standard_vasp', code=code)
    bench.create_input()
    bench.create_job_collection()
Пример #6
0
from __future__ import print_function, division

__author__ = 'setten'
__version__ = "0.1"
__maintainer__ = "Michiel van Setten"
__email__ = "*****@*****.**"
__date__ = "Sept 2014"


"""
Script to setup a set of benchmark calculations
"""


from PyBench.core.descriptions import get_description
from PyBench.core.benchmarks import get_benchmark
import os

if __name__ == "__main__":
    code = 'vasp'
    desc = get_description(code=code)
    if not os.path.isfile('description'):
        desc.print_template()
    bench = get_benchmark('standard_vasp', code=code)
    bench.create_input()
    bench.create_job_collection()