Skip to content

Commit

Permalink
Merge pull request #5 from NCAR/master
Browse files Browse the repository at this point in the history
Updating my fork
  • Loading branch information
Katetc committed Mar 15, 2016
2 parents 22fdf30 + 6d2accc commit 820aeda
Show file tree
Hide file tree
Showing 23 changed files with 2,854 additions and 1,756 deletions.
21 changes: 17 additions & 4 deletions doc/source/mach_walkthrough.txt
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ with: <pre>tar zxf parallel-netcdf-1.6.1.tar.gz</pre>

<p>Build with:
<pre>cd parallel-netcdf-1.6.1
FC=mpifort CC=mpicc ./configure --prefix=/usr/local
FC=mpifort CC=mpicc CFLAGS=-fPIC ./configure --prefix=/usr/local
make all check
sudo make install </pre>

Expand All @@ -371,16 +371,29 @@ sudo make install </pre>

<p>Download the netcdf C library from the <a
href="http://www.unidata.ucar.edu/downloads/netcdf/index.jsp">NetCDF download
page</a>. (These instructions were tested using version 4.3.3.1). Untar
with: <pre>tar zxf netcdf-4.3.3.1.tar.gz</pre>
page</a>. (These instructions were tested using version 4.4.0). Untar
with: <pre>tar zxf netcdf-c-4.4.0.tar.gz</pre>


<p>Build with:
<pre>cd netcdf-4.3.3.1
<pre>cd netcdf-c-4.4.0
CC=mpicc ./configure --with-zlib=/usr/local --prefix=/usr/local --with-szlib=/usr/local --with-hdf5=/usr/local --enable-pnetcdf --enable-parallel-tests --enable-logging
make all check
sudo make install </pre>

<li>Installing NetCDF-4 Fortran Library

<p>Download the netcdf Fortran library from the <a
href="http://www.unidata.ucar.edu/downloads/netcdf/index.jsp">NetCDF download
page</a>. (These instructions were tested using version 4.4.3). Untar
with: <pre>tar zxf netcdf-fortran-4.4.3.tar.gz</pre>


<p>Build with:
<pre>cd netcdf-fortran-4.4.3
F77=mpif77 F90=mpif90 ./configure --with-zlib=/usr/local --prefix=/usr/local --with-szlib=/usr/local --with-hdf5=/usr/local --enable-pnetcdf --enable-parallel-tests --enable-logging
make all check
sudo make install </pre>

<li>Installing ParallelIO Library

Expand Down
5 changes: 4 additions & 1 deletion examples/c/example1.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* processors.
*/

#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
Expand Down Expand Up @@ -280,6 +281,9 @@ int check_file(int ntasks, char *filename) {
/** Used for command line processing. */
int c;

/** Return value. */
int ret;

/* Parse command line. */
while ((c = getopt(argc, argv, "v")) != -1)
switch (c)
Expand All @@ -293,7 +297,6 @@ int check_file(int ntasks, char *filename) {

#ifdef TIMING
/* Initialize the GPTL timing library. */
int ret;
if ((ret = GPTLinitialize ()))
return ret;
#endif
Expand Down
4 changes: 3 additions & 1 deletion examples/c/example2.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* </pre>
*/

#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
Expand Down Expand Up @@ -437,6 +438,8 @@ int main(int argc, char* argv[])
/** Needed for command line processing. */
int c;

int ret;

/* Parse command line. */
while ((c = getopt(argc, argv, "v")) != -1)
switch (c)
Expand All @@ -450,7 +453,6 @@ int main(int argc, char* argv[])

#ifdef TIMING
/* Initialize the GPTL timing library. */
int ret;
if ((ret = GPTLinitialize ()))
return ret;
#endif
Expand Down
1 change: 1 addition & 0 deletions examples/c/examplePio.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* processors.
*/

#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
Expand Down
14 changes: 9 additions & 5 deletions src/clib/bget.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@
BGET CONFIGURATION
==================
*/
//#define PIO_USE_MALLOC 1
#ifdef PIO_USE_MALLOC
#include <stdlib.h>
#endif
Expand Down Expand Up @@ -610,11 +611,13 @@ void *bget(requested_size)
#endif

#ifdef PIO_USE_MALLOC
if(requested_size>maxsize){
maxsize=requested_size;
printf("%s %d %d\n",__FILE__,__LINE__,maxsize);
}
return(malloc(requested_size));
// if(requested_size>maxsize){
// maxsize=requested_size;
// printf("%s %d %d\n",__FILE__,__LINE__,maxsize);
// }
buf = malloc(requested_size);
// printf("bget allocate %ld %x\n",requested_size,buf);
return(buf);
#endif


Expand Down Expand Up @@ -875,6 +878,7 @@ void brel(buf)
struct bfhead *b, *bn;

#ifdef PIO_USE_MALLOC
// printf("bget free %d %x\n",__LINE__,buf);
free(buf);
return;
#endif
Expand Down
6 changes: 3 additions & 3 deletions src/clib/ncparser.pl
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
print F " if(name != NULL){ \n";
print F " int slen;\n";
print F " if(ios->iomaster)\n";
print F " slen = (int) strlen(name);\n";
print F " slen = (int) strlen(name) + 1;\n";
print F " mpierr = MPI_Bcast(&slen, 1, MPI_INT, ios->ioroot, ios->my_comm);\n";
print F " mpierr = MPI_Bcast(name, slen, MPI_CHAR, ios->ioroot, ios->my_comm);\n }\n";

Expand All @@ -316,15 +316,15 @@
print F " if(name != NULL){ \n";
print F " int slen;\n";
print F " if(ios->iomaster)\n";
print F " slen = (int) strlen(name);\n";
print F " slen = (int) strlen(name) + 1;\n";
print F " mpierr = MPI_Bcast(&slen, 1, MPI_INT, ios->ioroot, ios->my_comm);\n";
print F " mpierr = MPI_Bcast(name, slen, MPI_CHAR, ios->ioroot, ios->my_comm);\n }\n";
print F " if(lenp != NULL) mpierr = MPI_Bcast(lenp , 1, MPI_OFFSET, ios->ioroot, ios->my_comm);\n";
}elsif($func =~ /inq_dimname/ || $func =~ /inq_varname/ || $func =~ /inq_attname/){
print F " if(name != NULL){\n";
print F " int slen;\n";
print F " if(ios->iomaster)\n";
print F " slen = (int) strlen(name);\n";
print F " slen = (int) strlen(name) + 1;\n";
print F " mpierr = MPI_Bcast(&slen, 1, MPI_INT, ios->ioroot, ios->my_comm);\n";
print F " mpierr = MPI_Bcast(name, slen, MPI_CHAR, ios->ioroot, ios->my_comm);\n }\n";
}elsif($func =~ /inq_vardimid/){
Expand Down
15 changes: 7 additions & 8 deletions src/clib/pio.h
Original file line number Diff line number Diff line change
Expand Up @@ -366,19 +366,17 @@ int PIOc_def_var_deflate(int ncid, int varid, int shuffle, int deflate,
int PIOc_inq_var_deflate(int ncid, int varid, int *shufflep,
int *deflatep, int *deflate_levelp);
int PIOc_inq_var_szip(int ncid, int varid, int *options_maskp, int *pixels_per_blockp);
int PIOc_def_var_fletcher32(int ncid, int varid, int fletcher32);
int PIOc_inq_var_fletcher32(int ncid, int varid, int *fletcher32p);
int PIOc_def_var_chunking(int ncid, int varid, int storage, const size_t *chunksizesp);
int PIOc_inq_var_chunking(int ncid, int varid, int *storagep, size_t *chunksizesp);
int PIOc_def_var_chunking(int ncid, int varid, int storage, const PIO_Offset *chunksizesp);
int PIOc_inq_var_chunking(int ncid, int varid, int *storagep, PIO_Offset *chunksizesp);
int PIOc_def_var_fill(int ncid, int varid, int no_fill, const void *fill_value);
int PIOc_inq_var_fill(int ncid, int varid, int *no_fill, void *fill_valuep);
int PIOc_def_var_endian(int ncid, int varid, int endian);
int PIOc_inq_var_endian(int ncid, int varid, int *endianp);
int PIOc_set_chunk_cache(int iotype, int io_rank, size_t size, size_t nelems, float preemption);
int PIOc_get_chunk_cache(int iotype, int io_rank, size_t *sizep, size_t *nelemsp, float *preemptionp);
int PIOc_set_var_chunk_cache(int ncid, int varid, size_t size, size_t nelems,
int PIOc_set_chunk_cache(int iosysid, int iotype, PIO_Offset size, PIO_Offset nelems, float preemption);
int PIOc_get_chunk_cache(int iosysid, int iotype, PIO_Offset *sizep, PIO_Offset *nelemsp, float *preemptionp);
int PIOc_set_var_chunk_cache(int ncid, int varid, PIO_Offset size, PIO_Offset nelems,
float preemption);
int PIOc_get_var_chunk_cache(int ncid, int varid, size_t *sizep, size_t *nelemsp,
int PIOc_get_var_chunk_cache(int ncid, int varid, PIO_Offset *sizep, PIO_Offset *nelemsp,
float *preemptionp);
int PIOc_inq_var (int ncid, int varid, char *name, nc_type *xtypep, int *ndimsp, int *dimidsp, int *nattsp);
int PIOc_inq_varname (int ncid, int varid, char *name);
Expand Down Expand Up @@ -601,6 +599,7 @@ int PIOc_set_blocksize(const int newblocksize);
int PIOc_get_varm_short (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const PIO_Offset imap[], short *buf);
int PIOc_get_varm_ulonglong (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const PIO_Offset imap[], unsigned long long *buf);
int PIOc_get_var_schar (int ncid, int varid, signed char *buf);
int PIOc_iotype_available(const int iotype);

#if defined(__cplusplus)
}
Expand Down
Loading

0 comments on commit 820aeda

Please sign in to comment.