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
205f9f4d
Commit
205f9f4d
authored
22 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
Move some code to re-initialize job allocate data-structure between
allocate calls.
parent
7fd19547
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
testsuite/slurm_unit/api/manual/allocate-tst.c
+32
-28
32 additions, 28 deletions
testsuite/slurm_unit/api/manual/allocate-tst.c
with
32 additions
and
28 deletions
testsuite/slurm_unit/api/manual/allocate-tst.c
+
32
−
28
View file @
205f9f4d
...
@@ -9,15 +9,18 @@
...
@@ -9,15 +9,18 @@
int
int
main
(
int
argc
,
char
*
argv
[])
main
(
int
argc
,
char
*
argv
[])
{
{
int
error_code
;
int
error_code
,
job_count
,
max_jobs
;
job_desc_msg_t
job_mesg
;
job_desc_msg_t
job_mesg
;
job_allocation_response_msg_t
resp_msg
;
resource_allocation_response_msg_t
resp_msg
;
if
(
argc
>
1
)
max_jobs
=
atoi
(
argv
[
1
]);
else
max_jobs
=
1000
;
slurm_init_job_desc_msg
(
&
job_mesg
);
slurm_init_job_desc_msg
(
&
job_mesg
);
job_mesg
.
contiguous
=
1
;
job_mesg
.
contiguous
=
1
;
job_mesg
.
groups
=
(
"students,employee
\0
"
);
job_mesg
.
groups
=
(
"students,employee
\0
"
);
job_mesg
.
job_id
=
12345
;
job_mesg
.
name
=
(
"job01
\0
"
);
job_mesg
.
name
=
(
"job01
\0
"
);
job_mesg
.
partition_key
=
"1234"
;
job_mesg
.
partition_key
=
"1234"
;
job_mesg
.
min_procs
=
4
;
job_mesg
.
min_procs
=
4
;
...
@@ -38,28 +41,28 @@ main (int argc, char *argv[])
...
@@ -38,28 +41,28 @@ main (int argc, char *argv[])
if
(
error_code
)
if
(
error_code
)
printf
(
"allocate error %d
\n
"
,
error_code
);
printf
(
"allocate error %d
\n
"
,
error_code
);
else
{
else
{
printf
(
"allocate nodes %s to job %u
\n
"
,
job_mesg
.
req_nodes
,
job_mesg
.
job_id
);
printf
(
"allocate nodes %s to job %u
\n
"
,
"TBD"
,
job_mesg
.
job_id
);
}
}
job_count
=
1
;
for
(
;
job_count
<
max_jobs
;
job_count
++
)
{
slurm_init_job_desc_msg
(
&
job_mesg
);
job_mesg
.
contiguous
=
1
;
job_mesg
.
groups
=
(
"students,employee
\0
"
);
job_mesg
.
name
=
(
"more.big
\0
"
);
job_mesg
.
partition_key
=
"1234"
;
job_mesg
.
min_procs
=
4
;
job_mesg
.
min_memory
=
1024
;
job_mesg
.
min_tmp_disk
=
2034
;
job_mesg
.
partition
=
"batch
\0
"
;
job_mesg
.
priority
=
100
;
job_mesg
.
req_nodes
=
"lx[3000-3003]
\0
"
;
job_mesg
.
job_script
=
"/bin/hostname
\0
"
;
job_mesg
.
shared
=
0
;
job_mesg
.
time_limit
=
200
;
job_mesg
.
num_procs
=
4000
;
job_mesg
.
user_id
=
1500
;
slurm_init_job_desc_msg
(
&
job_mesg
);
job_mesg
.
contiguous
=
1
;
job_mesg
.
groups
=
(
"students,employee
\0
"
);
job_mesg
.
name
=
(
"more.big
\0
"
);
job_mesg
.
partition_key
=
"1234"
;
job_mesg
.
min_procs
=
4
;
job_mesg
.
min_memory
=
1024
;
job_mesg
.
min_tmp_disk
=
2034
;
job_mesg
.
partition
=
"batch
\0
"
;
job_mesg
.
priority
=
100
;
job_mesg
.
req_nodes
=
"lx[3000-3003]
\0
"
;
job_mesg
.
job_script
=
"/bin/hostname
\0
"
;
job_mesg
.
shared
=
0
;
job_mesg
.
time_limit
=
200
;
job_mesg
.
num_procs
=
4000
;
job_mesg
.
user_id
=
1500
;
while
(
1
)
{
/* the string also had Immediate */
/* the string also had Immediate */
error_code
=
slurm_allocate_resources
(
&
job_mesg
,
&
resp_msg
,
true
);
error_code
=
slurm_allocate_resources
(
&
job_mesg
,
&
resp_msg
,
true
);
...
@@ -69,14 +72,15 @@ main (int argc, char *argv[])
...
@@ -69,14 +72,15 @@ main (int argc, char *argv[])
break
;
break
;
}
}
else
{
else
{
printf
(
"allocate nodes %s to job %u
\n
"
,
job_mesg
.
req_nodes
,
job_mesg
.
job_id
);
printf
(
"allocate nodes %s to job %u
\n
"
,
"TBD"
,
job_mesg
.
job_id
);
}
}
}
}
job_mesg
.
name
=
(
"more.tiny
\0
"
);
for
(
;
job_count
<
max_jobs
;
job_count
++
)
{
job_mesg
.
num_procs
=
40
;
while
(
1
)
{
slurm_init_job_desc_msg
(
&
job_mesg
);
slurm_init_job_desc_msg
(
&
job_mesg
);
job_mesg
.
name
=
(
"more.tiny
\0
"
);
job_mesg
.
num_procs
=
40
;
job_mesg
.
user_id
=
1500
;
error_code
=
slurm_allocate_resources
(
&
job_mesg
,
&
resp_msg
,
false
);
error_code
=
slurm_allocate_resources
(
&
job_mesg
,
&
resp_msg
,
false
);
if
(
error_code
)
{
if
(
error_code
)
{
...
@@ -84,7 +88,7 @@ main (int argc, char *argv[])
...
@@ -84,7 +88,7 @@ main (int argc, char *argv[])
break
;
break
;
}
}
else
{
else
{
printf
(
"allocate nodes %s to job %u
\n
"
,
job_mesg
.
req_nodes
,
job_mesg
.
job_id
);
printf
(
"allocate nodes %s to job %u
\n
"
,
"TBD"
,
job_mesg
.
job_id
);
}
}
}
}
...
...
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