[ase-users] [ase-developers] ASE calculator interface proposal

Jussi Enkovaara jussi.enkovaara at aalto.fi
Thu Jan 24 11:58:07 CET 2013


On 2013-01-24 12:14, Marcin Dulak wrote:
>> One question that should maybe also discussed is if there should
>> standard way to specify the command/binary to be executed when
>> calculator is run. Some calculators (e.g. Siesta) request a python
>> script containing the actual command to be executed, while other
>> calculators (e.g. Castep) ask for a shell command. I prefer the shell
>> command, as it is easier to specify e.g. number of CPUs within a batch
>> job script (at least for casual user who is used to do something like
>> 'mpirun -np 8 siesta'). People wanting to script everything may prefer
>> the first option...
> i think the best way is to have a choice here.
> For example aims interface
> (https://trac.fysik.dtu.dk/projects/ase/browser/trunk/ase/calculators/aims.py)
> offers you the choice of
> providing the run command as an init argument *run_command*
> or reading the AIMS_COMMAND environment variable.
> Some run commands may get quite involved:
> https://listserv.fysik.dtu.dk/pipermail/ase-developers/2012-November/001601.html

In the aims calculator the *run_command* seems to be just another way of 
specifying the shell command to be run. I think the main difference is 
whether the calculator uses "execfile" (as in siesta) or "os.system" as 
in aims. In case of execfile, the command has to be Python script, while 
os.system (or maybe in a more modern fashion subprocess.call) allows any 
shell commands/scripts. On the other hand execfile allows passing data 
between the namespaces of scripts. It would be of course possible to 
have both execfile and os.system options, and support
both calculator keyword (i.e. run_command) and environment variable,
but some standard convention might be nice.

> I like the related idea that there is a standard calculator method that
> verifies if the code
> has been installed and configured (i'm using *get_command* - see again
> the aims interface).
> In the tests one calls this method and raises NotAvailable to skip the test
> (see
> https://trac.fysik.dtu.dk/projects/ase/browser/trunk/ase/test/aims/aims_cmdline.py)

+1

Best regards,
Jussi



More information about the ase-users mailing list