Moses-support Digest, Vol 85, Issue 37

Send Moses-support mailing list submissions to
moses-support@mit.edu

To subscribe or unsubscribe via the World Wide Web, visit
http://mailman.mit.edu/mailman/listinfo/moses-support
or, via email, send a message with subject or body 'help' to
moses-support-request@mit.edu

You can reach the person managing the list at
moses-support-owner@mit.edu

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Moses-support digest..."


Today's Topics:

1. Re: Estimating probabilities with KenLM (Kenneth Heafield)
2. Segfault when using sigtest-filtering for hierarchical mt
(Fabienne Braune)


----------------------------------------------------------------------

Message: 1
Date: Fri, 22 Nov 2013 09:50:20 -0800
From: Kenneth Heafield <moses@kheafield.com>
Subject: Re: [Moses-support] Estimating probabilities with KenLM
To: moses-support@mit.edu
Message-ID: <528F995C.2030306@kheafield.com>
Content-Type: text/plain; charset=ISO-8859-1

Hi,

What OS are you on? Cygwin? Apparently every OS reports memory size
in a different way:

http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=lib/physmem.c;h=2629936146e3042f927523322f18aca76996cd7f;hb=HEAD

The good news is that the above code is LGPLv2:

http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=modules/physmem;h=9644522e0493a85a9fb4ae7c4449741c2c1500ea;hb=HEAD

But currently I'm just using this short function that will fail on some
platforms:

uint64_t GuessPhysicalMemory() {
#if defined(_WIN32) || defined(_WIN64)
return 0;
#elif defined(_SC_PHYS_PAGES) && defined(_SC_PAGESIZE)
long pages = sysconf(_SC_PHYS_PAGES);
if (pages == -1) return 0;
long page_size = sysconf(_SC_PAGESIZE);
if (page_size == -1) return 0;
return static_cast<uint64_t>(pages) * static_cast<uint64_t>(page_size);
#else
return 0;

0 Response to "Moses-support Digest, Vol 85, Issue 37"

Post a Comment