Can you specify on which core should a batch script run?Update MS Windows XP via batch scriptHow to issue an...
Will tsunami waves travel forever if there was no land?
Who is the Umpire in this picture?
Size of electromagnet needed to replicate Earth's magnetic field
How to pronounce 'C++' in Spanish
Examples of subgroups where it's nontrivial to show closure under multiplication?
What was the first Intel x86 processor with "Base + Index * Scale + Displacement" addressing mode?
Fizzy, soft, pop and still drinks
How to solve constants out of the internal energy equation?
How to have a sharp product image?
A Note on N!
Was there a shared-world project before "Thieves World"?
With a Canadian student visa, can I spend a night at Vancouver before continuing to Toronto?
Was there a Viking Exchange as well as a Columbian one?
How to stop co-workers from teasing me because I know Russian?
How can I practically buy stocks?
Apply MapThread to all but one variable
how to sum variables from file in bash
Can someone publish a story that happened to you?
How to type a section sign (§) into the Minecraft client
How to make a pipeline wait for end-of-file or stop after an error?
Examples of non trivial equivalence relations , I mean equivalence relations without the expression " same ... as" in their definition?
How to get a plain text file version of a CP/M .BAS (M-BASIC) program?
What route did the Hindenburg take when traveling from Germany to the U.S.?
Combinable filters
Can you specify on which core should a batch script run?
Update MS Windows XP via batch scriptHow to issue an rsh command to run in the background from a batch file?Run SOX batch on files in a relative folderCores and threads? How does it all work exactly?Will process run slower on one thread rather than one coreAutothrottle CPU based on usageWriting to file with 'find' command in a batch scriptBatch script to run and close multiple programs at a specific timeWindows command line to run as the currently logged in user after starting command/batch script as another user within the same script?Safekill OBS with a batch script
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I have a batch script that runs a program for a while. The program is monothread. I would like to run several instances of this program in parallel and be sure they do not run using the same core/thread.
The reason for that is that I am measuring the time it takes to run the program and I would like to try and avoid having biased results because some instances running using concurrent cpu ressources.
Is there a way to specify in my batch script a given core/thread number and avoid the aforementioned bias I could get ?
windows windows-10 cpu batch
add a comment |
I have a batch script that runs a program for a while. The program is monothread. I would like to run several instances of this program in parallel and be sure they do not run using the same core/thread.
The reason for that is that I am measuring the time it takes to run the program and I would like to try and avoid having biased results because some instances running using concurrent cpu ressources.
Is there a way to specify in my batch script a given core/thread number and avoid the aforementioned bias I could get ?
windows windows-10 cpu batch
add a comment |
I have a batch script that runs a program for a while. The program is monothread. I would like to run several instances of this program in parallel and be sure they do not run using the same core/thread.
The reason for that is that I am measuring the time it takes to run the program and I would like to try and avoid having biased results because some instances running using concurrent cpu ressources.
Is there a way to specify in my batch script a given core/thread number and avoid the aforementioned bias I could get ?
windows windows-10 cpu batch
I have a batch script that runs a program for a while. The program is monothread. I would like to run several instances of this program in parallel and be sure they do not run using the same core/thread.
The reason for that is that I am measuring the time it takes to run the program and I would like to try and avoid having biased results because some instances running using concurrent cpu ressources.
Is there a way to specify in my batch script a given core/thread number and avoid the aforementioned bias I could get ?
windows windows-10 cpu batch
windows windows-10 cpu batch
asked yesterday
NorgannonNorgannon
103
103
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You can try running it with the taskset
utility with the -c option like taskset -c 0 batch.job
. In order to find your cpu-count you can use the nproc
tool.
article about process affinity - linux
taskset manpage
Edit: On windows you can probably use the similar start
utility with the /affinity
option.
processor affinity in windows/linux
New contributor
Well I am on windows, I didn't specify it in the text but in the tags. Looking up taskset there might be a solution on this SO thread.
– Norgannon
yesterday
Looks like on windows your best bet would be thestart
-command with the/affinity
-option. Sorry I can't help much further as I am more of a Linux-Guy ; )
– juo
yesterday
I tried that but it looks like every 5 seconds or so, the process switches thread. I will update if I find the reason.
– Norgannon
yesterday
It works fine ! The problem was that I was using a batch script to run a batch script to run the program. So I guess the second batch script was indeed running on a given core, but the program it was running was not. You need to use start command with /affinity option when running the .exe, if you do that on the .bat, it doesn't echoes onto the "child" processes.
– Norgannon
yesterday
Well now it looks like/affinity
does echo onto the "child" processes... I'm confused. But it's still working !
– Norgannon
yesterday
|
show 1 more comment
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1429910%2fcan-you-specify-on-which-core-should-a-batch-script-run%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can try running it with the taskset
utility with the -c option like taskset -c 0 batch.job
. In order to find your cpu-count you can use the nproc
tool.
article about process affinity - linux
taskset manpage
Edit: On windows you can probably use the similar start
utility with the /affinity
option.
processor affinity in windows/linux
New contributor
Well I am on windows, I didn't specify it in the text but in the tags. Looking up taskset there might be a solution on this SO thread.
– Norgannon
yesterday
Looks like on windows your best bet would be thestart
-command with the/affinity
-option. Sorry I can't help much further as I am more of a Linux-Guy ; )
– juo
yesterday
I tried that but it looks like every 5 seconds or so, the process switches thread. I will update if I find the reason.
– Norgannon
yesterday
It works fine ! The problem was that I was using a batch script to run a batch script to run the program. So I guess the second batch script was indeed running on a given core, but the program it was running was not. You need to use start command with /affinity option when running the .exe, if you do that on the .bat, it doesn't echoes onto the "child" processes.
– Norgannon
yesterday
Well now it looks like/affinity
does echo onto the "child" processes... I'm confused. But it's still working !
– Norgannon
yesterday
|
show 1 more comment
You can try running it with the taskset
utility with the -c option like taskset -c 0 batch.job
. In order to find your cpu-count you can use the nproc
tool.
article about process affinity - linux
taskset manpage
Edit: On windows you can probably use the similar start
utility with the /affinity
option.
processor affinity in windows/linux
New contributor
Well I am on windows, I didn't specify it in the text but in the tags. Looking up taskset there might be a solution on this SO thread.
– Norgannon
yesterday
Looks like on windows your best bet would be thestart
-command with the/affinity
-option. Sorry I can't help much further as I am more of a Linux-Guy ; )
– juo
yesterday
I tried that but it looks like every 5 seconds or so, the process switches thread. I will update if I find the reason.
– Norgannon
yesterday
It works fine ! The problem was that I was using a batch script to run a batch script to run the program. So I guess the second batch script was indeed running on a given core, but the program it was running was not. You need to use start command with /affinity option when running the .exe, if you do that on the .bat, it doesn't echoes onto the "child" processes.
– Norgannon
yesterday
Well now it looks like/affinity
does echo onto the "child" processes... I'm confused. But it's still working !
– Norgannon
yesterday
|
show 1 more comment
You can try running it with the taskset
utility with the -c option like taskset -c 0 batch.job
. In order to find your cpu-count you can use the nproc
tool.
article about process affinity - linux
taskset manpage
Edit: On windows you can probably use the similar start
utility with the /affinity
option.
processor affinity in windows/linux
New contributor
You can try running it with the taskset
utility with the -c option like taskset -c 0 batch.job
. In order to find your cpu-count you can use the nproc
tool.
article about process affinity - linux
taskset manpage
Edit: On windows you can probably use the similar start
utility with the /affinity
option.
processor affinity in windows/linux
New contributor
edited yesterday
New contributor
answered yesterday
juojuo
362
362
New contributor
New contributor
Well I am on windows, I didn't specify it in the text but in the tags. Looking up taskset there might be a solution on this SO thread.
– Norgannon
yesterday
Looks like on windows your best bet would be thestart
-command with the/affinity
-option. Sorry I can't help much further as I am more of a Linux-Guy ; )
– juo
yesterday
I tried that but it looks like every 5 seconds or so, the process switches thread. I will update if I find the reason.
– Norgannon
yesterday
It works fine ! The problem was that I was using a batch script to run a batch script to run the program. So I guess the second batch script was indeed running on a given core, but the program it was running was not. You need to use start command with /affinity option when running the .exe, if you do that on the .bat, it doesn't echoes onto the "child" processes.
– Norgannon
yesterday
Well now it looks like/affinity
does echo onto the "child" processes... I'm confused. But it's still working !
– Norgannon
yesterday
|
show 1 more comment
Well I am on windows, I didn't specify it in the text but in the tags. Looking up taskset there might be a solution on this SO thread.
– Norgannon
yesterday
Looks like on windows your best bet would be thestart
-command with the/affinity
-option. Sorry I can't help much further as I am more of a Linux-Guy ; )
– juo
yesterday
I tried that but it looks like every 5 seconds or so, the process switches thread. I will update if I find the reason.
– Norgannon
yesterday
It works fine ! The problem was that I was using a batch script to run a batch script to run the program. So I guess the second batch script was indeed running on a given core, but the program it was running was not. You need to use start command with /affinity option when running the .exe, if you do that on the .bat, it doesn't echoes onto the "child" processes.
– Norgannon
yesterday
Well now it looks like/affinity
does echo onto the "child" processes... I'm confused. But it's still working !
– Norgannon
yesterday
Well I am on windows, I didn't specify it in the text but in the tags. Looking up taskset there might be a solution on this SO thread.
– Norgannon
yesterday
Well I am on windows, I didn't specify it in the text but in the tags. Looking up taskset there might be a solution on this SO thread.
– Norgannon
yesterday
Looks like on windows your best bet would be the
start
-command with the /affinity
-option. Sorry I can't help much further as I am more of a Linux-Guy ; )– juo
yesterday
Looks like on windows your best bet would be the
start
-command with the /affinity
-option. Sorry I can't help much further as I am more of a Linux-Guy ; )– juo
yesterday
I tried that but it looks like every 5 seconds or so, the process switches thread. I will update if I find the reason.
– Norgannon
yesterday
I tried that but it looks like every 5 seconds or so, the process switches thread. I will update if I find the reason.
– Norgannon
yesterday
It works fine ! The problem was that I was using a batch script to run a batch script to run the program. So I guess the second batch script was indeed running on a given core, but the program it was running was not. You need to use start command with /affinity option when running the .exe, if you do that on the .bat, it doesn't echoes onto the "child" processes.
– Norgannon
yesterday
It works fine ! The problem was that I was using a batch script to run a batch script to run the program. So I guess the second batch script was indeed running on a given core, but the program it was running was not. You need to use start command with /affinity option when running the .exe, if you do that on the .bat, it doesn't echoes onto the "child" processes.
– Norgannon
yesterday
Well now it looks like
/affinity
does echo onto the "child" processes... I'm confused. But it's still working !– Norgannon
yesterday
Well now it looks like
/affinity
does echo onto the "child" processes... I'm confused. But it's still working !– Norgannon
yesterday
|
show 1 more comment
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1429910%2fcan-you-specify-on-which-core-should-a-batch-script-run%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown