[SCM] an open source computer algebra system branch, cleanedupstream, updated. 6125e540ca6d66c307958938a9d53b245507c323
Bernhard R. Link
brlink at debian.org
Tue Apr 24 15:54:14 UTC 2012
The following commit has been merged in the cleanedupstream branch:
commit d3c06ea3648df55e06497d9be9c18ae201c0f34d
Author: Hans Schoenemann <hannes at mathematik.uni-kl.de>
Date: Thu Mar 22 15:30:54 2012 +0100
chg: re-enable system("cpu"), change setting of semaphore 0
diff --git a/Singular/extra.cc b/Singular/extra.cc
index 0c2a5a0..b5dc814 100644
--- a/Singular/extra.cc
+++ b/Singular/extra.cc
@@ -284,7 +284,13 @@ BOOLEAN jjSYSTEM(leftv res, leftv args)
/*==================== cpu ==================================*/
if(strcmp(sys_cmd,"cpu")==0)
{
- res->data=(void *)feOptValue(FE_OPT_CPUS);
+ long cpu=1; //feOptValue(FE_OPT_CPUS);
+ #ifdef _SC_NPROCESSORS_ONLN
+ cpu=sysconf(_SC_NPROCESSORS_ONLN);
+ #elif defined(_SC_NPROCESSORS_CONF)
+ cpu=sysconf(_SC_NPROCESSORS_CONF);
+ #endif
+ res->data=(void *)cpu;
res->rtyp=INT_CMD;
return FALSE;
}
diff --git a/Singular/tesths.cc b/Singular/tesths.cc
index ad7fd38..d68b38e 100644
--- a/Singular/tesths.cc
+++ b/Singular/tesths.cc
@@ -129,7 +129,7 @@ int main( /* main entry to Singular */
#ifdef HAVE_SIMPLEIPC
feOptIndex cpu_opt = feGetOptIndex("cpus");
int cpus = (int)(long)feOptValue(FE_OPT_CPUS);
- sipc_semaphore_init(0, cpus);
+ sipc_semaphore_init(0, cpus-1);
#endif
/* say hello */
--
an open source computer algebra system
More information about the debian-science-commits
mailing list