Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Slurm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tud-zih-energy
Slurm
Commits
52877ec7
Commit
52877ec7
authored
19 years ago
by
Danny Auble
Browse files
Options
Downloads
Patches
Plain Diff
fixed non-thread safe cause in _start_agent() for uid_to_string().
parent
0fe537e0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/select/bluegene/bgl_job_run.c
+24
-15
24 additions, 15 deletions
src/plugins/select/bluegene/bgl_job_run.c
src/plugins/select/bluegene/bgl_part_info.c
+30
-12
30 additions, 12 deletions
src/plugins/select/bluegene/bgl_part_info.c
with
54 additions
and
27 deletions
src/plugins/select/bluegene/bgl_job_run.c
+
24
−
15
View file @
52877ec7
...
...
@@ -216,12 +216,10 @@ static void _start_agent(bgl_update_t *bgl_update_ptr)
int
rc
;
bgl_record_t
*
bgl_record
=
NULL
;
bgl_record_t
*
found_record
=
NULL
;
char
*
user_name
=
uid_to_string
(
bgl_update_ptr
->
uid
);
ListIterator
itr
;
pthread_attr_t
attr_agent
;
pthread_t
thread_agent
;
int
retries
;
bgl_record
=
find_bgl_record
(
bgl_update_ptr
->
bgl_part_id
);
if
(
!
bgl_record
)
{
...
...
@@ -286,7 +284,7 @@ static void _start_agent(bgl_update_t *bgl_update_ptr)
break
;
}
}
}
}
list_iterator_destroy
(
itr
);
/* wait for all necessary partitions to be freed */
...
...
@@ -304,15 +302,25 @@ static void _start_agent(bgl_update_t *bgl_update_ptr)
bgl_update_ptr
->
job_id
);
return
;
}
}
else
if
(
bgl_record
->
state
==
RM_PARTITION_CONFIGURING
)
{
bgl_record
->
boot_state
=
1
;
}
slurm_mutex_lock
(
&
part_state_mutex
);
bgl_record
->
boot_count
=
0
;
if
(
bgl_record
->
target_name
)
xfree
(
bgl_record
->
target_name
);
bgl_record
->
target_name
=
xstrdup
(
user_name
);
bgl_record
->
target_name
=
xstrdup
(
uid_to_string
(
bgl_update_ptr
->
uid
));
debug
(
"setting the target_name for Partition %s to %s"
,
bgl_record
->
bgl_part_id
,
bgl_record
->
target_name
);
if
(
bgl_record
->
state
==
RM_PARTITION_READY
)
if
(
bgl_record
->
state
==
RM_PARTITION_READY
)
{
debug
(
"partition %s is ready."
,
bgl_record
->
bgl_part_id
);
set_part_user
(
bgl_record
);
}
slurm_mutex_unlock
(
&
part_state_mutex
);
}
...
...
@@ -412,10 +420,10 @@ static void _term_agent(bgl_update_t *bgl_update_ptr)
bgl_record
->
target_name
=
xstrdup
(
slurmctld_conf
.
slurm_user_name
);
}
if
(
bgl_record
->
state
!=
RM_PARTITION_CONFIGURING
)
{
bgl_record
->
boot_state
=
0
;
bgl_record
->
boot_count
=
0
;
}
bgl_record
->
boot_state
=
0
;
bgl_record
->
boot_count
=
0
;
last_bgl_update
=
time
(
NULL
);
slurm_mutex_unlock
(
&
part_state_mutex
);
}
else
{
...
...
@@ -469,11 +477,6 @@ static void _part_op(bgl_update_t *bgl_update_ptr)
int
retries
;
slurm_mutex_lock
(
&
agent_cnt_mutex
);
if
(
agent_cnt
>
MAX_AGENT_COUNT
)
{
/* already running an agent */
slurm_mutex_unlock
(
&
agent_cnt_mutex
);
return
;
}
agent_cnt
++
;
if
((
bgl_update_list
==
NULL
)
&&
((
bgl_update_list
=
list_create
(
_bgl_list_del
))
==
NULL
))
fatal
(
"malloc failure in start_job/list_create"
);
...
...
@@ -487,6 +490,11 @@ static void _part_op(bgl_update_t *bgl_update_ptr)
if
(
list_enqueue
(
bgl_update_list
,
bgl_update_ptr
)
==
NULL
)
fatal
(
"malloc failure in _part_op/list_enqueue"
);
}
if
(
agent_cnt
>
MAX_AGENT_COUNT
)
{
/* already running an agent */
slurm_mutex_unlock
(
&
agent_cnt_mutex
);
return
;
}
agent_cnt
++
;
slurm_mutex_unlock
(
&
agent_cnt_mutex
);
/* spawn an agent */
slurm_attr_init
(
&
attr_agent
);
...
...
@@ -624,7 +632,8 @@ extern int start_job(struct job_record *job_ptr)
select_g_get_jobinfo
(
job_ptr
->
select_jobinfo
,
SELECT_DATA_NODE_USE
,
&
(
bgl_update_ptr
->
node_use
));
info
(
"Queue start of job %u in BGL partition %s"
,
job_ptr
->
job_id
,
bgl_update_ptr
->
bgl_part_id
);
job_ptr
->
job_id
,
bgl_update_ptr
->
bgl_part_id
);
_part_op
(
bgl_update_ptr
);
#else
...
...
This diff is collapsed.
Click to expand it.
src/plugins/select/bluegene/bgl_part_info.c
+
30
−
12
View file @
52877ec7
...
...
@@ -175,6 +175,7 @@ extern int update_partition_list()
error
(
"Partition %s not found in bgl_list "
"removing from database"
,
name
);
term_jobs_on_part
(
name
);
bgl_free_partition
(
bgl_record
);
rc
=
rm_remove_partition
(
name
);
if
(
rc
!=
STATUS_OK
)
{
error
(
"rm_remove_partition(%s): %s"
,
...
...
@@ -221,19 +222,32 @@ extern int update_partition_list()
"users from partition %s"
,
bgl_record
->
bgl_part_id
);
}
if
(
!
strcmp
(
bgl_record
->
target_name
,
slurmctld_conf
.
slurm_user_name
)
&&
strcmp
(
bgl_record
->
target_name
,
bgl_record
->
user_name
))
{
info
(
"partition %s was in a "
"ready state but got freed "
"booting again for user %s"
,
bgl_record
->
bgl_part_id
,
bgl_record
->
user_name
);
xfree
(
bgl_record
->
target_name
);
if
(
bgl_record
->
target_name
&&
bgl_record
->
user_name
)
{
if
(
!
strcmp
(
bgl_record
->
target_name
,
slurmctld_conf
.
slurm_user_name
)
&&
strcmp
(
bgl_record
->
target_name
,
bgl_record
->
user_name
))
{
info
(
"partition %s was in a "
"ready state but got "
"freed booting again for "
"user %s"
,
bgl_record
->
bgl_part_id
,
bgl_record
->
user_name
);
xfree
(
bgl_record
->
target_name
);
bgl_record
->
target_name
=
xstrdup
(
bgl_record
->
user_name
);
}
}
else
if
(
bgl_record
->
user_name
)
bgl_record
->
target_name
=
xstrdup
(
bgl_record
->
user_name
);
}
else
error
(
"Target Name and User Name are "
"not set for partition %s."
,
bgl_record
->
bgl_part_id
);
}
else
if
(
bgl_record
->
state
==
RM_PARTITION_CONFIGURING
)
bgl_record
->
boot_state
=
1
;
...
...
@@ -276,7 +290,7 @@ extern int update_partition_list()
error
(
"Couldn't boot Partition %s "
"for user %s"
,
bgl_record
->
bgl_part_id
,
bgl_record
->
target
_name
);
bgl_record
->
user
_name
);
now
=
time
(
NULL
);
time_ptr
=
localtime
(
&
now
);
strftime
(
reason
,
sizeof
(
reason
),
...
...
@@ -291,9 +305,13 @@ extern int update_partition_list()
}
break
;
case
RM_PARTITION_READY
:
debug
(
"partition %s is ready."
,
bgl_record
->
bgl_part_id
);
set_part_user
(
bgl_record
);
break
;
default:
debug
(
"Hey the state of the Partition is %d "
"doing nothing."
,
bgl_record
->
state
);
break
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment