Skip to content
Commits on Source (8)
This diff is collapsed.
......@@ -184,7 +184,7 @@ am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/compile \
$(top_srcdir)/config/config.sub \
$(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \
$(top_srcdir)/config/missing AUTHORS COPYING ChangeLog INSTALL \
NEWS README config/compile config/config.guess \
NEWS README TODO config/compile config/config.guess \
config/config.sub config/install-sh config/ltmain.sh \
config/missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
......@@ -259,6 +259,7 @@ EXEEXT = @EXEEXT@
FGREP = @FGREP@
GMAPDB = @GMAPDB@
GREP = @GREP@
HAVE_INLINE = @HAVE_INLINE@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
......
Add flag that allows for splitting afterwards.
2017-11-15
\ No newline at end of file
2018-07-04
\ No newline at end of file
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for gmap 2017-11-15.
# Generated by GNU Autoconf 2.69 for gmap 2018-07-04.
#
# Report bugs to <Thomas Wu <twu@gene.com>>.
#
......@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='gmap'
PACKAGE_TARNAME='gmap'
PACKAGE_VERSION='2017-11-15'
PACKAGE_STRING='gmap 2017-11-15'
PACKAGE_VERSION='2018-07-04'
PACKAGE_STRING='gmap 2018-07-04'
PACKAGE_BUGREPORT='Thomas Wu <twu@gene.com>'
PACKAGE_URL=''
 
......@@ -660,6 +660,7 @@ SIMD_SSSE3_CFLAGS
SIMD_SSE2_CFLAGS
POPCNT_CFLAGS
ALLOCA
HAVE_INLINE
PTHREAD_CFLAGS
PTHREAD_LIBS
PTHREAD_CC
......@@ -689,6 +690,8 @@ SED
LIBTOOL
PERL
BINDIR
MAKE_LIB_FALSE
MAKE_LIB_TRUE
MAINTAINER_FALSE
MAINTAINER_TRUE
FULLDIST_FALSE
......@@ -800,6 +803,7 @@ enable_silent_rules
enable_maintainer_mode
enable_fulldist
enable_maintainer
enable_lib
enable_shared
enable_static
with_pic
......@@ -1369,7 +1373,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures gmap 2017-11-15 to adapt to many kinds of systems.
\`configure' configures gmap 2018-07-04 to adapt to many kinds of systems.
 
Usage: $0 [OPTION]... [VAR=VALUE]...
 
......@@ -1440,7 +1444,7 @@ fi
 
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of gmap 2017-11-15:";;
short | recursive ) echo "Configuration of gmap 2018-07-04:";;
esac
cat <<\_ACEOF
 
......@@ -1460,6 +1464,9 @@ Optional Features:
sometimes confusing) to the casual installer
--enable-fulldist For use by program maintainer
--enable-maintainer For use by program maintainer
--enable-lib Build and install a GMAP library (Warning: will put
headers into include subdirectory)
(default=disable-lib)
--enable-shared[=PKGS] build shared libraries [default=yes]
--enable-static[=PKGS] build static libraries [default=yes]
--enable-fast-install[=PKGS]
......@@ -1469,8 +1476,9 @@ Optional Features:
(default=yes). Note: Use only if you have a parallel
I/O file system, like Lustre
--enable-pthreads Enable pthreads (default=yes)
--enable-alloca Enable alloca (default=yes) for stack-based memory
allocation.
--enable-alloca Enable alloca (default=no) for stack-based memory
allocation. Warning: Can cause GMAP to crash on long
sequences.
--enable-mmap Enable mmap (default=yes). Recommend that you do not
disable this unless absolutely necessary.
--enable-simd Enable simd commands in general if they compile and
......@@ -1577,7 +1585,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
gmap configure 2017-11-15
gmap configure 2018-07-04
generated by GNU Autoconf 2.69
 
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -2183,7 +2191,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
 
It was created by gmap $as_me 2017-11-15, which was
It was created by gmap $as_me 2018-07-04, which was
generated by GNU Autoconf 2.69. Invocation command line was
 
$ $0 $@
......@@ -2533,8 +2541,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking package version" >&5
$as_echo_n "checking package version... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: 2017-11-15" >&5
$as_echo "2017-11-15" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: 2018-07-04" >&5
$as_echo "2018-07-04" >&6; }
 
 
### Read defaults
......@@ -4401,7 +4409,7 @@ fi
 
# Define the identity of the package.
PACKAGE='gmap'
VERSION='2017-11-15'
VERSION='2018-07-04'
 
 
cat >>confdefs.h <<_ACEOF
......@@ -4679,6 +4687,22 @@ else
fi
 
 
if test "x$enable_library" = xyes; then
MAKE_LIB_TRUE=
MAKE_LIB_FALSE='#'
else
MAKE_LIB_TRUE='#'
MAKE_LIB_FALSE=
fi
# Check whether --enable-lib was given.
if test "${enable_lib+set}" = set; then :
enableval=$enable_lib; enable_library="yes"
else
enable_library="no"
fi
# For Perl scripts, because otherwise configure inserts
# @bindir@ => "${exec_prefix}/bin";
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking bindir" >&5
......@@ -14502,6 +14526,55 @@ done
 
 
# Checks for typedefs, structures, and compiler characteristics.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
$as_echo_n "checking for inline... " >&6; }
if ${ac_cv_c_inline+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifndef __cplusplus
typedef int foo_t;
static $ac_kw foo_t static_foo () {return 0; }
$ac_kw foo_t foo () {return 0; }
#endif
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_c_inline=$ac_kw
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
test "$ac_cv_c_inline" != no && break
done
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
$as_echo "$ac_cv_c_inline" >&6; }
case $ac_cv_c_inline in
inline | yes) ;;
*)
case $ac_cv_c_inline in
no) ac_val=;;
*) ac_val=$ac_cv_c_inline;;
esac
cat >>confdefs.h <<_ACEOF
#ifndef __cplusplus
#define inline $ac_val
#endif
_ACEOF
;;
esac
if test "$ac_cv_c_line" != no; then
$as_echo "#define HAVE_INLINE 1" >>confdefs.h
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
if ${ac_cv_c_bigendian+:} false; then :
......@@ -15258,194 +15331,8 @@ $as_echo "disabled" >&6; }
;;
 
x)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not specified so enabled by default" >&5
$as_echo "not specified so enabled by default" >&6; }
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
$as_echo_n "checking for working alloca.h... " >&6; }
if ${ac_cv_working_alloca_h+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <alloca.h>
int
main ()
{
char *p = (char *) alloca (2 * sizeof (int));
if (p) return 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_working_alloca_h=yes
else
ac_cv_working_alloca_h=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
$as_echo "$ac_cv_working_alloca_h" >&6; }
if test $ac_cv_working_alloca_h = yes; then
$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
$as_echo_n "checking for alloca... " >&6; }
if ${ac_cv_func_alloca_works+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef __GNUC__
# define alloca __builtin_alloca
#else
# ifdef _MSC_VER
# include <malloc.h>
# define alloca _alloca
# else
# ifdef HAVE_ALLOCA_H
# include <alloca.h>
# else
# ifdef _AIX
#pragma alloca
# else
# ifndef alloca /* predefined by HP cc +Olibcalls */
void *alloca (size_t);
# endif
# endif
# endif
# endif
#endif
int
main ()
{
char *p = (char *) alloca (1);
if (p) return 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_func_alloca_works=yes
else
ac_cv_func_alloca_works=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
$as_echo "$ac_cv_func_alloca_works" >&6; }
if test $ac_cv_func_alloca_works = yes; then
$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
else
# The SVR3 libPW and SVR4 libucb both contain incompatible functions
# that cause trouble. Some versions do not even contain alloca or
# contain a buggy version. If you still want to use their alloca,
# use ar to extract alloca.o from them instead of compiling alloca.c.
ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
$as_echo "#define C_ALLOCA 1" >>confdefs.h
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
if ${ac_cv_os_cray+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#if defined CRAY && ! defined CRAY2
webecray
#else
wenotbecray
#endif
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "webecray" >/dev/null 2>&1; then :
ac_cv_os_cray=yes
else
ac_cv_os_cray=no
fi
rm -f conftest*
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
$as_echo "$ac_cv_os_cray" >&6; }
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define CRAY_STACKSEG_END $ac_func
_ACEOF
break
fi
done
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
$as_echo_n "checking stack direction for C alloca... " >&6; }
if ${ac_cv_c_stack_direction+:} false; then :
$as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then :
ac_cv_c_stack_direction=0
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$ac_includes_default
int
find_stack_direction (int *addr, int depth)
{
int dir, dummy = 0;
if (! addr)
addr = &dummy;
*addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
dir = depth ? find_stack_direction (addr, depth - 1) : 0;
return dir + dummy;
}
int
main (int argc, char **argv)
{
return find_stack_direction (0, argc + !argv + 20) < 0;
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
ac_cv_c_stack_direction=1
else
ac_cv_c_stack_direction=-1
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
$as_echo "$ac_cv_c_stack_direction" >&6; }
cat >>confdefs.h <<_ACEOF
#define STACK_DIRECTION $ac_cv_c_stack_direction
_ACEOF
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not specified so disabled by default" >&5
$as_echo "not specified so disabled by default" >&6; }
;;
esac
 
......@@ -19400,6 +19287,8 @@ ac_config_files="$ac_config_files util/gvf_iit.pl"
 
ac_config_files="$ac_config_files util/vcf_iit.pl"
 
ac_config_files="$ac_config_files util/sam-exons.pl"
ac_config_files="$ac_config_files tests/Makefile"
 
ac_config_files="$ac_config_files tests/align.test"
......@@ -19556,6 +19445,10 @@ if test -z "${MAINTAINER_TRUE}" && test -z "${MAINTAINER_FALSE}"; then
as_fn_error $? "conditional \"MAINTAINER\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${MAKE_LIB_TRUE}" && test -z "${MAKE_LIB_FALSE}"; then
as_fn_error $? "conditional \"MAKE_LIB\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
 
if test -z "${MAKE_AVX512_TRUE}" && test -z "${MAKE_AVX512_FALSE}"; then
as_fn_error $? "conditional \"MAKE_AVX512\" was never defined.
......@@ -19978,7 +19871,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by gmap $as_me 2017-11-15, which was
This file was extended by gmap $as_me 2018-07-04, which was
generated by GNU Autoconf 2.69. Invocation command line was
 
CONFIG_FILES = $CONFIG_FILES
......@@ -20044,7 +19937,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
gmap config.status 2017-11-15
gmap config.status 2018-07-04
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
 
......@@ -20483,6 +20376,7 @@ do
"util/dbsnp_iit.pl") CONFIG_FILES="$CONFIG_FILES util/dbsnp_iit.pl" ;;
"util/gvf_iit.pl") CONFIG_FILES="$CONFIG_FILES util/gvf_iit.pl" ;;
"util/vcf_iit.pl") CONFIG_FILES="$CONFIG_FILES util/vcf_iit.pl" ;;
"util/sam-exons.pl") CONFIG_FILES="$CONFIG_FILES util/sam-exons.pl" ;;
"tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
"tests/align.test") CONFIG_FILES="$CONFIG_FILES tests/align.test" ;;
"tests/coords1.test") CONFIG_FILES="$CONFIG_FILES tests/coords1.test" ;;
......
......@@ -131,6 +131,13 @@ AC_ARG_ENABLE([maintainer],
[enable_maintainer="yes"],
[enable_maintainer="no"])
AM_CONDITIONAL(MAKE_LIB,test "x$enable_library" = xyes)
AC_ARG_ENABLE([lib],
AC_HELP_STRING([--enable-lib],
[Build and install a GMAP library (Warning: will put headers into include subdirectory) (default=disable-lib)]),
[enable_library="yes"],
[enable_library="no"])
# For Perl scripts, because otherwise configure inserts
# @bindir@ => "${exec_prefix}/bin";
AC_MSG_CHECKING(bindir)
......@@ -223,6 +230,12 @@ AC_HEADER_DIRENT
AC_CHECK_HEADERS([fcntl.h limits.h stddef.h stdlib.h string.h strings.h unistd.h sys/types.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
if test "$ac_cv_c_line" != no; then
AC_DEFINE(HAVE_INLINE,1,[Define to 1 if compiler supports extern inline])
AC_SUBST(HAVE_INLINE)
fi
AC_C_BIGENDIAN
AC_C_CONST
AC_C_VOLATILE
......@@ -247,7 +260,7 @@ AC_FUNC_FSEEKO
AC_MSG_CHECKING(whether alloca is enabled)
AC_ARG_ENABLE([alloca],
AC_HELP_STRING([--enable-alloca],
[Enable alloca (default=yes) for stack-based memory allocation.]),
[Enable alloca (default=no) for stack-based memory allocation. Warning: Can cause GMAP to crash on long sequences.]),
[answer="$enableval"],
[answer=""])
case x"$answer" in
......@@ -261,8 +274,7 @@ case x"$answer" in
;;
x)
AC_MSG_RESULT([not specified so enabled by default])
AC_FUNC_ALLOCA
AC_MSG_RESULT([not specified so disabled by default])
;;
esac
......@@ -586,6 +598,7 @@ AC_CONFIG_FILES([util/gff3_genes.pl])
AC_CONFIG_FILES([util/dbsnp_iit.pl])
AC_CONFIG_FILES([util/gvf_iit.pl])
AC_CONFIG_FILES([util/vcf_iit.pl])
AC_CONFIG_FILES([util/sam-exons.pl])
AC_CONFIG_FILES([tests/Makefile])
AC_CONFIG_FILES([tests/align.test],[chmod +x tests/align.test])
AC_CONFIG_FILES([tests/coords1.test],[chmod +x tests/coords1.test])
......
gmap (2018-07-04-1) UNRELEASED; urgency=medium
* Cleanup d/rules
* New upstream version
* debhelper 11
* Point Vcs fields to salsa.debian.org
* Standards-Version: 4.1.5
* libgmap1-dev Depends: gmap, libgmap1 (instead of alternative)
Closes: #903793
-- Andreas Tille <tille@debian.org> Tue, 17 Jul 2018 07:24:19 +0200
gmap (2017-11-15-1) unstable; urgency=medium
* New upstream version 2017-11-15
......
......@@ -6,19 +6,21 @@ Uploaders: Shaun Jackman <sjackman@debian.org>,
Section: non-free/science
XS-Autobuild: no
Priority: optional
Build-Depends: debhelper (>= 10),
Build-Depends: debhelper (>= 11~),
dh-exec,
help2man,
libbz2-dev,
zlib1g-dev
Standards-Version: 4.1.2
Vcs-Browser: https://anonscm.debian.org/cgit/debian-med/gmap.git
Vcs-Git: https://anonscm.debian.org/git/debian-med/gmap.git
Standards-Version: 4.1.5
Vcs-Browser: https://salsa.debian.org/med-team/gmap
Vcs-Git: https://salsa.debian.org/med-team/gmap.git
Homepage: http://research-pub.gene.com/gmap
Package: gmap
Architecture: any
Depends: ${misc:Depends}, ${perl:Depends}, ${shlibs:Depends}
Depends: ${misc:Depends},
${perl:Depends},
${shlibs:Depends}
Description: spliced and SNP-tolerant alignment for mRNA and short reads
This package contains the programs GMAP and GSNAP as well as
utilities to manage genome databases in GMAP/GSNAP format.
......@@ -34,7 +36,8 @@ Description: spliced and SNP-tolerant alignment for mRNA and short reads
Package: libgmap1
Architecture: any
Section: non-free/libs
Depends: ${misc:Depends}, ${shlibs:Depends}
Depends: ${misc:Depends},
${shlibs:Depends}
Description: library for gmap tool
This package contains library for gmap tool.
GMAP (Genomic Mapping and Alignment Program) is a tool for aligning
......@@ -49,8 +52,9 @@ Description: library for gmap tool
Package: libgmap1-dev
Architecture: any
Section: non-free/libdevel
Depends: gmap (= ${binary:Version}) | libgmap1 (= ${binary:Version}),
${misc:Depends},
Depends: gmap (= ${binary:Version}),
libgmap1 (= ${binary:Version}),
${misc:Depends}
Description: development files for gmap
This package contains header files for gmap.
GMAP (Genomic Mapping and Alignment Program) is a tool for aligning
......
......@@ -2,8 +2,7 @@
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
include /usr/share/dpkg/default.mk
pkg := gmap
mandir := $(CURDIR)/debian/$(pkg)/usr/share/man/man1
mandir := $(CURDIR)/debian/$(DEB_SOURCE)/usr/share/man/man1
utildir := $(CURDIR)/util
bindir := $(CURDIR)/src
......@@ -34,11 +33,11 @@ override_dh_auto_install:
override_dh_install:
dh_install
mkdir -p debian/$(pkg)/usr/bin
mkdir -p debian/$(DEB_SOURCE)/usr/bin
for bin in `echo gmap gsnap gmap_build gmapl gsnapl; \
cd $(CURDIR)/debian/tmp/usr/lib/$(pkg)/; \
cd $(CURDIR)/debian/tmp/usr/lib/$(DEB_SOURCE)/; \
ls -1 gmap*.* gsnap*.* `; do \
ln -s /usr/lib/gmap/$$bin debian/$(pkg)/usr/bin/$$bin; \
ln -s /usr/lib/gmap/$$bin debian/$(DEB_SOURCE)/usr/bin/$$bin; \
done
override_dh_auto_test:
......
This diff is collapsed.
This diff is collapsed.
static char rcsid[] = "$Id: access.c 198277 2016-09-24 00:46:18Z twu $";
static char rcsid[] = "$Id: access.c 213998 2018-03-03 04:59:34Z twu $";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
......@@ -54,6 +54,9 @@ static char rcsid[] = "$Id: access.c 198277 2016-09-24 00:46:18Z twu $";
#endif
#define MAX_KILL_ATTEMPTS 5 /* Limits on attempts to kill unattached memory segments */
#ifdef DEBUG
#define debug(x) x
#else
......@@ -470,6 +473,45 @@ Access_deallocate (void *memory, int shmid, key_t key) {
}
/* Same as Access_deallocate, but without deleting semaphore */
void
Access_deallocate_wo_semaphore (void *memory, int shmid, key_t key) {
struct shmid_ds *buf = NULL;
short nattached;
int semid;
/* First, detach memory */
if (shmdt(memory) == -1) {
#if 0
/* Somehow, shmdt forks and prints the error message and continues with the rest of the code */
fprintf(stderr,"Error in Access_emergency_cleanup with shmdt on memory %p, shmid %d. Error %d: %s\n",
memory,shmid,errno,strerror(errno));
#endif
}
/* Then, delete memory and semaphores, if applicable */
if ((semid = Semaphore_find(key)) != -1 && Semaphore_get_value(semid,SEMNO_KEEP) == SEMAPHORE_RESIDENT) {
fprintf(stderr,"Keeping memory for shmid %d resident, because it was pre-loaded. To remove, run gsnap on this genome index with --unload-shared-memory\n",
shmid);
} else if ((nattached = shmem_nattached(shmid)) > 0) {
fprintf(stderr,"Keeping memory for shmid %d resident, because it is being used by %d processes\n",
shmid,nattached);
} else if (shmctl(shmid,IPC_RMID,buf) == -1) {
/* Somehow, shmctl forks and prints the error message and continues with the rest of the code */
/* fprintf(stderr,"Error in Access_deallocate with shmctl. Error %d: %s\n",errno,strerror(errno)); */
/* Semaphore_delete(semid); */
} else {
fprintf(stderr,"Removed existing memory for shmid %d\n",shmid);
/* Semaphore_delete(semid); */
}
return;
}
#define FREAD_BATCH 100000000 /* 100 million elements at a time */
......@@ -495,6 +537,17 @@ copy_memory_from_file (void *memory, char *filename, size_t filesize, size_t elt
fread(p,sizeof(unsigned char),filesize/eltsize - i,fp);
}
} else if (eltsize == 2) {
for (i = 0; i + FREAD_BATCH < filesize/eltsize; i += FREAD_BATCH) {
p = (void *) &(((UINT2 *) memory)[i]);
fread(p,sizeof(UINT2),FREAD_BATCH,fp);
}
if (i < filesize/eltsize) {
p = (void *) &(((UINT2 *) memory)[i]);
fread(p,sizeof(UINT2),filesize/eltsize - i,fp);
}
} else if (eltsize == 4) {
for (i = 0; i + FREAD_BATCH < filesize/eltsize; i += FREAD_BATCH) {
p = (void *) &(((UINT4 *) memory)[i]);
......@@ -545,6 +598,14 @@ copy_limited_from_file (void *memory, char *filename, size_t filesize, size_t el
fread(p,sizeof(unsigned char),filesize/eltsize,fp);
}
} else if (eltsize == 2) {
p = (void *) &(((UINT2 *) memory)[0]);
if (FREAD_BATCH < filesize/eltsize) {
fread(p,sizeof(UINT2),FREAD_BATCH,fp);
} else {
fread(p,sizeof(UINT2),filesize/eltsize,fp);
}
} else if (eltsize == 4) {
p = (void *) &(((UINT4 *) memory)[0]);
if (FREAD_BATCH < filesize/eltsize) {
......@@ -570,11 +631,15 @@ copy_limited_from_file (void *memory, char *filename, size_t filesize, size_t el
return;
}
static void *
shmem_attach (int *shmid, key_t *key, char *filename, size_t filesize, size_t eltsize) {
void *memory = NULL;
int semid = -1;
ushort values[NSEMAPHORES];
int nattached;
bool donep;
int niter;
values[SEMNO_LOCK] = -1;
/* For some reason, these values are not being set, so using Semaphore_set_value below */
......@@ -615,41 +680,66 @@ shmem_attach (int *shmid, key_t *key, char *filename, size_t filesize, size_t el
others wait. They will be woken up when the semaphore is
removed. */
if ((*shmid = shmget(*key,filesize,IPC_CREAT | IPC_EXCL |
donep = false;
niter = 0;
while (donep == false) {
if ((*shmid = shmget(*key,filesize,IPC_CREAT | IPC_EXCL |
#ifdef HAVE_SHM_NORESERVE
SHM_NORESERVE |
#endif
0666)) != -1) {
/* Created new shared memory */
if ((memory = shmat(*shmid,NULL,0)) == (void *) -1) {
fprintf(stderr,"Error with shmat. Error %d: %s\n",errno,strerror(errno));
} else if (unload_shared_memory_p == true) {
semaphore_ids = Intlist_push(semaphore_ids,semid);
shmem_memory = List_push(shmem_memory,memory);
shmem_ids = Intlist_push(shmem_ids,*shmid);
copy_limited_from_file(memory,filename,filesize,eltsize);
} else {
semaphore_ids = Intlist_push(semaphore_ids,semid);
shmem_memory = List_push(shmem_memory,memory);
shmem_ids = Intlist_push(shmem_ids,*shmid);
copy_memory_from_file(memory,filename,filesize,eltsize);
fprintf(stderr,"Attached new memory for %s...",filename);
}
SHM_NORESERVE |
#endif
0666)) != -1) {
/* Created new shared memory */
if ((memory = shmat(*shmid,NULL,0)) == (void *) -1) {
fprintf(stderr,"Error with shmat. Error %d: %s\n",errno,strerror(errno));
} else if (unload_shared_memory_p == true) {
semaphore_ids = Intlist_push(semaphore_ids,semid);
shmem_memory = List_push(shmem_memory,memory);
shmem_ids = Intlist_push(shmem_ids,*shmid);
copy_limited_from_file(memory,filename,filesize,eltsize);
donep = true;
} else {
semaphore_ids = Intlist_push(semaphore_ids,semid);
shmem_memory = List_push(shmem_memory,memory);
shmem_ids = Intlist_push(shmem_ids,*shmid);
copy_memory_from_file(memory,filename,filesize,eltsize);
fprintf(stderr,"Attached new memory for %s...",filename);
donep = true;
}
} else if ((*shmid = shmget(*key,0,0)) != -1) {
/* Found existing shared memory */
if ((memory = shmat(*shmid,NULL,0)) == (void *) -1) {
fprintf(stderr,"Error with shmat. Error %d: %s\n",errno,strerror(errno));
} else if ((nattached = shmem_nattached(*shmid)) > 1) {
/* Existing memory is indeed valid: attached (by a process other than this one) */
semaphore_ids = Intlist_push(semaphore_ids,semid);
shmem_memory = List_push(shmem_memory,memory);
shmem_ids = Intlist_push(shmem_ids,*shmid);
fprintf(stderr,"Attached existing memory (%d attached) for %s...",nattached,filename);
donep = true;
} else if (niter > MAX_KILL_ATTEMPTS) {
/* Existing memory is not attached by any other process, but unable to kill. Could be corrupted */
fprintf(stderr,"Abandoned shared memory found, but could not be removed after %d attempts. Using malloc instead of shared memory\n",niter);
memory = (void *) NULL;
donep = true;
} else if ((*shmid = shmget(*key,0,0)) != -1) {
/* Found existing shared memory */
if ((memory = shmat(*shmid,NULL,0)) == (void *) -1) {
fprintf(stderr,"Error with shmat. Error %d: %s\n",errno,strerror(errno));
} else {
/* Existing memory is not attached by any other process. Could be corrupted. */
fprintf(stderr,"Clearing existing shared memory for %s...\n",filename);
Access_deallocate_wo_semaphore(memory,*shmid,*key);
/* Now loop above to try again */
}
} else {
semaphore_ids = Intlist_push(semaphore_ids,semid);
shmem_memory = List_push(shmem_memory,memory);
shmem_ids = Intlist_push(shmem_ids,*shmid);
fprintf(stderr,"Attached existing memory for %s...",filename);
fprintf(stderr,"Using malloc instead of shmget for file %s\n",filename);
memory = (void *) NULL;
donep = true;
}
} else {
fprintf(stderr,"Using malloc instead of shmget for file %s\n",filename);
memory = (void *) NULL;
niter++;
}
#if 0
......@@ -713,6 +803,8 @@ Access_allocate_private (Access_T *access, size_t *len, double *seconds, char *f
if (eltsize == 1) {
FREAD_CHARS(memory2,(*len)/eltsize,fp);
} else if (eltsize == 2) {
FREAD_USHORTS(memory2,(*len)/eltsize,fp);
} else if (eltsize == 4) {
FREAD_UINTS(memory2,(*len)/eltsize,fp);
} else if (eltsize == 8) {
......@@ -778,6 +870,8 @@ Access_allocate_shared (Access_T *access, int *shmid, key_t *key, int *fd, size_
if (eltsize == 1) {
FREAD_CHARS(memory2,(*len)/eltsize,fp);
} else if (eltsize == 2) {
FREAD_USHORTS(memory2,(*len)/eltsize,fp);
} else if (eltsize == 4) {
FREAD_UINTS(memory2,(*len)/eltsize,fp);
} else if (eltsize == 8) {
......
static char rcsid[] = "$Id: atoi.c 195989 2016-08-08 21:42:24Z twu $";
static char rcsid[] = "$Id: atoi.c 214305 2018-03-19 23:40:43Z twu $";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
......@@ -16435,3 +16435,18 @@ Atoi_reduce_ag (Oligospace_T oligo) {
return reduced;
}
 
UINT2
Atoi_reduce_tc_local (UINT2 oligo) {
/* Handles 16 bits, or k-mer up to 8 */
return convert_tc[oligo];
}
UINT2
Atoi_reduce_ag_local (UINT2 oligo) {
/* Handles 16 bits, or k-mer up to 8 */
return convert_ag[oligo];
}
/* $Id: atoi.h 180699 2015-12-10 19:10:10Z twu $ */
/* $Id: atoi.h 214305 2018-03-19 23:40:43Z twu $ */
#ifndef ATOI_INCLUDED
#define ATOI_INCLUDED
......@@ -8,6 +8,10 @@ extern Oligospace_T
Atoi_reduce_ag (Oligospace_T oligo);
extern Oligospace_T
Atoi_reduce_tc (Oligospace_T oligo);
extern UINT2
Atoi_reduce_tc_local (UINT2 oligo);
extern UINT2
Atoi_reduce_ag_local (UINT2 oligo);
#endif
This diff is collapsed.
/* $Id: bitpack64-access.h 212659 2018-01-20 00:58:14Z twu $ */
#ifndef BITPACK64_ACCESS_INCLUDED
#define BITPACK64_ACCESS_INCLUDED
#include "types.h"
......
static char rcsid[] = "$Id: bitpack64-incr.c 199469 2016-10-23 03:49:07Z twu $";
static char rcsid[] = "$Id: bitpack64-incr.c 212659 2018-01-20 00:58:14Z twu $";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
......@@ -9537,7 +9537,7 @@ transfer_22_24 (UINT4 *out, const UINT4 *in) {
value = ( CONVERT(*in) >> 18 ) % (1U << 22 ) ;
in += WORD_INCR;
value |= (CONVERT(*in) % (1U<< 8 ))<<( 22 - 8 );
*out |= (value << 8); /* was 16 */
*out |= (value << 8);
/* 12 */
value = ( CONVERT(*in) >> 8 ) % (1U << 22 ) ;
......@@ -9719,7 +9719,7 @@ transfer_26_28 (UINT4 *out, const UINT4 *in) {
value |= (CONVERT(*in) % (1U<< 2 ))<<( 26 - 2 );
*out |= (value << 16);
out += WORD_INCR;
*out |= (value >> (28 - 12)); /* was (28 - 8) */
*out |= (value >> (28 - 12));
/* 05 */
value = ( CONVERT(*in) >> 2 ) % (1U << 26 ) ;
......
/* $Id: bitpack64-incr.h 212659 2018-01-20 00:58:14Z twu $ */
#ifndef BITPACK64_INCR_INCLUDED
#define BITPACK64_INCR_INCLUDED
#include "types.h"
......