Skip to content

Commit ecf571c

Browse files
committed
updated the guidance document
0 parents  commit ecf571c

File tree

120 files changed

+17856
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+17856
-0
lines changed

KNOWN_ISSUES.txt

+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
large malloc problem
2+
====================
3+
4+
Description
5+
-----------
6+
7+
alquimia >= r144 8e9ef8e, <= r148
8+
running: batch_chem -i general-reaction-pc.cfg -d
9+
10+
alquimia <= r143 2e6ed9f
11+
running: batch_chem -i general-reaction-ac.cfg -d
12+
13+
14+
cause an attempt to malloc huge (~1.3-1.8GB) of memory during a
15+
function call in pflotran:database_module%basisinit to
16+
database_aux_module%DatabaseRxnCreateFromRxnString at
17+
~database.F90:2898
18+
19+
screen output
20+
~~~~~~~~~~~~~
21+
PFloTran_Alquimia_Setup() :
22+
Reading : general-reaction.in
23+
WARNING: Card (NONISOTHERMAL) not found in input file.batch_chem(48324) malloc: *** mmap(size=132224767150366720) failed (error code=12)
24+
*** error: can't allocate region
25+
*** set a breakpoint in malloc_error_break to debug
26+
Operating system error: Cannot allocate memory
27+
Memory allocation failed
28+
29+
backtrace
30+
~~~~~~~~~
31+
#5 0x00007fff97f9d1b3 in malloc_zone_malloc ()
32+
from /usr/lib/system/libsystem_c.dylib
33+
#6 0x00007fff97f9dc07 in malloc () from /usr/lib/system/libsystem_c.dylib
34+
#7 0x00000001004335a9 in _gfortrani_get_mem ()
35+
from /opt/local/lib/gcc46/libgfortran.3.dylib
36+
#8 0x000000010050a1b0 in _gfortran_internal_pack ()
37+
from /opt/local/lib/gcc46/libgfortran.3.dylib
38+
#9 0x000000010005eafb in __database_module_MOD_basisinit (reaction=...,
39+
option=...) at database.F90:2898
40+
#10 0x000000010000eb84 in __pflotranalquimiainterface_module_MOD_initializepflotranreactions (option=0x101020a00, input=0x101022400, reaction=0x101028c00)
41+
at pflotran_alquimia_interface.F90:902
42+
#11 0x000000010001123f in __pflotranalquimiainterface_module_MOD_setup (
43+
input_filename=..., pft_engine_state=0x400, sizes=..., functionality=...,
44+
status=..., _input_filename=1) at pflotran_alquimia_interface.F90:163
45+
#12 0x00000001000115b7 in pflotran_alquimia_setup (input_filename=...,
46+
pft_engine_state=0x400, sizes=..., functionality=..., status=...)
47+
at pflotran_alquimia_wrappers.F90:46
48+
#13 0x0000000100002924 in BatchChemWithAlquimia (demo_simulation=...,
49+
demo_state=..., demo_material_props=..., demo_conditions=...,
50+
output=<optimized out>) at batch_chem.cc:176
51+
52+
53+
Notes
54+
-----
55+
56+
* Using Mac OS X 10.8.4, gcc 4.7.3, mpich-3.0.4, I've worked back
57+
through the alquimia history from r143(2e6ed9f)--r112(57432fd) and
58+
general-reaction-ac.cfg exhibits this error in all versions.
59+
60+
* Not using the debug flag '-d' does not generate this error. Harding
61+
coding the internal debug flag to on and leaving the command line flag
62+
off does not generate this error. --> implies an issue with command
63+
line processing.
64+
65+
* getopt, petsc, and mpi all touch the command line flags.
66+
67+
* Commenting out the getopt calls and simply hard coding the values,
68+
passing no command line args --> ok. passing command line args -->
69+
fails. Not a problem with getopt
70+
71+
* passing command line args and using PetscInitializeNoArguements() -->
72+
ok, appears to be a problem with petsc or mpi commandline processing.
73+
74+
* passing commandline args but adding a call to
75+
PetscOptionsView(PETSC_STDOUT_VIEWER?) immediately after
76+
PetscInitialize() --> ok. Moving PetscOptionsView(...) down eventually
77+
causes the same error when it comes after cfg_reader.ReadInputFile().
78+
79+
* Doing commandline processing in petsc using PetscOptionsGetXXX()
80+
seems to side step this problem with when running
81+
general-reaction-pc.cfg with debug. It's not clear if this
82+
actually fixes the problem, or is a bandaid like the
83+
PetscOptionsView() described above. This "fix" will be committed
84+
as r149 as part of the work to remove getopt/xgetopt.
85+
86+
87+
88+
Platform Status
89+
---------------
90+
91+
Mac OS X
92+
~~~~~~~~
93+
94+
alquimia(639283b202dd) : pflotran(8083548d3f59) : petsc(61d360f)
95+
96+
mpich-3.0.4-106
97+
openmpi-1.6.4
98+
99+
gcc46 @4.6.4_1
100+
gcc47 @4.7.3_1
101+
gcc48 @4.8.1_1
102+
103+
Darwin 12.4.0 = OS X v10.8.4
104+
105+
PASS : gcc4.6-openmpi-gr-pc : Darwin 12.4.0 : Xcode 4.6.3
106+
FAIL : gcc4.6-mpich-gr-pc : Darwin 12.4.0 : Xcode 4.6.3
107+
PASS : gcc4.7-openmpi-gr-pc : Darwin 12.4.0 : Xcode 4.6.3
108+
FAIL : gcc4.7-mpich-gr-pc : Darwin 12.4.0 : Xcode 4.6.3
109+
PASS : gcc4.8-openmpi-gr-pc : Darwin 12.4.0 : Xcode 4.6.3
110+
PASS : gcc4.8-mpich-gr-pc : Darwin 12.4.0 : Xcode 4.6.3
111+
112+
Darwin 11.4.2 = Mac OS X v10.7.5
113+
114+
PASS : gcc4.6-openmpi-gr-pc : Darwin 11.4.2 : Xcode 4.4.1
115+
PASS : gcc4.6-mpich-gr-pc : Darwin 11.4.2 : Xcode 4.4.1
116+
PASS : gcc4.7-openmpi-gr-pc : Darwin 11.4.2 : Xcode 4.4.1
117+
PASS : gcc4.7-mpich-gr-pc : Darwin 11.4.2 : Xcode 4.4.1
118+
PASS : gcc4.8-openmpi-gr-pc : Darwin 11.4.2 : Xcode 4.4.1
119+
PASS : gcc4.8-mpich-gr-pc : Darwin 11.4.2 : Xcode 4.4.1
120+
121+
Linux Mint 14 Nadia
122+
~~~~~~~~~~~~~~~~~~~

LICENSE.txt

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
Alquimia Copyright (c) 2013, The Regents of the University of
2+
California, through Lawrence Berkeley National Laboratory (subject to
3+
receipt of any required approvals from the U.S. Dept. of Energy). All
4+
rights reserved.
5+
6+
7+
8+
Redistribution and use in source and binary forms, with or without
9+
modification, are permitted provided that the following conditions are
10+
met:
11+
12+
13+
14+
(1) Redistributions of source code must retain the above copyright
15+
notice, this list of conditions and the following disclaimer.
16+
17+
18+
19+
(2) Redistributions in binary form must reproduce the above copyright
20+
notice, this list of conditions and the following disclaimer in the
21+
documentation and/or other materials provided with the distribution.
22+
23+
24+
25+
(3) Neither the name of the University of California, Lawrence
26+
Berkeley National Laboratory, U.S. Dept. of Energy nor the names of
27+
its contributors may be used to endorse or promote products derived
28+
from this software without specific prior written permission.
29+
30+
31+
32+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
33+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
34+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
35+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
36+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
37+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
38+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
39+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
40+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
41+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
42+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43+
44+
45+
46+
You are under no obligation whatsoever to provide any bug fixes,
47+
patches, or upgrades to the features, functionality or performance of
48+
the source code ("Enhancements") to anyone; however, if you choose to
49+
make your Enhancements available either publicly, or directly to
50+
Lawrence Berkeley National Laboratory, without imposing a separate
51+
written license agreement for such Enhancements, then you hereby grant
52+
the following license: a non-exclusive, royalty-free perpetual license
53+
to install, use, modify, prepare derivative works, incorporate into
54+
other computer software, distribute, and sublicense such enhancements
55+
or derivative works thereof, in binary and source code form.

README.rst

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
Legal
2+
-----
3+
4+
"Alquimia Copyright (c) 2013, The Regents of the University of
5+
California, through Lawrence Berkeley National Laboratory (subject to
6+
receipt of any required approvals from the U.S. Dept. of Energy). All
7+
rights reserved.
8+
9+
If you have questions about your rights to use or distribute this
10+
software, please contact Berkeley Lab's Technology Transfer and
11+
Intellectual Property Management at [email protected] referring to "Alquimia
12+
(LBNL Ref. 2013-119)."
13+
14+
15+
16+
NOTICE. This software was developed under funding from the
17+
U.S. Department of Energy. As such, the U.S. Government has been
18+
granted for itself and others acting on its behalf a paid-up,
19+
nonexclusive, irrevocable, worldwide license in the Software to
20+
reproduce, prepare derivative works, and perform publicly and display
21+
publicly. Beginning five (5) years after the date permission to
22+
assert copyright is obtained from the U.S. Department of Energy, and
23+
subject to any subsequent five (5) year renewals, the U.S. Government
24+
is granted for itself and others acting on its behalf a paid-up,
25+
nonexclusive, irrevocable, worldwide license in the Software to
26+
reproduce, prepare derivative works, distribute copies to the public,
27+
perform publicly and display publicly, and to permit others to do so.
28+
29+
30+
Description
31+
-----------
32+
33+
Alquimia is an biogeochemistry API and wrapper library being developed
34+
as part of the [ASCEM](http://esd.lbl.gov/research/projects/ascem/)
35+
project.
36+
37+
The aim is to provide a unified interface to existing "geochemistry
38+
engines" such as
39+
[CrunchFlow](http://www.csteefel.com/CrunchFlowIntroduction.html) or
40+
[PFLOTRAN](https://bitbucket.org/pflotran/pflotran-dev), allowing
41+
subsurface flow and transport simulators to access a range of
42+
functionality.
43+
44+
It is not an implementation of a biogeochemistry reaction library, and
45+
does not do any geochemical calculations.
46+
47+
48+
Building
49+
--------
50+
51+
To build alquimia, you must have petsc installed, with the PETSC_DIR
52+
and PETSC_ARCH environment variables set. Compilers are obtained from
53+
the petsc variables.
54+
55+
PFLOTRAN_DIR=/path/to/pflotran/dir must be defined to link pflotran.
56+
57+
::
58+
59+
cd ${ALQUIMIA_DIR}/src
60+
export PFLOTRAN_DIR=${HOME}/projects/pflotran-dev
61+
make all
62+
63+
64+
Test your build by running the batch chemistry demo driver.
65+
66+
::
67+
68+
cd ${ALQUIMIA_DIR}/tests
69+
ln -s ../src/drivers/batch_chem .
70+
./batch_chem -d -i calcite-short-pc.cfg
71+
72+
73+
Builds are debug by default. To build without debug symbols and with
74+
optimization:
75+
76+
::
77+
78+
make RELEASE=1 all
79+
80+
81+
The default compiler is assumed to be GCC (or compatible LLVM?). And
82+
uses GCC specific build options. To build with minimal generic build
83+
flags:
84+
85+
::
86+
87+
make COMPILER=generic all

alquimia/alquimia.vfproj

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<VisualStudioProject ProjectCreator="Intel Fortran" Keyword="Console Application" Version="11.0" ProjectIdGuid="{78920602-A012-416F-860F-A9B7F32CE13B}">
3+
<Platforms>
4+
<Platform Name="Win32"/></Platforms>
5+
<Configurations>
6+
<Configuration Name="Debug|Win32">
7+
<Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" DebugInformationFormat="debugEnabled" Optimization="optimizeDisabled" Interfaces="true" WarnInterfaces="true" Traceback="true" BoundsCheck="true" RuntimeLibrary="rtMultiThreadedDebug"/>
8+
<Tool Name="VFLinkerTool" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" GenerateDebugInformation="true" SubSystem="subSystemConsole"/>
9+
<Tool Name="VFResourceCompilerTool"/>
10+
<Tool Name="VFMidlTool" SuppressStartupBanner="true"/>
11+
<Tool Name="VFCustomBuildTool"/>
12+
<Tool Name="VFPreLinkEventTool"/>
13+
<Tool Name="VFPreBuildEventTool"/>
14+
<Tool Name="VFPostBuildEventTool"/>
15+
<Tool Name="VFManifestTool" SuppressStartupBanner="true"/></Configuration>
16+
<Configuration Name="Release|Win32">
17+
<Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true"/>
18+
<Tool Name="VFLinkerTool" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" SubSystem="subSystemConsole"/>
19+
<Tool Name="VFResourceCompilerTool"/>
20+
<Tool Name="VFMidlTool" SuppressStartupBanner="true"/>
21+
<Tool Name="VFCustomBuildTool"/>
22+
<Tool Name="VFPreLinkEventTool"/>
23+
<Tool Name="VFPreBuildEventTool"/>
24+
<Tool Name="VFPostBuildEventTool"/>
25+
<Tool Name="VFManifestTool" SuppressStartupBanner="true"/></Configuration></Configurations>
26+
<Files>
27+
<Filter Name="Header Files" Filter="fi;fd"/>
28+
<Filter Name="Resource Files" Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"/>
29+
<Filter Name="Source Files" Filter="f90;for;f;fpp;ftn;def;odl;idl">
30+
<Filter Name="csource">
31+
<File RelativePath="..\src\alquimia\c\alquimia_constants.c"/>
32+
<File RelativePath="..\src\alquimia\c\alquimia_constants.h"/>
33+
<File RelativePath="..\src\alquimia\c\alquimia_containers.h"/>
34+
<File RelativePath="..\src\alquimia\c\alquimia_interface.c"/>
35+
<File RelativePath="..\src\alquimia\c\alquimia_interface.h"/>
36+
<File RelativePath="..\src\alquimia\c\alquimia_memory.c"/>
37+
<File RelativePath="..\src\alquimia\c\alquimia_memory.h"/>
38+
<File RelativePath="..\src\alquimia\c\alquimia_util.c"/>
39+
<File RelativePath="..\src\alquimia\c\alquimia_util.h"/>
40+
<File RelativePath="..\src\alquimia\c\crunch_alquimia_interface.h"/>
41+
<File RelativePath="..\src\alquimia\c\pflotran_alquimia_interface.h"/>
42+
<File RelativePath="..\src\alquimia\c\xstdbool.h"/></Filter>
43+
<File RelativePath="..\src\alquimia\fortran\alquimia_containers.F90"/>
44+
<File RelativePath="..\src\alquimia\fortran\c_f_interface_module.F90"/>
45+
<File RelativePath="..\src\alquimia\fortran\crunch_alquimia_interface.F90"/>
46+
<File RelativePath="..\src\alquimia\fortran\crunch_alquimia_wrappers.F90"/>
47+
<File RelativePath="..\src\alquimia\fortran\pflotran_alquimia_interface.F90"/>
48+
<File RelativePath="..\src\alquimia\fortran\pflotran_alquimia_wrappers.F90"/></Filter></Files>
49+
<Globals/></VisualStudioProject>
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
pflotran_input_gfortran_string_len_trim
3+
Memcheck:Cond
4+
fun:_gfortran_string_len_trim
5+
fun:__input_module_MOD_inputfindstringinfile1
6+
fun:__pflotranalquimiainterface_module_MOD_initializepflotranreactions
7+
fun:__pflotranalquimiainterface_module_MOD_setup
8+
fun:pflotran_alquimia_setup
9+
fun:main
10+
}
11+
{
12+
pflotran_database_gfortran_string_len_trim
13+
Memcheck:Cond
14+
fun:_gfortran_string_len_trim
15+
fun:__database_module_MOD_databaseread
16+
fun:__pflotranalquimiainterface_module_MOD_initializepflotranreactions
17+
fun:__pflotranalquimiainterface_module_MOD_setup
18+
fun:pflotran_alquimia_setup
19+
fun:main
20+
}
21+
{
22+
pflotran_input_readword2
23+
Memcheck:Cond
24+
fun:__input_module_MOD_inputreadword2
25+
fun:__constraint_module_MOD_tranconstraintread
26+
fun:__pflotranalquimiainterface_module_MOD_readpflotranconstraints
27+
fun:__pflotranalquimiainterface_module_MOD_setup
28+
fun:pflotran_alquimia_setup
29+
fun:main
30+
}
31+
{
32+
pflotran_database_basisinit
33+
Memcheck:Leak
34+
fun:malloc
35+
fun:__database_module_MOD_basisinit
36+
fun:__pflotranalquimiainterface_module_MOD_initializepflotranreactions
37+
fun:__pflotranalquimiainterface_module_MOD_setup
38+
fun:pflotran_alquimia_setup
39+
fun:main
40+
}

0 commit comments

Comments
 (0)