File: ad_panfs_hints.c

package info (click to toggle)
openmpi 2.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 99,912 kB
  • ctags: 55,589
  • sloc: ansic: 525,999; f90: 18,307; makefile: 12,062; sh: 6,583; java: 6,278; asm: 3,515; cpp: 2,227; perl: 2,136; python: 1,350; lex: 734; fortran: 52; tcl: 12
file content (72 lines) | stat: -rw-r--r-- 2,472 bytes parent folder | download | duplicates (2)
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
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
/*
 *   ad_panfs_hints.c
 *
 *   Copyright (C) 2001 University of Chicago.
 *   See COPYRIGHT notice 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;
    }
}