Difficulty creating a new test

Documentation, Web site and code modifications

Moderators: baguetl, routerov

Locked
abokhanc
Posts: 24
Joined: Tue Jul 29, 2014 4:28 pm

Difficulty creating a new test

Post by abokhanc » Mon Nov 10, 2014 3:37 pm

Hi all,

I'm trying to make a new test for my fold2Bloch utility, which is being integrated into abinit-7.11.2. The documentation says to edit the parser in testsuite.py, but I'm not sure where to start.
I know I need to change the executable and other parameters in the tXX.in file, as well as my output file to be tested. Fold2Bloch, however, requires the following command line to run:

Code: Select all

fold2Bloch H6o_WFK 1:2:3

where:
H6O_WFK is the input file (unformatted 750kB in size)
1:2:3 is the multiplicity in the corresponding direction used when constructing the super-cell (x:y:z)

I renamed my output file fold2Bloch.out into t01.out, and I put H6o_WFK as my "extra_inputs". My t01.in contains only the <TEST_INFO> part. So when I run "runtests.py", it says my input file doesn't have a valid "testcnf" ? section.
Any help will be greatly appreciated.

Thank you,

Anton

Jordan
Posts: 282
Joined: Tue May 07, 2013 9:47 am

Re: Difficulty creating a new test

Post by Jordan » Fri Nov 14, 2014 10:02 am

Hi,

I may not be helpful on the testsuite topic (Matteo is the person of interest) but I do have 3 remarks:

- Since November 4th we are at version 7.11.3, so you should branch this new version and merge your work into this branch.
- Using command line argument is only possible if the GET_COMMAND_ARGUMENT function is available in your compilater suite (which is tested by the build system). You may want to have a back up solution if you can not read the command arguments.
A quick solution would be to read those arguments from the stdin as in abinit : fold2Block < arguments_files > log
- Could you provide you tXX.in file so we can see what is in it ?

Jordan

User avatar
pouillon
Posts: 651
Joined: Wed Aug 19, 2009 10:08 am
Location: Spain
Contact:

Re: Difficulty creating a new test

Post by pouillon » Fri Nov 14, 2014 10:39 pm

You input file probably lacks a section of formatted comments at the end of the file that runtests.py is expecting to know how to run your test. Please have a look at random tests inputs for examples of what to put in these comments.
Yann Pouillon
Simune Atomistics
Donostia-San Sebastián, Spain

abokhanc
Posts: 24
Joined: Tue Jul 29, 2014 4:28 pm

Re: Difficulty creating a new test

Post by abokhanc » Mon Nov 17, 2014 4:15 pm

So here is what I've got for my t01.in :

Code: Select all

#%%<BEGIN TEST_INFO>
#%% [setup]
#%% executable = fold2Bloch
#%% [files]
#%% files_to_test =
#%%   t01.out, tolnlines = 0, tolabs = 0.0, tolrel = 0.0, fld_options =  -medium
#%% [paral_info]
#%% max_nprocs = 1
#%% [extra_info]
#%% authors =
#%% keywords = fold2Bloch
#%% description =
#%%   Test the unfolding of a Hydrogen Supercell
#%%<END TEST_INFO>


However, the actual input file used by FOLD2BLOCH is a binary _WFK file, created by ABINIT. So I'm not sure how to insert a binary file as input. Do I have to do it in two steps: run ABINIT first to create the file, then run FOLD2BLOCH? Or do I need to make my binary t02.in and put it in as extra input files?
For the Hydrogen test, _WFK file is 750kB

I read that when created a test for a new executable, the actual testsuite.py needs to be edited, the BASETEST class to be specific. However, I'm not sure where to start. Do I need to make a new subclass?

Thank you,

Anton

Jordan
Posts: 282
Joined: Tue May 07, 2013 9:47 am

Re: Difficulty creating a new test

Post by Jordan » Thu Nov 20, 2014 11:03 am

Usually, when you need an input _WFK file, what you do is creat one test that runs abinit to creat the files you need.
Then creat a second test chained with the first one.

So in your first test you must have

Code: Select all

#%% [setup]
#%% executable = abinit
#%% test_chain = t01.in , t02.in
#%%[shell]
#%% post_commands = ww_cp t01o_WFK t02i_WFK

This is just an example, you can use ww_mv as well.

Then you set up your t02 to run fold2bloch

Then to modify the testsuite, I think you should
1) modify tests/__init__.py and add you executable to the list (l. 798)
2) You have to creat a subclass of BaseTest to adapt the creation of files, copy of files, run of you code and so on.
But I am really not sure you can use the command line arguments to run your code since a JobRunner runs with only the # of MPI procs, bin_path stdin, stdout, stderr and path as arguments.
A JobRunner basically runs with

Code: Select all

executable < stdin> stdou 2> stderr

mpirun, valgrind or gdb can be inserted at the beginning of the line with some arguments that are passed through by the parser of runtests.py

Matteo G. is the person who can help you.

Jordan

abokhanc
Posts: 24
Joined: Tue Jul 29, 2014 4:28 pm

Re: Difficulty creating a new test

Post by abokhanc » Wed Dec 03, 2014 8:05 pm

Can you please give me his email.

Thank you,

Jordan
Posts: 282
Joined: Tue May 07, 2013 9:47 am

Re: Difficulty creating a new test

Post by Jordan » Thu Dec 04, 2014 9:29 am

You can find it here : http://www.uclouvain.be/matteo.giantomassi

Jordan

Locked