Skip to content

Commit

Permalink
Initial addition of dSFMT files and documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpgill86 committed Nov 13, 2009
0 parents commit 0e75d9e
Show file tree
Hide file tree
Showing 57 changed files with 9,329 additions and 0 deletions.
674 changes: 674 additions & 0 deletions COPYING

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Chemical Metabolism Simulator
=============================

Chemical Metabolism Simulator is a work in progress.

Dependencies
============

This project uses code developed by the Qt, Qwt, and SFMT projects.

To build this program, you will need to install the development tools for
Qt 4 (version 4.3 or later, available from www.trolltech.com) and the Qwt
libraries (available from qwt.sourceforge.net). The SFMT libraries have
been modified and are included with the source code, but the project page
can be found at http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT ).

Compilation Instructions
========================
This program uses the standard Qt build process run from the src directory:

cd src
qmake
make

40 changes: 40 additions & 0 deletions dSFMT/CHANGE-LOG.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
ver 1.2.1
-------
add #include <altivec.h> to dSFMT.c

ver 1.2
-------
The precision specifier of printf was too large in test.c
CAUTION! *.out.txt is changed.
add dSFMT-params216091.h
gcc compile option changed form -O9 to -O3.
add AltiVec parameter format for systems which are not OSX.
change Makefile for systems which are not OSX and support AltiVec.
change sample2 of howto-compile for Free BSD.
change period certification code more smart.
change source files for BORLANDC and Visual Studio.

ver 1.1.1
-------
BUG in dSFMT-sse2.h is fixed.
This bug didn't change the result.
Change test.c

ver 1.1
-------
add dSFMT-params132049.h
fix bug in period_certification. It's a bug but result is the same for
all parameter files.
change macro definition names and global variables. Thank you, Adam Piatyszek.
remove L suffix from floating point constants. It's Saito's misunderstanding.
fix bug of sfmt_idxof definition for BIG ENDIAN machine.

ver 1.0.1
-------
change name dSFMT-alti.c to SFMT-alti.h
change name dSFMT-sse2.c to SFMT-sse2.h
This version is not released.

ver 1.0
-------
The first version.
37 changes: 37 additions & 0 deletions dSFMT/FILES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
This archive contails following directories and files.

TOP DIRECTORY
FILES.txt: This file.
CHANGE-LOG.txt change log.
LICENSE.txt: License file.
Makefile: Makefile for test programs.
dSFMT.h: Header file.
dSFMT-params.h: parameter file control for various Mersenne expornent
dSFMT-params607.h: parameters for period of 2^{607}-1
dSFMT-params1279.h: parameters for period of 2^{1279}-1
dSFMT-params2281.h: parameters for period of 2^{2281}-1
dSFMT-params4423.h: parameters for period of 2^{4423}-1
dSFMT-params11213.h: parameters for period of 2^{11213}-1
dSFMT-params19937.h: parameters for period of 2^{19937}-1
dSFMT-params44497.h: parameters for period of 2^{44497}-1
dSFMT-params86243.h: parameters for period of 2^{86243}-1
dSFMT-params132049.h: parameters for period of 2^{132049}-1
dSFMT-params216091.h: parameters for period of 2^{216091}-1
dSFMT-ref.c: simple reference C code.
dSFMT.c: C code for standard C (c99) and unix like systems.
dSFMT-alti.h: C code optimized for PowerPC AltiVec.
dSFMT-sse2.h: C code optimized for intel SSE2.
test.c: Test driver for standard C.
check.sh: Test shell script.
dSFMT.607.out.txt: correct output of dSFMT MEXP=607
dSFMT.1279.out.txt: correct output of dSFMT MEXP=1279
dSFMT.2281.out.txt: correct output of dSFMT MEXP=2281
dSFMT.4423.out.txt: correct output of dSFMT MEXP=4423
dSFMT.11213.out.txt: correct output of dSFMT MEXP=11213
dSFMT.19937.out.txt: correct output of dSFMT MEXP=19937
dSFMT.44497.out.txt: correct output of dSFMT MEXP=44497
dSFMT.86243.out.txt: correct output of dSFMT MEXP=86243
dSFMT.132049.out.txt: correct output of dSFMT MEXP=132049
dSFMT.216091.out.txt: correct output of dSFMT MEXP=216091

html DIRECTORY: The documents generated by doxygen.
29 changes: 29 additions & 0 deletions dSFMT/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Copyright (c) 2007, Mutsuo Saito, Makoto Matsumoto and Hiroshima University.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of the Hiroshima University nor the names of
its contributors may be used to endorse or promote products
derived from this software without specific prior written
permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
188 changes: 188 additions & 0 deletions dSFMT/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
# @file Makefile
# @brief Makefile
#
# @author Mutsuo Saito (Hiroshima University)
# @author Makoto Matsumoto (Hiroshima University)
#
# Copyright (C) 2007 Mutsuo Saito, Makoto Matsumoto and Hiroshima
# University. All rights reserved.
#
# The new BSD License is applied to this software.
# see LICENSE.txt
#
# @note
# We could comple test-sse2-Mxxx using gcc 3.4.4 of cygwin.
# We could comple test-sse2-Mxxx using gcc 4.0.1 of Linux.
# We coundn't comple test-sse2-Mxxx using gcc 3.3.2 of Linux.
# We could comple test-alti-Mxxx using gcc 3.3 of osx.
# We could comple test-alti-Mxxx using gcc 4.0 of osx.

WARN = -Wmissing-prototypes -Wall #-Winline
#WARN = -Wmissing-prototypes -Wall -W
OPTI = -O3 -finline-functions -fomit-frame-pointer -DNDEBUG \
-fno-strict-aliasing --param max-inline-insns-single=1800
#--param inline-unit-growth=500 --param large-function-growth=900 #for gcc 4
#STD =
#STD = -std=c89 -pedantic
#STD = -std=c99 -pedantic
STD = -std=c99
CC = gcc
CCFLAGS = $(OPTI) $(WARN) $(STD)
ALTIFLAGS = -mabi=altivec -maltivec -DHAVE_ALTIVEC
OSXALTIFLAGS = -faltivec -maltivec -DHAVE_ALTIVEC
SSE2FLAGS = -msse2 -DHAVE_SSE2
STD_TARGET = test-std-M19937
ALL_STD_TARGET = test-std-M607 test-std-M1279 test-std-M2281 test-std-M4423 \
test-std-M11213 test-std-M19937 test-std-M44497 test-std-M86243 \
test-std-M132049 test-std-M216091
ALTI_TARGET = $(STD_TARGET) test-alti-M19937
ALL_ALTI_TARGET = test-alti-M607 test-alti-M1279 test-alti-M2281 \
test-alti-M4423 test-alti-M11213 test-alti-M19937 test-alti-M44497 \
test-alti-M86243 test-alti-M132049 test-alti-M216091
SSE2_TARGET = $(STD_TARGET) test-sse2-M19937
ALL_SSE2_TARGET = test-sse2-M607 test-sse2-M1279 test-sse2-M2281 \
test-sse2-M4423 test-sse2-M11213 test-sse2-M19937 test-sse2-M44497 \
test-sse2-M86243 test-sse2-M132049 test-sse2-M216091
# ==========================================================
# comment out or EDIT following lines to get max performance
# ==========================================================
# --------------------
# for gcc 4
# --------------------
#CCFLAGS += --param inline-unit-growth=500 \
#--param large-function-growth=900
# --------------------
# for icl
# --------------------
#CC = icl /Wcheck /O3 /QxB /Qprefetch
# -----------------
# for PowerPC
# -----------------
#CCFLAGS += -arch ppc
# -----------------
# for Pentium M
# -----------------
#CCFLAGS += -march=prescott
# -----------------
# for Athlon 64
# -----------------
#CCFLAGS += -march=athlon64

.PHONY: std-check sse2-check alti-check

std: ${STD_TARGET}

sse2: ${SSE2_TARGET}

alti: ${ALTI_TARGET}

osx-alti:
${MAKE} "ALTIFLAGS=${OSXALTIFLAGS}" alti

std-check: ${ALL_STD_TARGET}
./check.sh test-std

sse2-check: ${ALL_SSE2_TARGET}
./check.sh test-sse2

alti-check: ${ALL_ALTI_TARGET}
./check.sh test-alti

osx-alti-check:
make "ALTIFLAGS=${OSXALTIFLAGS}" alti-check

test-std-M607: test.c dSFMT.c dSFMT.h
${CC} ${CCFLAGS} -DSFMT_MEXP=607 -o $@ test.c

test-alti-M607: test.c dSFMT.c dSFMT.h
${CC} ${CCFLAGS} ${ALTIFLAGS} -DSFMT_MEXP=607 -o $@ test.c

test-sse2-M607: test.c dSFMT.c dSFMT.h
${CC} ${CCFLAGS} ${SSE2FLAGS} -DSFMT_MEXP=607 -o $@ test.c

test-std-M1279: test.c dSFMT.c dSFMT.h
${CC} ${CCFLAGS} -DSFMT_MEXP=1279 -o $@ test.c

test-alti-M1279: test.c dSFMT.c dSFMT.h
${CC} ${CCFLAGS} ${ALTIFLAGS} -DSFMT_MEXP=1279 -o $@ test.c

test-sse2-M1279: test.c dSFMT.c dSFMT.h
${CC} ${CCFLAGS} ${SSE2FLAGS} -DSFMT_MEXP=1279 -o $@ test.c

test-std-M2281: test.c dSFMT.c dSFMT.h
${CC} ${CCFLAGS} -DSFMT_MEXP=2281 -o $@ test.c

test-alti-M2281: test.c dSFMT.c dSFMT.h
${CC} ${CCFLAGS} ${ALTIFLAGS} -DSFMT_MEXP=2281 -o $@ test.c

test-sse2-M2281: test.c dSFMT.c dSFMT.h
${CC} ${CCFLAGS} ${SSE2FLAGS} -DSFMT_MEXP=2281 -o $@ test.c

test-std-M4423: test.c dSFMT.c dSFMT.h
${CC} ${CCFLAGS} -DSFMT_MEXP=4423 -o $@ test.c

test-alti-M4423: test.c dSFMT.c dSFMT.h
${CC} ${CCFLAGS} ${ALTIFLAGS} -DSFMT_MEXP=4423 -o $@ test.c

test-sse2-M4423: test.c dSFMT.c dSFMT.h
${CC} ${CCFLAGS} ${SSE2FLAGS} -DSFMT_MEXP=4423 -o $@ test.c

test-std-M11213: test.c dSFMT.c dSFMT.h
${CC} ${CCFLAGS} -DSFMT_MEXP=11213 -o $@ test.c

test-alti-M11213: test.c dSFMT.c dSFMT.h
${CC} ${CCFLAGS} ${ALTIFLAGS} -DSFMT_MEXP=11213 -o $@ test.c

test-sse2-M11213: test.c dSFMT.c dSFMT.h
${CC} ${CCFLAGS} ${SSE2FLAGS} -DSFMT_MEXP=11213 -o $@ test.c

test-std-M19937: test.c dSFMT.c dSFMT.h
${CC} ${CCFLAGS} -DSFMT_MEXP=19937 -o $@ test.c

test-alti-M19937: test.c dSFMT.c dSFMT.h
${CC} ${CCFLAGS} ${ALTIFLAGS} -DSFMT_MEXP=19937 -o $@ test.c

test-sse2-M19937: test.c dSFMT.c dSFMT.h
${CC} ${CCFLAGS} ${SSE2FLAGS} -DSFMT_MEXP=19937 -o $@ test.c

test-std-M44497: test.c dSFMT.c dSFMT.h
${CC} ${CCFLAGS} -DSFMT_MEXP=44497 -o $@ test.c

test-alti-M44497: test.c dSFMT.c dSFMT.h
${CC} ${CCFLAGS} ${ALTIFLAGS} -DSFMT_MEXP=44497 -o $@ test.c

test-sse2-M44497: test.c dSFMT.c dSFMT.h
${CC} ${CCFLAGS} ${SSE2FLAGS} -DSFMT_MEXP=44497 -o $@ test.c

test-std-M86243: test.c dSFMT.c dSFMT.h
${CC} ${CCFLAGS} -DSFMT_MEXP=86243 -o $@ test.c

test-alti-M86243: test.c dSFMT.c dSFMT.h
${CC} ${CCFLAGS} ${ALTIFLAGS} -DSFMT_MEXP=86243 -o $@ test.c

test-sse2-M86243: test.c dSFMT.c dSFMT.h
${CC} ${CCFLAGS} ${SSE2FLAGS} -DSFMT_MEXP=86243 -o $@ test.c

test-std-M132049: test.c dSFMT.c dSFMT.h
${CC} ${CCFLAGS} -DSFMT_MEXP=132049 -o $@ test.c

test-alti-M132049: test.c dSFMT.c dSFMT.h
${CC} ${CCFLAGS} ${ALTIFLAGS} -DSFMT_MEXP=132049 -o $@ test.c

test-sse2-M132049: test.c dSFMT.c dSFMT.h
${CC} ${CCFLAGS} ${SSE2FLAGS} -DSFMT_MEXP=132049 -o $@ test.c

test-std-M216091: test.c dSFMT.c dSFMT.h
${CC} ${CCFLAGS} -DSFMT_MEXP=216091 -o $@ test.c

test-alti-M216091: test.c dSFMT.c dSFMT.h
${CC} ${CCFLAGS} ${ALTIFLAGS} -DSFMT_MEXP=216091 -o $@ test.c

test-sse2-M216091: test.c dSFMT.c dSFMT.h
${CC} ${CCFLAGS} ${SSE2FLAGS} -DSFMT_MEXP=216091 -o $@ test.c

.c.o:
${CC} ${CCFLAGS} -c $<

clean:
rm -f *.o *~
30 changes: 30 additions & 0 deletions dSFMT/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
=================================================================
dSFMT ver. 1.2
2007.08.22

double precision SIMD oriented Fast Mersenne Twister(dSFMT)
based on IEEE 754 floating point format.

Mutsuo Saito (Hiroshima University) and
Makoto Matsumoto (Hiroshima University)

Copyright (C) 2007 Mutsuo Saito, Makoto Matsumoto and Hiroshima
University. All rights reserved.

The (modified) BSD License is applied to this software, see
LICENSE.txt
=================================================================
This program only works on systems which have IEEE754 floating point
format.

To see documents, see html/index.html.

To make test program, see html/howto-compile.html.
If your CPU is BIG ENDIAN and your compiler is not gcc,
define BIG_ENDIAN preprocessor macro, please.

If you want to redistribute and/or change source files, see LICENSE.txt.

When you change these files and redistribute them, PLEASE write your
e-mail address in redistribution and write to contact YOU first if
users of your changed source encounter troubles.
18 changes: 18 additions & 0 deletions dSFMT/check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh
prefix=$1
tmp=tmp.$$
exps="607 1279 2281 4423 11213 19937 44497 86243 132049 216091"
for mexp in $exps; do
compare=dSFMT.${mexp}.out.txt
command=${prefix}-M${mexp}
./$command -v > $tmp
if diff -q -w $tmp $compare; then
echo $command output check OK
rm -f $tmp
else
echo $command output check NG!
rm -f $tmp
exit 1
fi
done
exit 0
Loading

0 comments on commit 0e75d9e

Please sign in to comment.