Share CPU core


 
Thread Tools Search this Thread
Operating Systems Solaris Share CPU core
# 1  
Old 03-26-2010
Shared CPU core

Hi,

I have 2 physical processor UltraSPARC-T2 with 32 virtual processors
I want to execute a perl program on 10 virtual processors.
I try prset command, but I don't see a difference.

Code:
psrset -c   "created processor set 2" 1 2 3 4 5 6 7 8 9 10" 
psrset -b 2 `pgrep program.pl`

Maybe I need to add kernel option in /etc/system ?

Thanks

Last edited by falloutsam; 03-26-2010 at 01:45 PM..
# 2  
Old 03-28-2010
What says
Code:
psrset -i
psrset -q

?
# 3  
Old 03-28-2010
Code:
 
 psrset -i
user processor set 1: processors 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
 
psrset -q
process id 21811: 1

Thanks
# 4  
Old 03-28-2010
So a processor set is properly configured although with 16 VCPUs instead of 10.

What do you mean "I don't see a difference", i.e. what difference are you expecting that you don't see ?

Last edited by jlliagre; 03-28-2010 at 08:29 PM..
# 5  
Old 03-30-2010
Hi,

When I use mpstat command, I wish to see 4 or 5 CPU virtual core used.
But only one virtual core is using.
Maybe my script don't need more CPU and I need to modify my script with threads module for example.
Because my script read one line in a source file and put it in an output file.
I can put into memory 10000 lines with a thread, and put in an output file 10000 lines

Code:
 
#!/usr/local/perl/bin/perl
use warnings;
use strict;
use threads;
sub ProcessLog{
        my $l__line = "";
        my $i = 0;
        my $core=0;
        while ( defined($l__line = <INPUT_FILE>)){
            chomp($l__line);
            $i++;
            $core=0;
            if($i==10000){
                $i=1;
            } 
            if($i==1){ 
                 $core++;
                 my $thr = threads->new(\&sub1,$l__line);
                 if($core==32){
                     $thr->join;
                 }
                 sub sub1 {
                     #print "In the thread\n";
                     my $line=$_[0];
                     #print "LINE:".$line;
                     if ($line ne ""){
                         my $val1="";
                         my $val2="";
                         my $val3="";
                         if(defined $line){
                             ($val1,$val2,$val3)=split(/ /,$line);
                         }
                         my $l__newLine = $val1.";".$val3;
                         print OUTPUT_FILE $l__newLine."\n";
                         #return($l__newLine."\n");
                     }
                 }
            }
        }
}
my $l__logInput = $ARGV[0];
my $l__logOutput = $ARGV[1];
open(INPUT_FILE, "< $l__logInput") || die "probleme d'ouverture du fichier de lecture\n";
open(OUTPUT_FILE, "> $l__logOutput") || die "probleme d'ouverture du fichier d ecriture\n";
&ProcessLog;

Thanks
# 6  
Old 03-30-2010
Perl is probably not the best language to experiment with threads (and to experiment with anything IMHO).
Anyway, what perl version is /usr/local/perl/bin/perl ?
Code:
/usr/local/perl/bin/perl --version

Is threading support enabled ? As far as I know, it is still quite experimental.
Code:
/usr/local/perl/bin/perl -V | grep thread

# 7  
Old 03-30-2010
I compiled perl with options -Dusethreads -Dprefix=/usr/local/perl

Code:
 
$ /usr/local/perl/bin/perl --version
 
This is perl, v5.8.8 built for sun4-solaris-thread-multi
Copyright 1987-2006, Larry Wall

Code:
 
 
$ /usr/local/perl/bin/perl -V | grep thread
    osname=solaris, osvers=2.10, archname=sun4-solaris-thread-multi
    config_args='-ds -e -Dprefix=/usr/local/perl -Dusethreads'
    usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
    libs=-lsocket -lnsl -ldl -lm -lpthread -lc
    perllibs=-lsocket -lnsl -ldl -lm -lpthread -lc
    /usr/local/perl/lib/5.8.8/sun4-solaris-thread-multi
    /usr/local/perl/lib/site_perl/5.8.8/sun4-solaris-thread-multi
prcsvadm15-new:~/testdir

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

Assigning cpu/core to globalzone

hi all, I am running SPARC server + solaris 10. (no LDOMs) Due to change of setup and application licensing cost, I need to cap my core/cpu utilization in my globalzone. Right now, I have 1x6 cores in my server, how do I change it to utilized 4 cores instead ? By using... (2 Replies)
Discussion started by: javanoob
2 Replies

2. Red Hat

No of CPU's and No of Core

I would like to understand how many number of CPUs and cores do I have on my server based on following out put.. Few observations... Please correct me if I am wrong Since Physical ID is same CPU is singe It has 8 virtual processors Hyper thrading is enabled since no of siblings are... (1 Reply)
Discussion started by: parth_buch
1 Replies

3. AIX

What is a cpu core ?

Hi Friends- What does it mean by 2 cpu cores, 3 cpu cores? Does it mean 2 separate cpus or what is it exactly ? Kindly explain a bit in detail. Thanks panditt (4 Replies)
Discussion started by: deshaipet
4 Replies

4. Solaris

Restricting CPU Core Access

Hi all. I've had a quick look around but cant see anything exactly matching my requirements. I have a new T2000 running S10. Im looking to restrict the no. cores that a S10 non-global zone can use to 1 only. The box is single CPU but 8core. I want to do this to save on some software... (4 Replies)
Discussion started by: boneyard
4 Replies

5. UNIX for Advanced & Expert Users

Distinguishing between CPU and Core

Hi, I want to know if in UNIX is it possible to distinguish between a CPU and a core through any command? Thanks, Vineet (1 Reply)
Discussion started by: vineetd
1 Replies

6. UNIX for Advanced & Expert Users

How maney CPU and core?

Hi, Is it a command that show's how many CPU and Core the solaris server have? Tnx (2 Replies)
Discussion started by: mehrdad68
2 Replies

7. AIX

no of core in cpu for aix

is there command which will display no of core per cpu in aix? Regads, Manoj (1 Reply)
Discussion started by: manoj.solaris
1 Replies

8. Solaris

cpu core level from solaris os [8,9,10]

hi all how to find cpu core level in 8,9 and 10 . thanks (2 Replies)
Discussion started by: kumarmani
2 Replies

9. AIX

cpu and core

Hi, what is concept of core in ibm platform? I want to know how to find out no of core in cpu in aix i.e command how to find out value of core? Wheather any specification is there? (1 Reply)
Discussion started by: manoj.solaris
1 Replies
Login or Register to Ask a Question