xqwKen / hustoj

Automatically exported from code.google.com/p/hustoj
0 stars 0 forks source link

Intel C++ support... #30

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I'll add Intel C++ compiler support to SuPearOJ in a few days, for parallel 
(multi-core) computing, OpenMP, TBB, Intel Math Library, etc.

Btw, you really have done a good job!

Original issue reported on code.google.com by cn-...@china.com.cn on 22 Nov 2010 at 11:45

GoogleCodeExporter commented 8 years ago
nice to know new progress of SuPearOJ , i 've linked your homepage at ours.

take care about the license they used , supporting these commercial libs can be 
a good point of SuPearOJ differ from HUSTOJ.

Original comment by newsc...@gmail.com on 23 Nov 2010 at 12:53

GoogleCodeExporter commented 8 years ago
Yeah, I noticed that, so we can just live some empty directories and let the 
user themselves put those non-gpl licensed projects in. 

And I also suggest the judge_client program in HUSTOJ core specifying CPU 
affinity for its instances, so that we can measure process time more accurately 
and at the same time let the judging task run on several(The total cpu_core -1) 
CPU cores. 
And logical_cpu_core(i) gets the judging task of solution_id(k) where k mod 
(Total_logical_cpu_cores -1), for load balance in a high-concurrency contest 
event.

On/About CPU affinity, see: 
http://software.intel.com/en-us/articles/improved-linux-smp-scaling-user-directe
d-processor-affinity/
and load balance:
http://rdc.taobao.com/blog/cs/?p=379

And I'll give you this:
不同操作系统下实现处理器亲和性的方法
    函数/API  命令行/UI
Windows SetThreadAffinityMask()或SetProcessAffinityMask()  TaskManager
Linux   sched_setaffinity() taskset
FreeBSD pthread_setaffinity_np()    cpuset
NetBSD  pthread_setaffinity_np()    psrset
MacOS   affinity API    ----

Original comment by cn-...@china.com.cn on 23 Nov 2010 at 11:34

GoogleCodeExporter commented 8 years ago
miss tapping,,,
k mod (Total_logical_cpu_cores -1) = 0

Original comment by cn-...@china.com.cn on 23 Nov 2010 at 11:34

GoogleCodeExporter commented 8 years ago
judge.conf has relative parameter OJ_RUNNING
to control the number of judge_client sessions.
multi-running threads will make use of SMP .
considering most server still running with LAMP-judge all together, and some 
may running other web-site, the administrator might want to limit the usage of 
system resource used by judged/judge_clients.

solutions differ from each others, i wonder how much would this CPU affinity 
improve the total performance.

would you like to make this change and a test?

i can add you into the commiters, so you can submit this change into HUSTOJ.

Original comment by newsc...@gmail.com on 23 Nov 2010 at 1:48

GoogleCodeExporter commented 8 years ago
This is my hypothesis. 
This may be a transient when the judge runs on a multi-cpu, multi-core, 
hyper-threading system, and with an SAS HDD to support 2-channels of I/O read & 
write. 
And in a 64-bit system with enough main memory, I suggest changing 
/proc/sys/kernel/shmmax for the max size of memory allocation, and pre-read all 
the test-data and user's output to memory, use HUSTOJ_compare to avoid I/O 
operation. However you can also make it flexible, judge whether the size of 
test data is over 32MB or shmmax, then chose ZOJ or HUSTOJ's comparison 
function. 

I saw that without the usage of SMP and with OJ_RUNNING value >1(4 or more) in 
the conf file, when you add a set of problems once, every several solution 
returns a RE while the codes are correct.

Original comment by cn-...@china.com.cn on 24 Nov 2010 at 12:06

Attachments:

GoogleCodeExporter commented 8 years ago
using OJ_RUNNING require hand mkdir runX like run1 run2 run3
check the [[MultiRUNNING]] in wiki

Original comment by newsc...@gmail.com on 24 Nov 2010 at 2:05

GoogleCodeExporter commented 8 years ago
about I/O cache, i thought linux disk cache works on those files frequently 
accessed.
if you try to make a managable cache , considering memcached, and mysql can be 
cached too

Original comment by newsc...@gmail.com on 24 Nov 2010 at 2:10

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
acm.zjgsu.edu.cn is using OJ_RUNNING=4 on a 2-core system

Original comment by newsc...@gmail.com on 24 Nov 2010 at 6:08

GoogleCodeExporter commented 8 years ago
Haven't noticed the usage of MultiRUNNING, sorry. 

And I think we'd better add a temporary table (use In-MEMORY storage engine) in 
the DB structure -- Pending or Waiting table, it only stores the pending queue, 
so the judged can just check this table regularly. After judged, then delete 
the corresponding in this record in the in-memory temporary table and write sth 
to other tables.

Check the email I sent you.

Original comment by cn-...@china.com.cn on 24 Nov 2010 at 6:12

GoogleCodeExporter commented 8 years ago
this should works

Original comment by newsc...@gmail.com on 24 Nov 2010 at 6:54

GoogleCodeExporter commented 8 years ago
but this affect many system parts,i need to find a way minorize the 
modification and give transparent upgrade for old system users.

Original comment by newsc...@gmail.com on 24 Nov 2010 at 7:05

GoogleCodeExporter commented 8 years ago

Original comment by newsc...@gmail.com on 16 Jul 2011 at 3:06