17 | | [http://www.nemo-ocean.eu/Using-NEMO/User-Guides/Basics/XIOS-IO-server-installation-and-use Document here] (and come back to this page afterwards to create NEMO executable!) |
18 | | }}} |
| 17 | Note that NetCDF files created by XIOS are not compatible with NetCDF3. The softwares you use to see or analyze NEMO outputs needs to be linked with NetCDF4 and not NetCDF3. |
| 18 | |
| 19 | 2 - Download XIOS |
| 20 | The up to date version of XIOS is XIOS2 (previoulsy XIOS1). |
| 21 | XIOS uses xml input files. Those are slightly different from XIOS1 to XIOS2. For the moment, interface for both XIOS1 and XIO2 are available in NEMO, so as the xml files for both. |
| 22 | From nemo_v3_6_STABLE and further, use of XIOS2 is now strongly suggested. |
| 23 | |
| 24 | Download the XIOS2 software (this will create your xios-2.0 directory): |
| 25 | cd $HOME |
| 26 | svn co -r 819 http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/trunk xios-2.0 |
| 27 | ln -s xios-2.0 XIOS |
| 28 | |
| 29 | Install the XIOS library and executable: |
| 30 | Follow the documentation available here: http://forge.ipsl.jussieu.fr/ioserver/wiki/documentation |
| 31 | |
| 32 | Compile NEMO (see NEMO quickstart guide) using appropriate directives : |
| 33 | - NEMO must be compiled with with following cpp keys (see your NEMOCGM/CONFIG/"MY_CONFIG"/cpp*.fcm file: |
| 34 | |
| 35 | key_iomput and key_mpp_mpi |
| 36 | and also (if using XIOS2) |
| 37 | |
| 38 | key_xios2 |
| 39 | - you need to set appropriate PATHS for XIOS libraries in your ARCH/arch-xxxx.fcm file, |
| 40 | |
| 41 | see for example in NEMOGCM/ARCH, the arch files: arch-macport_osx.fcm, arch-PW6_VARGAS.fcm, arch-X64_CURIE.fcm or NOC |
| 42 | Input files for XIOS: |
| 43 | You need the following files: |
| 44 | |
| 45 | domain_def.xml |
| 46 | field_def.xml |
| 47 | iodef.xml |
| 48 | Templates can be found here: |
| 49 | |
| 50 | NEMOGCM/CONFIG/SHARED for field_def.xml and domain_def.xml |
| 51 | see NEMOGCM/CONFIG/ORCA2_LIM for examples of iodef*.xml |
| 52 | |
| 53 | (Templates for XIOS2 version are different from XIOS1 and can be found here: |
| 54 | |
| 55 | NEMOGCM/CONFIG/NEMOGCM/CONFIG/GYRE_XIOS for field_def.xml, file_def.xml, domain_def.xml, and example of iodef.xml) |
| 56 | |
| 57 | Run XIOS in attached mode: XIOS used as a library in NEMO, NEMO is the unique executable |
| 58 | This mode has bad performances but is convenient as you have only one executable. It is suitable if you use a relatively low number of cores. |
| 59 | |
| 60 | Define the attached mode in iodef.xml: |
| 61 | |
| 62 | <variable id="using_server" type="boolean">false</variable> |
| 63 | Choose the number of files created: |
| 64 | |
| 65 | You can create as many files as NEMO cores or produce directly 1 file for all NEMO cores, by choosing the attribute type of the tag "file_definition" in iodef.xml |
| 66 | |
| 67 | - As many files as NEMO cores : |
| 68 | |
| 69 | <file_definition type="multiple_file" sync_freq="1d" min_digits="4"> |
| 70 | Note that in this case, the files you will get are not located on the subdomains used in the mpi domain decomposition of NEMO. XIOS (even when it is used as a library) creates its own mpi domain decomposition in order to have subdomains containing complete lines (better for IO performances). |
| 71 | |
| 72 | - A unique file for all NEMO cores: |
| 73 | |
| 74 | <file_definition type="one_file" sync_freq="1d" min_digits="4"> |
| 75 | Note that this mode is not available if you compiled XIOS with the option "--netcdf_lib netcdf4_seq" or if the hdf/netcdf flibraries are not properly compiled to allow parallel IO. |
| 76 | |
| 77 | Check and eventually change the buffer_size |
| 78 | |
| 79 | The buffer size is defined in iodef.xml according to your domain size, the number of cores you use and the memory available on your machine. |
| 80 | Note that you will get a clear error message if this buffer is too small: |
| 81 | |
| 82 | <variable id="buffer_size" type="integer">10000000</variable> |
| 83 | Buffer_size must be bigger than jpi*jpj*jpk*8*3 (with jpi(not jpiglo) and jpj(not jpjglo) NEMO subdomain size) |
| 84 | |
| 85 | Run NEMO: |
| 86 | |
| 87 | mpirun -np x ./opa |
| 88 | Run XIOS in detached (or server) mode: XIOS used as a library in NEMO and as an external executable. |
| 89 | This mode has the best performances but is less convenient as you have to deal with two executables (NEMO and XIOS). |
| 90 | |
| 91 | Define the mode in iodef.xml: |
| 92 | |
| 93 | <variable id="using_server" type="boolean">true</variable> |
| 94 | Choose the number of files created: |
| 95 | |
| 96 | If you want to create 1 file per XIOS core or produce directly 1 file for all XIOS cores by choosing the attribute type of the tag "file_definition" in iodef.xml |
| 97 | - One file per XIOS core : |
| 98 | |
| 99 | <file_definition type="multiple_file" sync_freq="1d" min_digits="4"> |
| 100 | - A unique file for all XIOS cores: |
| 101 | |
| 102 | <file_definition type="one_file" sync_freq="1d" min_digits="4"> |
| 103 | Note that this mode is not available if you compiled XIOS with the option "--netcdf_lib netcdf4_seq" or if the hdf/netcdf flibraries are not properly compiled to allow parallel IO. |
| 104 | |
| 105 | Check and eventually change the buffer_size |
| 106 | |
| 107 | The buffer size is defined in iodef.xml according to your domain size, the number of cores you use and the memory available on your machine. |
| 108 | Note that you will get a clear error message if this buffer is too small: |
| 109 | |
| 110 | <variable id="buffer_size" type="integer">10000000</variable> |
| 111 | Buffer_size must be bigger than jpi*jpj*jpk*8*3 (with jpi(not jpiglo) and jpj(not jpjglo) the subdomain size) |
| 112 | |
| 113 | Copy xios executable in the directory to run NEMO: |
| 114 | |
| 115 | cp XIOS/bin/xios_server.exe . |
| 116 | Create once for all app.txt file: |
| 117 | |
| 118 | cat >app.txt |
| 119 | -np x ./opa # nemo will run on x cores |
| 120 | -np y ./xios_server.exe # xios will run on y cores |
| 121 | Run NEMO: |
| 122 | |
| 123 | mpirun --app app.txt |
| 124 | Advanced options: |
| 125 | |
| 126 | From version 482 of XIOS onwards, several advanced features have been added to the server's capabilities. These include: the ability to perform computations with combinations of output fields; the ability to change the precision of output variables and the ability to add user-defined attributes. The following PDF document contains details and some worked examples: |
| 127 | * Documentation: [attachment:wiki:Users/ModelInstall:newxios_functions_zooms.pdf] |
| 128 | |