コード例 #1
0
ファイル: Instrument.py プロジェクト: McStasMcXtrace/MCViNE
    def _configure(self):

        # XXX: to be removed
        # XXX: for backward compatibility
        dump_instrument = self.inventory.dump_instrument
        if dump_instrument:
            import warnings
            warnings.warn(
                'This option is not supported anymore. Please use --dump-pml')

        # handle dumppml
        # this overrides the option dumpconfiguration in order to
        # provide a simpler interface for users.
        dumppml = self.inventory.dumppml
        if dumppml:
            self.inventory.dumpconfiguration = True
            self._showHelpOnly = True

        base._configure(self)
        self.geometer = self.inventory.geometer
        self.overwrite_datafiles = self.inventory.overwrite_datafiles

        self.sequence = self.inventory.sequence
        self.buffer_size = self._getBufferSize()
        self.ncount = self.inventory.ncount
        if self.parallel:
            # every node only need to run a portion of the total counts
            partitions = getPartitions(self.ncount, self.mpiSize)
            self.ncount = partitions[self.mpiRank]

        # tracer
        tracer = self.inventory.tracer
        if tracer.name == 'no-neutron-tracer':
            tracer = None
        self.tracer = tracer

        return
コード例 #2
0
ファイル: Instrument.py プロジェクト: mcvine/mcvine
    def _configure(self):

        # XXX: to be removed
        # XXX: for backward compatibility
        dump_instrument = self.inventory.dump_instrument
        if dump_instrument:
            import warnings
            warnings.warn('This option is not supported anymore. Please use --dump-pml')
        
        # handle dumppml
        # this overrides the option dumpconfiguration in order to
        # provide a simpler interface for users.
        dumppml = self.inventory.dumppml
        if dumppml:
            self.inventory.dumpconfiguration = True
            self._showHelpOnly = True

        base._configure(self)
        self.geometer = self.inventory.geometer
        self.overwrite_datafiles = self.inventory.overwrite_datafiles
        
        self.sequence = self.inventory.sequence
        if self.inventory.mode == 'worker':
            self.buffer_size = self._getBufferSize()
            self.ncount = self.inventory.ncount
            if self.parallel:
                # every node only need to run a portion of the total counts
                partitions = getPartitions(self.ncount, self.mpi.size)
                self.ncount = partitions[self.mpi.rank]

        # tracer
        tracer = self.inventory.tracer
        if tracer.name == 'no-neutron-tracer':
            tracer = None
        self.tracer = tracer
        
        return
コード例 #3
0
ファイル: Instrument.py プロジェクト: McStasMcXtrace/MCViNE
 def __init__(self, name):
     base.__init__(self, name)
     self._warning = journal.warning(name)
     return
コード例 #4
0
ファイル: Instrument.py プロジェクト: McStasMcXtrace/MCViNE
 def _defaults(self):
     base._defaults(self)
     self.inventory.geometer = _build_geometer(self)
     return
コード例 #5
0
ファイル: Instrument.py プロジェクト: mcvine/mcvine
 def _defaults(self):
     base._defaults(self)
     self.inventory.geometer = _build_geometer( self )
     return
コード例 #6
0
ファイル: Instrument.py プロジェクト: mcvine/mcvine
 def __init__(self, name):
     base.__init__(self, name)
     self._warning = journal.warning( name )
     return