~ubuntu-branches/ubuntu/vivid/mpich/vivid-proposed

« back to all changes in this revision

Viewing changes to src/mpi/romio/adio/ad_lustre/ad_lustre_hints.c

  • Committer: Package Import Robot
  • Author(s): Anton Gladky
  • Date: 2014-04-01 20:24:20 UTC
  • mfrom: (5.2.4 sid)
  • Revision ID: package-import@ubuntu.com-20140401202420-t5ey1ia2klt5dkq3
Tags: 3.1-4
* [c3e3398] Disable test_primitives, which is unreliable on some platforms.
            (Closes: #743047)
* [265a699] Add minimal autotest.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
 
11
11
#include "ad_lustre.h"
12
12
#include "adio_extern.h"
 
13
#include "hint_fns.h"
13
14
 
14
15
void ADIOI_LUSTRE_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code)
15
16
{
17
18
    int flag, stripe_val[3], str_factor = -1, str_unit=0, start_iodev=-1;
18
19
    struct lov_user_md lum = { 0 };
19
20
    int err, myrank, fd_sys, perm, amode, old_mask;
20
 
    int int_val, tmp_val;
21
21
    static char myname[] = "ADIOI_LUSTRE_SETINFO";
22
22
 
23
23
    value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char));
138
138
    if (users_info != MPI_INFO_NULL) {
139
139
        /* CO: IO Clients/OST,
140
140
         * to keep the load balancing between clients and OSTs */
141
 
        ADIOI_Info_get(users_info, "romio_lustre_co_ratio", MPI_MAX_INFO_VAL, value,
142
 
                     &flag);
143
 
        if (flag && (int_val = atoi(value)) > 0) {
144
 
            tmp_val = int_val;
145
 
            MPI_Bcast(&tmp_val, 1, MPI_INT, 0, fd->comm);
146
 
            if (tmp_val != int_val) {
147
 
                MPIO_ERR_CREATE_CODE_INFO_NOT_SAME(myname,
148
 
                                                   "romio_lustre_co_ratio",
149
 
                                                   error_code);
150
 
                ADIOI_Free(value);
151
 
                return;
152
 
            }
153
 
            ADIOI_Info_set(fd->info, "romio_lustre_co_ratio", value);
154
 
            fd->hints->fs_hints.lustre.co_ratio = atoi(value);
155
 
        }
 
141
        ADIOI_Info_check_and_install_int(fd, users_info, "romio_lustre_co_ratio", 
 
142
                &(fd->hints->fs_hints.lustre.co_ratio), myname, error_code );
 
143
 
156
144
        /* coll_threshold:
157
145
         * if the req size is bigger than this, collective IO may not be performed.
158
146
         */
159
 
        ADIOI_Info_get(users_info, "romio_lustre_coll_threshold", MPI_MAX_INFO_VAL, value,
160
 
                     &flag);
161
 
        if (flag && (int_val = atoi(value)) > 0) {
162
 
            tmp_val = int_val;
163
 
            MPI_Bcast(&tmp_val, 1, MPI_INT, 0, fd->comm);
164
 
            if (tmp_val != int_val) {
165
 
                MPIO_ERR_CREATE_CODE_INFO_NOT_SAME(myname,
166
 
                                                   "romio_lustre_coll_threshold",
167
 
                                                   error_code);
168
 
                ADIOI_Free(value);
169
 
                return;
170
 
            }
171
 
            ADIOI_Info_set(fd->info, "romio_lustre_coll_threshold", value);
172
 
            fd->hints->fs_hints.lustre.coll_threshold = atoi(value);
173
 
        }
 
147
        ADIOI_Info_check_and_install_int(fd, users_info, "romio_lustre_coll_threshold",
 
148
                &(fd->hints->fs_hints.lustre.coll_threshold), myname, error_code );
 
149
 
174
150
        /* ds_in_coll: disable data sieving in collective IO */
175
 
        ADIOI_Info_get(users_info, "romio_lustre_ds_in_coll", MPI_MAX_INFO_VAL,
176
 
                     value, &flag);
177
 
        if (flag && (!strcmp(value, "disable") ||
178
 
                     !strcmp(value, "DISABLE"))) {
179
 
            tmp_val = int_val = 2;
180
 
            MPI_Bcast(&tmp_val, 2, MPI_INT, 0, fd->comm);
181
 
            if (tmp_val != int_val) {
182
 
                MPIO_ERR_CREATE_CODE_INFO_NOT_SAME(myname,
183
 
                                                   "romio_lustre_ds_in_coll",
184
 
                                                   error_code);
185
 
                ADIOI_Free(value);
186
 
                return;
187
 
            }
188
 
            ADIOI_Info_set(fd->info, "romio_lustre_ds_in_coll", "disable");
189
 
            fd->hints->fs_hints.lustre.ds_in_coll = ADIOI_HINT_DISABLE;
190
 
        }
 
151
        ADIOI_Info_check_and_install_enabled(fd, users_info, "romio_lustre_ds_in_coll",
 
152
                &(fd->hints->fs_hints.lustre.ds_in_coll), myname, error_code );
 
153
 
191
154
    }
192
155
    /* set the values for collective I/O and data sieving parameters */
193
156
    ADIOI_GEN_SetInfo(fd, users_info, error_code);