1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
2 /*
3 *
4 * Copyright (C) 2003 University of Chicago, Ohio Supercomputer Center.
5 * See COPYRIGHT notice in top-level directory.
6 */
7
8 /*
9
10 Valid hints for ftp:// and gsiftp:// URLs (aside from the std. ones):
11
12 ftp_control_mode extended|block|stream|compressed
13 (default extended for gsiftp:// URLs and stream for ftp:// URLs)
14
15 parallelism integer number of simultaneous threads connecting to
16 ftp server (default 1)
17
18 striped_ftp true|false or enable|disable; enables gsiftp striped data transfer
19
20 tcp_buffer integer size of tcp stream buffers in bytes
21
22 transfer_type ascii or binary (default binary)
23
24 These *must* be specified at open time currently.
25 */
26
27 #include "ad_gridftp.h"
28 #include "adioi.h"
29
30 void ADIOI_GRIDFTP_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code)
31 {
32
33 if (!(fd->info))
34 {
35 if ( users_info==MPI_INFO_NULL )
36 {
37 /* This must be part of the open call. */
38 MPI_Info_create(&(fd->info));
39 }
40 else
41 {
42 MPI_Info_dup(users_info,&(fd->info));
43 }
44 }
45 else
46 {
47 int i,nkeys,valuelen,flag;
48 char key[MPI_MAX_INFO_KEY], value[MPI_MAX_INFO_VAL];
49
50 if ( users_info!=MPI_INFO_NULL )
51 {
52 MPI_Info_get_nkeys(users_info,&nkeys);
53 for (i=0;i<nkeys;i++)
54 {
55 MPI_Info_get_nthkey(users_info,i,key);
56 MPI_Info_get_valuelen(users_info,key,&valuelen,&flag);
57 if (flag)
58 {
59 ADIOI_Info_get(users_info,key,valuelen,value,&flag);
60 if (flag) ADIOI_Info_set(fd->info,key,value);
61 }
62 }
63 }
64 }
65
66 /* let the generic ROMIO and MPI-I/O stuff happen... */
67 ADIOI_GEN_SetInfo(fd, users_info, error_code);
68 }