Coder Social home page Coder Social logo

jonekoo / coarsemc Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 14.8 MB

A Monte Carlo molecular simulation program for coarse-grained molecular models.

License: Other

Makefile 0.74% Fortran 54.07% M4 1.20% Shell 0.31% Awk 0.08% Standard ML 2.69% C 37.07% C++ 1.38% Python 2.30% Pascal 0.16%

coarsemc's Introduction



CoarseMC Quick Start Guide
-------------------

Jouni Karjalainen
[email protected]



Introduction
------------

This is CoarseMC, a Monte Carlo simulation package for coarse-grained
molecular models. The copyright belongs to Jouni Karjalainen for most
of the code. See LICENSE file for copyright information.





Building
---------

Requirements:


The program has been successfully compiled using Gnu Compiler Collection
(GCC) 6.0.0 with OpenMPI 1.10.0, as well as Intel Parallel Studio XE
versions 2015 and 2016, with Intel MPI 5.0.1 and 5.1.1, respectively.
Older versions of the compilers may lack support for some Fortran 
2003/2008 features used in the program. A C compiler is also needed to
compile the included Cephes library. A POSIX-compliant Bourne-shell-like
environment is expected in the build process, but not necessary. Python
2.7 with the ujson module (https://pypi.python.org/pypi/ujson) installed
is recommended to run the scripts used to edit input/output files. If the
distribution is cloned from the repository, also the GNU Autotools (Automake,
Autoconf and Libtool) are needed.


Cloning from repository:

If coarsemc was cloned from the repository, the first step is to go to the
cloned coarsemc directory where configure.ac is located and run 

autoreconf --install

If some errors appear at this step, it is probably due to missing one of the
GNU Autotools components (see Requirements).


Compiling:

Here we assume that the MPI wrappers for your Fortran and C compilers
are called mpif90 and mpicc, respectively.

The top folder of the package contains the script configure to configure
the package before building it with make. Here are examples of
configuring and building the package with GNU and Intel compilers:
 
GCC:
./configure --prefix=yourinstallationpath FC=mpif90 \
FCFLAGS="-fno-range-check -O2 -fopenmp" CC=mpicc CFLAGS="-O2 -fopenmp" \
F77=mpif90 FFLAGS="-O2 -fopenmp" PYTHON=pathtopython2
make

Intel:
./configure --prefix=yourinstallationpath FC=mpif90 \
FCFLAGS="-standard-semantics -O2 -openmp" CC=mpicc CFLAGS="-O2 -openmp" \
F77=mpif90 FFLAGS="-O2 -openmp" PYTHON=pathtopython2
make

Note that the compiler flags "-standard-semantics" (Intel) and
"-fno-range-check" (GNU) are mandatory. Giving the path to a Python 2.6 
(or 2.7) installation is necessary only for running the python scripts, which
include tests and examples. The --prefix option is also optional and needed
only if you want to install the binaries with

make install

To see more configuration options, use command
./configure --help

VPATH builds are supported so that one can do in the top directory for example:
mkdir build
cd build
../configure [the options as listed above]
make


Running:

To run a simulation you need at least one input file. The Examples
folder gives these for different systems. Assuming the input file 
input-0.json and the program binary coarsemc exist in the current folder,
one can run the program with 

mpirun -np 1 ./coarsemc

This will produce files output-0.json containing the snapshots (the 
trajectory) and restart-0.json, which is provided for restarting the
simulation. 

More detailed information about the files and running a simulation can
be found from the User Manual and the Examples folder.



Package folders (in alphabetical order)
---------------------------------------

cephes:
Mathematical library of special functions. Used by the ljwall_interaction.

claf90:
Library for command-line parsing. Used by the main program.

doxygen-doc:
Created if doxygen is available

Examples:
Contains example input files for simulations.

mt_stream_f90-1.11:
Multiple Stream Mersenne Twister Pseudo-Random Number Generator

src:
The program source code and accompanied scripts for processing input and
output files



coarsemc's People

Contributors

jonekoo avatar

Watchers

 avatar  avatar

coarsemc's Issues

Publish the repository

At the moment there are no plans from my part to develop the code further but maybe somebody could find pieces of it useful. Anyway in the name of open science it would be nice to have the code available for anyone to see. Are there any issues why it should not be releaesed or things that should be fixed/removed before release @borbware ?

Remove group_names variable from m_nvt_engine

This would just be a cosmetic change to the code since the use of a separate group_names variable is a bit ugly. Not of high priority, though. Should not fix things which are not broken, but...

Unit tests to the distribution

At the moment the pFUnit is available in the repository but if at any stage the repository is about to be made public, the pFUnit must be removed since we do not have the right to distribute it along with our package. It would be nice though, if the user or (open source) developer could run the unit tests just by cloning the repository.

Example: LJ_and_GB_in_R7

  • Shorten the run time of the example
  • Add instructions on running to the manual
  • Creation of input?
  • Verification of output?
  • Analysis?

Factory of random number generators?

Many routines that don't actually use the RNG have to pass it around and thus become dependent on at least the interface of the RNG. One could e.g. create a factory of RNG:s and each routine that really needs the RNG could then call the factory for a RNG or just ask for a random number. Maybe it is not even necessary to have separate generator instances for different threads. For MPI processes the separate instances are probably needed.

Error handling

In the case of an error occurring, there should be a systematic way to find out which part of the code raised the error, what was the possible cause, etc.

Make python scripts compatible with Python 3

Now the requirement is python 2.6 or higher but actually the scripts don't work and were not meant to work with Python 3. Python 2 is already outdated and with probably small changes one could make all scripts compatible with Python 3.

Refactor mc_engine + m_nvt_engine + particlegroup to decomposed_system + mc_engine

particlegroup could be an internal class of nvt_engine, since nvt_engine knows about the internals of particlegroup anyway. nvt_engine could be named as nonbonded_system or decomposed system. One would not have to give the interactions to it, since the now the system would own them. Parts of the mc_engine would become parts of decomposed system. Not of high priority anyway.

Make dist runs the test inputs in the "Tests" folder

I compiled the code from scratch (I was checked out to my separate "doublerod" branch with all the commits to master branch fetched on 23/6/2016).
I ran the configure script in a separate folder with the command
../ptgbcyl/gbcyl/configure FC=mpif90 FC=mpif90 FCFLAGS="-fno-range-check -O2 -fopenmp" CC=mpicc CFLAGS="-O2 -fopenmp" F77=mpif90 FFLAGS="-O2 -fopenmp"

After a successful make command, I ran make dist, and the compiler printed the following output:
https://dl.dropboxusercontent.com/u/22336072/sharetemp/makedist1.png

That is, it ran all the tests located at the "Tests" folder. Obviously, this shouldn't be happening.

Binary output/trajectory

This would hugely decrease disk space requirements for trajectories. Could also increase performance significantly when writing trajectories. The problem can of course be the portability of the files.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.