# The protocol file generated by protogen.py ver. 1.0 on 2013-06-27 12:54
# AUTHOR: Magda S aka Magic Magg magg dot gatech at gmail dot com
# DATE: 2013-08-05


DESCRIPTION
===========
The idea of this test is to have something similar that we have in Maya.
We create a similar, yet simplified structure we are using in Maya.
The basic idea is to write down a lot of ADIOS variables and see if I can reread it.
You can change the number of outputted variables with in utils.h/MAYA_GRID_FUNC_COUNT.
I call them the grid function. The test is slightly convoluted. Sorry for that
but Maya is challenging.

Actually, this test was used to find the
hash table bug (and later redesigned in the adios). As we tried to write 
same variables a few times, and ADIOS at that time couldn't handle that.

RUN
===== 
# to clean files hanging around after previous runs
$ make -f Makefile.generic clean_test

# the test is designed to run one writer and one reader
$ ./writer -t mpi
$ ./reader -t mpi

See Makefile for other options of running the test.

PLAYING WITH TEST CONFIGURATION
===============================
To play with the test configuration, you can modify macros in the cfg.h file

- MAYA_GRID_FUNC_COUNT this will increase the number of variables output
  (you might need to increase/decrease the ADS_BUFFER_SIZE see troubleshooting)

NOTES
======
2013-08-05 Test passes with the MPI method on my laptop; it fails with the FLEXPATH method
enabled (branch v1.5.1)

 $ ./writer -t flx
ERROR: set_format: Unknown Type Error 54
[heffalin:10320] *** Process received signal ***
[heffalin:10320] Signal: Segmentation fault (11)
[heffalin:10320] Signal code: Address not mapped (1)
[heffalin:10320] Failing at address: (nil)
[heffalin:10320] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x364a0) [0x7fbbfda764a0]
[heffalin:10320] [ 1] ./writer(adios_flexpath_open+0x1003) [0x475d46]
[heffalin:10320] [ 2] ./writer() [0x408df1]
[heffalin:10320] [ 3] ./writer() [0x408353]
[heffalin:10320] [ 4] ./writer() [0x4077a5]
[heffalin:10320] [ 5] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7fbbfda6176d]
[heffalin:10320] [ 6] ./writer() [0x406e19]
[heffalin:10320] *** End of error message ***
Segmentation fault


TROUBLESHOOTING
================

2013-08-06, ERROR adios_allocate_buffer(): insufficient memory

ERROR: adios_allocate_buffer (): insufficient memory: 5242880000 requested, 860221440 available.  Using available.

$ grep ADS_BUFFER_SIZE cfg.h
#define ADS_BUFFER_SIZE 50

Try changing the ADS_BUFFER_SIZE in cfg.h to a smaller value.

OUTDATED (2013-07-08)
======================
I will update later. 

RUNNING ON KRAKEN
=================
This runs one reader per node and one writer per node.

aprun -n 1 -N 1 ./arrays_read &
aprun -n 1 -N 1 ./arrays_write

You should be able to run the example with as many readers and writers as you wish.

Example PBS script
------------------
#!/bash/bin
#PBS -l walltime=00:05:00,size=24
#PBS -A UT-TENN0033

date

echo "nodefile="
cat $PBS_NODEFILE
echo "=end nodefile"

# make sure you have all modules loaded
module use ~smagg/opt/modulefiles
module load mag-mxml-2.7/kraken-gnu
module list

cd $PBS_O_WORKDIR

aprun -n 1 -N 1 ./arrays_read &
aprun -n 1 -N 1 ./arrays_write

date

# eof


TROUBLESHOOTING
===============

There might be text files left; they should be removed for the next run.

# EOF
