Skip to content

Commit 74cc315

Browse files
authored
Merge pull request #1 from marouenbg/check-precision
v 0.2.1
2 parents 8317d72 + 6a64076 commit 74cc315

File tree

11 files changed

+52
-22
lines changed

11 files changed

+52
-22
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Add the project folder to your MATLAB path and save it.
1919
For the comparison with fastFVA (FFVA), you can install FFVA [here](http://wwwen.uni.lu/lcsb/research/mol_systems_physiology/fastfva).
2020

2121
### Quick installation
22+
This is a standard installation recipe, if this does not work, please install each dependency separately as specified in the [documentation](https://vffva.readthedocs.io/en/latest/).
2223
```
2324
cd lib
2425
source ./install.sh

data/comRes.mat

1.54 KB
Binary file not shown.

docs/guide/index.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ After installing the dependencies of `VFFVA`, you can build the binaries at the
88

99
Then call `VFFVA` as follows:
1010

11-
`mpirun -np nCores --bind-to none -x OMP_NUM_THREADS=nThreads veryfastFVA model.mps SCAIND`
11+
`mpirun -np nCores --bind-to none -x OMP_NUM_THREADS=nThreads veryfastFVA model.mps OPTPERC SCAIND`
1212

1313
Replace the following variables with your own parameters:
1414

@@ -18,6 +18,10 @@ Replace the following variables with your own parameters:
1818

1919
+ model.mps: the metabolic model in `.mps` format. To convert a model in `.mat` format to `.mps`, you can use the provided converter `convertProblem.m`
2020

21+
+ OPTPERC: Optimization percentage of the objective value (0-100). The default is 90, where VFFVa will be computed with the objective value set to 90% of the optimal
22+
objective.
23+
24+
2125
+ SCAIND: (optional) corresponds to the scaling CPLEX parameter SCAIND and can take the values 0 (equilibration scaling: default), 1(aggressive scaling), -1 (no scaling).
2226
scaling is usually desactivated with tightly constrained metabolic model such as coupled models to avoid numerical instabilities and large solution times.
2327

@@ -51,6 +55,8 @@ Then VFFVA.m can be called from MATLAB using the following function description:
5155
scaling: CPLEX parameter. It corresponds to SCAIND parameter (Default = 0).
5256
-1: no scaling; 0: equilibration scaling; 1: more aggressive scaling.
5357
more information here: https://www.ibm.com/support/knowledgecenter/SSSA5P_12.7.0/ilog.odms.cplex.help/CPLEX/Parameters/topics/ScaInd.html.
58+
optPerc: Percentage of the optimal objective used in FVA. Float between 0 and 100. For example, when set to 90
59+
FVA will be computed on 90% of the optimal objective.
5460
memAff: none, core, or socket. (Default = none). This an OpenMPI parameter, more
5561
information here: https://www.open-mpi.org/faq/?category=tuning#using-paffinity-v1.4.
5662
schedule: Dynamic, static, or guided. (Default = dynamic). This is an OpenMP parameter, more

docs/install/index.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@ The C implementation is a hybrid MPI/OpenMP code that has two levels of parallel
88
and non-shared memory systems.
99

1010
### Requirements
11-
+ Linux-based system.
11+
+ Linux-based system (tested on Ubuntu 16.04 and 18.04).
1212

13-
+ IBM CPLEX 12.6.3. and above [Free academic version.](http://www-03.ibm.com/software/products/fr/ibmilogcpleoptistud)
13+
+ IBM CPLEX 12.6.3. (tested on 12.6.3 and 12.10) and above [Free academic version.](http://www.ibm.com/academic)
1414

15-
+ OpenMP comes be default in the latest gcc version.
15+
+ OpenMP comes be default in the latest gcc version (For macOs, OpenMp has to be installed separately)
1616

1717
+ MPI through the OpenMPI 1.10.3 implementation.
1818

1919
### Quick install
2020

21+
This will install OpenMPI, IBM ILOG CPLEX 12.10 (Make sure you register at IBM Academic Initiative), and will set the environment variables.
2122
```
2223
cd lib
2324
source ./install.sh
@@ -55,7 +56,7 @@ You might also need to add MPI path
5556
```
5657
export PATH=$HOME/open-mpi/bin:$PATH
5758
```
58-
+ IBM CPLEX: The recommended approach is to download [IBM CPLEX](http://www-03.ibm.com/software/products/fr/ibmilogcpleoptistud) and register for the free academic version.
59+
+ IBM CPLEX: The recommended approach is to download [IBM CPLEX](http://www.ibm.com/academic) and register for the free academic version.
5960

6061
Make sure that the CPLEXDIR path in `lib/Makefile` corresponds to the installation folder of CPLEX.
6162

@@ -72,7 +73,7 @@ VFFVA.m is the MATLAB implementation that consists of a wrapper around the C ver
7273

7374
+ MATLAB
7475

75-
+ IBM CPLEX 12.6.3. and above [Free academic version.](http://www-03.ibm.com/software/products/fr/ibmilogcpleoptistud)
76+
+ IBM CPLEX 12.6.3. and above [Free academic version.](http://www.ibm.com/academic)
7677

7778
+ OpenMP comes be default in the latest gcc version.
7879

docs/tutos/images/VFFVAbenchmark.png

113 KB
Loading

docs/tutos/index.md

+15-2
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,23 @@ ecoli=model;
5353
+ Compare the results
5454

5555
```
56-
plot(minFluxVFFVA,minFluxFVA,'o')
56+
%Using a log-log scale
57+
figure;
58+
loglog(abs([minFluxVFFVA;maxFluxVFFVA]),abs([minFluxFVA;maxFluxFVA]),'o')
5759
hold on;
58-
plot([-40 100],[-40 100])
60+
loglog([0.1 1000],[0.1 1000])
5961
```
6062

6163
As we can see the results lie perfectly on the identity line.
6264
![](images/VFFVAbenchmark.png)
65+
66+
We can further check the largest difference in precision between the two results.
67+
Since we are using the same solver, the results are nearly identical.
68+
69+
```
70+
max([minFluxVFFVA;maxFluxVFFVA]-[minFluxFVA;maxFluxFVA])
71+
72+
ans =
73+
74+
4.9314e-07
75+
```

lib/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ LIBFORMAT = static_pic
1111

1212
ifndef TRAVIS
1313
#Please define CPLEX path here
14-
CPLEXDIR = $(HOME)/CPLEX_Studio12.7.1/cplex
14+
CPLEXDIR = $(HOME)/CPLEX_Studio1210/cplex
1515
#CPLEXDIR = /work/projects/cplex/soft/cplex/12.6.3/cplex/
1616
else
1717
CPLEXDIR = /home/travis/travis/cplex
@@ -45,7 +45,7 @@ CPLEXLIBDIR = $(CPLEXDIR)/lib/$(SYSTEM)/$(LIBFORMAT)
4545

4646
CLNDIRS = -L$(CPLEXLIBDIR)
4747
CCLNFLAGS = -lconcert -lilocplex -lcplex -lm -lpthread
48-
CLNFLAGS = -lcplex -lm -lpthread -lrt
48+
CLNFLAGS = -lcplex -lm -lpthread -lrt -ldl
4949

5050

5151

lib/VFFVA.m

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function [minFlux,maxFlux]=VFFVA(nCores, nThreads, model, scaling, memAff, schedule, nChunk)
1+
function [minFlux,maxFlux]=VFFVA(nCores, nThreads, model, scaling, memAff, schedule, nChunk, optPerc)
22
% performs Very Fast Flux Variability Analysis (VFFVA). VFFVA is a parallel implementation of FVA that
33
% allows dynamically assigning reactions to each worker depending on their computational load
44
% Guebila, Marouen Ben. "Dynamic load balancing enables large-scale flux variability analysis." bioRxiv (2018): 440701.
@@ -18,6 +18,8 @@
1818
% scaling: CPLEX parameter. It corresponds to SCAIND parameter (Default = 0).
1919
% -1: no scaling; 0: equilibration scaling; 1: more aggressive scaling.
2020
% more information here: https://www.ibm.com/support/knowledgecenter/SSSA5P_12.7.0/ilog.odms.cplex.help/CPLEX/Parameters/topics/ScaInd.html.
21+
% optPerc: Percentage of the optimal objective used in FVA. Float between 0 and 100. For example, when set to 90
22+
% FVA will be computed on 90% of the optimal objective.
2123
% memAff: none, core, or socket. (Default = none). This an OpenMPI parameter, more
2224
% information here: https://www.open-mpi.org/faq/?category=tuning#using-paffinity-v1.4.
2325
% schedule: Dynamic, static, or guided. (Default = dynamic). This is an OpenMP parameter, more
@@ -45,7 +47,9 @@
4547
if nargin<7
4648
nChunk=50;
4749
end
48-
50+
if nargin<8
51+
optPerc=90;
52+
end
4953

5054
%Set install folder of MPI
5155
setenv('PATH', [getenv('PATH') ':' getenv('HOME') '/open-mpi/bin'])
@@ -76,7 +80,7 @@
7680

7781
%Call VFFVA
7882
[status,cmdout]=system(['mpirun -np ' num2str(nCores) ' --bind-to ' num2str(memAff) ' -x OMP_NUM_THREADS=' num2str(nThreads)...
79-
' ./veryfastFVA ' model ' ' num2str(scaling)]);
83+
' ./veryfastFVA ' model ' ' num2str(optPerc) ' ' num2str(scaling)]);
8084

8185
%Fetch results
8286
resultFile=[model(1:end-4) 'output.csv'];

lib/install.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ make install
2626
export PATH=$HOME/open-mpi/bin:$PATH
2727

2828
#2. install IBM CPLEX
29-
VERSION_CPLEX=12.7.1
30-
wget "https://ak-dsw-mul.dhe.ibm.com/sdfdl/v2/fulfill/CNI55ML/Xa.2/Xb.wzt5iJcvdsf_6y3jnv4KVpeZrR1ITpFqw_nGoUyO9WgOsMy3zfirXa-luwtfb9Wxyg/Xc.CNI55ML/cplex_studio12.7.1.linux-x86-64.bin/Xd./Xf.lPr.D1VC/Xg.15048651/Xi.kivuto/XY.scholars/XZ.Kt3-euG55mrPls29B3kHipq8x0U/cplex_studio12.7.1.linux-x86-64.bin"
29+
VERSION_CPLEX=1210
30+
wget "https://ak-dsw-mul.dhe.ibm.com/sdfdl/v2/fulfill/CC439ML/Xa.2/Xb.XwdHXGddWvrm/Xc.CC439ML/cplex_studio1210.linux-x86-64.bin/Xd./Xf.lPr.D1VC/Xg.10615575/Xi./XY.scholars/XZ.unQjp7Yeq28Xo4Z12DgJGXx--L4/cplex_studio1210.linux-x86-64.bin#anchor"
3131
chmod +x cplex_studio$VERSION_CPLEX.linux-x86-64.bin
3232

3333
#specify install options

lib/veryfastFVA.c

+10-5
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@ int main (int argc, char **argv){
123123

124124
/*Check arg number*/
125125
if (rank==0){
126-
if(( argc == 2 ) | ( argc == 3 )){
126+
if(( argc == 2 ) | ( argc == 3 ) | (argc == 4)){
127127
printf("\nThe model supplied is %s\n", argv[1]);
128128
strcpy(modelName,argv[1]);
129-
}else if( argc > 3 ) {
129+
}else if( argc > 4) {
130130
printf("Too many arguments supplied.\n");
131131
goto TERMINATE;
132132
}else {
@@ -182,16 +182,21 @@ int main (int argc, char **argv){
182182
status = CPXsetintparam (env, CPX_PARAM_AUXROOTTHREADS, 2);
183183

184184
/*Scaling parameter if coupled model*/
185-
if ( argc == 3 ) {
186-
if (atoi(argv[2])==-1){
185+
if ( argc == 4 ) {
186+
if (atoi(argv[3])==-1){
187187
/*Change of scaling parameter*/
188188
scaling = 1;
189189
status = CPXsetintparam (env, CPX_PARAM_SCAIND, -1);//1034 is index scaling parameter
190190
status = CPXgetintparam (env, CPX_PARAM_SCAIND, &curpreind);
191191
printf("SCAIND parameter is %d\n",curpreind);
192192
}
193193
}
194-
194+
195+
/*Read OptPercentage*/
196+
if (argc > 2) {
197+
optPerc=atoi(argv[2])/100.0;
198+
}
199+
195200
/* Optimize the problem and obtain solution. */
196201
clock_gettime(CLOCK_REALTIME, &tmstart);
197202
status = CPXlpopt (env, lp);

travis/install-mpi.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ case "$os" in
5252
esac
5353

5454
#install IBM CPLEX
55-
VERSION_CPLEX=12.7.1
56-
wget "https://ak-dsw-mul.dhe.ibm.com/sdfdl/v2/fulfill/CNI55ML/Xa.2/Xb.wzt5iJcvdsf_6y3jnv4KVpeZrR1ITpFqw_nGoUyO9WgOsMy3zfirXa-luwtfb9Wxyg/Xc.CNI55ML/cplex_studio12.7.1.linux-x86-64.bin/Xd./Xf.lPr.D1VC/Xg.15048651/Xi.kivuto/XY.scholars/XZ.Kt3-euG55mrPls29B3kHipq8x0U/cplex_studio12.7.1.linux-x86-64.bin"
55+
VERSION_CPLEX=1210
56+
wget "https://ak-dsw-mul.dhe.ibm.com/sdfdl/v2/fulfill/CC439ML/Xa.2/Xb.XwdHXGddWvrm/Xc.CC439ML/cplex_studio1210.linux-x86-64.bin/Xd./Xf.lPr.D1VC/Xg.10615575/Xi./XY.scholars/XZ.unQjp7Yeq28Xo4Z12DgJGXx--L4/cplex_studio1210.linux-x86-64.bin#anchor"
5757
chmod +x cplex_studio$VERSION_CPLEX.linux-x86-64.bin
5858

5959
#specify install options

0 commit comments

Comments
 (0)