Changes between Version 20 and Version 21 of Plugin


Ignore:
Timestamp:
Dec 8, 2017, 10:44:56 AM (7 years ago)
Author:
Olivier Mattelaer
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Plugin

    v20 v21  
    405405new_interface = None
    406406 
     407
    407408 
    408409########################## CONTROL VARIABLE ####################################
     
    416417
    417418to use this plugin, you can either edit your file "input/mg5_configuration.txt" or type in the MG5aMC shell "set cluster_type new_condor".
     419
     420=== Example 4: Change hidden parameter of the run_card to change the default behavior of running
     421
     422This cluster request madgraph to reduce the number of submitted jobs (and therefore submitting longer jobs).
     423By setting the associated parameter in the run_card if the user did not specify those. (implemeted with/for Roberto Franscini)
     424
     425__init__.py
     426{{{
     427## import the required files
     428# example: import maddm_interface as maddm_interface # local file
     429#          import madgraph.various.cluster as cluster #MG5 distribution file
     430
     431import madxgraph.various.cluster as cluster
     432import time
     433
     434#local file
     435
     436class MYcluster(cluster.PBSCluster):
     437
     438    def modify_interface(self, run_interface):
     439        """
     440        routine which allow to modify the run_card/mg5cmd object to change the
     441        default behavior of the runs.
     442        This is called at the time of the compilation of the run_card.
     443        Note that this function can be called multiple times by run.
     444        """
     445        run_card = run_interface.run_card
     446        run_card.set('survey_nchannel_per_job',10, changeifuserset=False)
     447        run_card.set('refine_evt_by_job', 25000, changeifuserset=False)
     448        return super(MYcluster, self).modify_interface(run_interface)
     449
     450
     451# Three types of functionality are allowed in a plugin
     452#   1. new output mode
     453#   2. new cluster support
     454#   3. new interface
     455
     456# 1. Define new output mode
     457#    example: new_output = {'myformat': MYCLASS}
     458#    madgraph will then allow the command "output myformat PATH"
     459#    MYCLASS should inherated of the class madgraph.iolibs.export_v4.VirtualExporter
     460new_output = {}
     461
     462# 2. Define new way to handle the cluster.
     463#    example new_cluster = {'mycluster': MYCLUSTERCLASS}
     464#    allow "set cluster_type mycluster" in madgraph
     465#    MYCLUSTERCLASS should inherated from madgraph.various.cluster.Cluster
     466new_cluster = {'new_pbs': MYcluster}
     467
     468
     469# 3. Define a new interface (allow to add/modify MG5 command)
     470#    This can be activated via ./bin/mg5_aMC --mode=PLUGINNAME
     471## Put None if no dedicated command are required
     472new_interface = None
     473
     474
     475########################## CONTROL VARIABLE ####################################
     476__author__ = 'Mattelaer Olivier'
     477__email__ = 'o.p.c.mattelaer@durham.ac.uk'
     478__version__ = (1,0,0)
     479minimal_mg5amcnlo_version = (2,5,0)
     480maximal_mg5amcnlo_version = (1000,1000,1000)
     481latest_validated_version = (2,6,0)
     482
     483}}}