Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Service management of Sage - D
05-09-2019, 06:39 PM
Post: #41
RE: Service management of Sage - D
(05-09-2019 10:37 AM)xwcwt Wrote:  Also I feel it will be

Code:
modname = sage
LearnPcf /thinker/etc/soft/$modname/mic.pcf before LearnPcf $base/config.pcf

Update into head-post.

My impression is that the pcf reading does not override earlier values. Because config.pcf has precedence, we should learn config.pcf first, then mic.pcf.
Find all posts by this user
Quote this message in a reply
05-09-2019, 06:42 PM
Post: #42
RE: Service management of Sage - D
(05-09-2019 10:37 AM)xwcwt Wrote:  
(05-08-2019 10:01 PM)lingu Wrote:  The sage program begins with the following logic.

Code:
base=current dir
LearnPcf $base/config.pcf
ips=$base/hosts.ips

I suggest we also learn /thinker/etc/soft/sage/mic.pcf but $base/config.pcf take precedence over /thinker/etc/soft/sage/mic.pcf

RR xwcwt

Good to me.

Also I feel it will be

Code:
modname = sage
LearnPcf /thinker/etc/soft/$modname/mic.pcf before LearnPcf $base/config.pcf

Update into head-post.

I guess you added 'Common var input' in the headpost. I think it is too narrow and, if we use such narrorw section topics, the info ortanization would have 20 pieces of pseudocode. I am changing it to 'sage main logic' so that we can add the overall logic of the sage program to it.
Find all posts by this user
Quote this message in a reply
05-09-2019, 06:52 PM
Post: #43
RE: Service management of Sage - D
(07-12-2016 05:54 PM)YU_Xinjie Wrote:  sage main logiccommon var import
Code:
modname = sage
base=current dir
LearnPcf /thinker/etc/soft/$modname/mic.pcf
LearnPcf $base/config.pcf
ips=$base/hosts.ips

also, avoid such hard clash of blocks, such as a title followed by a title, a title followed by a code segment, a code segment followed by a code segment, ...
Add text between titles and other blocks of content.

The sage logic also performs the following and I'll add them to the pseudocode.
Code:
set timeout
parse options
run command
  start
  status
  ps
  tasks
  help
Find all posts by this user
Quote this message in a reply
05-09-2019, 07:09 PM
Post: #44
RE: Service management of Sage - D
(07-12-2016 05:54 PM)YU_Xinjie Wrote:  sage main logiccommon var import

modname = sage
base=current dir
LearnPcf /thinker/etc/soft/$modname/mic.pcf
LearnPcf $base/config.pcf
ips=$base/hosts.ips
set timeout to be half of the number of IPs

Driver: The IP counting is based on 'wc -l $ips'. But $ips may not exist on non-portal.

I suggest we use a plain number 3 if $ips does not exist.

RR xwcwt
Find all posts by this user
Quote this message in a reply
05-09-2019, 07:12 PM
Post: #45
RE: Service management of Sage - D
(05-09-2019 07:09 PM)lingu Wrote:  
(07-12-2016 05:54 PM)YU_Xinjie Wrote:  sage main logiccommon var import

modname = sage
base=current dir
LearnPcf /thinker/etc/soft/$modname/mic.pcf
LearnPcf $base/config.pcf
ips=$base/hosts.ips
set timeout to be half of the number of IPs

Driver: The IP counting is based on 'wc -l $ips'. But $ips may not exist on non-portal.

I suggest we use a plain number 3 if $ips does not exist.

RR xwcwt

Good to me.
Quote this message in a reply
05-10-2019, 07:41 PM
Post: #46
RE: Service management of Sage - D
(07-12-2016 05:54 PM)YU_Xinjie Wrote:  sage tasks
cat $sage_base/stdout/tasks_graph.tmp.<timestamp>.

The logic is actually more involved than that. I will outline the logic as follows.
Code:
local tasks_graph_file=$base/stdout/tasks_graph.tmp
while True {
  while True {
    cnt = count ${tasks_graph_file}*;
    sleep 5 if cnt>1 || cnt==0;
    otherwise break;
  }
  check timestamp;
  cat $sage_base/stdout/tasks_graph.tmp.<timestamp>
  update timestamp;
}
Find all posts by this user
Quote this message in a reply
05-10-2019, 07:46 PM
Post: #47
RE: Service management of Sage - D
driver: we used to rely on a sage awake screen to collect sage tasks result, but that screen runs only on sage_portal. Now we allow non-sage_portal to interact with sage. So we should run 'auntie' to wake up sage before collecting the sage tasks result.

(07-12-2016 05:54 PM)YU_Xinjie Wrote:  sage tasks
sage tasks invokes function tasks_sage():
local tasks_graph_file=$base/stdout/tasks_graph.tmp
while True {
while True {

Proposal: add 'auntie' here

Quote: cnt = count ${tasks_graph_file}*;
sleep 5 if cnt>1 || cnt==0;
otherwise break;
}
check timestamp;
cat $sage_base/stdout/tasks_graph.tmp.<timestamp>
update timestamp;
}
[/code]

RR xwcwt
Find all posts by this user
Quote this message in a reply
05-10-2019, 07:56 PM
Post: #48
RE: Service management of Sage - D
Driver: Sage configuration can be quite complex. It is often convenient to evaluate a var in Sage either on command line or in a program. GLAD has a command 'gladinfo var' or 'glad info var' to read the value of a variable var. But Sage does not have it.

Proposal: add a command 'info' like the 'info' command in glad, an let 'sage info var' report the value of var.

RR zheny
Find all posts by this user
Quote this message in a reply
05-11-2019, 10:14 AM
Post: #49
RE: Service management of Sage - D
(05-10-2019 07:46 PM)lingu Wrote:  driver: we used to rely on a sage awake screen to collect sage tasks result, but that screen runs only on sage_portal. Now we allow non-sage_portal to interact with sage. So we should run 'auntie' to wake up sage before collecting the sage tasks result.

(07-12-2016 05:54 PM)YU_Xinjie Wrote:  sage tasks
sage tasks invokes function tasks_sage():
local tasks_graph_file=$base/stdout/tasks_graph.tmp
while True {
while True {

Proposal: add 'auntie' here

Quote: cnt = count ${tasks_graph_file}*;
sleep 5 if cnt>1 || cnt==0;
otherwise break;
}
check timestamp;
cat $sage_base/stdout/tasks_graph.tmp.<timestamp>
update timestamp;
}
[/code]

RR xwcwt

The idea is Good to me. Also I think the auntie call should add before check timestamp. Update first.
Quote this message in a reply
11-23-2019, 11:30 PM
Post: #50
RE: Service management of Sage - D
(07-12-2016 05:54 PM)YU_Xinjie Wrote:  sage tasks
sage tasks invokes function tasks_sage():
Code:
local tasks_graph_file=$base/stdout/tasks_graph.tmp
while True {
  while True {
    cnt = count ${tasks_graph_file}*;
    sleep 5 if cnt>1 || cnt==0;
    otherwise break;
  }
  call auntie ##To wake up sage to collect info in all nodes.
  check timestamp;
  cat $sage_base/stdout/tasks_graph.tmp.<timestamp>
  update timestamp;
}

I'm splitting this info to be a separate thread.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: