[DRMAA-WG] drmaa python
Enrico Sirola
enrico.sirola at gmail.com
Mon Oct 13 05:22:06 CDT 2008
Hi Cheng,
Il giorno 12/ott/08, alle ore 15:58, Cheng Soon Ong ha scritto:
> I imagine that many sites would have
> some sort of custom default resource requests (we definitely do
> here). My naive
> pythonic solution would be to have a base class which has the
> "basic" drmaa
> requests, and then a derived class which mirrors our local set of
> submit scripts
> so that jobs submitted via drmaa have identical rights (and default
> settings) to
> jobs submitted by command line. Would this be a good thing to do? I
> guess my
> question is more about "How does one customize drmaa for a
> particular site?". Or
> is it bad to have the class implementing "basic" drmaa requests,
> because the
> cluster system admins probably would like such jobs.
I guess here you would have some solutions:
1. perform the configuration work outside drmaa (e.g. configuring
different default parameters for different users/groups at the DRM
level)
2. using the DRMAA library:
* inheritance (this is what you outlined)
here you derive a new job type and override some parameters,
creating different job types for different environments.
* composition
create one (and only one) job type, put the various job
configurations somewhere else in another data structure (e.g. dict)
and pass it to the job in a standardized way (e.g. pass him a
configuration dictionary at construnction time)
Personally, I'd prefer 1 (zero-development). If this is not feasible,
I'd go for composition: you are not changing the job behaviour, just
its configuration parameters so I'd have these parameters sets stored
somwhere (text files/relational DB/dicts in a python module - your
choice) different from class attributes. Anyway all 3 approaches are
effective, it just depends on your use case.
Cheers,
e.
More information about the drmaa-wg
mailing list