Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
aresio committed Oct 17, 2015
1 parent 87b9fd5 commit f563437
Show file tree
Hide file tree
Showing 16 changed files with 8,951 additions and 0 deletions.
23 changes: 23 additions & 0 deletions COPYING
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Copyright (c) 2015 Marco S. Nobile (Department of Informatics,
Systems and Communication, University of Milano-Bicocca).
All rights reserved.

Permission is hereby granted, without written agreement and without
license or royalty fees, to use, copy, modify, and distribute this
software and its documentation for any purpose, provided that the
above copyright notice and the following two paragraphs appear in all
copies of this software.

IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE TO ANY PARTY FOR DIRECT,
INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF
THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE AUTHOR(S),
HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

THE DEPARTMENT OF INFORMATICS, SYSTEMS AND COMMUNICATION SPECIFICALLY
DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE
AUTHOR(S) HAVE NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
ENHANCEMENTS, OR MODIFICATIONS.

Contact: [email protected]
22 changes: 22 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#cupSODA release 1.0

## ABOUT

cupSODA is a black-box deterministic simulator of biological systems that exploits the remarkable memory bandwidth and computational capability of GPUs.
cupSODA allows to efficiently execute in parallel large numbers of simulations, which are usually required to investigate the emergent dynamics of a given biological system under different conditions.
cupSODA works by automatically deriving the system of ordinary differential equations from a reaction-based mechanistic model, defined according to the mass-action kinetics, and then exploiting the numerical integration algorithm, LSODA.


## DEPENDENCIES

Just the Nvidia CUDA library.


## LICENSE

BSD License


## CONTACT

[email protected]
6 changes: 6 additions & 0 deletions compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
module load cuda
nvcc kernel.cu cupSODA.cu input_reader.cpp stoc2det.cpp -gencode=arch=compute_20,code=compute_20 -O3 -o cupSODA --use_fast_math --cudart static
nvcc kernel.cu cupSODA.cu input_reader.cpp stoc2det.cpp -gencode=arch=compute_35,code=compute_35 -O3 -o cupSODA35 --use_fast_math --cudart static


25 changes: 25 additions & 0 deletions constants.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
Constants and defines used by cupSODA.
See file COPYING for copyright and licensing information.
*/


#ifndef __CONSTANTS__
#define __CONSTANTS

/* cuLSODO variables */
// #define THREADS 16
// #define BLOCKS 1
// #define VARIABLES 4
// #define KINCONSTANTS 3

#define USE_SHARED_MEMORY
#define USE_CONSTANT_MEMORY

#define ERROR_INSUFF_CONSTANT_MEMORY_ODE 100
#define ERROR_INSUFF_CONSTANT_MEMORY_JAC 101
#define ERROR_INSUFF_SHARED_MEMORY 102
#define ERROR_INSUFF_GLOBAL_MEMORY 103
#define ERROR_TIMESERIES_NOT_SPECIFIED 1001

#endif
61 changes: 61 additions & 0 deletions create_condition.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import locale
import numpy

path= "input_MM"

tpb = 64
blocks = 64
points = 1000
threads = tpb*blocks
print "Total threads:", threads
EPSILON = 10E-2
SIZEOF_FLOAT = 4
specie = 0
PSA_QTY = False

def intWithCommas(x):
if type(x) not in [type(0), type(0L)]:
raise TypeError("Parameter must be an integer.")
if x < 0:
return '-' + intWithCommas(-x)
result = ''
while x >= 1000:
x, r = divmod(x, 1000)
result = "'%03d%s" % (r, result)
return "%d%s" % (x, result)


M_0 = []
with open(path+"/M_0") as f:
M_0 = f.readline();
specie = len(M_0.split())
if not PSA_QTY:
with open(path+"/MX_0", "w") as f2:
for i in range(threads):
f2.write(M_0)

specie = 1

lista_parametri = []
with open(path+"/c_vector") as f:
for line in f:
lista_parametri.append( float( line.strip("\n") ))
with open(path+"/c_matrix", "w") as f2:
for i in range(threads):
for j in lista_parametri[:-1]:
f2.write(str(j)+"\t")
f2.write(str(lista_parametri[-1]))
if i!=threads-1:
f2.write("\n")

lista_campioni = []
with open(path+"/time_max") as f:
tempo = float(f.readline())
tempo = tempo-EPSILON
lista_campioni = numpy.linspace(EPSILON,tempo,points)
print "Requested samples:", len(lista_campioni)
with open(path+"/t_vector", "w") as f2:
for c in lista_campioni:
f2.write(str(c)+"\n")

print "Memoria necessaria per lettura output completo:", intWithCommas(threads*points*SIZEOF_FLOAT*specie), "bytes"
Loading

0 comments on commit f563437

Please sign in to comment.