File: ad_pvfs2_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 (117 lines) | stat: -rw-r--r-- 5,123 bytes parent folder | download | duplicates (6)
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/*
 * Copyright (C) by Argonne National Laboratory
 *     See COPYRIGHT in top-level directory
 */

#include <stdlib.h>
#include "ad_pvfs2.h"

#include "hint_fns.h"

void ADIOI_PVFS2_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code)
{
    char *value;
    int flag, tmp_value;
    static char myname[] = "ADIOI_PVFS_SETINFO";

    if ((fd->info) == MPI_INFO_NULL) {
        /* part of the open call */
        MPI_Info_create(&(fd->info));
        ADIOI_Info_set(fd->info, "romio_pvfs2_debugmask", "0");
        fd->hints->fs_hints.pvfs2.debugmask = 0;

        ADIOI_Info_set(fd->info, "striping_factor", "0");
        fd->hints->striping_factor = 0;

        ADIOI_Info_set(fd->info, "striping_unit", "0");
        fd->hints->striping_unit = 0;

        /* disable the aggressive strided optimizations by default */
        ADIOI_Info_set(fd->info, "romio_pvfs2_posix_read", "disable");
        ADIOI_Info_set(fd->info, "romio_pvfs2_posix_write", "disable");
        fd->hints->fs_hints.pvfs2.posix_read = ADIOI_HINT_DISABLE;
        fd->hints->fs_hints.pvfs2.posix_write = ADIOI_HINT_DISABLE;

        ADIOI_Info_set(fd->info, "romio_pvfs2_dtype_read", "disable");
        ADIOI_Info_set(fd->info, "romio_pvfs2_dtype_write", "disable");
        fd->hints->fs_hints.pvfs2.dtype_read = ADIOI_HINT_DISABLE;
        fd->hints->fs_hints.pvfs2.dtype_write = ADIOI_HINT_DISABLE;

        ADIOI_Info_set(fd->info, "romio_pvfs2_listio_read", "disable");
        ADIOI_Info_set(fd->info, "romio_pvfs2_listio_write", "disable");
        fd->hints->fs_hints.pvfs2.listio_read = ADIOI_HINT_DISABLE;
        fd->hints->fs_hints.pvfs2.listio_write = ADIOI_HINT_DISABLE;


        /* any user-provided hints? */
        if (users_info != MPI_INFO_NULL) {
            value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL + 1) * sizeof(char));
            /* pvfs2 debugging */
            ADIOI_Info_get(users_info, "romio_pvfs2_debugmask", MPI_MAX_INFO_VAL, value, &flag);
            if (flag) {
                tmp_value = fd->hints->fs_hints.pvfs2.debugmask =
                    PVFS_debug_eventlog_to_mask(value);

                MPI_Bcast(&tmp_value, 1, MPI_INT, 0, fd->comm);
                /* --BEGIN ERROR HANDLING-- */
                if (tmp_value != fd->hints->fs_hints.pvfs2.debugmask) {
                    MPIO_ERR_CREATE_CODE_INFO_NOT_SAME(myname, "romio_pvfs2_debugmask", error_code);
                    return;
                }
                /* --END ERROR HANDLING-- */

                ADIOI_Info_set(fd->info, "romio_pvfs2_debugmask", value);
            }

            /* the striping factor */
            ADIOI_Info_check_and_install_int(fd, users_info, "striping_factor",
                                             &(fd->hints->striping_factor), myname, error_code);


            /* the striping unit */
            ADIOI_Info_check_and_install_int(fd, users_info, "striping_unit",
                                             &(fd->hints->striping_unit), myname, error_code);

            /* distribution name */
            ADIOI_Info_get(users_info, "romio_pvfs2_distribution_name",
                           MPI_MAX_INFO_VAL, value, &flag);
            if (flag) {
            }

            /* POSIX read */
            ADIOI_Info_check_and_install_enabled(fd, users_info, "romio_pvfs2_posix_read",
                                                 &(fd->hints->fs_hints.pvfs2.posix_read), myname,
                                                 error_code);

            /* POSIX write */
            ADIOI_Info_check_and_install_enabled(fd, users_info, "romio_pvfs2_posix_write",
                                                 &(fd->hints->fs_hints.pvfs2.posix_write), myname,
                                                 error_code);

            /* Datatype read */
            ADIOI_Info_check_and_install_enabled(fd, users_info, "romio_pvfs2_dtype_read",
                                                 &(fd->hints->fs_hints.pvfs2.dtype_read), myname,
                                                 error_code);

            /* Datatype write */
            ADIOI_Info_check_and_install_enabled(fd, users_info, "romio_pvfs2_dtype_write",
                                                 &(fd->hints->fs_hints.pvfs2.dtype_write), myname,
                                                 error_code);

            /* Listio read */
            ADIOI_Info_check_and_install_enabled(fd, users_info, "romio_pvfs2_listio_read",
                                                 &(fd->hints->fs_hints.pvfs2.listio_read), myname,
                                                 error_code);

            /* Datatype write */
            ADIOI_Info_check_and_install_enabled(fd, users_info, "romio_pvfs2_listio_write",
                                                 &(fd->hints->fs_hints.pvfs2.listio_write), myname,
                                                 error_code);
            ADIOI_Free(value);
        }
    }
    /* set the values for collective I/O and data sieving parameters */
    ADIOI_GEN_SetInfo(fd, users_info, error_code);

    *error_code = MPI_SUCCESS;
}