Intel® DevCloud
Help for those needing help starting or connecting to the Intel® DevCloud
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
891 Discussions

question about job script submit and validate on Intel devCloud

Saharsa
New Contributor I
421 Views

Hello,

At first, thank you that every time you response my questions very fast.

I wrote two job scripts, one of them is compilation and the other one is execution.

Compilation script:

#!/bin/bash

dpcpp main.cpp -lsycl -lOpenCL -tbb -o a.out

 

Execution script:

#!/bin/bash

source /opt/intel/inteloneapi/setvars.sh
echo
echo start: $(date "+%y%m%d.%H%M%S.%3N")
echo
./a.out
echo
echo stop: $(date "+%y%m%d.%H%M%S.%3N")
echo

at first, I submitted my compilation job script in a queue, and then I submitted the execution one. but when I executed 

bash job.sh

which is the execution script, it troughs an error which is not exist a.out file.

and it was correct.

so, every time after submitting my compilation script in a queue I used 

bash complition.sh

and then I submited the excution script and validated it. 

my question is: is there other solution to avoid doing every time

bash compilation.sh

after submitting it in a queue?! 

I am not sure my compilation script is correct!

 

0 Kudos
5 Replies
RahulU_Intel
Moderator
387 Views

Hi,

 

Thanks for posting in Intel forums.

We looked into your case. The "a.out not found" error is because you have not provided the path to that file in the execution script. Please follow the below steps to run both compilation and execution file one after other automatically.

 

Step- 1: Create a script for compilation

$ vi compile.sh

Add the below code to the file and save:

#!/bin/bash

dpcpp main.cpp -lsycl -lOpenCL -tbb -o a.out

Step- 2: Create a script for execution

$ vi execute.sh

Add the below code to the file and save:

#!/bin/bash

  

source /opt/intel/inteloneapi/setvars.sh

echo

echo start: $(date "+%y%m%d.%H%M%S.%3N")

echo

cd $PBS_O_WORKDIR = <path to working directory>

./a.out

echo

echo stop: $(date "+%y%m%d.%H%M%S.%3N")

echo

 

Step- 3: As mentioned in the previous query,

https://community.intel.com/t5/Intel-DevCloud/How-to-submit-two- different-job-scripts-to-queue/m-p/1290673#M2448

Create the common script to call this jobs as below:

$ vi submit_job.sh

You can give the below commands in the script and save.

#!/bin/sh -f

 

FIRST=$(qsub compile.sh)

echo $FIRST

SECOND=$(qsub -W depend=afterany:$FIRST execute.sh)

echo $SECOND

 

Step- 4: You can run the submit_job.sh using the below command,

                "./submit_job.sh"

 

You can use the command "qstat" to view the status of the job submitted. After successful execution of the job you will see the file compile.sh.oxxxxxx, compile.sh.exxxxxx and execute.sh.oxxxxxx, execute.sh.exxxxxx. '.o' is the output file and '.e' is the error file and 'xxxxxx' is the queue.

(You can find the queue when you do qstat)

 

Hope this helps.

 

Regards,

 

Rahul

 

 

 

 

Saharsa
New Contributor I
319 Views

Thank you for you reply, but your solution does not work.

I found one solution for my problem, which is I creates a script which creates my job script. with I could submit my job and see the result of executing my code on CPU or on GPU.

 

RahulU_Intel
Moderator
356 Views

Hi,


We haven't heard back from you. Could you please confirm if your issue is resolved.


Thanks


Saharsa
New Contributor I
318 Views
RahulU_Intel
Moderator
301 Views

Hi,


We are glad that your issue is resolved. We are closing this case. If you need any assistance you can post a new question.


Thanks


Reply