After using the omp barrier I need the cpu to do some work so I don't want to be in openMP anymore. Then a different part of the program comes up where I need each individual thread.
Do I need to reassign an ID to each thread again like this:
myID will not exist the second time you enter a parallel block, because it was declared in a different block. So yes, you have to call omp_get_thread_num() again, but it has nothing to do with the thread not "remembering" its ID. Every time you enter a new parallel block you're creating a new group of threads, independent of earlier ones.