File: ad_panfs_hints.c

package info (click to toggle)
openmpi 5.0.8-4
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 201,684 kB
  • sloc: ansic: 613,078; makefile: 42,353; sh: 11,194; javascript: 9,244; f90: 7,052; java: 6,404; perl: 5,179; python: 1,859; lex: 740; fortran: 61; cpp: 20; tcl: 12
file content (71 lines) | stat: -rw-r--r-- 2,895 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
 * Copyright (C) by Argonne National Laboratory
 *     See COPYRIGHT in top-level directory
 */

#include "ad_panfs.h"
#include <pan_fs_client_cw_mode.h>
#include "hint_fns.h"

void ADIOI_PANFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code)
{
#if defined(MPICH) || !defined(PRINT_ERR_MSG)
    static char myname[] = "ADIOI_PANFS_SETINFO";
#endif
    int gen_error_code;

    *error_code = MPI_SUCCESS;

    if (fd->info == MPI_INFO_NULL) {
        /* This must be part of the open call. can set striping parameters
         * if necessary.
         */
        MPI_Info_create(&(fd->info));

        /* anticipate concurrent writes in an MPI-IO application */
        ADIOI_Info_set(fd->info, "panfs_concurrent_write", "1");

        /* has user specified striping parameters
         * and do they have the same value on all processes? */
        if (users_info != MPI_INFO_NULL) {

            ADIOI_Info_check_and_install_int(fd, users_info, "panfs_concurrent_write",
                                             NULL, myname, error_code);

            ADIOI_Info_check_and_install_int(fd, users_info, "panfs_layout_type",
                                             NULL, myname, error_code);

            ADIOI_Info_check_and_install_int(fd, users_info, "panfs_layout_stripe_unit",
                                             NULL, myname, error_code);

            /* strange: there was a check "layout_type ==
             * PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE, but
             * nothing ever touched layout_type  */
            ADIOI_Info_check_and_install_int(fd, users_info,
                                             "panfs_layout_parity_stripe_width", NULL, myname,
                                             error_code);

            ADIOI_Info_check_and_install_int(fd, users_info,
                                             "panfs_layout_parity_stripe_depth", NULL, myname,
                                             error_code);

            ADIOI_Info_check_and_install_int(fd, users_info,
                                             "panfs_layout_total_num_comps", NULL, myname,
                                             error_code);
            /* this hint used to check for
             * PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE or
             * PAN_FS_CLIENT_LAYOUT_TYPE__RAID10, but again, layout_type never
             * gets updated */
            ADIOI_Info_check_and_install_int(fd, users_info,
                                             "panfs_layout_visit_policy", NULL, myname, error_code);
        }
    }

    ADIOI_GEN_SetInfo(fd, users_info, &gen_error_code);
    /* If this function is successful, use the error code returned from ADIOI_GEN_SetInfo
     * otherwise use the error_code generated by this function
     */
    if (*error_code == MPI_SUCCESS) {
        *error_code = gen_error_code;
    }
}