Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
darshan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
75
Issues
75
List
Boards
Labels
Milestones
Merge Requests
13
Merge Requests
13
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
darshan
darshan
Commits
ffc2ef63
Commit
ffc2ef63
authored
Feb 03, 2015
by
Philip Carns
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add cxx test case
- also fix misc. bash comparison operator goofs
parent
4831753d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
147 additions
and
9 deletions
+147
-9
darshan-test/regression/run-all.sh
darshan-test/regression/run-all.sh
+12
-3
darshan-test/regression/test-cases/cxxpi.sh
darshan-test/regression/test-cases/cxxpi.sh
+40
-0
darshan-test/regression/test-cases/mpi-io-test.sh
darshan-test/regression/test-cases/mpi-io-test.sh
+5
-5
darshan-test/regression/test-cases/src/cxxpi.cxx
darshan-test/regression/test-cases/src/cxxpi.cxx
+63
-0
darshan-test/regression/ws/setup-cc.sh
darshan-test/regression/ws/setup-cc.sh
+1
-1
darshan-test/regression/ws/setup-cxx.sh
darshan-test/regression/ws/setup-cxx.sh
+26
-0
No files found.
darshan-test/regression/run-all.sh
View file @
ffc2ef63
...
@@ -41,24 +41,33 @@ fi
...
@@ -41,24 +41,33 @@ fi
# set up c compiler for this platform
# set up c compiler for this platform
DARSHAN_CC
=
`
$DARSHAN_PLATFORM
/setup-cc.sh
`
DARSHAN_CC
=
`
$DARSHAN_PLATFORM
/setup-cc.sh
`
if
[
$?
!=
0
]
;
then
if
[
$?
-ne
0
]
;
then
exit
1
exit
1
fi
fi
export
DARSHAN_CC
export
DARSHAN_CC
# set up c++ compiler for this platform
DARSHAN_CXX
=
`
$DARSHAN_PLATFORM
/setup-cxx.sh
`
if
[
$?
-ne
0
]
;
then
exit
1
fi
export
DARSHAN_CXX
# set up job execution wrapper for this platform
# set up job execution wrapper for this platform
DARSHAN_RUNJOB
=
`
$DARSHAN_PLATFORM
/setup-runjob.sh
`
DARSHAN_RUNJOB
=
`
$DARSHAN_PLATFORM
/setup-runjob.sh
`
if
[
$?
!=
0
]
;
then
if
[
$?
-ne
0
]
;
then
exit
1
exit
1
fi
fi
export
DARSHAN_RUNJOB
export
DARSHAN_RUNJOB
for
i
in
`
ls
test-cases/
*
.sh
`
;
do
for
i
in
`
ls
test-cases/
*
.sh
`
;
do
echo
Running
${
i
}
...
$i
$i
if
[
$?
!=
0
]
;
then
if
[
$?
-ne
0
]
;
then
echo
"Error: failed to execute test case
$i
"
echo
"Error: failed to execute test case
$i
"
exit
1
exit
1
fi
fi
echo
Done.
done
done
exit
0
exit
0
darshan-test/regression/test-cases/cxxpi.sh
0 → 100755
View file @
ffc2ef63
#!/bin/bash
PROG
=
cxxpi
# set log file path; remove previous log if present
export
DARSHAN_LOGFILE
=
$DARSHAN_TMP
/
${
PROG
}
.darshan.gz
rm
-f
${
DARSHAN_LOGFILE
}
# compile
echo
$DARSHAN_CXX
test-cases/src/
${
PROG
}
.cxx
-o
$DARSHAN_TMP
/
${
PROG
}
$DARSHAN_CXX
test-cases/src/
${
PROG
}
.cxx
-o
$DARSHAN_TMP
/
${
PROG
}
if
[
$?
-ne
0
]
;
then
echo
"Error: failed to compile
${
PROG
}
"
1>&2
exit
1
fi
# execute
$DARSHAN_RUNJOB
$DARSHAN_TMP
/
${
PROG
}
-f
$DARSHAN_TMP
/
${
PROG
}
.tmp.dat
if
[
$?
-ne
0
]
;
then
echo
"Error: failed to execute
${
PROG
}
"
1>&2
exit
1
fi
# parse log
$DARSHAN_PATH
/bin/darshan-parser
$DARSHAN_LOGFILE
>
$DARSHAN_TMP
/
${
PROG
}
.darshan.txt
if
[
$?
-ne
0
]
;
then
echo
"Error: failed to parse
${
DARSHAN_LOGFILE
}
"
1>&2
exit
1
fi
# check results
# in this case we want to confirm that the open counts are zero; cxxpi does not do any IO
POSIX_OPENS
=
`
grep
CP_POSIX_OPENS
$DARSHAN_TMP
/
${
PROG
}
.darshan.txt |cut
-f
4
`
if
[
$POSIX_OPENS
!=
""
]
;
then
echo
"Error: Found unexpected POSIX open count of
$POSIX_OPENS
"
1>&2
exit
1
fi
exit
0
darshan-test/regression/test-cases/mpi-io-test.sh
View file @
ffc2ef63
...
@@ -8,21 +8,21 @@ rm -f ${DARSHAN_LOGFILE}
...
@@ -8,21 +8,21 @@ rm -f ${DARSHAN_LOGFILE}
# compile
# compile
$DARSHAN_CC
test-cases/src/
${
PROG
}
.c
-o
$DARSHAN_TMP
/
${
PROG
}
$DARSHAN_CC
test-cases/src/
${
PROG
}
.c
-o
$DARSHAN_TMP
/
${
PROG
}
if
[
$?
!=
0
]
;
then
if
[
$?
-ne
0
]
;
then
echo
"Error: failed to compile
${
PROG
}
"
1>&2
echo
"Error: failed to compile
${
PROG
}
"
1>&2
exit
1
exit
1
fi
fi
# execute
# execute
$DARSHAN_RUNJOB
$DARSHAN_TMP
/
${
PROG
}
-f
$DARSHAN_TMP
/
${
PROG
}
.tmp.dat
$DARSHAN_RUNJOB
$DARSHAN_TMP
/
${
PROG
}
-f
$DARSHAN_TMP
/
${
PROG
}
.tmp.dat
if
[
$?
!=
0
]
;
then
if
[
$?
-ne
0
]
;
then
echo
"Error: failed to execute
${
PROG
}
"
1>&2
echo
"Error: failed to execute
${
PROG
}
"
1>&2
exit
1
exit
1
fi
fi
# parse log
# parse log
$DARSHAN_PATH
/bin/darshan-parser
$DARSHAN_LOGFILE
>
$DARSHAN_TMP
/
${
PROG
}
.darshan.txt
$DARSHAN_PATH
/bin/darshan-parser
$DARSHAN_LOGFILE
>
$DARSHAN_TMP
/
${
PROG
}
.darshan.txt
if
[
$?
!=
0
]
;
then
if
[
$?
-ne
0
]
;
then
echo
"Error: failed to parse
${
DARSHAN_LOGFILE
}
"
1>&2
echo
"Error: failed to parse
${
DARSHAN_LOGFILE
}
"
1>&2
exit
1
exit
1
fi
fi
...
@@ -30,12 +30,12 @@ fi
...
@@ -30,12 +30,12 @@ fi
# check results
# check results
# in this case we want to confirm that both the MPI and POSIX open counters were triggered
# in this case we want to confirm that both the MPI and POSIX open counters were triggered
MPI_OPENS
=
`
grep
CP_INDEP_OPENS
$DARSHAN_TMP
/
${
PROG
}
.darshan.txt |cut
-f
4
`
MPI_OPENS
=
`
grep
CP_INDEP_OPENS
$DARSHAN_TMP
/
${
PROG
}
.darshan.txt |cut
-f
4
`
if
[
!
$MPI_OPENS
>
0
]
;
then
if
[
!
$MPI_OPENS
-gt
0
]
;
then
echo
"Error: MPI open count of
$MPI_OPENS
is incorrect"
1>&2
echo
"Error: MPI open count of
$MPI_OPENS
is incorrect"
1>&2
exit
1
exit
1
fi
fi
POSIX_OPENS
=
`
grep
CP_POSIX_OPENS
$DARSHAN_TMP
/
${
PROG
}
.darshan.txt |cut
-f
4
`
POSIX_OPENS
=
`
grep
CP_POSIX_OPENS
$DARSHAN_TMP
/
${
PROG
}
.darshan.txt |cut
-f
4
`
if
[
!
$POSIX_OPENS
>
0
]
;
then
if
[
!
$POSIX_OPENS
-gt
0
]
;
then
echo
"Error: POSIX open count of
$POSIX_OPENS
is incorrect"
1>&2
echo
"Error: POSIX open count of
$POSIX_OPENS
is incorrect"
1>&2
exit
1
exit
1
fi
fi
...
...
darshan-test/regression/test-cases/src/cxxpi.cxx
0 → 100644
View file @
ffc2ef63
/* -*- Mode: C++; c-basic-offset:4 ; -*- */
/*
* (C) 2004 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#include "mpi.h"
#include <iostream>
using
namespace
std
;
#include <math.h>
double
f
(
double
);
double
f
(
double
a
)
{
return
(
4.0
/
(
1.0
+
a
*
a
));
}
int
main
(
int
argc
,
char
**
argv
)
{
int
n
,
myid
,
numprocs
,
i
;
double
PI25DT
=
3.141592653589793238462643
;
double
mypi
,
pi
,
h
,
sum
,
x
;
double
startwtime
=
0.0
,
endwtime
;
int
namelen
;
char
processor_name
[
MPI_MAX_PROCESSOR_NAME
];
MPI
::
Init
(
argc
,
argv
);
numprocs
=
MPI
::
COMM_WORLD
.
Get_size
();
myid
=
MPI
::
COMM_WORLD
.
Get_rank
();
MPI
::
Get_processor_name
(
processor_name
,
namelen
);
cout
<<
"Process "
<<
myid
<<
" of "
<<
numprocs
<<
" is on "
<<
processor_name
<<
endl
;
n
=
10000
;
/* default # of rectangles */
if
(
myid
==
0
)
startwtime
=
MPI
::
Wtime
();
MPI
::
COMM_WORLD
.
Bcast
(
&
n
,
1
,
MPI_INT
,
0
);
h
=
1.0
/
(
double
)
n
;
sum
=
0.0
;
/* A slightly better approach starts from large i and works back */
for
(
i
=
myid
+
1
;
i
<=
n
;
i
+=
numprocs
)
{
x
=
h
*
((
double
)
i
-
0.5
);
sum
+=
f
(
x
);
}
mypi
=
h
*
sum
;
MPI
::
COMM_WORLD
.
Reduce
(
&
mypi
,
&
pi
,
1
,
MPI_DOUBLE
,
MPI_SUM
,
0
);
if
(
myid
==
0
)
{
endwtime
=
MPI
::
Wtime
();
cout
<<
"pi is approximately "
<<
pi
<<
" Error is "
<<
fabs
(
pi
-
PI25DT
)
<<
endl
;
cout
<<
"wall clock time = "
<<
endwtime
-
startwtime
<<
endl
;
}
MPI
::
Finalize
();
return
0
;
}
darshan-test/regression/ws/setup-cc.sh
View file @
ffc2ef63
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
# subsequent tests should be generated from this using darshan-gen-cc.pl.
# subsequent tests should be generated from this using darshan-gen-cc.pl.
$DARSHAN_PATH
/bin/darshan-gen-cc.pl
`
which mpicc
`
--output
$DARSHAN_TMP
/mpicc
$DARSHAN_PATH
/bin/darshan-gen-cc.pl
`
which mpicc
`
--output
$DARSHAN_TMP
/mpicc
if
[
$?
!=
0
]
;
then
if
[
$?
-ne
0
]
;
then
echo
"Error: failed to generate c compiler."
1>&2
echo
"Error: failed to generate c compiler."
1>&2
exit
1
exit
1
fi
fi
...
...
darshan-test/regression/ws/setup-cxx.sh
0 → 100755
View file @
ffc2ef63
#!/bin/bash
# General notes
#######################
# Script to set up the C++ compiler to use for subsequent test cases. This
# script may load optional modules (as in a Cray PE), set LD_PRELOAD
# variables (as in a dynamically linked environment), or generate mpicxx
# wrappers (as in a statically linked environment).
# The script should produce a single string to stdout, which is the command
# line to use for invoking the C compiler
# Notes specific to this platform (ws)
########################
# This particular version of the setup-cxx script assumes that mpicxx is
# present in the path already, and that the C++ compiler to use for
# subsequent tests should be generated from this using darshan-gen-cxx.pl.
$DARSHAN_PATH
/bin/darshan-gen-cxx.pl
`
which mpicxx
`
--output
$DARSHAN_TMP
/mpicxx
if
[
$?
-ne
0
]
;
then
echo
"Error: failed to generate c compiler."
1>&2
exit
1
fi
echo
$DARSHAN_TMP
/mpicxx
exit
0
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment