From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id CE02CBC6D for ; Wed, 23 Jan 2008 11:15:22 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAHOilkfAXQImh2dsb2JhbACQFwEBAQgKKZVfhzA X-IronPort-AV: E=Sophos;i="4.25,237,1199660400"; d="scan'208";a="7117714" Received: from discorde.inria.fr ([192.93.2.38]) by mail1-smtp-roc.national.inria.fr with ESMTP; 23 Jan 2008 11:15:22 +0100 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id m0NAFLlQ010281 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Wed, 23 Jan 2008 11:15:22 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAADiilkfRVYC9mGdsb2JhbACQFwEBAQEBBgQECQoYlV+HMA X-IronPort-AV: E=Sophos;i="4.25,237,1199660400"; d="scan'208";a="8227784" Received: from fk-out-0910.google.com ([209.85.128.189]) by mail3-smtp-sop.national.inria.fr with ESMTP; 23 Jan 2008 11:15:21 +0100 Received: by fk-out-0910.google.com with SMTP id z22so2648673fkz.9 for ; Wed, 23 Jan 2008 02:15:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=RWB302FkUmuq6I0vFHYKJL1Jw8LABDvhMNECKEBma/E=; b=UHO6UuTS9+vqFl5oeJGouXkw83xAu+5CoN1IBN7KROoC3GgaahhpOP4g/dTXGZHc0KElE9Aeex6NyrWDN06T2aTuKirg87++Ibqfopq4k7SnAy4KYxirsTCOGXKO1mda9FUlOuuw05IWRHccWohQSRkAJpfVmLZsVty3guTY2fI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=f/EPLF1yflHdhb3Bt1iCpnW/v//ZXGWjXmkEsXJKVdHwj0Ds8zy9pJiAxHVJd2DItfA/RcW87kqmTslt/4hUSooLLfCUs4Hh7Zh/zTv5IP3Mv2PLi86syt0Qzuj3vzE0dpDkyCPTodcPFDjtv3zIXSMqfXHdOwDTQS81zFdHpBU= Received: by 10.78.140.17 with SMTP id n17mr12815003hud.47.1201083320578; Wed, 23 Jan 2008 02:15:20 -0800 (PST) Received: by 10.78.25.10 with HTTP; Wed, 23 Jan 2008 02:15:20 -0800 (PST) Message-ID: <95513600801230215k4798b826tfe6c0a38620ca73d@mail.gmail.com> Date: Wed, 23 Jan 2008 11:15:20 +0100 From: "Olivier Andrieu" Sender: oandrieu@gmail.com To: "Thomas Fischbacher" Subject: Re: [Caml-list] CamlMPI: sending marshalled objects Cc: "Caml-list List" In-Reply-To: <47963B6C.1010301@functionality.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <47963B6C.1010301@functionality.de> X-Google-Sender-Auth: 0faef0c00bf5656e X-Miltered: at discorde with ID 479713B9.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; andrieu:01 oandrieu:01 rewrote:01 malloc:01 serialize:01 alloc:01 buffer:01 bigarrays:01 iirc:01 ocamlmpi:01 ocaml:01 1998.:98 wrote:01 exception:01 caml-list:01 Hi, On Jan 22, 2008 7:52 PM, Thomas Fischbacher wrote: > > Hello everybody, > > there is an old Caml/MPI interface, written by Xavier himself in 1998. > This provides a pair of C functions caml_mpi_send/caml_mpi_receive, > which may look a bit funny considering present day ML-C-interface coding > conventions, but GC-wise is actually valid code as far as I can judge. > For reference, I added them at the end of this email. I've been using this interface some time ago (in 2006). I rewrote it a bit to bring it up-to-date with the current conventions. > As far as I can see, output_value_to_malloc() actually should be able to > serialize virtually any ML object (which does not contain alloc_custom() > blocks and similar stuff) to a buffer. some custom blocks such as Bigarrays can be serialised too. > Sending this over the net also > should not be much of a problem, regardless of the data being sent. If, > on the other hand, I manually serialized to a string and tried to send > that, I would be bound by the 16 MB maximal string length limitation on > 32-bit architectures. right. > So much the theory. But what I actually find in reality is that -- even > using caml_mpi_send/caml_mpi_receive rather than intermediate strings -- > my code crashes when I try to pass around serialized ML data over MPI > which is larger than 16 MB. I am not yet 100% sure that this really is > the problem, but at present, I have every reason to believe so. > > So, (1) what is going on here, and (2) how can I repair it? > Is there a quick fix? I'm not sure what is going on, I was able to transmit large marshalled values IIRC. One serious problem in the current code is the treatment of errors. Ocamlmpi registers an error handler that raises an OCaml exception. However, should an error occur during MPI_Send, the handler is invoked with the global mutex released since MPI_Send is between enter/leave_blocking_section. Maybe that's what causing the crash. -- Olivier