From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id eIo3Kt06c2UQIQEAG6o9tA:P1 (envelope-from ) for ; Fri, 08 Dec 2023 16:48:45 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id eIo3Kt06c2UQIQEAG6o9tA (envelope-from ) for ; Fri, 08 Dec 2023 16:48:45 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 17A3A5B4DF for ; Fri, 8 Dec 2023 16:48:45 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=umanitoba.ca header.s=selector2 header.b=Rx7W4XAu; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=umanitoba.ca; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1702050525; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=/nV0ONj7Cxyc/jNOpWsawJ4JxsOvvFYTDXI1LtwE70I=; b=f6g3FVjc88OHb5TRGCbuxbCs9RAzcU8+64agMJmn1iPk0I+TsUGForhNY5qjKcJLle6mx7 K4zKHiwKxaCmMamvQ9P9OdHc1sJWGUJYqi4oVtargqP+hUnmiOGvjuI7rciX9+8e0bGlxB xvGRDQUvsp3eZSsFQm3mpSVd22/kCqhef2V4zxWA2NucjmmwDmmtUNgu6bAUmSD/UPz44N rOXXVX9nKcz5igmoBKSn5RdzdYJHLC4FlXHVg++NeYvB5H2lmUfvpG/ZvOxavzzOgcvUx9 BhfreNjDOG1WxFJkY8R9TlQu5QhkHVhYxikbEJni00AmTqmZVkKfGCN+zOXOxA== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1702050525; a=rsa-sha256; cv=pass; b=qWGMTdYWUKLJPbXWvWiL7Se7iWyWFNiQ63UEe+etBsDwXKhDIPPb3uoyuceaKzq98trABc IX/EKNnJBqbUK4u2lE9gAqdu44pKhHmIzA0vov/KL12arblWoe+hfJ8DBxP0clcEsUVNHG ksCO57yLdHEb5WN7Wr+HSq2ZOnpFeT+Id2wPCB0t58feu9vKA9Xl0dKZ7GL2dvE7/HxREn 07puj8b2ojRn3hHtiwQbaeteFXefH/wsX0z41Xd6W3XzI/4NlJtYE7JeciqewxxsWn9nGY xmsf8DJHTWN0qPP3N5O++5wD5SZUMAIdsLk3aiEBmZDfqqxpPk/geQHuHo5JhA== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=umanitoba.ca header.s=selector2 header.b=Rx7W4XAu; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=umanitoba.ca; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rBd59-0006Yd-Sq; Fri, 08 Dec 2023 10:48:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rBd53-0006Wk-Mm for emacs-orgmode@gnu.org; Fri, 08 Dec 2023 10:47:58 -0500 Received: from mail-yt3can01on2099.outbound.protection.outlook.com ([40.107.115.99] helo=CAN01-YT3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rBd50-0000KM-8W for emacs-orgmode@gnu.org; Fri, 08 Dec 2023 10:47:56 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jqLZNYUy2SAws7QDmT41diqIGYWJc03WyVF3/y07HWMf4ZODDYGA1WkWxOSdZWGepOJUZQfQbLxDiBMqDKrfLrPoZkP/RzIB+NE3moN1SC9JK8kb9cglXkeO3Hw10j3qehH3hktfWpH93NuAUaHFeUrOU95fgUkwthCGKVvJwjH4gnDKAvk1C0U7rgjfCzN6nzwJOL8wJP2K330lQHrjAwArd49y2QuSdWl3HrVXIEheermwUuXmAJuA40LsiDN3oGf9NZkQpskkIX046MjLDPxebItlWFg2R/qejIUmN8p2heqxeZfmMkcrTmx9DS2r+D8dCwZn2tVtTk67stN8Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/nV0ONj7Cxyc/jNOpWsawJ4JxsOvvFYTDXI1LtwE70I=; b=PjjAzoY1eP8Fasx/B+WM7xs960RX+e/4KV78EpD5/kALkRfIayNSr4+IA4hix7qpWnkzUBLDf+NDB1XZcbhe0O6YjwoL4tQCosHe5ivGoF3+f5d95l5chF0YmCLewr2W3B2jWJdfi+ob/m5Pb95YAUPTWMNG3dhotWQaKR57T518Pxt4mJwpVC/v38o6rVsHwQwWaTsRjOs32E1FL7AHGmOZZTGd9gpDkGzY5fOoHJ3nK3PADl4VywwU5SmDlO9FqJcjOUw2aEjp56z3qtL2VCc49uPIyQ7GdUlJNRv1U3fEDuReu/vUZta2AML95yXk5CdQCiqg7mdFf3OCSfIyUQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=umanitoba.ca; dmarc=pass action=none header.from=umanitoba.ca; dkim=pass header.d=umanitoba.ca; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umanitoba.ca; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/nV0ONj7Cxyc/jNOpWsawJ4JxsOvvFYTDXI1LtwE70I=; b=Rx7W4XAuXVGLhOzPwcEHL2SDsQd/TAYY9uKdEVLHGx5Cl+r481kzoKseo4MxsyIEjjkP/mjprJxDbbJhY8HV8cXAkyb0DX6PTwAzj1Ni8gAUF5oeVqcrpINOxRIu389g/8NNiiewfxqY4N1ay9DkRboVSODZ5miIJWYW2hIVsN3RG86AiqjLvxcQkJsE6ofWQGja2BvPpNeOFVNU1rGDCUKTtsx1+8fGpAi0DvAL6GrYTHZ7AU3try3h6lbWcrejPuunt/Q0oYBOUpX71iZp3969lmoEr94vkQxH+dHFYZwSXj+XpX3umJJJoo8t/b++TMMOzo2xGBaaIx9thhC9Yg== Received: from YT3PR01MB9964.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:90::5) by YT2PR01MB10808.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:f0::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.28; Fri, 8 Dec 2023 15:47:48 +0000 Received: from YT3PR01MB9964.CANPRD01.PROD.OUTLOOK.COM ([fe80::94c8:d86a:210c:c4d6]) by YT3PR01MB9964.CANPRD01.PROD.OUTLOOK.COM ([fe80::94c8:d86a:210c:c4d6%4]) with mapi id 15.20.7068.029; Fri, 8 Dec 2023 15:47:48 +0000 From: Leo Butler To: tbanelwebmin CC: "emacs-orgmode@gnu.org" Subject: Re: How to use mpirun with C or C++ Org-babel? Thread-Topic: How to use mpirun with C or C++ Org-babel? Thread-Index: AQHaKWKeqb7imUSOZkWCc40UuX80BA== Date: Fri, 8 Dec 2023 15:47:48 +0000 Message-ID: <87plzg7l25.fsf@t14.reltub.ca> References: <1819406926.505980.1701990611441@fidget.co-bxl> <6efe8fc4-c12f-e128-8d7e-9e32887b127c@free.fr> In-Reply-To: <6efe8fc4-c12f-e128-8d7e-9e32887b127c@free.fr> (tbanelwebmin@free.fr's message of "Fri, 8 Dec 2023 11:36:02 +0100") Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Gnus/5.13 (Gnus v5.13) x-ms-publictraffictype: Email x-ms-traffictypediagnostic: YT3PR01MB9964:EE_|YT2PR01MB10808:EE_ x-ms-office365-filtering-correlation-id: 77444235-8f3e-4a21-2a7a-08dbf805078f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: YSClXiTFTuAc4JDxJ9QfsVN+y4NO0/W3J7kZW4HQ8JyGWcnUFMWo1LdHzbKGUfaf515QNwph1rwiXciR4jqdBzddV91ts/xtk6K4Pik1nR466YY1JIdTF57viCmJtX/7qAmso1VGdqI7TM9wcl5IsDcxiX1SJ+rOL1b4cVWEEoe9VhvTejwLQcm1L4ftCcOpHl4+r0gpZfiQqgoYei7bj9LRqCMt2nXqxGL14yUeoGYUbWxGB+vWZxFqKAIEIVEnaZdZc8j4HkUNUj4ikV+OLgAGgij08sAf7iq3/QGhvmLh/TI6n0sc/dB7h73fkC3tOqWJMC15rAO1qAVUVpKjNDEjDBcRR4t7bRtpNRa1FJqsSF9ldxcVjbhI+39Fx+eQWl49G7oJd6auTvRyKPg1HbbwfociCILcd0SaN3Nr+PL9IpBlAFQpYOotiW04vbs6CZ4enMU2hV0ItoiTW2mmW0NGUVCwWcKu5nRK3WQyKIL8Jar4z48YU4Q5L8/l8Nf+cTbFMG7wMV5ugHUgwAkH7fmUUpUvQnvdYn75N3ddmuCpblIReJWJyg6J+f6usjpikDjHABWJbbkoAgq1jvIkzKVh0B27U6ZSzKFMMrXI2prlk2M8+vl91J3/zJilFMe5IuMLzCLWstyMhMo1kbwR5McSvgfmAafFxUNGHhmy5tKNQp/sIsW42a5a2NH1EntwLV1hWy8hIbKFgQ3Cuhugog== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:YT3PR01MB9964.CANPRD01.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230031)(39860400002)(366004)(396003)(376002)(136003)(346002)(230173577357003)(230273577357003)(230922051799003)(1800799012)(451199024)(64100799003)(186009)(53546011)(6506007)(9686003)(6512007)(26005)(83380400001)(19627235002)(8936002)(8676002)(41300700001)(4326008)(2906002)(5660300002)(38070700009)(66446008)(64756008)(86362001)(66556008)(66476007)(6916009)(786003)(316002)(66946007)(76116006)(91956017)(966005)(478600001)(71200400001)(6486002)(38100700002)(122000001)(15866825006)(41080700001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?5h14rQYy4Vy3tX8ytOm7KuSTN7UzD/MO2UUUqeJB1T+rspIJfjD0dy1wSK?= =?iso-8859-1?Q?HPio/piRVGicgjzENP3c1Ekx/PtNOJ6p1qc5st6y6HIHK//Xm/3BWufoM7?= =?iso-8859-1?Q?zWGFYpwgpeBx4DUXUUYwAUJkgKOXpqTXwYQzYbKC+iIGbJkL1wFGVwXG0K?= =?iso-8859-1?Q?iZcG/MnotJ7qsreWHHbrjEZtlSfZRbftCW53qFJmzzDPflV+jpDIzP6Jsc?= =?iso-8859-1?Q?nCnpGcoKjmFVLTUX7HcMhCRYg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?iso-8859-1?Q?Zxh8GP2p33pCHrtCsYTIdHzDcUFjwumTjG9c1hfKUK9XtkrjV0rSXH3apG?= =?iso-8859-1?Q?teqYVgjn6h/Pn3mx5+kJdXqsgcvWE2hyYVEPI0rlolaiq1UnYYNcv39K8J?= =?iso-8859-1?Q?4QW60ug6cYJ8uX1mDkwJ5e6m+2VzOhENmus3IwmRtNP539pLNXsoRqyzMR?= =?iso-8859-1?Q?1L3YQ+/Mz+4Z9mZyyI630Ol6voV8XuVgD1tVWfzS/Vc6iMQ2CUnrTh8B1M?= =?iso-8859-1?Q?Yu0wiWNjkex3ELcXvINjUGKwgWSkQ4EWVM+dx73heMlHSm0y9wepsfriVf?= =?iso-8859-1?Q?a6Y3lh3Cn+h1ty2yn7JNp9YsxhZ5kZXzzn7sCxnui0AJiMa5yCCzF9TWEk?= =?iso-8859-1?Q?omqjo7pcovoCjWlVj8uH/uxi/gt0187ZYUGA2hEXsPE4v1cmaWwYxqjkdN?= =?iso-8859-1?Q?IDolxGTd/VSwnPp2JZIUvfPCb0brti/L7eBWphfkoUIqfyl3r+4QxLfijl?= =?iso-8859-1?Q?SiUgnWdv++Rx87yGj9OtlmWtTY7E8zQih4Tpe8vU1wRFkCFALch8qeHg?= =?iso-8859-1?Q?=3D=3D?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: umanitoba.ca X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: YT3PR01MB9964.CANPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 77444235-8f3e-4a21-2a7a-08dbf805078f X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Dec 2023 15:47:48.8115 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4f80dd0b-338c-4e4c-8a14-90446962f7b8 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 9yQf2TBkRLzPtl9PYVUVwqQkO6mPTfdnLpgYgMZWUsrh262wH8IUz+8MJXHHekA2pbc1UqVTkOsnd1xwtiI6qQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: YT2PR01MB10808 Received-SPF: pass client-ip=40.107.115.99; envelope-from=Leo.Butler@umanitoba.ca; helo=CAN01-YT3-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx11.migadu.com X-Migadu-Spam-Score: -10.64 X-Spam-Score: -10.64 X-Migadu-Queue-Id: 17A3A5B4DF X-TUID: /Sezx2Hw/Dbq On Fri, Dec 08 2023, tbanelwebmin wrote: > Caution: This message was sent from outside the University of Manitoba. > > On 23-12-08 00:10, Edgar Lux wrote: > > Hello, I found [1][2] that it is possible to change the compiler for = C and C++ > source blocks. I would like to know if there is a way to add =3Dmpiru= n -np 2=3D > (where 2 can be any other number) to run the resulting executable. Th= anks! [1]=20 > https://orgmode.org/worg//org-contrib/babel/languages/ob-doc-C.html [= 2]=20 > https://github.com/gheber/literate-hdf5 > > I guess you want to run the executable after it has been compiled, with a= command > like this one: > > mpirun -np 2 /tmp/babel-ad2pdk/C-bin-JTvjS4 > > Currently it is not possible. > > There is the :cmdline specifier which adds parameters to the executable, = like this: > > #+begin_src C++ :cmdline AAA BBB CCC > int main (int nargs, char** argv) > { > // argv will be { > // "/tmp/babel-ad2pdk/C-bin-JTvjS4", > // "AAA", > // "BBB", > // "CCC" > // } > } > #+end_src > > Those parameters come AFTER the executable, whereas mpirun should come BE= FORE the > executable. > > An extension may be written in ob-C.el, in the org-babel-C-execute functi= on. > The relevant line is: > (concat tmp-bin-file cmdline) > > If you want to contribute... If you are wanting to run jobs with mpirun, then I will guess that they are relatively long-running. However, ob-C.el does not support asynchronous (background) execution, so your emacs would be tied up for the duration. I doubt you want that. I submitted an imperfect patch some time ago [1] that targeted your use case: allow ob-C.el to create a named binary. Unfortunately, Ihor dropped the issue due to lack of interest from other users. My goal was to enable something like this to work: #+begin_src cpp :includes :results none :file ./hello-world std::cout << "Hello World!\n"; #+end_src #+begin_src bash :async t mpirun -np 4 ./hello-world #+end_src As I said, the patch I wrote was not perfect, but I am happy to re-visit the issue. The ability to create named binaries would significantly increase the usability of ob-C for projects where you want to compile the source once and run the binary repeatedly for potentially long periods of time. Leo [1] https://list.orgmode.org/87fs81egk5.fsf@t14.reltub.ca/=