=begin
= EratosthenesFortran: MPI-parallelized sieve of Eratosthenes writen in Fortran

EratosthenesFortran is an MPI-parallelized sieve of Eratosthenes writen in
Fortran. Because each odd number is assigned to a single bit, you can sieve
a large number of natural numbers.

It is a good example of usage of MPI with Fortran and GNU autotools.
You can use it for testing your cluster of computers.

== Homepage and DOWNLOAD
EratosthenesFortran's homepage is http://wolfchen.sourceforge.jp/EratosthenesFortran/ .

You can download a tar ball of EratosthenesFortran (EratosthenesFortran-X.YY.ZZ.tar.gz) from
http://sourceforge.jp/projects/wolfchen/ .

== Install
=== Requirements
 * GNU make (You cannot use BSD make.)  http://www.gnu.org/software/make/
 * Fortran 90 compiler
   * gfortran coming with GCC-4.2.2 or higher  http://gcc.gnu.org/
   * g95  http://www.g95.org/
   * Intel Fortran Compiler for Linux (ifort, version 10.0.025 or higher)  http://www.intel.com/cd/software/products/asmo-na/eng/compilers/flin/index.htm
   * PGI Compiler (pgf95) for Linux, version 7.0 or higher  http://www.pgroup.com/

=== Preferables
 * To build an MPI-parallel version, an implementation of MPI is required.
   * MPICH2 version 1.0.6 or higher   http://www-unix.mcs.anl.gov/mpi/mpich2/
   * LAM/MPI version 7.1.3 or higher  http://www.lam-mpi.org/
   * Open MPI version 1.2.4 or higher http://www.open-mpi.org/
   * PGI Fortran has its own MPI implementation.
 * gnuplot (version 4.2 or higher)

=== For developers
 * autoconf (version 2.59 or higher)
 * automake (version 1.10 higher)

=== Quick start
  $ tar zxf EratosthenesFortran-X.YY.ZZ.tar.gz
  $ cd EratosthenesFortran-X.YY.ZZ
  $ mkdir foo
  $ cd foo
  $ ../configure --help
  $ ../configure
  $ make
  $ src/Eratosthenes   # You will get its version number.
  $ mpdtrace && mpdboot && mpdtrace   # Only for MPICH2.
  $ make test
  $ su
  # make install
  # exit
  $ EratosthenesFortran 1 10 100 1k 10k 100k 1M 10M 100M 1G
  $ mpirun -np 2 EratosthenesFortran 1 10 100 1k 10k 100k 1M 10M 100M 1G
  $ mpirun -np 3 EratosthenesFortran 1 10 100 1k 10k 100k 1M 10M 100M 1G

== Input/Output
Specify memory size(s) for each process. You can use k, M, G, Ki, Mi and Gi for the
unit of memory. The number of processes, memory size for each process, n, the number
of prime numbers less than n, the largest prime number less than n and computational
time are reported to stdout. For example,
  $ mpirun -np 2 ./EratosthenesFortran 1k 1Ki 1M 1Mi
  #EratosthenesFortran by Takeshi NISHIMATSU 0.00.04
  #proc      byte/proc                 n           n_prime           largest     time[s]
      2           1000             32000              3432             31991       0.018
      2           1024             32768              3512             32749       0.017
      2        1000000          32000000           1973815          31999939       6.309
      2        1048576          33554432           2063689          33554393       6.628

== SR11000
EratosthenesFortran runs effectively on N nodes (16*N CPUs) of the SR11000 supercomputer in
Institute for Materials Research (IMR), Tohoku University.
  % tar zxf EratosthenesFortran-X.YY.ZZ.tar.gz
  % cd EratosthenesFortran-X.YY.ZZ
  % mkdir SR11000-mpixf90
  % cd SR11000-mpixf90
  % env FC=mpixf90 ../configure --host=SR11000
  % make
Becasue SR11000 and its Fortran compiler cannot treat command arguments,
you have to specify input file(s) in FILES file. For example,
 2
 10k
 10M
 heating
1st line: the number of input memory size(s). 2nd- line: memory size(s).
Execute EratosthenesFortran with poe command as:
 poe EratosthenesFortran | tee EratosthenesFortran.log

== Copying
Copyright (C) 2007 Takeshi Nishimatsu

EratosthenesFortran is distributed in the hope that
it will be useful, but WITHOUT ANY WARRANTY.
You can copy, modify and redistribute EratosthenesFortran,
but only under the conditions described in
the GNU General Public License (the "GPL").
For more detail, see COPYING.

== Author
Takeshi Nishimatsu (t-nissie {at} users.sourceforge.jp)


=end
#
# for ulmul.rb
#
require 'ulmul'
u=Ulmul.new()
u.subs_rules << [/(\S*\/?\.jpg)(\s|$)/,      '<img src="\1" alt="\1" />\2']
u.subs_rules << [/(\S*\/?\.F)(\s|$)/,        '<a href="\1">\1</a>\2']
u.subs_rules << [/(\S*\/?\.pdf)(\s|$)/,      '<a href="\1">\1</a>\2']
u.subs_rules << [/(\S*\/?COPYING)(\s|$|\.)/, '<a href="\1">\1</a>\2']
u.subs_rules << [/&package_id/,              '&amp;package_id']

u.parse(ARGF)
puts u.html(["style.css"],[],"Takeshi Nishimatsu")

# Local variables:
#   mode: RD
#   compile-command: "ruby -I ~/f/loto/loto/trunk README README > README.html"
# End:
