Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

Testing latest pari + WASM + node.js... and it works?! Wow.

28495 views
License: GPL3
ubuntu2004
1
/* Copyright (C) 2013 The PARI group.
2
3
This file is part of the PARI/GP package.
4
5
PARI/GP is free software; you can redistribute it and/or modify it under the
6
terms of the GNU General Public License as published by the Free Software
7
Foundation; either version 2 of the License, or (at your option) any later
8
version. It is distributed in the hope that it will be useful, but WITHOUT
9
ANY WARRANTY WHATSOEVER.
10
11
Check the License for details. You should have received a copy of it, along
12
with the package; see the file 'COPYING'. If not, write to the Free Software
13
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
14
#include "pari.h"
15
#include "paripriv.h"
16
#include "mt.h"
17
18
void mt_sigint_block(void) { }
19
void mt_sigint_unblock(void) { }
20
void mt_err_recover(long er) { mtsingle_err_recover(er); }
21
void pari_mt_close(void) { }
22
void mt_queue_reset(void) { }
23
void mt_broadcast(GEN code) {(void) code;}
24
25
void
26
mt_sigint(void) {}
27
28
int
29
mt_is_parallel(void)
30
{
31
return 0;
32
}
33
34
int
35
mt_is_thread(void)
36
{
37
return mtsingle_is_thread();
38
}
39
40
long
41
mt_nbthreads(void)
42
{
43
return 1;
44
}
45
46
void
47
mt_export_add(const char *str, GEN val)
48
{
49
if (mtsingle_is_thread())
50
pari_err(e_MISC,"export not allowed during parallel sections");
51
export_add(str, val);
52
}
53
54
void
55
mt_export_del(const char *str)
56
{
57
if (mtsingle_is_thread())
58
pari_err(e_MISC,"unexport not allowed during parallel sections");
59
export_del(str);
60
}
61
62
void
63
pari_mt_init(void)
64
{
65
pari_mt_nbthreads = 1;
66
}
67
68
void
69
mt_queue_start_lim(struct pari_mt *pt, GEN worker, long lim)
70
{
71
(void) lim;
72
mtsingle_queue_start(pt, worker);
73
}
74
75